Eneboo - Documentación para desarrolladores
src/qt/src/widgets/qframe.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qframe.h   3.3.8   edited Jan 11 14:38 $
00003 **
00004 ** Definition of QFrame widget class
00005 **
00006 ** Created : 950201
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the widgets module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QFRAME_H
00039 #define QFRAME_H
00040 
00041 #ifndef QT_H
00042 #include "qwidget.h"
00043 #endif // QT_H
00044 
00045 #ifndef QT_NO_FRAME
00046 
00047 class Q_EXPORT QFrame : public QWidget
00048 {
00049     Q_OBJECT
00050     Q_ENUMS( Shape Shadow )
00051     Q_PROPERTY( int frameWidth READ frameWidth )
00052     Q_PROPERTY( QRect contentsRect READ contentsRect )
00053     Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape )
00054     Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
00055     Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
00056     Q_PROPERTY( int margin READ margin WRITE setMargin )
00057     Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
00058     Q_PROPERTY( QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false )
00059 
00060 public:
00061     QFrame( QWidget* parent=0, const char* name=0, WFlags f=0 );
00062 
00063     int         frameStyle()    const;
00064     virtual void setFrameStyle( int );
00065 
00066     int         frameWidth()    const;
00067     QRect       contentsRect()  const;
00068 
00069 #ifndef Q_QDOC
00070     bool        lineShapesOk()  const { return TRUE; }
00071 #endif
00072 
00073     QSize       sizeHint() const;
00074 
00075     enum Shape { NoFrame  = 0,                  // no frame
00076                  Box      = 0x0001,             // rectangular box
00077                  Panel    = 0x0002,             // rectangular panel
00078                  WinPanel = 0x0003,             // rectangular panel (Windows)
00079                  HLine    = 0x0004,             // horizontal line
00080                  VLine    = 0x0005,             // vertical line
00081                  StyledPanel = 0x0006,          // rectangular panel depending on the GUI style
00082                  PopupPanel = 0x0007,           // rectangular panel depending on the GUI style
00083                  MenuBarPanel = 0x0008,
00084                  ToolBarPanel = 0x0009,
00085                  LineEditPanel = 0x000a,
00086                  TabWidgetPanel = 0x000b,
00087                  GroupBoxPanel = 0x000c,
00088                  MShape   = 0x000f              // mask for the shape
00089     };
00090     enum Shadow { Plain    = 0x0010,            // plain line
00091                   Raised   = 0x0020,            // raised shadow effect
00092                   Sunken   = 0x0030,            // sunken shadow effect
00093                   MShadow  = 0x00f0 };          // mask for the shadow
00094 
00095     Shape       frameShape()    const;
00096     void        setFrameShape( Shape );
00097     Shadow      frameShadow()   const;
00098     void        setFrameShadow( Shadow );
00099 
00100     int         lineWidth()     const;
00101     virtual void setLineWidth( int );
00102 
00103     int         margin()        const;
00104     virtual void setMargin( int );
00105 
00106     int         midLineWidth()  const;
00107     virtual void setMidLineWidth( int );
00108 
00109     QRect       frameRect()     const;
00110     virtual void setFrameRect( const QRect & );
00111 
00112 protected:
00113     void        paintEvent( QPaintEvent * );
00114     void        resizeEvent( QResizeEvent * );
00115     virtual void drawFrame( QPainter * );
00116     virtual void drawContents( QPainter * );
00117     virtual void frameChanged();
00118     void        styleChange( QStyle& );
00119 
00120 private:
00121     void        updateFrameWidth(bool=FALSE);
00122     QRect       frect;
00123     int         fstyle;
00124     short       lwidth;
00125     short       mwidth;
00126     short       mlwidth;
00127     short       fwidth;
00128 
00129     void * d;
00130 private:        // Disabled copy constructor and operator=
00131 #if defined(Q_DISABLE_COPY)
00132     QFrame( const QFrame & );
00133     QFrame &operator=( const QFrame & );
00134 #endif
00135 };
00136 
00137 
00138 inline int QFrame::frameStyle() const
00139 { return fstyle; }
00140 
00141 inline QFrame::Shape QFrame::frameShape() const
00142 { return (Shape) ( fstyle & MShape ); }
00143 
00144 inline QFrame::Shadow QFrame::frameShadow() const
00145 { return (Shadow) ( fstyle & MShadow ); }
00146 
00147 inline void QFrame::setFrameShape( QFrame::Shape s )
00148 { setFrameStyle( ( fstyle & MShadow ) | s ); }
00149 
00150 inline void QFrame::setFrameShadow( QFrame::Shadow s )
00151 { setFrameStyle( ( fstyle & MShape ) | s ); }
00152 
00153 inline int QFrame::lineWidth() const
00154 { return lwidth; }
00155 
00156 inline int QFrame::midLineWidth() const
00157 { return mlwidth; }
00158 
00159 inline int QFrame::margin() const
00160 { return mwidth; }
00161 
00162 inline int QFrame::frameWidth() const
00163 { return fwidth; }
00164 
00165 
00166 #endif // QT_NO_FRAME
00167 
00168 #endif // QFRAME_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'