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

kdevelop/kdevplatform/interfaces

  • KDevelop
  • IDocumentController
Public Types | Public Slots | Signals | Public Member Functions | List of all members
KDevelop::IDocumentController Class Referenceabstract

#include <idocumentcontroller.h>

Inheritance diagram for KDevelop::IDocumentController:
Inheritance graph
[legend]

Public Types

enum  DocumentActivation {
  DefaultMode = 0, DoNotActivate = 1, DoNotCreateView = 2, DoNotFocus = 4,
  DoNotAddToRecentOpen = 8
}
 

Public Slots

virtual bool closeAllDocuments ()=0
 
KDevelop::IDocument * openDocument (const QUrl &url, const KTextEditor::Cursor &cursor, DocumentActivationParams activationParams={}, const QString &encoding={})
 
virtual KDevelop::IDocument * openDocument (const QUrl &url, const KTextEditor::Range &range=KTextEditor::Range::invalid(), DocumentActivationParams activationParams={}, const QString &encoding={}, IDocument *buddy=nullptr)=0
 
virtual bool openDocument (IDocument *doc, const KTextEditor::Range &range=KTextEditor::Range::invalid(), DocumentActivationParams activationParams={}, IDocument *buddy=nullptr)=0
 
virtual KDevelop::IDocument * openDocument (const QUrl &url, const QString &prefName)=0
 

Signals

void documentActivated (KDevelop::IDocument *document)
 
void documentClosed (KDevelop::IDocument *document)
 
void documentContentChanged (KDevelop::IDocument *document)
 
void documentJumpPerformed (KDevelop::IDocument *newDocument, KTextEditor::Cursor newCursor, KDevelop::IDocument *previousDocument, KTextEditor::Cursor previousCursor)
 
void documentLoaded (KDevelop::IDocument *document)
 
void documentLoadedPrepare (KDevelop::IDocument *document)
 
void documentOpened (KDevelop::IDocument *document)
 
void documentSaved (KDevelop::IDocument *document)
 
void documentStateChanged (KDevelop::IDocument *document)
 
void documentUrlChanged (KDevelop::IDocument *document)
 
void textDocumentCreated (KDevelop::IDocument *document)
 

Public Member Functions

 IDocumentController (QObject *parent)
 
virtual void activateDocument (KDevelop::IDocument *document, const KTextEditor::Range &range=KTextEditor::Range::invalid())=0
 
virtual KDevelop::IDocument * activeDocument () const =0
 
virtual KTextEditor::View * activeTextDocumentView () const =0
 
virtual KDevelop::IDocument * documentForUrl (const QUrl &url) const =0
 
virtual IDocumentFactory * factory (const QString &mime) const =0
 
virtual KDevelop::IDocument * openDocumentFromText (const QString &data)=0
 
virtual QList
< KDevelop::IDocument * > 
openDocuments () const =0
 
virtual void registerDocumentForMimetype (const QString &, KDevelop::IDocumentFactory *)=0
 
virtual bool saveAllDocuments (KDevelop::IDocument::DocumentSaveMode mode=KDevelop::IDocument::Default)=0
 
virtual bool saveAllDocumentsForWindow (KParts::MainWindow *mw, IDocument::DocumentSaveMode mode, bool currentAreaOnly=false)=0
 
virtual bool saveSomeDocuments (const QList< IDocument * > &list, KDevelop::IDocument::DocumentSaveMode mode=KDevelop::IDocument::Default)=0
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Allows to access the open documents and also open new ones.

Definition at line 52 of file idocumentcontroller.h.

Member Enumeration Documentation

enum KDevelop::IDocumentController::DocumentActivation
Enumerator
DefaultMode 
DoNotActivate 

Activate document and create a view if no other flags passed.

DoNotCreateView 

Don't activate the Document.

DoNotFocus 

Don't create and show the view for the Document.

DoNotAddToRecentOpen 

