kdockwidget_private.h
/* This file is part of the KDE libraries
Copyright (C) 2000 Max Judin <novaprint@mtu-net.ru>
Copyright (C) 2005 Dominik Haumann <dhdev@gmx.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/*
IMPORTANT Note: This file compiles also in Qt-only mode by using the NO_KDE2 precompiler definition
*/
#ifndef KDOCKWIDGET_PRIVATE_H
#define KDOCKWIDGET_PRIVATE_H
#include <qwidget.h>
#include <qpushbutton.h>
#ifndef NO_KDE2
#include <netwm_def.h>
#endif
class QFrame;
class KDockContainer;
class KDEUI_EXPORT KDockSplitter : public QWidget
{
// NOTE: in theory the KDEUI_EXPORT above shouldn't be there, but it's needed for kexi,
// which copies the whole definition of the class to be able to access separatorPosInPercent etc.
// This needs real fixing in KDE4.
Q_OBJECT
public:
KDockSplitter(QWidget *parent= 0, const char *name= 0, Orientation orient= Vertical, int pos= 50);
virtual ~KDockSplitter(){}
void activate(QWidget *c0, QWidget *c1 = 0L);
void deactivate();
int separatorPosInPercent();
void setSeparatorPosInPercent(int percent);
int separatorPos() const;
void setSeparatorPos(int pos, bool do_resize = true);
// ### please come up with a nicer name
void setSeparatorPosX(int pos, bool do_resize=false);
virtual bool eventFilter(QObject *, QEvent *);
virtual bool event( QEvent * );
QWidget* getFirst() const { return child0; }
QWidget* getLast() const { return child1; }
QWidget* getAnother( QWidget* w ) const;
void updateName();
void setOpaqueResize(bool b=true);
bool opaqueResize() const;
void setKeepSize(bool b=true);
bool keepSize() const;
void setForcedFixedWidth(KDockWidget *dw,int w);
void setForcedFixedHeight(KDockWidget *dw,int h);
void restoreFromForcedFixedSize(KDockWidget *dw);
Orientation orientation(){return m_orientation;}
protected:
friend class KDockContainer;
int checkValue(int position) const;
int checkValueOverlapped(int position, QWidget* child) const;
virtual void resizeEvent(QResizeEvent *ev);
/*
protected slots:
void delayedResize();*/
private:
void setupMinMaxSize();
QWidget *child0, *child1;
Orientation m_orientation;
bool initialised;
QFrame* divider;
int xpos, savedXPos;
bool mOpaqueResize, mKeepSize;
int fixedWidth0,fixedWidth1;
int fixedHeight0,fixedHeight1;
bool m_dontRecalc;
static const int factor = 100000;
};
class KDEUI_EXPORT KDockButton_Private : public QPushButton
{
Q_OBJECT
public:
KDockButton_Private( QWidget *parent=0, const char *name=0 );
~KDockButton_Private();
protected:
virtual void drawButton( QPainter * );
virtual void enterEvent( QEvent * );
virtual void leaveEvent( QEvent * );
private:
bool moveMouse;
};
class KDockWidgetPrivate : public QObject
{
Q_OBJECT
public:
KDockWidgetPrivate();
~KDockWidgetPrivate();
public slots:
void slotFocusEmbeddedWidget(QWidget* w = 0L);
public:
enum KDockWidgetResize
{ResizeLeft,ResizeTop,ResizeRight,ResizeBottom,ResizeBottomLeft,ResizeTopLeft,ResizeBottomRight,ResizeTopRight};
int index;
int splitPosInPercent;
bool pendingFocusInEvent;
bool blockHasUndockedSignal;
bool pendingDtor;
int forcedWidth;
int forcedHeight;
bool isContainer;
#ifndef NO_KDE2
NET::WindowType windowType;
#endif
QWidget *_parent;
bool transient;
QGuardedPtr<QWidget> container;
QPoint resizePos;
bool resizing;
KDockWidgetResize resizeMode;
};
class KDockWidgetHeaderPrivate
: public QObject
{
public:
KDockWidgetHeaderPrivate( QObject* parent )
: QObject( parent )
{
forceCloseButtonHidden=false;
toDesktopButton = 0;
showToDesktopButton = true;
topLevel = false;
dummy=0;
}
KDockButton_Private* toDesktopButton;
bool showToDesktopButton;
bool topLevel;
QPtrList<KDockButton_Private> btns;
bool forceCloseButtonHidden;
QWidget *dummy;
};
#endif
KDockSplitter::getLast
QWidget * getLast() const
Definition: kdockwidget_private.h:128
KDockSplitter::getFirst
QWidget * getFirst() const
Definition: kdockwidget_private.h:124
KDockSplitter
Like QSplitter but specially designed for dockwidgets stuff.
Definition: kdockwidget_private.h:44
KDockWidgetPrivate::slotFocusEmbeddedWidget
void slotFocusEmbeddedWidget(QWidget *w=0L)
Especially used for Tab page docking.
Definition: kdockwidget_private.cpp:700
NET::WindowType
WindowType
KDockSplitter::orientation
Orientation orientation()
The orientation is either Horizontal or Vertical.
Definition: kdockwidget_private.h:159
KDockButton_Private
A mini-button usually placed in the dockpanel.
Definition: kdockwidget_private.h:248
KDockWidgetPrivate
resizing enum
Definition: kdockwidget_private.h:273
KDockWidget
Floatable widget that can be dragged around with the mouse and encapsulate the actual widgets (and me...
Definition: kdockwidget.h:423

KDE Home | KDE Accessibility Home | Description of Access Keys