kate/kate/interfaces/kate
#include <documentmanager.h>
Signals | |
void | documentCreated (KTextEditor::Document *document) |
void | documentDeleted (KTextEditor::Document *document) |
void | documentWillBeDeleted (KTextEditor::Document *document) |
Public Member Functions | |
DocumentManager (void *documentManager) | |
virtual | ~DocumentManager () |
bool | closeDocument (KTextEditor::Document *document) |
bool | closeDocumentList (QList< KTextEditor::Document * > documents) |
const QList < KTextEditor::Document * > & | documents () const |
KTextEditor::Document * | findUrl (const KUrl &url) const |
KTextEditor::Document * | openUrl (const KUrl &url, const QString &encoding=QString()) |
Detailed Description
Interface for the document manager.
This interface provides access to Kate's document manager. The document manager manages all documents. Use document() get a given document, activeDocument() to retrieve the active document. Check with isOpen() whether an URL is opened and use findDocument() to get it. To get the number of managed documents use documents().
Open new documents with openUrl() and close a document with closeDocument() or closeAllDocuments(). Several signals are provided, documentChanged() is emitted whenever the document's content changed, documentCreated() when a new document was created and documentDeleted() when a document was closed.
To access the document manager use the global accessor function documentManager() or Application::documentManager(). You should never have to create an instance of this class yourself.
Definition at line 54 of file documentmanager.h.
Constructor & Destructor Documentation
Kate::DocumentManager::DocumentManager | ( | void * | documentManager | ) |
Construtor.
The constructor is internally used by the Kate application, so it is of no interest for plugin developers. Plugin developers should use the global accessor pluginManager() instead.
- Parameters
-
documentManager internal usage
Definition at line 44 of file documentmanager.cpp.
|
virtual |
Virtual destructor.
Definition at line 50 of file documentmanager.cpp.
Member Function Documentation
bool Kate::DocumentManager::closeDocument | ( | KTextEditor::Document * | document | ) |
Close the given document
.
- Parameters
-
document the document to be closed
- Returns
- true on success, otherwise false
Definition at line 70 of file documentmanager.cpp.
Close a list of documents.
If any of them are modified, show a "save modified" dialog.
- Parameters
-
documents list of documents to be closed
- Returns
- true on success, otherwise false
Definition at line 75 of file documentmanager.cpp.
|
signal |
This signal is emitted when the document
was created.
|
signal |
This signal is emitted when the document
has been deleted.
Warning !!! DO NOT ACCESS THE DATA REFERENCED BY THE POINTER, IT IS ALREADY INVALID Use the pointer only to remove mappings in hash or maps
const QList< KTextEditor::Document * > & Kate::DocumentManager::documents | ( | ) | const |
Get a list of all documents.
- Returns
- all documents
Definition at line 55 of file documentmanager.cpp.
|
signal |
This signal is emitted before a document
which should be closed is deleted The document is still accessible and usable, but it will be deleted after this signal was send.
KTextEditor::Document * Kate::DocumentManager::findUrl | ( | const KUrl & | url | ) | const |
Get the document with the URL url
.
if multiple documents match the searched url, return the first found one...
- Parameters
-
url the document's URL
- Returns
- the document with the given
url
or NULL, if no such document is in the document manager's internal list.
Definition at line 60 of file documentmanager.cpp.
KTextEditor::Document * Kate::DocumentManager::openUrl | ( | const KUrl & | url, |
const QString & | encoding = QString() |
||
) |
Open the document url
with the given encoding
.
if the url is empty, a new empty document will be created
- Parameters
-
url the document's url encoding the preferred encoding. If encoding is QString() the encoding will be guessed or the default encoding will be used.
- Returns
- a pointer to the created document
Definition at line 65 of file documentmanager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.