hk_button.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_classes library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file COPYING included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00010 // ****************************************************************************
00011 #ifndef HK_BUTTON_H
00012 #define HK_BUTTON_H
00013 #include "hk_dsvisible.h"
00014 #include <list>
00015 using namespace std;
00016 class hk_database;
00017 class hk_buttonprivate;
00018 class hk_buttonmodeprivate;
00025 class hk_button :public hk_dsvisible
00026 {
00027     public:
00028         hk_button(hk_form* form=NULL);
00029         virtual ~hk_button(void);
00060         void set_action(const hk_string& action,const hk_string& object,bool showmaximized=false,bool registerchange=true);
00061         void set_action(long action,const hk_string& object,bool showmaximized=false,bool registerchange=true);
00062 virtual bool push_action(void);
00063         hk_string object (void);
00085         int action(void);
00086         bool show_maximized(void);
00087         void set_database(hk_database* database);
00088         hk_database* database(void);
00089 
00090         virtual void loaddata(xmlNodePtr definition);
00091         virtual void  savedata(ostream& s );
00092 
00093         typedef class
00094         {
00095             public:
00096                 hk_string reportfield;
00097                 hk_string condition;
00098                 hk_string formdatasource;
00099                 hk_string formfield;
00100         } struct_condition;
00101 
00102         void add_condition(const hk_string& reportfield,const hk_string& condition,const hk_string& formdatasource,const hk_string& formfield,bool registerchange=true);
00103         list<struct_condition>* conditions(void);
00104         void clear_conditions(bool registerchange=true);
00105 
00106 virtual bool load_icon(const hk_string& filename,bool registerchange=true);
00107 struct_raw_data* icon();
00108 virtual void show_icon(){}
00109 virtual void set_is_togglebutton(bool,bool registerchange=true,bool forcesetting=false);
00110         bool is_togglebutton(void) const;
00111 virtual bool is_pushed() const;
00112 virtual void set_is_pushed(bool,bool registerchange=true,bool forcesetting=false);
00113 
00114 
00115     protected:
00116         virtual bool    widget_specific_open_form(void);
00117         virtual bool    widget_specific_close_form(void);
00118         virtual bool    widget_specific_open_table(void);
00119         virtual bool    widget_specific_open_query(void);
00120         virtual bool    widget_specific_open_view(void);
00121         virtual bool    widget_specific_preview_report(void);
00122         virtual bool    widget_specific_print_report(void);
00123         virtual bool    widget_specific_close_application(void);
00124         virtual bool    widget_specific_is_pushed(void);
00125         hk_string parsed_condition(hk_presentation*);
00126 
00127     private:
00128         long int p_action;
00129         hk_string p_object;
00130         bool p_showmaximized;
00131         hk_database* p_database;
00132         list<struct_condition> p_reportconditions;
00133         hk_buttonmodeprivate* p_designdata;
00134         hk_buttonmodeprivate* p_viewdata;
00135         hk_buttonprivate* p_private;
00136 
00137 };
00138 #endif

Generated on Tue Nov 28 02:48:07 2006 for Databaseconnectionclasses by  doxygen 1.5.0