Don't change the keyboard focus.

Definition at line 55 of file idocumentcontroller.h.

Constructor & Destructor Documentation

KDevelop::IDocumentController::IDocumentController ( QObject *  parent)
explicit

Definition at line 23 of file idocumentcontroller.cpp.

Member Function Documentation

virtual void KDevelop::IDocumentController::activateDocument ( KDevelop::IDocument *  document,
const KTextEditor::Range &  range = KTextEditor::Range::invalid() 
)
pure virtual
virtual KDevelop::IDocument* KDevelop::IDocumentController::activeDocument ( ) const
pure virtual

Returns the currently active or focused document.

Returns
The active document.
virtual KTextEditor::View* KDevelop::IDocumentController::activeTextDocumentView ( ) const
pure virtual
Returns
the KTextEditor::View of the current document, in case it is a text document
virtual bool KDevelop::IDocumentController::closeAllDocuments ( )
pure virtualslot
void KDevelop::IDocumentController::documentActivated ( KDevelop::IDocument *  document)
signal

Emitted when the document has been activated.

void KDevelop::IDocumentController::documentClosed ( KDevelop::IDocument *  document)
signal

Emitted when a document has been closed.

void KDevelop::IDocumentController::documentContentChanged ( KDevelop::IDocument *  document)
signal

This is emitted when the document content changed.

virtual KDevelop::IDocument* KDevelop::IDocumentController::documentForUrl ( const QUrl &  url) const
pure virtual

Finds the first document object corresponding to a given url.

Parameters
urlThe Url of the document.
Returns
The corresponding document, or null if not found.
void KDevelop::IDocumentController::documentJumpPerformed ( KDevelop::IDocument *  newDocument,
KTextEditor::Cursor  newCursor,
KDevelop::IDocument *  previousDocument,
KTextEditor::Cursor  previousCursor 
)
signal

Emitted whenever the active cursor jumps from one document+cursor to another, as e.g.

caused by a call to openDocument(..).

This is also emitted when a document is only activated. Then previousDocument is zero.

void KDevelop::IDocumentController::documentLoaded ( KDevelop::IDocument *  document)
signal

Emitted when a document has been loaded.

NOTE: No views exist for the document at the time this signal is emitted.

void KDevelop::IDocumentController::documentLoadedPrepare ( KDevelop::IDocument *  document)
signal

Emitted when a document has been loaded, but before documentLoaded(..) is emitted.

This allows parts of kdevplatform to prepare data-structures that can be used by other parts during documentLoaded(..).

void KDevelop::IDocumentController::documentOpened ( KDevelop::IDocument *  document)
signal

Emitted when a document has been opened.

NOTE: The document may not be loaded from disk/network at this point. NOTE: No views exist for the document at the time this signal is emitted.

void KDevelop::IDocumentController::documentSaved ( KDevelop::IDocument *  document)
signal

Emitted when a document has been saved.

void KDevelop::IDocumentController::documentStateChanged ( KDevelop::IDocument *  document)
signal

This is emitted when the document state(the relationship between the file in the editor and the file stored on disk) changes.

void KDevelop::IDocumentController::documentUrlChanged ( KDevelop::IDocument *  document)
signal

Emitted when a document url has changed.

virtual IDocumentFactory* KDevelop::IDocumentController::factory ( const QString &  mime) const
pure virtual
KDevelop::IDocument * KDevelop::IDocumentController::openDocument ( const QUrl &  url,
const KTextEditor::Cursor &  cursor,
DocumentActivationParams  activationParams = {},
const QString &  encoding = {} 
)
slot

Opens a new or existing document.

Parameters
urlThe full Url of the document to open.
cursorThe location information, if applicable.
activationParamsIndicates whether to fully activate the document.
encodingthe encoding for the document, the name must be accepted by QTextCodec, if an empty encoding name is given, the document should fallback to its own default encoding, e.g. the system encoding or the global user settings

