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

KTextEditor

  • KTextEditor
  • SessionConfigInterface
Public Member Functions
KTextEditor::SessionConfigInterface Class Reference
Document Extension Interfaces | View Extension Interfaces | Plugin Extension Interfaces

#include <sessionconfiginterface.h>

List of all members.

Public Member Functions

 SessionConfigInterface ()
virtual ~SessionConfigInterface ()
virtual void readSessionConfig (const KConfigGroup &config)=0
virtual void writeSessionConfig (KConfigGroup &config)=0

Detailed Description

Session config interface extension for the Document, View and Plugin.

Introduction

The SessionConfigInterface is an extension for Documents, Views and Plugins to add support for session-specific configuration settings. readSessionConfig() is called whenever session-specific settings are to be read from the given KConfig* and writeSessionConfig() whenever they are to be written, for example when a session changed or was closed.

Note:
A session does not have anything to do with an X-session under Unix. What is meant is rather a context, think of sessions in Kate or projects in KDevelop for example.

Adding Session Support

To add support for sessions a KTextEditor implementation has to derive the Document and View class from SessionConfigInterface and reimplement readSessionConfig() and writeSessionConfig().

The same applies to a Plugin, read the detailed description for plugins.

Accessing the SessionConfigInterface

The SessionConfigInterface is supposed to be an extension interface for a Document, a View or a Plugin, i.e. the Document/View/Plugin inherits the interface provided that it implements the interface. Use qobject_cast to access the interface:

// object is of type KTextEditor::Document* or View* or Plugin*
KTextEditor::SessionConfigInterface *iface =
qobject_cast<KTextEditor::SessionConfigInterface*>( object );
if( iface ) {
// interface is supported
// do stuff
}
See also:
KTextEditor::Document, KTextEditor::View, KTextEditor::Plugin
Author:
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>
Note:
KDE5: Replace this interface with ParameterizedSessionConfigInterface

Definition at line 82 of file sessionconfiginterface.h.


Constructor & Destructor Documentation

SessionConfigInterface::SessionConfigInterface ( )

Definition at line 253 of file ktexteditor.cpp.

SessionConfigInterface::~SessionConfigInterface ( )
virtual

Virtual destructor.

Definition at line 257 of file ktexteditor.cpp.


Member Function Documentation

virtual void KTextEditor::SessionConfigInterface::readSessionConfig ( const KConfigGroup &  config)
pure virtual

Read session settings from the given config.

That means for example

  • a Document should reload the file, restore all marks etc...
  • a View should scroll to the last position and restore the cursor position etc...
  • a Plugin should restore session specific settings
  • If no file is being loaded, because an empty new document is going to be displayed, this function should emit ReadOnlyPart::completed
Parameters:
configread the session settings from this KConfigGroup
See also:
writeSessionConfig()
virtual void KTextEditor::SessionConfigInterface::writeSessionConfig ( KConfigGroup &  config)
pure virtual

Write session settings to the config.

See readSessionConfig() for more details.

Parameters:
configwrite the session settings to this KConfigGroup
See also:
readSessionConfig()

The documentation for this class was generated from the following files:
  • sessionconfiginterface.h
  • ktexteditor.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 11:53:25 by doxygen 1.8.1.1 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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
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