Databaseconnectionclasses  0.5.3
hk_button.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_BUTTON_H
12 #define HK_BUTTON_H
13 #include "hk_dsvisible.h"
14 #include <list>
15 using namespace std;
16 class hk_database;
17 class hk_buttonprivate;
25 class hk_button :public hk_dsvisible
26 {
27  public:
28  hk_button(hk_form* form=NULL);
29  virtual ~hk_button(void);
60  void set_action(const hk_string& action,const hk_string& object,bool showmaximized=false,bool registerchange=true);
61  void set_action(long action,const hk_string& object,bool showmaximized=false,bool registerchange=true);
62 virtual bool push_action(void);
63  hk_string object (void);
85  int action(void);
86  bool show_maximized(void);
87  void set_database(hk_database* database);
88  hk_database* database(void);
89 
90  virtual void loaddata(xmlNodePtr definition);
91  virtual void savedata(ostream& s );
92 
93  typedef class
94  {
95  public:
96  hk_string reportfield;
97  hk_string condition;
98  hk_string formdatasource;
99  hk_string formfield;
101 
102  void add_condition(const hk_string& reportfield,const hk_string& condition,const hk_string& formdatasource,const hk_string& formfield,bool registerchange=true);
103  list<struct_condition>* conditions(void);
104  void clear_conditions(bool registerchange=true);
105 
106 virtual bool load_icon(const hk_string& filename,bool registerchange=true);
107 struct_raw_data* icon();
108 virtual void show_icon(){}
109 virtual void set_is_togglebutton(bool,bool registerchange=true,bool forcesetting=false);
110  bool is_togglebutton(void) const;
111 virtual bool is_pushed() const;
112 virtual void set_is_pushed(bool,bool registerchange=true,bool forcesetting=false);
113 
114 
115  protected:
116  virtual bool widget_specific_open_form(void);
117  virtual bool widget_specific_close_form(void);
118  virtual bool widget_specific_open_table(void);
119  virtual bool widget_specific_open_query(void);
120  virtual bool widget_specific_open_view(void);
121  virtual bool widget_specific_preview_report(void);
122  virtual bool widget_specific_print_report(void);
123  virtual bool widget_specific_close_application(void);
124  virtual bool widget_specific_is_pushed(void);
125  hk_string parsed_condition(hk_presentation*);
126 
127  private:
128  long int p_action;
129  hk_string p_object;
130  bool p_showmaximized;
131  hk_database* p_database;
132  list<struct_condition> p_reportconditions;
133  hk_buttonmodeprivate* p_designdata;
134  hk_buttonmodeprivate* p_viewdata;
135  hk_buttonprivate* p_private;
136 
137 };
138 #endif
base class for a button in a form
Definition: hk_button.h:25
represents a particular database on the SQL Server
Definition: hk_database.h:48
base class for visible widgets without column data connection
Definition: hk_dsvisible.h:31
Definition: hk_button.cpp:32
Definition: hk_button.h:93
base class for forms
Definition: hk_form.h:43
Definition: hk_button.cpp:23
Definition: hk_definitions.h:122
base class for multidatasource based classes like forms and reports
Definition: hk_presentation.h:40