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

KParts

partmanager.h

Go to the documentation of this file.
00001 // -*- mode: c++; c-basic-offset: 2 -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
00004              (C) 1999 David Faure <faure@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef __kpartmanager_h__
00022 #define __kpartmanager_h__
00023 
00024 #include <qobject.h>
00025 #include <qwidget.h>
00026 #include <qptrlist.h>
00027 
00028 #include <kdelibs_export.h>
00029 
00030 class KInstance;
00031 
00032 namespace KParts
00033 {
00034 
00035 class Part;
00036 
00037 class PartManagerPrivate;
00038 
00050 class KPARTS_EXPORT PartManager : public QObject
00051 {
00052   Q_OBJECT
00053   Q_ENUMS( SelectionPolicy )
00054   Q_PROPERTY( SelectionPolicy selectionPolicy READ selectionPolicy WRITE setSelectionPolicy )
00055   Q_PROPERTY( bool allowNestedParts READ allowNestedParts WRITE setAllowNestedParts )
00056   Q_PROPERTY( bool ignoreScrollBars READ ignoreScrollBars WRITE setIgnoreScrollBars )
00057 public:
00059   enum SelectionPolicy { Direct, TriState };
00060 
00067   enum Reason { ReasonLeftClick = 100, ReasonMidClick, ReasonRightClick, NoReason };
00068 
00077   PartManager( QWidget * parent, const char * name = 0L );
00087   PartManager( QWidget * topLevel, QObject *parent, const char *name = 0 );
00088   virtual ~PartManager();
00089 
00093   void setSelectionPolicy( SelectionPolicy policy );
00097   SelectionPolicy selectionPolicy() const;
00098 
00111   void setAllowNestedParts( bool allow );
00115   bool allowNestedParts() const;
00116 
00125   void setIgnoreScrollBars( bool ignore );
00129   bool ignoreScrollBars() const;
00130 
00136   void setActivationButtonMask( short int buttonMask );
00140   short int activationButtonMask() const;
00141 
00145   virtual bool eventFilter( QObject *obj, QEvent *ev );
00146 
00154   virtual void addPart( Part *part, bool setActive = true );
00155 
00161   virtual void removePart( Part *part );
00162 
00168   virtual void replacePart( Part * oldPart, Part * newPart, bool setActive = true );
00169 
00178   virtual void setActivePart( Part *part, QWidget *widget = 0L );
00179 
00183   virtual Part *activePart() const;
00184 
00188   virtual QWidget *activeWidget() const;
00189 
00198   virtual void setSelectedPart( Part *part, QWidget *widget = 0L );
00199 
00203   virtual Part *selectedPart() const;
00204 
00208   virtual QWidget *selectedWidget() const;
00209 
00213   const QPtrList<Part> *parts() const;
00214 
00222   void addManagedTopLevelWidget( const QWidget *topLevel );
00227   void removeManagedTopLevelWidget( const QWidget *topLevel );
00228 
00234   int reason() const;
00235 
00236 signals:
00241   void partAdded( KParts::Part *part );
00246   void partRemoved( KParts::Part *part );
00251   void activePartChanged( KParts::Part *newPart );
00252 
00253 protected:
00259   virtual void setActiveInstance( KInstance * instance );
00260 
00261 protected slots:
00265   void slotObjectDestroyed();
00266 
00270   void slotWidgetDestroyed();
00271 
00275   void slotManagedTopLevelWidgetDestroyed();
00276 private:
00277   Part * findPartFromWidget( QWidget * widget, const QPoint &pos );
00278   Part * findPartFromWidget( QWidget * widget );
00279 
00280 protected:
00281   virtual void virtual_hook( int id, void* data );
00282 private:
00283   PartManagerPrivate *d;
00284 };
00285 
00286 }
00287 
00288 #endif
00289 

KParts

Skip menu "KParts"
  • 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