• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

interfaces

idocumentcontroller.h

00001 /***************************************************************************
00002  *   Copyright 2007 Alexander Dymo <adymo@kdevelop.org>                    *
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU Library General Public License as       *
00006  *   published by the Free Software Foundation; either version 2 of the    *
00007  *   License, or (at your option) any later version.                       *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Library General Public     *
00015  *   License along with this program; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
00018  ***************************************************************************/
00019 #ifndef IDOCUMENTCONTROLLER_H
00020 #define IDOCUMENTCONTROLLER_H
00021 
00022 #include <QtCore/QObject>
00023 
00024 #include <kurl.h>
00025 #include <ktexteditor/cursor.h>
00026 #include <ktexteditor/range.h>
00027 
00028 #include "interfacesexport.h"
00029 
00030 #include "idocument.h"
00031 
00032 namespace KDevelop {
00033 
00034 class ICore;
00035 
00036 class KDEVPLATFORMINTERFACES_EXPORT IDocumentFactory {
00037 public:
00038     virtual ~IDocumentFactory() {}
00039     virtual IDocument* create(const KUrl&, ICore* ) = 0;
00040 };
00041 
00042 
00043 class KDEVPLATFORMINTERFACES_EXPORT IDocumentController: public QObject {
00044     Q_OBJECT
00045 public:
00046     enum DocumentActivation
00047     {
00048         DefaultMode = 0,            
00049         DoNotActivate = 1,          
00050         DoNotCreateView = 2         
00051     };
00052     Q_DECLARE_FLAGS(DocumentActivationParams, DocumentActivation)
00053 
00054     IDocumentController(QObject *parent);
00055 
00059     Q_SCRIPTABLE virtual void setEncoding( const QString &encoding ) = 0;
00060     Q_SCRIPTABLE virtual QString encoding() const = 0;
00061 
00065     Q_SCRIPTABLE virtual KDevelop::IDocument* documentForUrl( const KUrl & url ) const = 0;
00066 
00068     Q_SCRIPTABLE virtual QList<KDevelop::IDocument*> openDocuments() const = 0;
00069 
00072     Q_SCRIPTABLE virtual KDevelop::IDocument* activeDocument() const = 0;
00073 
00074     Q_SCRIPTABLE virtual void activateDocument( KDevelop::IDocument * document, const KTextEditor::Range& range = KTextEditor::Range::invalid() ) = 0;
00075 
00076     virtual void registerDocumentForMimetype( const QString&, KDevelop::IDocumentFactory* ) = 0;
00077 
00078     Q_SCRIPTABLE virtual bool saveAllDocuments(KDevelop::IDocument::DocumentSaveMode mode = KDevelop::IDocument::Default) = 0;
00079 
00080     Q_SCRIPTABLE virtual KDevelop::IDocument* openDocumentFromText( const QString& data ) = 0;
00081 
00082     virtual void notifyDocumentClosed(IDocument* doc) = 0;
00083 
00084 public Q_SLOTS:
00089     KDevelop::IDocument* openDocument( const KUrl &url,
00090             const KTextEditor::Cursor& cursor,
00091             DocumentActivationParams activationParams = 0 );
00092 
00097     virtual KDevelop::IDocument* openDocument( const KUrl &url,
00098             const KTextEditor::Range& range = KTextEditor::Range::invalid(),
00099             DocumentActivationParams activationParams = 0 ) = 0;
00100 
00101     virtual void closeAllDocuments() = 0;
00102 
00103 Q_SIGNALS:
00105     void documentActivated( KDevelop::IDocument* document );
00106 
00108     void documentSaved( KDevelop::IDocument* document );
00109 
00113     void documentOpened( KDevelop::IDocument* document );
00114 
00117     void documentLoaded( KDevelop::IDocument* document );
00118 
00121     void textDocumentCreated( KDevelop::IDocument* document );
00122 
00124     void documentClosed( KDevelop::IDocument* document );
00125 
00128     void documentStateChanged( KDevelop::IDocument* document );
00129 
00131     void documentContentChanged( KDevelop::IDocument* document );
00132 
00136     void documentLoadedPrepare( KDevelop::IDocument* document );
00137 
00139     void documentUrlChanged( KDevelop::IDocument* document );
00140 
00141     friend class IDocument;
00142 };
00143 
00144 Q_DECLARE_OPERATORS_FOR_FLAGS(IDocumentController::DocumentActivationParams)
00145 
00146 }
00147 
00148 #endif
00149 

interfaces

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

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.4
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