• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
KateSessionManager Class Reference

#include <katesession.h>

Inherits TQObject.

List of all members.

Public Types

enum  { INVALID_SESSION = -1 }
enum  { STARTUP_NEW = 0, STARTUP_LAST, STARTUP_MANUAL }
enum  { SWITCH_DISCARD = 0, SWITCH_SAVE, SWITCH_ASK }

Signals

void switchOptionChanged ()
void sessionActivated (int newSessionId, int oldSessionId)
void sessionCreated (int sessionId)
void sessionSaved (int sessionId)
void sessionDeleted (int sessionId)
void sessionsSwapped (int sessionIdMin, int sessionIdMax)
void sessionRenamed (int sessionId)

Public Member Functions

 ~KateSessionManager ()
void saveConfig (bool saveSessions)
const int getStartupOption ()
const int getSwitchOption ()
void setSwitchOption (int option)
const TQString & getBaseDir () const
int getSessionCount () const
int getActiveSessionId () const
const TQString & getActiveSessionName ()
const TQString & getSessionName (int sessionId)
KateSession * getActiveSession ()
KateSession * getSessionFromId (int sessionId)
int getSessionIdFromName (const TQString &name)
TQPtrList< KateSession > & getSessionsList ()
bool activateSession (int sessionId, bool saveCurr=true)
int newSession (const TQString &sessionName=TQString::null, bool saveCurr=true)
int cloneSession (int sessionId, const TQString &sessionName=TQString::null, bool activate=true, bool deleteCurr=false)
void reloadActiveSession ()
bool restoreLastSession ()
void saveActiveSession ()
void saveSession (int sessionId)
bool deleteSession (int sessionId, int actSessId)
void moveSessionForward (int sessionId)
void moveSessionBackward (int sessionId)
void renameSession (int sessionId, const TQString &newSessionName)
void setSessionReadOnlyStatus (int sessionId, bool readOnly)

Static Public Member Functions

static KateSessionManager * self ()

Protected Types

enum  { SO_STARTUP = 0, SO_SWITCH, SO_ALL }

Protected Member Functions

void updateSessionOptions (int optionType)
void saveSessionOptions (int optionType)
void swapSessionsPosition (int sessionId1, int sessionId2)
void saveSession (int sessionId, bool saveGUIInfo, bool setReadOnly=false)

Protected Attributes

TQString m_baseDir
TQString m_configFile
int m_activeSessionId
int m_lastSessionId
TQPtrList< KateSession > m_sessions
KSimpleConfig * m_config
int m_startupOption
int m_switchOption

Static Protected Attributes

static KateSessionManager * ksm_instance = NULL

Detailed Description

The Kate session manager.

It takes care of storing and retrieving each session object as well as providing methods to operate on them.

Note:
The Kate session manager takes ownership of each session object it handles.

Definition at line 176 of file katesession.h.


Constructor & Destructor Documentation

KateSessionManager::~KateSessionManager ( )

Destructor.

Definition at line 385 of file katesession.cpp.


Member Function Documentation

bool KateSessionManager::activateSession ( int  sessionId,
bool  saveCurr = true 
)

Activate the selected session.

Parameters:
sessionIdthe id of the session to activate
saveCurrif true, save the current session before activating the new one
Returns:
whether the session was activated or not sessionActivated

Definition at line 583 of file katesession.cpp.

int KateSessionManager::cloneSession ( int  sessionId,
const TQString &  sessionName = TQString::null,
bool  activate = true,
bool  deleteCurr = false 
)

Create a new session and activate it if required.

Parameters:
sessionIdthe id of the session to clone
sessionNamethe new session name
activateif true, activate the new session after creation
deleteCurrif true, delete the current session after switching
Returns:
the id of the newly created session sessionCreated

Definition at line 646 of file katesession.cpp.

bool KateSessionManager::deleteSession ( int  sessionId,
int  actSessId 
)

Delete the specified session.

Parameters:
sessionIdthe id of the session to delete
actSessIdthe id of the next session to activate. If INVALID_SESSION or invalid, create a new empty session. This is only meaningful when deleting the current active session.
Returns:
whether the session has been deleted or not sessionDeleted

Definition at line 694 of file katesession.cpp.

KateSession* KateSessionManager::getActiveSession ( ) [inline]
Returns:
a reference to the active session

Definition at line 269 of file katesession.h.

int KateSessionManager::getActiveSessionId ( ) const [inline]
Returns:
the active session id

Definition at line 253 of file katesession.h.

const TQString& KateSessionManager::getActiveSessionName ( ) [inline]
Returns:
the active session name

Definition at line 258 of file katesession.h.

const TQString& KateSessionManager::getBaseDir ( ) const [inline]
Returns:
the session files folder name

Definition at line 243 of file katesession.h.

int KateSessionManager::getSessionCount ( ) const [inline]
Returns:
the number of existing sessions

Definition at line 248 of file katesession.h.

KateSession * KateSessionManager::getSessionFromId ( int  sessionId)
Parameters:
sessionIdthe id of the session to return
Returns:
a reference to the specified session

Definition at line 557 of file katesession.cpp.

int KateSessionManager::getSessionIdFromName ( const TQString &  name)

Return the session id of the first session whose name matches the provided one.

In case multiple sessions share the same name, the id of the first one found will be returned.

Parameters:
namethe session name to look for
Returns:
the session id of the matching session if it is found, otherwise KateSessionManager::INVALID_SESSION.

Definition at line 568 of file katesession.cpp.

const TQString & KateSessionManager::getSessionName ( int  sessionId)
Parameters:
sessionIdthe id of the session of interest
Returns:
the name of the specified session

Definition at line 546 of file katesession.cpp.

TQPtrList<KateSession>& KateSessionManager::getSessionsList ( ) [inline]
Returns:
a reference to the sessions list

