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

KTextEditor

  • KTextEditor
  • ModeInterface
Public Member Functions

KTextEditor::ModeInterface Class Reference
Document Extension Interfaces

Mode information interface for the Document. More...

#include <modeinterface.h>

List of all members.

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
Author:
Joseph Wenninger <jowenn@kde.org>

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()
virtual QString KTextEditor::ModeInterface::modeAt ( const Cursor &  position) [pure virtual]

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:
  • modeinterface.h
  • ktexteditor.cpp

KTextEditor

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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