Definition at line 28 of file idocumentcontroller.cpp.

virtual KDevelop::IDocument* KDevelop::IDocumentController::openDocument ( const QUrl &  url,
const KTextEditor::Range &  range = KTextEditor::Range::invalid(),
DocumentActivationParams  activationParams = {},
const QString &  encoding = {},
IDocument *  buddy = nullptr 
)
pure virtualslot

Opens a new or existing document.

Parameters
urlThe full Url of the document to open.
rangeThe range of text to select, if applicable.
activationParamsIndicates whether to fully activate the document
encodingthe encoding for the document, the name must be accepted by QTextCodec, if an empty encoding name is given, the document should fallback to its own default encoding, e.g. the system encoding or the global user settings
buddyOptional buddy document. If 0, the registered IBuddyDocumentFinder for the URL's mimetype will be queried to find a fitting buddy. If a buddy was found (or passed) url will be opened next to its buddy.
Returns
The opened document
virtual bool KDevelop::IDocumentController::openDocument ( IDocument *  doc,
const KTextEditor::Range &  range = KTextEditor::Range::invalid(),
DocumentActivationParams  activationParams = {},
IDocument *  buddy = nullptr 
)
pure virtualslot

Opens a document from the IDocument instance.

Parameters
docThe IDocument to add
rangeThe location information, if applicable.
activationParamsIndicates whether to fully activate the document.
buddyOptional buddy document. If 0, the registered IBuddyDocumentFinder for the Documents mimetype will be queried to find a fitting buddy. If a buddy was found (or passed) url will be opened next to its buddy.
virtual KDevelop::IDocument* KDevelop::IDocumentController::openDocument ( const QUrl &  url,
const QString &  prefName 
)
pure virtualslot

Opens a new or existing document.

Parameters
urlThe full Url of the document to open.
prefNameThe name of the preferred KPart to open that document
virtual KDevelop::IDocument* KDevelop::IDocumentController::openDocumentFromText ( const QString &  data)
pure virtual

Opens a text document containing the data text.

virtual QList<KDevelop::IDocument*> KDevelop::IDocumentController::openDocuments ( ) const
pure virtual
Returns
The list of all open documents
virtual void KDevelop::IDocumentController::registerDocumentForMimetype ( const QString &  ,
KDevelop::IDocumentFactory *   
)
pure virtual
virtual bool KDevelop::IDocumentController::saveAllDocuments ( KDevelop::IDocument::DocumentSaveMode  mode = KDevelop::IDocument::Default)
pure virtual
virtual bool KDevelop::IDocumentController::saveAllDocumentsForWindow ( KParts::MainWindow *  mw,
IDocument::DocumentSaveMode  mode,
bool  currentAreaOnly = false 
)
pure virtual
virtual bool KDevelop::IDocumentController::saveSomeDocuments ( const QList< IDocument * > &  list,
KDevelop::IDocument::DocumentSaveMode  mode = KDevelop::IDocument::Default 
)
pure virtual
void KDevelop::IDocumentController::textDocumentCreated ( KDevelop::IDocument *  document)
signal

Emitted when a text document has been loaded, and the text document created.

NOTE: no views exist for the document at the time this signal is emitted.


The documentation for this class was generated from the following files:
  • idocumentcontroller.h
  • idocumentcontroller.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sun Dec 15 2019 03:46:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevelop/kdevplatform/interfaces

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

kdevelop API Reference

Skip menu "kdevelop API Reference"
  •   kdevplatform
  •     debugger
  •     documentation
  •     interfaces
  •     language
  •       assistant
  •       backgroundparser
  •       checks
  •       classmodel
  •       codecompletion
  •       codegen
  •       duchain
  •       editor
  •       highlighting
  •       interfaces
  •       util
  •     outputview
  •     project
  •     serialization
  •     shell
  •     sublime
  •     tests
  •     util
  •     vcs

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