• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

kdockwidget_private.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2000 Max Judin <novaprint@mtu-net.ru>
00003    Copyright (C) 2005 Dominik Haumann <dhdev@gmx.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 /*
00021    IMPORTANT Note: This file compiles also in Qt-only mode by using the NO_KDE2 precompiler definition
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   // NOTE: in theory the KDEUI_EXPORT above shouldn't be there, but it's needed for kexi,
00047   // which copies the whole definition of the class to be able to access separatorPosInPercent etc. 
00048   // This needs real fixing in KDE4.
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   // ### please come up with a nicer name
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 protected slots:
00196   void delayedResize();*/
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

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal