gwenhywfar 4.0.3

cppwidget.hpp

Go to the documentation of this file.
00001 /***************************************************************************
00002     begin       : Tue Jul 13 2010
00003     copyright   : (C) 2010 by Martin Preuss
00004     email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *          Please see toplevel file COPYING for license details           *
00008  ***************************************************************************/
00009 
00010 #ifndef CPPWIDGET_HPP
00011 #define CPPWIDGET_HPP
00012 
00013 #include <gwenhywfar/dialog_be.h>
00014 #include <list>
00015 #include <string>
00016 
00017 class CppWidget;
00018 class CppDialog;
00019 
00020 
00030 class CppWidget {
00031   friend class CppWidgetLinker;
00032 
00033 private:
00034   GWEN_WIDGET_SETINTPROPERTY_FN _setIntPropertyFn;
00035   GWEN_WIDGET_GETINTPROPERTY_FN _getIntPropertyFn;
00036   GWEN_WIDGET_SETCHARPROPERTY_FN _setCharPropertyFn;
00037   GWEN_WIDGET_GETCHARPROPERTY_FN _getCharPropertyFn;
00038   GWEN_WIDGET_ADDCHILDGUIWIDGET_FN _addChildGuiWidgetFn;
00039 
00040 public:
00041   CppWidget(GWEN_WIDGET *w);
00042   virtual ~CppWidget();
00043 
00044   GWEN_WIDGET *getCInterface();
00045   static CppWidget *getWidget(GWEN_WIDGET *w);
00046 
00047   CppDialog *getDialog();
00048 
00049   const char *getName();
00050   GWEN_WIDGET_TYPE getType();
00051   int getColumns();
00052   int getRows();
00053   uint32_t getFlags();
00054 
00055   int getGroupId();
00056   int getWidth();
00057   int getHeight();
00058   const char *getText(int idx);
00059   const char *getIconFileName();
00060   const char *getImageFileName();
00061 
00062 
00063 protected:
00064   GWEN_WIDGET *_widget;
00065 
00066   CppWidget();
00067 
00068   virtual int setIntProperty(GWEN_DIALOG_PROPERTY prop,
00069                              int index,
00070                              int value,
00071                              int doSignal);
00072 
00073   virtual int getIntProperty(GWEN_DIALOG_PROPERTY prop,
00074                              int index,
00075                              int defaultValue);
00076 
00077   virtual int setCharProperty(GWEN_DIALOG_PROPERTY prop,
00078                               int index,
00079                               const char *value,
00080                               int doSignal);
00081 
00082   virtual const char *getCharProperty(GWEN_DIALOG_PROPERTY prop,
00083                                       int index,
00084                                       const char *defaultValue);
00085 
00086   virtual int addChildGuiWidget(GWEN_WIDGET *wChild);
00087 
00088 };
00089 
00090 
00091 
00092 
00093 #endif /* CPPWIDGET_HPP */
00094 
00095