Ananas Library  0.9.5
wactionbutton.h
1 /****************************************************************************
2 ** $Id: wactionbutton.h,v 1.11 2006/05/04 14:58:22 gr Exp $
3 **
4 ** Header file of the table plugin of Ananas
5 ** Designer and Engine applications
6 **
7 ** Created : 20031201
8 **
9 ** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10 **
11 ** This file is part of the Ananas Plugins of the Ananas
12 ** automation accounting system.
13 **
14 ** This file may be distributed and/or modified under the terms of the
15 ** GNU General Public License version 2 as published by the Free Software
16 ** Foundation and appearing in the file LICENSE.GPL included in the
17 ** packaging of this file.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23 ** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24 **
25 ** Contact org@leaderit.ru if any conditions of this licensing are
26 ** not clear to you.
27 **
28 **********************************************************************/
29 
30 #ifndef WACTIONBUTTON_H
31 #define WACTIONBUTTON_H
32 
33 #include <qpushbutton.h>
34 #include <qwidgetplugin.h>
35 #include "acfg.h"
36 
37 class QWidget;
38 
39 class QT_WIDGET_PLUGIN_EXPORT wActionButton : public QPushButton
40 {
41  Q_OBJECT
42  Q_PROPERTY( bool openEditor READ getOpenEditor WRITE setOpenEditor STORED false )
43  Q_PROPERTY( bool action READ isAction WRITE setAction DESIGNABLE true )
44  Q_PROPERTY( bool actionUpdate READ isActionUpdate WRITE setActionUpdate DESIGNABLE true )
45  Q_PROPERTY( bool actionTurnOn READ isActionTurnOn WRITE setActionTurnOn DESIGNABLE true)
46  Q_PROPERTY( bool actionClose READ isActionClose WRITE setActionClose DESIGNABLE true)
47  Q_PROPERTY( int actionId READ getActionId WRITE setActionId DESIGNABLE true)
48  Q_PROPERTY( bool script READ isScript WRITE setScript DESIGNABLE true)
49 // Q_PROPERTY( QString scriptCode READ getScriptCode WRITE setScriptCode DESIGNABLE false)
50 public:
51 
52  wActionButton( QWidget *parent = 0, const char *name = 0 );
53  virtual ~wActionButton();
54 
55  void openEditor();
56 
57 
58 public slots:
59 
60  void onClick();
61  void keyPressHandler ( QKeyEvent * e );
62 
63  bool getOpenEditor() const { return false; };
64  void setOpenEditor( bool b ) { if( b ) openEditor(); };
65  bool isAction() const { return action; };
66  bool isActionUpdate() const { return actionUpdate; };
67  bool isActionTurnOn() const { return actionTurnOn; };
68  bool isActionClose() const { return actionClose; };
69  int getActionId() const { return actionId; };
70  bool isScript() const { return !action; };
71  QString getScriptCode() const { return scriptCode; };
72 
73  void setAction( bool a ) { action = a; };
74  void setActionUpdate( bool a ) { actionUpdate = a; };
75  void setActionTurnOn( bool a ) { actionTurnOn = a; };
76  void setActionClose( bool a ) { actionClose = a; };
77  void setActionId( int a ) { actionId = a; };
78  void setScript( bool a ) { action = !a; };
79  void setScriptCode( QString a ) { scriptCode = a; };
80 private:
81 
82  bool action, actionUpdate, actionTurnOn, actionClose;
83  int actionId;
84  QString scriptCode;
85 };
86 
87 #endif //WACTIONBUTTON_H
88 
Definition: wactionbutton.h:39