src/hbcore/layouts/hbanchorlayout.h
changeset 0 16d8024aca5e
child 1 f7ac710697a9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbCore module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBANCHORLAYOUT_H
       
    27 #define HBANCHORLAYOUT_H
       
    28 
       
    29 #include <QGraphicsLayout>
       
    30 
       
    31 #include <hbglobal.h>
       
    32 #include <hbnamespace.h>
       
    33 
       
    34 class HbAnchorLayoutPrivate;
       
    35 class HbAnchor;
       
    36 
       
    37 class HB_CORE_EXPORT HbAnchorLayout : public QGraphicsLayout
       
    38 {
       
    39 public:
       
    40     typedef Hb::Edge Edge;
       
    41     
       
    42     explicit HbAnchorLayout(QGraphicsLayoutItem *parent = 0);
       
    43     virtual ~HbAnchorLayout();
       
    44 
       
    45     bool setAnchor(
       
    46         QGraphicsLayoutItem *startItem,
       
    47         Edge startEdge,
       
    48         QGraphicsLayoutItem *endItem,
       
    49         Edge endEdge,
       
    50         qreal value);
       
    51 
       
    52     bool removeAnchor(
       
    53         QGraphicsLayoutItem *startItem,
       
    54         Edge startEdge,
       
    55         QGraphicsLayoutItem *endItem,
       
    56         Edge endEdge);
       
    57 
       
    58     void removeAt(int index);
       
    59     void removeItem(QGraphicsLayoutItem* item);
       
    60     void setGeometry(const QRectF &rect);
       
    61     int count() const;
       
    62     QGraphicsLayoutItem *itemAt(int index) const;
       
    63     int indexOf(const QGraphicsLayoutItem* item) const;
       
    64 
       
    65     bool isValid() const;
       
    66 
       
    67     void invalidate();
       
    68     virtual void widgetEvent(QEvent *e);
       
    69 
       
    70 protected:
       
    71     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
       
    72 
       
    73 protected:
       
    74     HbAnchorLayoutPrivate * const d_ptr;
       
    75 
       
    76 private:
       
    77     Q_DISABLE_COPY(HbAnchorLayout)
       
    78     Q_DECLARE_PRIVATE_D(d_ptr, HbAnchorLayout)
       
    79 
       
    80     friend class HbAnchorLayoutDebug;
       
    81 };
       
    82 
       
    83 #endif
       
    84