00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef WACTIONBUTTON_H
00031 #define WACTIONBUTTON_H
00032
00033 #include <qpushbutton.h>
00034 #include <qwidgetplugin.h>
00035 #include "acfg.h"
00036
00037 class QWidget;
00038
00039 class QT_WIDGET_PLUGIN_EXPORT wActionButton : public QPushButton
00040 {
00041 Q_OBJECT
00042 Q_PROPERTY( bool openEditor READ getOpenEditor WRITE setOpenEditor STORED false )
00043 Q_PROPERTY( bool action READ isAction WRITE setAction DESIGNABLE true )
00044 Q_PROPERTY( bool actionUpdate READ isActionUpdate WRITE setActionUpdate DESIGNABLE true )
00045 Q_PROPERTY( bool actionTurnOn READ isActionTurnOn WRITE setActionTurnOn DESIGNABLE true)
00046 Q_PROPERTY( bool actionClose READ isActionClose WRITE setActionClose DESIGNABLE true)
00047 Q_PROPERTY( int actionId READ getActionId WRITE setActionId DESIGNABLE true)
00048 Q_PROPERTY( bool script READ isScript WRITE setScript DESIGNABLE true)
00049
00050 public:
00051
00052 wActionButton( QWidget *parent = 0, const char *name = 0 );
00053 virtual ~wActionButton();
00054
00055 void openEditor();
00056
00057
00058 public slots:
00059
00060 void onClick();
00061 void keyPressHandler ( QKeyEvent * e );
00062
00063 bool getOpenEditor() const { return false; };
00064 void setOpenEditor( bool b ) { if( b ) openEditor(); };
00065 bool isAction() const { return action; };
00066 bool isActionUpdate() const { return actionUpdate; };
00067 bool isActionTurnOn() const { return actionTurnOn; };
00068 bool isActionClose() const { return actionClose; };
00069 int getActionId() const { return actionId; };
00070 bool isScript() const { return !action; };
00071 QString getScriptCode() const { return scriptCode; };
00072
00073 void setAction( bool a ) { action = a; };
00074 void setActionUpdate( bool a ) { actionUpdate = a; };
00075 void setActionTurnOn( bool a ) { actionTurnOn = a; };
00076 void setActionClose( bool a ) { actionClose = a; };
00077 void setActionId( int a ) { actionId = a; };
00078 void setScript( bool a ) { action = !a; };
00079 void setScriptCode( QString a ) { scriptCode = a; };
00080 private:
00081
00082 bool action, actionUpdate, actionTurnOn, actionClose;
00083 int actionId;
00084 QString scriptCode;
00085 };
00086
00087 #endif //WACTIONBUTTON_H
00088