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_SUBFORM 00012 #define HK_SUBFORM 00013 #include "hk_dsvisible.h" 00014 #include "hk_definitions.h" 00015 #include <list> 00016 class hk_form; 00017 class hk_subformprivate; 00018 class hk_subformmodeprivate; 00019 00028 class hk_subform: public hk_dsvisible 00029 { 00030 friend class hk_form; 00031 public: 00032 hk_subform(hk_presentation* parent); 00033 virtual ~hk_subform(); 00037 void set_name(const hk_string&, bool registerchange=true); 00038 hk_string name(void) const; 00042 hk_form* subform(); 00050 void add_depending_fields( const hk_string& subfield,const hk_string& masterfield,bool registerchange=true); 00054 void clear_depending_fields(bool registerchange=true); 00058 void activate_subform(void); 00059 list<dependingclass>* depending_on_fields(void); 00060 virtual void savedata(ostream& s, bool savedatasource,bool saveall); 00061 virtual void savedata(ostream& s ); 00062 virtual void loaddata(const hk_string& definition); 00063 00064 protected: 00065 void set_subform(hk_form*); 00066 virtual void before_datasource_enables(void); 00067 virtual bool presentationmode_changed(void); 00068 void internal_set_datasourcevalues(void); 00069 private: 00070 00071 hk_subformprivate* p_private; 00072 hk_subformmodeprivate* p_viewdata; 00073 hk_subformmodeprivate* p_designdata; 00074 }; 00075 00076 #endif