KTextEditor
KTextEditor::ModeInterface Class Reference
Mode information interface for the Document. More...
#include <modeinterface.h>
Public Member Functions | |
| ModeInterface () | |
| virtual | ~ModeInterface () |
| virtual QStringList | allPossibleModes () const =0 |
| virtual QString | modeAt (const Cursor &position)=0 |
Detailed Description
Mode information interface for the Document.
Introduction
The ModeInterface provides access to the modes of a document
Accessing the ModeInterface
The ModeInterface is supposed to be an extension interface for a Document, i.e. the Document inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:
// doc is of type KTextEditor::Document* KTextEditor::ModeInterface *iface = qobject_cast<KTextEditor::ModeInterface*>( doc ); if( iface ) { // the implementation supports the interface // do stuff }
- See also:
- KTextEditor::Document
Definition at line 60 of file modeinterface.h.
Constructor & Destructor Documentation
| ModeInterface::ModeInterface | ( | ) |
Constructor.
Definition at line 304 of file ktexteditor.cpp.
| ModeInterface::~ModeInterface | ( | ) | [virtual] |
Virtual destructor.
Definition at line 307 of file ktexteditor.cpp.
Member Function Documentation
| virtual QStringList KTextEditor::ModeInterface::allPossibleModes | ( | ) | const [pure virtual] |
Get all available file modes for the current document.
- Returns:
- Returns a list of all possible modes within a document.
- See also:
- KTextEditor::Document::mode()
Get the possible modes for a given position.
The mode of a certain position might be ambiguos. eg. mode C++ could stand for the source or the header file. In most cases this mode will be equal to the highlighting name but it does not have to be. Modes should not be mixed with HighlightingModes. For instance for the toplevel in a document this might defer. For sub modes it might in the future
- See also:
- modes()
TODO: I intended to make this const but Kate's implementation needs to call kateTextline which is non-const. Solution?
The documentation for this class was generated from the following files:
KDE 4.6 API Reference