kdevpartcontroller.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 00003 Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.org> 00004 Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org> 00005 Copyright (C) 2003 Hamish Rodda <rodda@kde.org> 00006 Copyright (C) 2003 Harald Fernengel <harry@kdevelop.org> 00007 Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se> 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Library General Public 00011 License as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Library General Public License for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with this library; see the file COPYING.LIB. If not, write to 00021 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 Boston, MA 02111-1307, USA. 00023 */ 00024 #ifndef __KDEV_PARTCONTROLLER_H__ 00025 #define __KDEV_PARTCONTROLLER_H__ 00026 00027 00028 #include <kurl.h> 00029 #include <kparts/partmanager.h> 00030 00031 namespace KParts 00032 { 00033 class ReadOnlyPart; 00034 } 00035 00036 enum DocumentState 00037 { 00038 Clean, 00039 Modified, 00040 Dirty, 00041 DirtyAndModified 00042 }; 00043 00044 class KDevPartController : public KParts::PartManager 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 00050 KDevPartController(QWidget *parent); 00051 00056 virtual void setEncoding(const QString &encoding) = 0; 00057 00064 virtual void editDocument(const KURL &url, int lineNum=-1, int col=-1) = 0; 00065 00071 virtual void showDocument(const KURL &url, bool newWin = false) = 0; 00072 00079 virtual void showPart( KParts::Part* part, const QString& name, const QString& shortDescription ) = 0; 00080 00086 virtual KParts::ReadOnlyPart * partForURL( const KURL & url ) = 0; 00087 00093 virtual KParts::Part * partForWidget( const QWidget * widget ) = 0; 00094 00099 virtual KURL::List openURLs() = 0; 00100 00104 virtual void saveAllFiles() = 0; 00105 00110 virtual void saveFiles( const KURL::List & list) = 0; 00111 00115 virtual void revertAllFiles() = 0; 00116 00121 virtual void revertFiles( const KURL::List & list ) = 0; 00122 00126 virtual bool closeAllFiles() = 0; 00127 00132 virtual bool closeFiles( const KURL::List & list ) = 0; 00133 00139 virtual bool closePart( KParts::Part * part ) = 0; 00140 00145 virtual void activatePart( KParts::Part * part ) = 0; 00146 00152 virtual DocumentState documentState( KURL const & url ) = 0; 00153 00154 signals: 00155 00159 void savedFile( const KURL & ); 00160 00164 void loadedFile( const KURL & ); 00165 00169 void closedFile( const KURL & ); 00170 00174 void fileDirty( const KURL & ); 00175 00180 void partURLChanged( KParts::ReadOnlyPart * ); 00181 00186 void documentChangedState( const KURL &, DocumentState ); 00187 00188 00189 }; 00190 00191 00192 00193 #endif