• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KParts

  • sources
  • kde-4.14
  • kdelibs
  • kparts
partmanager.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
3  (C) 1999 David Faure <faure@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef __kpartmanager_h__
21 #define __kpartmanager_h__
22 
23 #include <QtGui/QWidget>
24 
25 #include <kparts/kparts_export.h>
26 
27 class KComponentData;
28 
29 namespace KParts
30 {
31 
32 class Part;
33 
34 class PartManagerPrivate;
35 
47 class KPARTS_EXPORT PartManager : public QObject
48 {
49  Q_OBJECT
50  Q_ENUMS( SelectionPolicy )
51  Q_PROPERTY( SelectionPolicy selectionPolicy READ selectionPolicy WRITE setSelectionPolicy )
52  Q_PROPERTY( bool allowNestedParts READ allowNestedParts WRITE setAllowNestedParts )
53  Q_PROPERTY( bool ignoreScrollBars READ ignoreScrollBars WRITE setIgnoreScrollBars )
54 public:
56  enum SelectionPolicy { Direct, TriState };
57 
63  enum Reason { ReasonLeftClick = 100, ReasonMidClick, ReasonRightClick, NoReason };
64 
72  PartManager( QWidget * parent );
81  PartManager( QWidget * topLevel, QObject *parent );
82  virtual ~PartManager();
83 
87  void setSelectionPolicy( SelectionPolicy policy );
91  SelectionPolicy selectionPolicy() const;
92 
105  void setAllowNestedParts( bool allow );
109  bool allowNestedParts() const;
110 
119  void setIgnoreScrollBars( bool ignore );
123  bool ignoreScrollBars() const;
124 
130  void setActivationButtonMask( short int buttonMask );
134  short int activationButtonMask() const;
135 
139  virtual bool eventFilter( QObject *obj, QEvent *ev );
140 
148  virtual void addPart( Part *part, bool setActive = true );
149 
155  virtual void removePart( Part *part );
156 
162  virtual void replacePart( Part * oldPart, Part * newPart, bool setActive = true );
163 
172  virtual void setActivePart( Part *part, QWidget *widget = 0 );
173 
177  virtual Part *activePart() const;
178 
182  virtual QWidget *activeWidget() const;
183 
192  virtual void setSelectedPart( Part *part, QWidget *widget = 0 );
193 
197  virtual Part *selectedPart() const;
198 
202  virtual QWidget *selectedWidget() const;
203 
207  const QList<Part *> parts() const;
208 
216  void addManagedTopLevelWidget( const QWidget *topLevel );
221  void removeManagedTopLevelWidget( const QWidget *topLevel );
222 
227  int reason() const;
228 
229 Q_SIGNALS:
234  void partAdded( KParts::Part *part );
239  void partRemoved( KParts::Part *part );
244  void activePartChanged( KParts::Part *newPart );
245 
246 protected:
252  virtual void setActiveComponent(const KComponentData &instance);
253 
264  void setIgnoreExplictFocusRequests(bool);
265 
266 protected Q_SLOTS:
270  void slotObjectDestroyed();
271 
275  void slotWidgetDestroyed();
276 
280  void slotManagedTopLevelWidgetDestroyed();
281 private:
282  Part * findPartFromWidget( QWidget * widget, const QPoint &pos );
283  Part * findPartFromWidget( QWidget * widget );
284 
285 private:
286  PartManagerPrivate* const d;
287 };
288 
289 }
290 
291 #endif
292 
QEvent
QWidget
KParts::PartManager::ReasonRightClick
Definition: partmanager.h:63
QPoint
KParts::Part
Base class for parts.
Definition: part.h:215
QObject
QList
Definition: browserextension.h:34
setActiveComponent
void setActiveComponent(const KComponentData &d)
KParts::PartManager::Reason
Reason
This extends QFocusEvent::Reason with the non-focus-event reasons for partmanager to activate a part...
Definition: partmanager.h:63
KParts::PartManager::SelectionPolicy
SelectionPolicy
Selection policy. The default policy of a PartManager is Direct.
Definition: partmanager.h:56
KParts::PartManager
The part manager is an object which knows about a collection of parts (even nested ones) and handles ...
Definition: partmanager.h:47
KComponentData
kparts_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KParts

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal