• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

kate/interfaces/kate

Kate::DocumentManager

Kate::DocumentManager Class Reference

Interface for the document manager. More...

#include <documentmanager.h>

Inheritance diagram for Kate::DocumentManager:
Inheritance graph
[legend]

List of all members.

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)
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.

Author:
Christoph Cullmann <cullmann@kde.org>

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

For internal use only.

Definition at line 44 of file documentmanager.cpp.

Kate::DocumentManager::~DocumentManager (  )  [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.

void Kate::DocumentManager::documentCreated ( KTextEditor::Document *  document  )  [signal]

This signal is emitted when the document was created.

void Kate::DocumentManager::documentDeleted ( KTextEditor::Document *  document  )  [signal]

This signal is emitted when the document was deleted.

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.

void Kate::DocumentManager::documentWillBeDeleted ( KTextEditor::Document *  document  )  [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:
  • documentmanager.h
  • documentmanager.cpp

kate/interfaces/kate

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

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
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