• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kparts
 

kparts

  • kparts
partmanager.h
1 // -*- mode: c++; c-basic-offset: 2 -*-
2 /* This file is part of the KDE project
3  Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
4  (C) 1999 David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef __kpartmanager_h__
22 #define __kpartmanager_h__
23 
24 #include <tqobject.h>
25 #include <tqwidget.h>
26 #include <tqptrlist.h>
27 
28 #include <kdelibs_export.h>
29 
30 class KInstance;
31 
32 namespace KParts
33 {
34 
35 class Part;
36 
37 class PartManagerPrivate;
38 
50 class KPARTS_EXPORT PartManager : public TQObject
51 {
52  Q_OBJECT
53  Q_ENUMS( SelectionPolicy )
54  Q_PROPERTY( SelectionPolicy selectionPolicy READ selectionPolicy WRITE setSelectionPolicy )
55  Q_PROPERTY( bool allowNestedParts READ allowNestedParts WRITE setAllowNestedParts )
56  Q_PROPERTY( bool ignoreScrollBars READ ignoreScrollBars WRITE setIgnoreScrollBars )
57 public:
59  enum SelectionPolicy { Direct, TriState };
60 
67  enum Reason { ReasonLeftClick = 100, ReasonMidClick, ReasonRightClick, NoReason };
68 
77  PartManager( TQWidget * parent, const char * name = 0L );
87  PartManager( TQWidget * topLevel, TQObject *parent, const char *name = 0 );
88  virtual ~PartManager();
89 
93  void setSelectionPolicy( SelectionPolicy policy );
97  SelectionPolicy selectionPolicy() const;
98 
111  void setAllowNestedParts( bool allow );
115  bool allowNestedParts() const;
116 
125  void setIgnoreScrollBars( bool ignore );
129  bool ignoreScrollBars() const;
130 
136  void setActivationButtonMask( short int buttonMask );
140  short int activationButtonMask() const;
141 
145  virtual bool eventFilter( TQObject *obj, TQEvent *ev );
146 
154  virtual void addPart( Part *part, bool setActive = true );
155 
161  virtual void removePart( Part *part );
162 
168  virtual void replacePart( Part * oldPart, Part * newPart, bool setActive = true );
169 
178  virtual void setActivePart( Part *part, TQWidget *widget = 0L );
179 
183  virtual Part *activePart() const;
184 
188  virtual TQWidget *activeWidget() const;
189 
198  virtual void setSelectedPart( Part *part, TQWidget *widget = 0L );
199 
203  virtual Part *selectedPart() const;
204 
208  virtual TQWidget *selectedWidget() const;
209 
213  const TQPtrList<Part> *parts() const;
214 
222  void addManagedTopLevelWidget( const TQWidget *topLevel );
227  void removeManagedTopLevelWidget( const TQWidget *topLevel );
228 
234  int reason() const;
235 
236 signals:
241  void partAdded( KParts::Part *part );
246  void partRemoved( KParts::Part *part );
251  void activePartChanged( KParts::Part *newPart );
252 
253 protected:
259  virtual void setActiveInstance( KInstance * instance );
260 
261 protected slots:
265  void slotObjectDestroyed();
266 
270  void slotWidgetDestroyed();
271 
275  void slotManagedTopLevelWidgetDestroyed();
276 private:
277  Part * findPartFromWidget( TQWidget * widget, const TQPoint &pos );
278  Part * findPartFromWidget( TQWidget * widget );
279 
280 protected:
281  virtual void virtual_hook( int id, void* data );
282 private:
283  PartManagerPrivate *d;
284 };
285 
286 }
287 
288 #endif
289 
KParts::Part
Base class for parts.
Definition: part.h:181
KInstance
KParts::PartManager::Reason
Reason
This extends TQFocusEvent::Reason with the non-focus-event reasons for partmanager to activate a part...
Definition: partmanager.h:67
KParts::PartManager::SelectionPolicy
SelectionPolicy
Selection policy. The default policy of a PartManager is Direct.
Definition: partmanager.h:59
KParts::PartManager
The part manager is an object which knows about a collection of parts (even nested ones) and handles ...
Definition: partmanager.h:50

kparts

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

kparts

Skip menu "kparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kparts by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |