You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
208 lines
4.9 KiB
208 lines
4.9 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
Copyright (C) 2000 Max Judin <novaprint@mtu-net.ru>
|
||
|
|
||
|
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.
|
||
|
*/
|
||
|
|
||
|
/*
|
||
14 years ago
|
IMPORTANT Note: This file compiles also in TQt-only mode by using the NO_KDE2 precompiler definition
|
||
15 years ago
|
*/
|
||
|
|
||
|
#ifndef KDOCKWIDGET_PRIVATE_H
|
||
|
#define KDOCKWIDGET_PRIVATE_H
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
|
#include <tqpushbutton.h>
|
||
15 years ago
|
|
||
|
#ifndef NO_KDE2
|
||
|
#include <netwm_def.h>
|
||
|
#endif
|
||
|
|
||
15 years ago
|
class TQFrame;
|
||
15 years ago
|
class KDockContainer;
|
||
|
|
||
|
|
||
|
/**
|
||
15 years ago
|
* Like TQSplitter but specially designed for dockwidgets stuff.
|
||
15 years ago
|
* @internal
|
||
|
*
|
||
|
* @author Max Judin.
|
||
|
*/
|
||
13 years ago
|
class TDEUI_EXPORT KDockSplitter : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
12 years ago
|
KDockSplitter(TQWidget *parent= 0, const char *name= 0, Orientation orient=TQt::Vertical, int pos= 50, bool highResolution=false);
|
||
15 years ago
|
virtual ~KDockSplitter(){};
|
||
|
|
||
15 years ago
|
void activate(TQWidget *c0, TQWidget *c1 = 0L);
|
||
15 years ago
|
void deactivate();
|
||
|
|
||
|
int separatorPos() const;
|
||
|
void setSeparatorPos(int pos, bool do_resize = true);
|
||
|
/**
|
||
|
* For usage from outside.
|
||
|
* If the splitter is in fixed position when called,
|
||
|
* the value of @p pos will be saved and used when the splitter
|
||
|
* is restored.
|
||
|
* If @p do_resize is true, the size will be changed unless the splitter
|
||
|
* is in fixed mode.
|
||
|
*/
|
||
|
// ### please come up with a nicer name
|
||
|
void setSeparatorPosX(int pos, bool do_resize=false);
|
||
|
|
||
15 years ago
|
virtual bool eventFilter(TQObject *, TQEvent *);
|
||
|
virtual bool event( TQEvent * );
|
||
15 years ago
|
|
||
15 years ago
|
TQWidget* getFirst() const { return child0; }
|
||
|
TQWidget* getLast() const { return child1; }
|
||
|
TQWidget* getAnother( TQWidget* ) const;
|
||
15 years ago
|
void updateName();
|
||
|
|
||
|
void setOpaqueResize(bool b=true);
|
||
|
bool opaqueResize() const;
|
||
|
|
||
|
void setKeepSize(bool b=true);
|
||
|
bool keepSize() const;
|
||
|
|
||
|
void setHighResolution(bool b=true);
|
||
|
bool highResolution() const;
|
||
|
|
||
|
void setForcedFixedWidth(KDockWidget *dw,int w);
|
||
|
void setForcedFixedHeight(KDockWidget *dw,int h);
|
||
|
void restoreFromForcedFixedSize(KDockWidget *dw);
|
||
|
|
||
12 years ago
|
Orientation orientation(){return m_orientation;}
|
||
15 years ago
|
|
||
|
protected:
|
||
|
friend class KDockContainer;
|
||
|
int checkValue( int ) const;
|
||
15 years ago
|
int checkValueOverlapped( int ,TQWidget*) const;
|
||
|
virtual void resizeEvent(TQResizeEvent *);
|
||
15 years ago
|
/*
|
||
|
protected slots:
|
||
|
void delayedResize();*/
|
||
|
|
||
|
private:
|
||
|
void setupMinMaxSize();
|
||
15 years ago
|
TQWidget *child0, *child1;
|
||
12 years ago
|
Orientation m_orientation;
|
||
15 years ago
|
bool initialised;
|
||
15 years ago
|
TQFrame* divider;
|
||
15 years ago
|
int xpos, savedXPos;
|
||
|
bool mOpaqueResize, mKeepSize, mHighResolution;
|
||
|
int fixedWidth0,fixedWidth1;
|
||
|
int fixedHeight0,fixedHeight1;
|
||
|
bool m_dontRecalc;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* A mini-button usually placed in the dockpanel.
|
||
|
* @internal
|
||
|
*
|
||
|
* @author Max Judin.
|
||
|
*/
|
||
13 years ago
|
class TDEUI_EXPORT KDockButton_Private : public TQPushButton
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
14 years ago
|
KDockButton_Private( TQWidget *parent=0, const char *name=0 );
|
||
15 years ago
|
~KDockButton_Private();
|
||
|
|
||
|
protected:
|
||
15 years ago
|
virtual void drawButton( TQPainter * );
|
||
|
virtual void enterEvent( TQEvent * );
|
||
|
virtual void leaveEvent( TQEvent * );
|
||
15 years ago
|
|
||
|
private:
|
||
|
bool moveMouse;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* resizing enum
|
||
|
**/
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* additional KDockWidget stuff (private)
|
||
|
*/
|
||
13 years ago
|
class TDEUI_EXPORT KDockWidgetPrivate : public TQObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
KDockWidgetPrivate();
|
||
|
~KDockWidgetPrivate();
|
||
|
|
||
|
public slots:
|
||
|
/**
|
||
|
* Especially used for Tab page docking. Switching the pages requires additional setFocus() for the embedded widget.
|
||
|
*/
|
||
15 years ago
|
void slotFocusEmbeddedWidget(TQWidget* w = 0L);
|
||
15 years ago
|
|
||
|
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
|
||
|
|
||
15 years ago
|
TQWidget *_parent;
|
||
15 years ago
|
bool transient;
|
||
|
|
||
15 years ago
|
TQGuardedPtr<TQWidget> container;
|
||
15 years ago
|
|
||
15 years ago
|
TQPoint resizePos;
|
||
15 years ago
|
bool resizing;
|
||
|
KDockWidgetResize resizeMode;
|
||
|
};
|
||
|
|
||
13 years ago
|
class TDEUI_EXPORT KDockWidgetHeaderPrivate
|
||
14 years ago
|
: public TQObject
|
||
15 years ago
|
{
|
||
|
public:
|
||
14 years ago
|
KDockWidgetHeaderPrivate( TQObject* parent )
|
||
|
: TQObject( parent )
|
||
15 years ago
|
{
|
||
|
forceCloseButtonHidden=false;
|
||
|
toDesktopButton = 0;
|
||
|
showToDesktopButton = true;
|
||
|
topLevel = false;
|
||
|
dummy=0;
|
||
|
}
|
||
|
KDockButton_Private* toDesktopButton;
|
||
|
|
||
|
bool showToDesktopButton;
|
||
|
bool topLevel;
|
||
15 years ago
|
TQPtrList<KDockButton_Private> btns;
|
||
15 years ago
|
bool forceCloseButtonHidden;
|
||
15 years ago
|
TQWidget *dummy;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|