kparts Library API Documentation

partmanager.h

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., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, 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 class KInstance; 00029 00030 namespace KParts 00031 { 00032 00033 class Part; 00034 00035 class PartManagerPrivate; 00036 00048 class PartManager : public QObject 00049 { 00050 Q_OBJECT 00051 Q_ENUMS( SelectionPolicy ) 00052 Q_PROPERTY( SelectionPolicy selectionPolicy READ selectionPolicy WRITE setSelectionPolicy ) 00053 Q_PROPERTY( bool allowNestedParts READ allowNestedParts WRITE setAllowNestedParts ) 00054 Q_PROPERTY( bool ignoreScrollBars READ ignoreScrollBars WRITE setIgnoreScrollBars ) 00055 public: 00057 enum SelectionPolicy { Direct, TriState }; 00058 00065 enum Reason { ReasonLeftClick = 100, ReasonMidClick, ReasonRightClick, NoReason }; 00066 00074 PartManager( QWidget * parent, const char * name = 0L ); 00083 PartManager( QWidget * topLevel, QObject *parent, const char *name = 0 ); 00084 virtual ~PartManager(); 00085 00089 void setSelectionPolicy( SelectionPolicy policy ); 00093 SelectionPolicy selectionPolicy() const; 00094 00107 void setAllowNestedParts( bool allow ); 00111 bool allowNestedParts() const; 00112 00121 void setIgnoreScrollBars( bool ignore ); 00125 bool ignoreScrollBars() const; 00126 00132 void setActivationButtonMask( short int buttonMask ); 00136 short int activationButtonMask() const; 00137 00141 virtual bool eventFilter( QObject *obj, QEvent *ev ); 00142 00148 virtual void addPart( Part *part, bool setActive = true ); 00149 00155 virtual void removePart( Part *part ); 00156 00162 virtual void replacePart( Part * oldPart, Part * newPart, bool setActive = true ); 00163 00172 virtual void setActivePart( Part *part, QWidget *widget = 0L ); 00173 00177 virtual Part *activePart() const; 00178 00182 virtual QWidget *activeWidget() const; 00183 00192 virtual void setSelectedPart( Part *part, QWidget *widget = 0L ); 00193 00197 virtual Part *selectedPart() const; 00198 00202 virtual QWidget *selectedWidget() const; 00203 00207 const QPtrList<Part> *parts() const; 00208 00216 void addManagedTopLevelWidget( const QWidget *topLevel ); 00221 void removeManagedTopLevelWidget( const QWidget *topLevel ); 00222 00228 int reason() const; 00229 00230 signals: 00235 void partAdded( KParts::Part *part ); 00240 void partRemoved( KParts::Part *part ); 00245 void activePartChanged( KParts::Part *newPart ); 00246 00247 protected: 00253 virtual void setActiveInstance( KInstance * instance ); 00254 00255 protected slots: 00259 void slotObjectDestroyed(); 00260 00264 void slotWidgetDestroyed(); 00265 00269 void slotManagedTopLevelWidgetDestroyed(); 00270 private: 00271 Part * findPartFromWidget( QWidget * widget, const QPoint &pos ); 00272 Part * findPartFromWidget( QWidget * widget ); 00273 00274 protected: 00275 virtual void virtual_hook( int id, void* data ); 00276 private: 00277 PartManagerPrivate *d; 00278 }; 00279 00280 } 00281 00282 #endif 00283
KDE Logo
This file is part of the documentation for kparts Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:31:37 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003