kdeui
kdockwidget_private.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KDOCKWIDGET_PRIVATE_H
00025 #define KDOCKWIDGET_PRIVATE_H
00026
00027 #include <qwidget.h>
00028 #include <qpushbutton.h>
00029
00030 #ifndef NO_KDE2
00031 #include <netwm_def.h>
00032 #endif
00033
00034 class QFrame;
00035 class KDockContainer;
00036
00037
00044 class KDEUI_EXPORT KDockSplitter : public QWidget
00045 {
00046
00047
00048
00049
00050 Q_OBJECT
00051 public:
00059 KDockSplitter(QWidget *parent= 0, const char *name= 0, Orientation orient= Vertical, int pos= 50);
00060 virtual ~KDockSplitter(){}
00061
00070 void activate(QWidget *c0, QWidget *c1 = 0L);
00074 void deactivate();
00075
00080 int separatorPosInPercent();
00085 void setSeparatorPosInPercent(int percent);
00086
00095 int separatorPos() const;
00102 void setSeparatorPos(int pos, bool do_resize = true);
00111
00112 void setSeparatorPosX(int pos, bool do_resize=false);
00113
00118 virtual bool eventFilter(QObject *, QEvent *);
00119 virtual bool event( QEvent * );
00120
00124 QWidget* getFirst() const { return child0; }
00128 QWidget* getLast() const { return child1; }
00133 QWidget* getAnother( QWidget* w ) const;
00134 void updateName();
00135
00141 void setOpaqueResize(bool b=true);
00142 bool opaqueResize() const;
00143
00148 void setKeepSize(bool b=true);
00149 bool keepSize() const;
00150
00151
00152 void setForcedFixedWidth(KDockWidget *dw,int w);
00153 void setForcedFixedHeight(KDockWidget *dw,int h);
00154 void restoreFromForcedFixedSize(KDockWidget *dw);
00155
00159 Orientation orientation(){return m_orientation;}
00160
00161 protected:
00162 friend class KDockContainer;
00168 int checkValue(int position) const;
00176 int checkValueOverlapped(int position, QWidget* child) const;
00177
00192 virtual void resizeEvent(QResizeEvent *ev);
00193
00194
00195
00196
00197
00198 private:
00204 void setupMinMaxSize();
00210 QWidget *child0, *child1;
00211 Orientation m_orientation;
00215 bool initialised;
00220 QFrame* divider;
00231 int xpos, savedXPos;
00232 bool mOpaqueResize, mKeepSize;
00233 int fixedWidth0,fixedWidth1;
00234 int fixedHeight0,fixedHeight1;
00235 bool m_dontRecalc;
00239 static const int factor = 100000;
00240 };
00241
00248 class KDEUI_EXPORT KDockButton_Private : public QPushButton
00249 {
00250 Q_OBJECT
00251 public:
00252 KDockButton_Private( QWidget *parent=0, const char *name=0 );
00253 ~KDockButton_Private();
00254
00255 protected:
00256 virtual void drawButton( QPainter * );
00257 virtual void enterEvent( QEvent * );
00258 virtual void leaveEvent( QEvent * );
00259
00260 private:
00261 bool moveMouse;
00262 };
00263
00273 class KDockWidgetPrivate : public QObject
00274 {
00275 Q_OBJECT
00276 public:
00277 KDockWidgetPrivate();
00278 ~KDockWidgetPrivate();
00279
00280 public slots:
00284 void slotFocusEmbeddedWidget(QWidget* w = 0L);
00285
00286 public:
00287 enum KDockWidgetResize
00288 {ResizeLeft,ResizeTop,ResizeRight,ResizeBottom,ResizeBottomLeft,ResizeTopLeft,ResizeBottomRight,ResizeTopRight};
00289
00290 int index;
00291 int splitPosInPercent;
00292 bool pendingFocusInEvent;
00293 bool blockHasUndockedSignal;
00294 bool pendingDtor;
00295 int forcedWidth;
00296 int forcedHeight;
00297 bool isContainer;
00298
00299 #ifndef NO_KDE2
00300 NET::WindowType windowType;
00301 #endif
00302
00303 QWidget *_parent;
00304 bool transient;
00305
00306 QGuardedPtr<QWidget> container;
00307
00308 QPoint resizePos;
00309 bool resizing;
00310 KDockWidgetResize resizeMode;
00311 };
00312
00313 class KDockWidgetHeaderPrivate
00314 : public QObject
00315 {
00316 public:
00317 KDockWidgetHeaderPrivate( QObject* parent )
00318 : QObject( parent )
00319 {
00320 forceCloseButtonHidden=false;
00321 toDesktopButton = 0;
00322 showToDesktopButton = true;
00323 topLevel = false;
00324 dummy=0;
00325 }
00326 KDockButton_Private* toDesktopButton;
00327
00328 bool showToDesktopButton;
00329 bool topLevel;
00330 QPtrList<KDockButton_Private> btns;
00331 bool forceCloseButtonHidden;
00332 QWidget *dummy;
00333 };
00334
00335 #endif