Definition at line 290 of file katesession.h.

const int KateSessionManager::getStartupOption ( )
Returns:
the session startup option The function checks the config file to see if there was any value update

Definition at line 524 of file katesession.cpp.

const int KateSessionManager::getSwitchOption ( )
Returns:
the session switch option The function checks the config file to see if there was any value update

Definition at line 531 of file katesession.cpp.

void KateSessionManager::moveSessionBackward ( int  sessionId)

Move the specified session backward in the session list (by one position)

Parameters:
sessionIdthe id of the session to move

Definition at line 783 of file katesession.cpp.

void KateSessionManager::moveSessionForward ( int  sessionId)

Move the specified session forward in the session list (by one position)

Parameters:
sessionIdthe id of the session to move

Definition at line 772 of file katesession.cpp.

int KateSessionManager::newSession ( const TQString &  sessionName = TQString::null,
bool  saveCurr = true 
)

Create a new session and activate it.

Parameters:
sessionNamenew session name
saveCurrif true, save the current session before activating the new one
Returns:
the id of the newly created session sessionCreated sessionDeleted (only when leaving an unstored and unnamed session)

Definition at line 636 of file katesession.cpp.

void KateSessionManager::reloadActiveSession ( ) [inline]

Restore the current active session to the last saved state.

Definition at line 326 of file katesession.h.

void KateSessionManager::renameSession ( int  sessionId,
const TQString &  newSessionName 
)

Rename the specified session.

Parameters:
sessionIdthe id of the session to rename
newSessionNamethe new session name sessionRenamed

Definition at line 794 of file katesession.cpp.

bool KateSessionManager::restoreLastSession ( )

Restore the last saved session.

Can only be used before any other session has been activated, i.e. on Kate's startup

Returns:
whether the session was activated or not

Definition at line 673 of file katesession.cpp.

void KateSessionManager::saveActiveSession ( ) [inline]

Saves the active session sessionSaved (through invoked "void saveSession(int)" method)

Definition at line 339 of file katesession.h.

void KateSessionManager::saveConfig ( bool  saveSessions)

Save session manager info.

Parameters:
saveSessionstrue = sessions info will be saved false = all sessions will be discarded

Definition at line 481 of file katesession.cpp.

void KateSessionManager::saveSession ( int  sessionId) [inline]

Save the specified session.

Parameters:
sessionIdthe id of the session to save sessionSaved

Definition at line 346 of file katesession.h.

void KateSessionManager::saveSession ( int  sessionId,
bool  saveGUIInfo,
bool  setReadOnly = false 
) [protected]

Save the specified session.

Parameters:
sessionIdthe id of the session to save
saveGUIInfoif true, save also the information about the GUI elements
setReadOnlynecessary to save a session that has to be turned to read only sessionSaved

Definition at line 683 of file katesession.cpp.

void KateSessionManager::saveSessionOptions ( int  optionType) [protected]

Save the session startup and switch options to the config file.

Parameters:
optionTypespecifies which options needs to be saved

Definition at line 442 of file katesession.cpp.

KateSessionManager * KateSessionManager::self ( ) [static]

get a pointer to the unique KateSessionManager instance.

If the manager does not exist yet, create it.

Definition at line 321 of file katesession.cpp.

void KateSessionManager::sessionActivated ( int  newSessionId,
int  oldSessionId 
) [signal]

Emitted once a session has been activated.

Parameters:
newSessionIdthe id of the previous active session
oldSessionIdthe id of the new active session
void KateSessionManager::sessionCreated ( int  sessionId) [signal]

Emitted once a session has been created.

Parameters:
sessionIdthe id of the new session
void KateSessionManager::sessionDeleted ( int  sessionId) [signal]

Emitted once a session has been deleted.

Parameters:
sessionIdthe id of the deleted session
void KateSessionManager::sessionRenamed ( int  sessionId) [signal]

Emitted once a session has been renamed.

Parameters:
sessionIdthe id of the new session
void KateSessionManager::sessionSaved ( int  sessionId) [signal]

Emitted once a session has been saved.

Parameters:
sessionIdthe id of the saved session
void KateSessionManager::sessionsSwapped ( int  sessionIdMin,
int  sessionIdMax 
) [signal]

Emitted once the position of the two sessions have been swapped.

Parameters:
sessionIdMinthe smallest id of the session couple
sessionIdMaxthe biggest id of the session couple
void KateSessionManager::setSessionReadOnlyStatus ( int  sessionId,
bool  readOnly 
)

Set the read only status of the specified session.

Parameters:
sessionIdthe id of the session to modify
readOnlythe new read only status

Definition at line 806 of file katesession.cpp.

void KateSessionManager::setSwitchOption ( int  option)

Set the new session switch preference.

Parameters:
optionthe new option value. Defaults to SWITCH_ASK if the value is invalid. switchOptionChanged

Definition at line 538 of file katesession.cpp.

void KateSessionManager::swapSessionsPosition ( int  sessionId1,
int  sessionId2 
) [protected]

Swap the position of the two specified sessions in the session list.

Parameters:
sessionId1the id of the first session
sessionId2the id of the second session sessionsSwapped

Definition at line 734 of file katesession.cpp.

void KateSessionManager::switchOptionChanged ( ) [signal]

Emitted when the session switch option has been set/changed.

void KateSessionManager::updateSessionOptions ( int  optionType) [protected]

Updated the session startup and switch options.

Parameters:
optionTypespecifies which options needs to be updated

Definition at line 395 of file katesession.cpp.


The documentation for this class was generated from the following files:
  • katesession.h
  • katesession.cpp

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kate

Skip menu "kate"
  • kate
  • libkonq
  • twin
  •   lib
Generated for kate by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.