ginebra2/ActionButtonSnippet.h
changeset 5 0f2326c2a325
parent 0 1450b09d0cfd
child 6 1c3b8676e58c
equal deleted inserted replaced
1:b0dd75e285d2 5:0f2326c2a325
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
     4 *
     9 * Initial Contributors:
     5 * This program is free software: you can redistribute it and/or modify
    10 * Nokia Corporation - initial contribution.
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
    11 *
     8 *
    12 * Contributors:
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
    13 *
    13 *
    14 * Description: 
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not,
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
    15 *
    19 *
    16 */
    20 */
    17 
       
    18 
    21 
    19 #ifndef __gva_actionbuttonsnippet_h__
    22 #ifndef __gva_actionbuttonsnippet_h__
    20 #define __gva_actionbuttonsnippet_h__
    23 #define __gva_actionbuttonsnippet_h__
    21 
    24 
    22 #include "ChromeSnippet.h"
    25 #include "ChromeSnippet.h"
    30   {
    33   {
    31     Q_OBJECT
    34     Q_OBJECT
    32     public:
    35     public:
    33        ActionButtonSnippet(const QString & elementId, ChromeWidget * chrome, QGraphicsWidget * widget, const QWebElement & element);
    36        ActionButtonSnippet(const QString & elementId, ChromeWidget * chrome, QGraphicsWidget * widget, const QWebElement & element);
    34        virtual ~ActionButtonSnippet() {;}
    37        virtual ~ActionButtonSnippet() {;}
       
    38        QAction * getDefaultAction();
       
    39        void setDefaultAction( QAction * action, QEvent::Type triggerOn = QEvent::GraphicsSceneMouseRelease );
       
    40        QIcon icon();
       
    41        bool isChecked();
       
    42        void setActive( bool active );
    35 
    43 
    36     public slots:
    44     public slots:
    37        void setIcon( const QString & icon );
    45        void setIcon( const QString & icon );
    38        void setDisabledIcon( const QString & icon );
    46        void setDisabledIcon( const QString & icon );
    39        void setSelectedIcon( const QString & icon );
    47        void setSelectedIcon( const QString & icon );
    40        void setActiveIcon( const QString & icon );
    48        void setActiveIcon( const QString & icon );
    41        void connectAction ( const QString & action, const QString & view, const QString & inputEvent = "Down" );
    49        void connectAction ( const QString & action, const QString & view, const QString & inputEvent = "Up" );
    42        void setEnabled( bool enabled );
    50        void setEnabled( bool enabled );
    43        void setLatched( bool latched );
    51        void setLatched( bool latched );
    44        void setInputEvent( const QString & inputEvent );
    52        void setInputEvent( const QString & inputEvent );
       
    53        void updateButtonState(bool state);
       
    54 
       
    55        
    45     signals:
    56     signals:
    46        void activated();
    57        void activated();
    47        void contextMenuEvent();
    58        void contextMenuEvent();
    48   };
    59   };
    49 }
    60 }
    50 
    61 
    51 #endif // ICONSNIPPET_H
    62 #endif // ACTIONBUTTONSNIPPET_H