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

KTextEditor

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

#include <sessionconfiginterface.h>

Public Types

enum  SessionConfigParameter {
  SkipNone = 0, SkipUrl = 1 << 0, SkipMode = 1 << 1, SkipHighlighting = 1 << 2,
  SkipEncoding = 1 << 3, SkipFolding = 1 << 4
}
 

Public Member Functions

 ParameterizedSessionConfigInterface ()
 
virtual ~ParameterizedSessionConfigInterface ()
 
virtual void readParameterizedSessionConfig (const KConfigGroup &config, unsigned long parameters)=0
 
virtual void writeParameterizedSessionConfig (KConfigGroup &config, unsigned long parameters)=0
 

Detailed Description

Parameterized session config interface extension for the Document.

Introduction

The ParameterizedSessionConfigInterface is an extension for Documents to add support for session-specific configuration settings with more fine-grained control over the settings that are manipulated. The readParameterizedSessionConfig() method is called whenever session-specific settings are to be read from the given KConfig* and the writeParameterizedSessionConfig() method 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.
ParameterizedSessionConfigInterface is meant to be an extension of SessionConfigInterface. Due to limitations with qobject_cast it is not possible in KDE4 to derive this interface from SessionConfigInterface.

Adding Session Support

To add support for sessions a KTextEditor implementation has to derive the Document class from ParameterizedSessionConfigInterface and reimplement the methods defined in this class.

Accessing the ParameterizedSessionConfigInterface

The ParameterizedSessionConfigInterface is supposed to be an extension interface for a Document i.e. the Document inherits the interface provided that it implements the interface. Use qobject_cast to access the interface:

// object is of type KTextEditor::Document*
KTextEditor::ParameterizedSessionConfigInterface *iface =
qobject_cast<KTextEditor::ParameterizedSessionConfigInterface*>( object );
if( iface ) {
// interface is supported
// do stuff
}
See also
KTextEditor::Document, KTextEditor::SessionConfigInterface
Since
4.4
Note
KDE5: Rename to SessionConfigInterface, delete old SessionConfigInterface

Definition at line 176 of file sessionconfiginterface.h.

Member Enumeration Documentation

enum KTextEditor::ParameterizedSessionConfigInterface::SessionConfigParameter

Flags for session restore.

These flags allow to skip some parts of the configuration from restoration.

Enumerator
SkipNone 
SkipUrl 
SkipMode 
SkipHighlighting 
SkipEncoding 
SkipFolding 

Definition at line 192 of file sessionconfiginterface.h.

Constructor & Destructor Documentation

ParameterizedSessionConfigInterface::ParameterizedSessionConfigInterface ( )

Definition at line 260 of file ktexteditor.cpp.

ParameterizedSessionConfigInterface::~ParameterizedSessionConfigInterface ( )
virtual

Virtual destructor.

Definition at line 263 of file ktexteditor.cpp.

Member Function Documentation

virtual void KTextEditor::ParameterizedSessionConfigInterface::readParameterizedSessionConfig ( const KConfigGroup &  config,
unsigned long  parameters 
)
pure virtual

Read session settings from the given config excluding the settings specified in parameters.

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 or 'SkipUrl' is set, this function should emit ReadOnlyPart::completed
Parameters
configread the session settings from this KConfigGroup
parameterssettings that should not be read (i.e. a combination of flags from SessionConfigParameter)
See also
writeParameterizedSessionConfig()
virtual void KTextEditor::ParameterizedSessionConfigInterface::writeParameterizedSessionConfig ( KConfigGroup &  config,
unsigned long  parameters 
)
pure virtual

Write session settings to the config excluding the settings specified in parameters.

See readSessionConfig() for more details.

Parameters
configwrite the session settings to this KConfigGroup
parameterssettings that should not be written (i.e. a combination of flags from SessionConfigParameter)
See also
readParameterizedSessionConfig()

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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:20 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

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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