ginebra2/ToolbarChromeItem.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
child 16 3c88a81ff781
equal deleted inserted replaced
1:b0dd75e285d2 3:0954f5dd2cd0
     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 __GINEBRA_TOOLBARCHROMEITEM_H
    22 #ifndef __GINEBRA_TOOLBARCHROMEITEM_H
    20 #define __GINEBRA_TOOLBARCHROMEITEM_H
    23 #define __GINEBRA_TOOLBARCHROMEITEM_H
    21 
    24 
    22 #include <QtGui>
    25 #include <QtGui>
    23 #include "WebChromeContainerSnippet.h"
    26 #include "ChromeSnippet.h"
       
    27 #include "NativeChromeItem.h"
    24 
    28 
    25 namespace GVA {
    29 namespace GVA {
    26 
    30 
    27 
    31 
    28   class ToolbarChromeItem : public QGraphicsWidget
    32   class ToolbarChromeItem : public ChromeItem
    29   {
    33   {
    30     Q_OBJECT
    34     Q_OBJECT
    31   public:
    35   public:
    32     ToolbarChromeItem(QGraphicsItem* parent = 0);
    36     ToolbarChromeItem(ChromeSnippet* snippet, QGraphicsItem* parent = 0);
    33     virtual ~ToolbarChromeItem();
    37     virtual ~ToolbarChromeItem();
    34     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* opt, QWidget* widget);
    38     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* opt, QWidget* widget);
    35     virtual void setSnippet(WebChromeContainerSnippet * snippet);
    39     virtual void setSnippet(ChromeSnippet* snippet);
    36     QPen pen() { return m_pen;}
    40     QPen pen() { return m_pen;}
    37     QLinearGradient grad() { return m_grad;}
    41     QLinearGradient grad() { return m_grad;}
    38     qreal opacity() { return m_opacity;}
    42     qreal opacity() { return m_opacity;}
    39     void setOpacity(qreal opacity) {m_opacity = opacity;}
    43     void setOpacity(qreal opacity) {m_opacity = opacity;}
    40     WebChromeContainerSnippet * getSnippet() { return m_snippet;}
       
    41     QPainterPath* partialbg() { return m_partialbg;}
    44     QPainterPath* partialbg() { return m_partialbg;}
    42     void removePartialbg() { delete m_partialbg; m_partialbg = NULL;}
    45     void removePartialbg() { delete m_partialbg; m_partialbg = NULL;}
    43     void addPartialbg() ;
    46     void addPartialbg() ;
    44 
    47 
    45   protected:
    48   protected:
    46     virtual void resizeEvent(QGraphicsSceneResizeEvent * ev);
    49     virtual void resizeEvent(QGraphicsSceneResizeEvent * ev);
    47   
    50 
    48   private:
    51   private:
    49     void setProperties();
    52     void setProperties();
    50 
    53 
    51     WebChromeContainerSnippet * m_snippet;
       
    52     QPainterPath* m_partialbg;
    54     QPainterPath* m_partialbg;
    53     QPen m_pen;
    55     QPen m_pen;
    54     QLinearGradient m_grad;
    56     QLinearGradient m_grad;
    55     qreal m_opacity;
    57     qreal m_opacity;
       
    58     QColor m_borderColor;
       
    59     int m_padding;
       
    60     int m_borderWidth;
    56 
    61 
    57   };
    62   };
    58 
    63 
    59 } // end of namespace GVA
    64 } // end of namespace GVA
    60 
    65