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

KTextEditor

  • KTextEditor
  • ModeInterface
Public Member Functions | List of all members
KTextEditor::ModeInterface Class Referenceabstract
Document Extension Interfaces

#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
Author
Joseph Wenninger <jowen.nosp@m.n@kd.nosp@m.e.org>

Definition at line 63 of file modeinterface.h.

Constructor & Destructor Documentation

ModeInterface::ModeInterface ( )

Constructor.

Definition at line 305 of file ktexteditor.cpp.

ModeInterface::~ModeInterface ( )
virtual

Virtual destructor.

Definition at line 308 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

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