32 |
32 |
33 class ActionButtonSnippet : public ChromeSnippet |
33 class ActionButtonSnippet : public ChromeSnippet |
34 { |
34 { |
35 Q_OBJECT |
35 Q_OBJECT |
36 public: |
36 public: |
|
37 /*! |
|
38 * Contructs an ActionButtonSnippet. |
|
39 * \param elementId the chrome HTML element's id. Also used as the object name of the enclosed ActionButton. |
|
40 * \param chrome the ChromeWidget that the ActionButtonSnippet will be a part of. |
|
41 * \param widget the enclosing graphics widget. |
|
42 * \param element the HTML element in the chrome that defines this snippet. |
|
43 */ |
37 ActionButtonSnippet(const QString & elementId, ChromeWidget * chrome, QGraphicsWidget * widget, const QWebElement & element); |
44 ActionButtonSnippet(const QString & elementId, ChromeWidget * chrome, QGraphicsWidget * widget, const QWebElement & element); |
38 virtual ~ActionButtonSnippet() {;} |
45 virtual ~ActionButtonSnippet() {;} |
39 static ActionButtonSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element); |
46 static ActionButtonSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element); |
40 QAction * getDefaultAction(); |
47 QAction * getDefaultAction(); |
41 void setDefaultAction( QAction * action, bool triggerOnDown =false, bool triggerOnUp=true); |
48 void setDefaultAction( QAction * action, bool triggerOnDown =false, bool triggerOnUp=true); |
42 QIcon icon(); |
49 QIcon icon(); |
43 bool isChecked(); |
50 bool isChecked(); |
44 void setActive( bool active ); |
51 void setActive( bool active ); |
45 void setActiveOnPress( bool ); |
52 void setActiveOnPress( bool ); |
|
53 void setTriggerOnUp( bool); |
46 |
54 |
47 public slots: |
55 public slots: |
48 void setIcon( const QString & icon ); |
56 void setIcon( const QString & icon ); |
49 void setDisabledIcon( const QString & icon ); |
57 void setDisabledIcon( const QString & icon ); |
50 void setActiveIcon( const QString & icon ); |
58 void setActiveIcon( const QString & icon ); |