diff -r 0f2326c2a325 -r 1c3b8676e58c ginebra2/ActionButtonSnippet.h --- a/ginebra2/ActionButtonSnippet.h Wed Jun 23 17:59:43 2010 +0300 +++ b/ginebra2/ActionButtonSnippet.h Tue Jul 06 14:03:49 2010 +0300 @@ -29,33 +29,30 @@ namespace GVA { + class ActionButtonSnippet : public ChromeSnippet { Q_OBJECT public: ActionButtonSnippet(const QString & elementId, ChromeWidget * chrome, QGraphicsWidget * widget, const QWebElement & element); virtual ~ActionButtonSnippet() {;} + static ActionButtonSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element); QAction * getDefaultAction(); - void setDefaultAction( QAction * action, QEvent::Type triggerOn = QEvent::GraphicsSceneMouseRelease ); + void setDefaultAction( QAction * action, bool triggerOnDown =false, bool triggerOnUp=true); QIcon icon(); bool isChecked(); void setActive( bool active ); + void setActiveOnPress( bool ); public slots: void setIcon( const QString & icon ); void setDisabledIcon( const QString & icon ); - void setSelectedIcon( const QString & icon ); void setActiveIcon( const QString & icon ); - void connectAction ( const QString & action, const QString & view, const QString & inputEvent = "Up" ); + void connectAction( const QString & action, const QString & view, bool onDown = false, bool onUp = true); + void setEnabled( bool enabled ); - void setLatched( bool latched ); - void setInputEvent( const QString & inputEvent ); void updateButtonState(bool state); - - signals: - void activated(); - void contextMenuEvent(); }; }