Databaseconnectionclasses  0.5.3
hk_dsimage.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_DSIMAGE
12 #define HK_DSIMAGE
13 #include "hk_dsdatavisible.h"
14 #include "hk_string.h"
15 #include <map>
16 
17 class hk_dsimageprivate;
19 
21 {
22 public:
23 hk_dsimage(hk_form* form=NULL);
24 virtual ~hk_dsimage();
25 void set_path(const hk_string& p,bool registerchange=true);
26 void set_path(const hk_string& p,bool registerchange,bool force_setting);
27 hk_string path(void) const;
28 virtual void savedata(ostream& s );
29 virtual void loaddata(xmlNodePtr definition);
30  virtual void set_value(const hk_string&);
31  virtual hk_string value(void);
32  virtual hk_string value_at(unsigned long row);
33 /*
34 zoom the image in percent. Values of 0 or smaller than 0 means 'fit to size',
35 100 (%) is the original size
36 */
37 void set_zoom(int,bool registerchange=true);
38 void set_zoom(int,bool registerchange,bool force_setting);
39 int zoom(void) const;
40 
41 virtual bool load_localimage(const hk_string& filename,bool registerchange=true);
42 struct_raw_data* localimage();
43 
44 virtual void show_image(void){}
45 
46 static bool get_postscript_image(const hk_string& file,hk_string& psimagedata);
47 static bool get_postscript_image(const struct_raw_data* data,hk_string& psimagedata);
48 static void add_postscriptimagetype(const hk_string& name,psimagedatatype* f);
49 
50 protected:
51 
52 virtual void widget_specific_path_changed() {}
53 virtual void widget_specific_zoom_changed() {}
54  virtual bool datasource_enable(void);
55 
56 private:
57  hk_dsimagemodeprivate* p_designdata;
58  hk_dsimagemodeprivate* p_viewdata;
59  hk_dsimageprivate* p_private;
60 
61  typedef map<hk_string,psimagedatatype*,less<hk_string> > imagetypelisttype ;
62  static imagetypelisttype p_imagetypefunctions;
63 
64 
65 };
66 #endif // hk_dsimage
virtual bool datasource_enable(void)
Definition: hk_dsimage.cpp:214
base class for forms
Definition: hk_form.h:43
virtual void loaddata(xmlNodePtr definition)
Definition: hk_dsimage.cpp:98
Definition: hk_dsimage.cpp:28
virtual hk_string value_at(unsigned long row)
Definition: hk_dsimage.cpp:198
Definition: hk_dsimage.h:20
Definition: hk_definitions.h:122
virtual void set_value(const hk_string &)
Definition: hk_dsimage.cpp:173
base class for visible widgets with data connection
Definition: hk_dsdatavisible.h:32
virtual void savedata(ostream &s)
Definition: hk_dsimage.cpp:80
Definition: hk_dsimage.cpp:19