ginebra2/ToolbarChromeItem.h
changeset 0 1450b09d0cfd
child 3 0954f5dd2cd0
child 5 0f2326c2a325
equal deleted inserted replaced
-1:000000000000 0:1450b09d0cfd
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     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 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __GINEBRA_TOOLBARCHROMEITEM_H
       
    20 #define __GINEBRA_TOOLBARCHROMEITEM_H
       
    21 
       
    22 #include <QtGui>
       
    23 #include "WebChromeContainerSnippet.h"
       
    24 
       
    25 namespace GVA {
       
    26 
       
    27 
       
    28   class ToolbarChromeItem : public QGraphicsWidget
       
    29   {
       
    30     Q_OBJECT
       
    31   public:
       
    32     ToolbarChromeItem(QGraphicsItem* parent = 0);
       
    33     virtual ~ToolbarChromeItem();
       
    34     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* opt, QWidget* widget);
       
    35     virtual void setSnippet(WebChromeContainerSnippet * snippet);
       
    36     QPen pen() { return m_pen;}
       
    37     QLinearGradient grad() { return m_grad;}
       
    38     qreal opacity() { return m_opacity;}
       
    39     void setOpacity(qreal opacity) {m_opacity = opacity;}
       
    40     WebChromeContainerSnippet * getSnippet() { return m_snippet;}
       
    41     QPainterPath* partialbg() { return m_partialbg;}
       
    42     void removePartialbg() { delete m_partialbg; m_partialbg = NULL;}
       
    43     void addPartialbg() ;
       
    44 
       
    45   protected:
       
    46     virtual void resizeEvent(QGraphicsSceneResizeEvent * ev);
       
    47   
       
    48   private:
       
    49     void setProperties();
       
    50 
       
    51     WebChromeContainerSnippet * m_snippet;
       
    52     QPainterPath* m_partialbg;
       
    53     QPen m_pen;
       
    54     QLinearGradient m_grad;
       
    55     qreal m_opacity;
       
    56 
       
    57   };
       
    58 
       
    59 } // end of namespace GVA
       
    60 
       
    61 #endif // __GINEBRA_TOOLBARCHROMEITEM_H