QEditSession Class Reference

A session recording class. More...

Inheritance diagram for QEditSession:

Inheritance graph
[legend]

List of all members.

Classes

struct  Command
struct  Cursor
struct  Document

Public Slots

virtual void addEditor (QEditor *e)
 Add an editor to the session.
virtual void removeEditor (QEditor *e)
 Remove an editor from the session.
virtual void updateData ()
 Updates the data.
virtual void setAutoUpdateInterval (int ms)
 Set the update interval.
virtual void setFileName (const QString &filename)
 Set the storage destination.
virtual void save (QDataStream &s)
 Serialize session data.
virtual void restore (const QDataStream &s)
 Deserialize session data.

Public Member Functions

 QEditSession (QObject *p=0)
 ctor
virtual ~QEditSession ()
 dtor
int autoUpdateInterval () const
QString fileName () const

Protected Member Functions

virtual void saved (QEditor *e)
 Called whenever an editor is saved.
virtual void timerEvent (QTimerEvent *e)
virtual QEditorcreateEditor ()

Protected Attributes

int m_id
int m_delay
QString m_fileName
QList< QPointer< QEditor * > > m_editors
QList< Document * > m_sessionData


Detailed Description

A session recording class.

The purpose of this class is to collect session data from several QEditor object, to serialize it and to re-create the same session by deserializing the stored data.


Member Function Documentation

int QEditSession::autoUpdateInterval (  )  const

Returns:
The update interval, in milliseconds
A value of zero means the data is NOT automatically updated.

See also:
updateData()

QString QEditSession::fileName (  )  const

Returns:
The file name used as storage
If it is empty then no auto-save is performed.

void QEditSession::saved ( QEditor e  )  [protected, virtual]

Called whenever an editor is saved.

This handler is responsible for updating file names and time stamps which is needed to avoid data loss upon session restoration

void QEditSession::setAutoUpdateInterval ( int  ms  )  [virtual, slot]

Set the update interval.

If ms is strictly positive then the data will be updated every ms milliseconds

If the session has been given a valid filename, the updated data will automatically be saved to that file.

void QEditSession::setFileName ( const QString &  filename  )  [virtual, slot]

Set the storage destination.

Every time the data is updated, either when the autoupdate timer ticks or when updateData() is called programmatically, it will be written to that file, provided the filename is valid and points to a writeable location.

See also:
updateData()

autoUpdateInterval()

void QEditSession::updateData (  )  [virtual, slot]

Updates the data.

Fetches up-to-date session data from the attached editors.

If the session has been given a valid filename the data will automatically be saved.

Note:
This will NOT affect the automatic updates


The documentation for this class was generated from the following files:

Generated on Sun Feb 15 22:50:20 2009 for QCodeEdit by  doxygen 1.5.7.1