src/qt3support/widgets/q3groupbox.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt3Support module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef Q3GROUPBOX_H
       
    43 #define Q3GROUPBOX_H
       
    44 
       
    45 #include <QtGui/qgroupbox.h>
       
    46 
       
    47 QT_BEGIN_HEADER
       
    48 
       
    49 QT_BEGIN_NAMESPACE
       
    50 
       
    51 QT_MODULE(Qt3SupportLight)
       
    52 
       
    53 class Q3GroupBoxPrivate;
       
    54 
       
    55 class Q_COMPAT_EXPORT Q3GroupBox : public QGroupBox
       
    56 {
       
    57     Q_OBJECT
       
    58 public:
       
    59     enum
       
    60 #if defined(Q_MOC_RUN)
       
    61     FrameShape
       
    62 #else
       
    63     DummyFrame
       
    64 #endif
       
    65     {   Box = QFrame::Box, Sunken = QFrame::Sunken, Plain = QFrame::Plain,
       
    66         Raised = QFrame::Raised, MShadow=QFrame::Shadow_Mask, NoFrame = QFrame::NoFrame,
       
    67         Panel = QFrame::Panel, StyledPanel = QFrame::StyledPanel, HLine = QFrame::HLine,
       
    68         VLine = QFrame::VLine,
       
    69         WinPanel = QFrame::WinPanel,ToolBarPanel = QFrame::StyledPanel,
       
    70         MenuBarPanel = QFrame::StyledPanel, PopupPanel = QFrame::StyledPanel,
       
    71         LineEditPanel = QFrame::StyledPanel,TabWidgetPanel = QFrame::StyledPanel,
       
    72         GroupBoxPanel = 0x0007,
       
    73         MShape = QFrame::Shape_Mask};
       
    74 
       
    75     typedef DummyFrame FrameShape;
       
    76     Q_ENUMS(FrameShape)
       
    77 
       
    78     Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false)
       
    79     Q_PROPERTY(int columns READ columns WRITE setColumns DESIGNABLE false)
       
    80 
       
    81     Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false)
       
    82     Q_PROPERTY(FrameShape frameShape READ frameShape WRITE setFrameShape)
       
    83     Q_PROPERTY(FrameShape frameShadow READ frameShadow WRITE setFrameShadow)
       
    84     Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
       
    85     Q_PROPERTY(int midLineWidth READ midLineWidth WRITE setMidLineWidth)
       
    86     Q_PROPERTY(int margin READ margin WRITE setMargin)
       
    87 
       
    88 public:
       
    89     explicit Q3GroupBox(QWidget* parent=0, const char* name=0);
       
    90     explicit Q3GroupBox(const QString &title,
       
    91 	       QWidget* parent=0, const char* name=0);
       
    92     Q3GroupBox(int strips, Qt::Orientation o,
       
    93 	       QWidget* parent=0, const char* name=0);
       
    94     Q3GroupBox(int strips, Qt::Orientation o, const QString &title,
       
    95 	       QWidget* parent=0, const char* name=0);
       
    96     ~Q3GroupBox();
       
    97 
       
    98     virtual void setColumnLayout(int strips, Qt::Orientation o);
       
    99 
       
   100     int columns() const;
       
   101     void setColumns(int);
       
   102 
       
   103     Qt::Orientation orientation() const;
       
   104     void setOrientation(Qt::Orientation);
       
   105 
       
   106     int insideMargin() const;
       
   107     int insideSpacing() const;
       
   108     void setInsideMargin(int m);
       
   109     void setInsideSpacing(int s);
       
   110 
       
   111     void addSpace(int);
       
   112 
       
   113     void setFrameRect(QRect);
       
   114     QRect frameRect() const;
       
   115 #ifdef qdoc
       
   116     void setFrameShadow(FrameShape);
       
   117     FrameShape frameShadow() const;
       
   118     void setFrameShape(FrameShape);
       
   119     FrameShape frameShape() const;
       
   120 #else
       
   121     void setFrameShadow(DummyFrame);
       
   122     DummyFrame frameShadow() const;
       
   123     void setFrameShape(DummyFrame);
       
   124     DummyFrame frameShape() const;
       
   125 #endif
       
   126     void setFrameStyle(int);
       
   127     int frameStyle() const;
       
   128     int frameWidth() const;
       
   129     void setLineWidth(int);
       
   130     int lineWidth() const;
       
   131     void setMargin(int margin) { setContentsMargins(margin, margin, margin, margin); }
       
   132     int margin() const
       
   133     { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy);  return margin; }
       
   134     void setMidLineWidth(int);
       
   135     int midLineWidth() const;
       
   136 
       
   137 protected:
       
   138     void childEvent(QChildEvent *);
       
   139     void resizeEvent(QResizeEvent *);
       
   140     void changeEvent(QEvent *);
       
   141     bool event(QEvent *);
       
   142 
       
   143 private:
       
   144     void skip();
       
   145     void init();
       
   146     void calculateFrame();
       
   147     void insertWid(QWidget*);
       
   148     void drawFrame(QPainter *p);
       
   149 
       
   150     Q3GroupBoxPrivate * d;
       
   151 
       
   152     Q_DISABLE_COPY(Q3GroupBox)
       
   153 };
       
   154 
       
   155 QT_END_NAMESPACE
       
   156 
       
   157 QT_END_HEADER
       
   158 
       
   159 #endif // Q3GROUPBOX_H