hk_dsimage.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_DSIMAGE
00012 #define HK_DSIMAGE
00013 #include "hk_dsdatavisible.h"
00014 #include "hk_string.h"
00015 #include <map>
00016 
00017 class hk_dsimageprivate;
00018 class hk_dsimagemodeprivate;
00019 
00020 class hk_dsimage : public hk_dsdatavisible
00021 {
00022 public:
00023 hk_dsimage(hk_form* form=NULL);
00024 virtual ~hk_dsimage();
00025 void set_path(const hk_string& p,bool registerchange=true);
00026 void set_path(const hk_string& p,bool registerchange,bool force_setting);
00027 hk_string path(void) const;
00028 virtual void savedata(ostream& s );
00029 virtual void loaddata(xmlNodePtr definition);
00030         virtual void set_value(const hk_string&);
00031         virtual hk_string value(void);
00032         virtual hk_string value_at(unsigned long row);
00033 /*
00034 zoom the image in percent. Values of 0 or smaller than 0 means 'fit to size',
00035 100 (%) is the original size
00036 */
00037 void set_zoom(int,bool registerchange=true);
00038 void set_zoom(int,bool registerchange,bool force_setting);
00039 int  zoom(void) const;
00040 
00041 virtual bool load_localimage(const hk_string& filename,bool registerchange=true);
00042 struct_raw_data* localimage();
00043 
00044 virtual void show_image(void){}
00045 
00046 static bool get_postscript_image(const hk_string& file,hk_string& psimagedata);
00047 static bool get_postscript_image(const struct_raw_data* data,hk_string& psimagedata);
00048 static void add_postscriptimagetype(const hk_string& name,psimagedatatype* f);
00049 
00050 protected:
00051 
00052 virtual void widget_specific_path_changed() {}
00053 virtual void widget_specific_zoom_changed() {}
00054         virtual bool datasource_enable(void);
00055 
00056 private:
00057         hk_dsimagemodeprivate* p_designdata;
00058         hk_dsimagemodeprivate* p_viewdata;
00059         hk_dsimageprivate* p_private;
00060         
00061         typedef  map<hk_string,psimagedatatype*,less<hk_string> >  imagetypelisttype ;
00062         static    imagetypelisttype  p_imagetypefunctions;
00063 
00064 
00065 };
00066 #endif // hk_dsimage

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