ginebra2/WebChromeContainerSnippet.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
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 
       
    19 #ifndef __GINEBRA_WEBCHROMECONTAINERSNIPPET_H__
    21 #ifndef __GINEBRA_WEBCHROMECONTAINERSNIPPET_H__
    20 #define __GINEBRA_WEBCHROMECONTAINERSNIPPET_H__
    22 #define __GINEBRA_WEBCHROMECONTAINERSNIPPET_H__
    21 
    23 
    22 #include <QtGui>
    24 #include <QtGui>
    23 #include "ChromeSnippet.h"
    25 #include "ChromeSnippet.h"
    28 
    30 
    29   class WebChromeContainerSnippet : public ChromeSnippet
    31   class WebChromeContainerSnippet : public ChromeSnippet
    30   {
    32   {
    31     Q_OBJECT
    33     Q_OBJECT
    32   public:
    34   public:
    33     WebChromeContainerSnippet(const QString& elementId, ChromeWidget * chrome, const QRectF& ownerArea, const QWebElement & element, QGraphicsWidget * widget);
    35     WebChromeContainerSnippet(const QString& elementId, ChromeWidget * chrome, const QWebElement & element);
    34     virtual ~WebChromeContainerSnippet();
    36     virtual ~WebChromeContainerSnippet();
    35     void addChild(ChromeSnippet * child);
    37     virtual void setChromeWidget(QGraphicsWidget * widget);
       
    38     virtual void addChild(ChromeSnippet * child);
    36     QGraphicsLinearLayout* layout() { return m_layout;}
    39     QGraphicsLinearLayout* layout() { return m_layout;}
    37 
    40 
       
    41   Q_SIGNALS:
       
    42     void childAdded(ChromeSnippet * );
    38   public slots:
    43   public slots:
    39     void setLayoutHeight(int height);
    44     void setLayoutHeight(int height);
       
    45     void setLayoutWidth(qreal width, bool update = false);
       
    46     virtual void updateSize(QSize );
       
    47     void updateSizes();
       
    48     QRectF ownerArea() { return QRectF(m_element.geometry());}
       
    49     virtual void updateOwnerArea();
    40 
    50 
    41   protected slots:
    51   protected slots:
    42     void positionChildren();
    52     void positionChildren();
    43   private slots:
    53 
    44     void updateOwnerArea();
       
    45   private:
    54   private:
    46 
       
    47     QRectF m_ownerArea;
       
    48     qreal m_layoutHeight;
    55     qreal m_layoutHeight;
       
    56     qreal m_layoutWidth;
    49     QGraphicsLinearLayout * m_layout;
    57     QGraphicsLinearLayout * m_layout;
    50   };
    58   };
    51 
    59 
    52 } // end of namespace GVA
    60 } // end of namespace GVA
    53 
    61