00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef KDOCKWIDGET_PRIVATE_H
00024
#define KDOCKWIDGET_PRIVATE_H
00025
00026
#include <qwidget.h>
00027
#include <qpushbutton.h>
00028
00029
#ifndef NO_KDE2
00030
#include <netwm_def.h>
00031
#endif
00032
00033
class QFrame;
00034
class KDockContainer;
00035
00036
00043 class KDockSplitter :
public QWidget
00044 {
00045 Q_OBJECT
00046
public:
00047
KDockSplitter(
QWidget *parent= 0,
const char *name= 0, Orientation orient= Vertical,
int pos= 50,
bool highResolution=
false);
00048
virtual ~
KDockSplitter(){};
00049
00050
void activate(
QWidget *c0,
QWidget *c1 = 0L);
00051
void deactivate();
00052
00053
int separatorPos()
const;
00054
void setSeparatorPos(
int pos,
bool do_resize =
true);
00055
00056
virtual bool eventFilter(
QObject *,
QEvent *);
00057
virtual bool event(
QEvent * );
00058
00059
QWidget* getFirst()
const {
return child0; }
00060
QWidget* getLast()
const {
return child1; }
00061
QWidget* getAnother(
QWidget* )
const;
00062
void updateName();
00063
00064
void setOpaqueResize(
bool b=
true);
00065
bool opaqueResize()
const;
00066
00067
void setKeepSize(
bool b=
true);
00068
bool keepSize()
const;
00069
00070
void setHighResolution(
bool b=
true);
00071
bool highResolution()
const;
00072
00073
void setForcedFixedWidth(
KDockWidget *dw,
int w);
00074
void setForcedFixedHeight(
KDockWidget *dw,
int h);
00075
void restoreFromForcedFixedSize(
KDockWidget *dw);
00076
00077 Orientation orientation(){
return m_orientation;}
00078
00079
protected:
00080
friend class KDockContainer;
00081
int checkValue(
int )
const;
00082
int checkValueOverlapped(
int ,
QWidget*)
const;
00083
virtual void resizeEvent(
QResizeEvent *);
00084
00085
00086
00087
00088
private:
00089
void setupMinMaxSize();
00090
00091
QWidget *child0, *child1;
00092 Orientation m_orientation;
00093
bool initialised;
00094
QFrame* divider;
00095
int xpos, savedXPos;
00096
bool mOpaqueResize, mKeepSize, mHighResolution;
00097
int fixedWidth0,fixedWidth1;
00098
int fixedHeight0,fixedHeight1;
00099 };
00100
00107 class KDockButton_Private :
public QPushButton
00108 {
00109 Q_OBJECT
00110
public:
00111
KDockButton_Private(
QWidget *parent=0,
const char *name=0 );
00112 ~
KDockButton_Private();
00113
00114
protected:
00115
virtual void drawButton(
QPainter * );
00116
virtual void enterEvent(
QEvent * );
00117
virtual void leaveEvent(
QEvent * );
00118
00119
private:
00120
bool moveMouse;
00121 };
00122
00132 class KDockWidgetPrivate :
public QObject
00133 {
00134 Q_OBJECT
00135
public:
00136
KDockWidgetPrivate();
00137 ~
KDockWidgetPrivate();
00138
00139
public slots:
00143
void slotFocusEmbeddedWidget(
QWidget* w = 0L);
00144
00145
public:
00146
enum KDockWidgetResize
00147 {ResizeLeft,ResizeTop,ResizeRight,ResizeBottom,ResizeBottomLeft,ResizeTopLeft,ResizeBottomRight,ResizeTopRight};
00148
00149
int index;
00150
int splitPosInPercent;
00151
bool pendingFocusInEvent;
00152
bool blockHasUndockedSignal;
00153
bool pendingDtor;
00154
int forcedWidth;
00155
int forcedHeight;
00156
bool isContainer;
00157
00158
#ifndef NO_KDE2
00159
NET::WindowType windowType;
00160
#endif
00161
00162
QWidget *_parent;
00163
bool transient;
00164
00165
QGuardedPtr<QWidget> container;
00166
00167
QPoint resizePos;
00168
bool resizing;
00169 KDockWidgetResize resizeMode;
00170 };
00171
00172
class KDockWidgetHeaderPrivate
00173 :
public QObject
00174 {
00175
public:
00176 KDockWidgetHeaderPrivate(
QObject* parent )
00177 :
QObject( parent )
00178 {
00179 forceCloseButtonHidden=
false;
00180 toDesktopButton = 0;
00181 showToDesktopButton =
true;
00182 topLevel =
false;
00183 dummy=0;
00184 }
00185
KDockButton_Private* toDesktopButton;
00186
00187
bool showToDesktopButton;
00188
bool topLevel;
00189
QPtrList<KDockButton_Private> btns;
00190
bool forceCloseButtonHidden;
00191
QWidget *dummy;
00192 };
00193
00194
#endif