ginebra2/ActionButton.h
changeset 16 3c88a81ff781
parent 3 0954f5dd2cd0
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
    32 class ActionButton : public NativeChromeItem
    32 class ActionButton : public NativeChromeItem
    33     {
    33     {
    34         Q_OBJECT
    34         Q_OBJECT
    35 
    35 
    36     public:
    36     public:
    37         ActionButton( ChromeSnippet * snippet, QGraphicsItem * parent = 0 );
    37         /*!
       
    38          * Contructs an ActionButton based on the given snippet.  
       
    39          * \param snippet the chrome snippet that defines this ActionButton.
       
    40          * \param objectName the object name of the button.  REQUIRED to enable automated testing.
       
    41          * \param parent the QGraphicsItem parent.
       
    42          */
       
    43         ActionButton( ChromeSnippet * snippet, const QString &objectName, QGraphicsItem * parent = 0 );
    38         virtual ~ActionButton() {};
    44         virtual ~ActionButton() {};
    39         void paint( QPainter * painter, const QStyleOptionGraphicsItem * opt, QWidget * widget );
    45         void paint( QPainter * painter, const QStyleOptionGraphicsItem * opt, QWidget * widget );
    40         void addIcon( const QString & icon, QIcon::Mode mode = QIcon::Normal );
    46         void addIcon( const QString & icon, QIcon::Mode mode = QIcon::Normal );
    41         QIcon icon() {return m_icon;}
    47         QIcon icon() {return m_icon;}
    42         void setAction ( QAction * action, bool triggerOnDown = false,  bool triggerOnUp = true);
    48         void setAction ( QAction * action, bool triggerOnDown = false,  bool triggerOnUp = true);
    43         void setEnabled(bool);
    49         void setEnabled(bool);
    44         void setActive(bool);
    50         void setActive(bool);
    45         void setActiveOnPress(bool);
    51         void setActiveOnPress(bool);
       
    52         void setTriggerOnUp(bool);
    46         QAction * defaultAction();
    53         QAction * defaultAction();
    47         bool isChecked() {return m_internalAction->isChecked();}
    54         bool isChecked() {return m_internalAction->isChecked();}
    48 
    55         bool handleGesture(QEvent* event);
       
    56         bool eventFilter(QObject* receiver, QEvent* event);
       
    57         
    49     public Q_SLOTS:
    58     public Q_SLOTS:
    50         void onActionChanged();
    59         void onActionChanged();
    51         void onHidden();
    60         void onHidden();
    52         void onShown();
    61         void onShown();
    53 
    62