Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
AliasManager Class Reference

#include </tmp/quassel/src/common/aliasmanager.h>

Inheritance diagram for AliasManager:
Collaboration diagram for AliasManager:


struct  Alias

Public Types

typedef QList< AliasAliasList
typedef QList< QPair
< BufferInfo, QString > > 

Public Slots

virtual QVariantMap initAliases () const
virtual void initSetAliases (const QVariantMap &aliases)
virtual void addAlias (const QString &name, const QString &expansion)
virtual void setInitialized ()
void requestUpdate (const QVariantMap &properties)
virtual void update (const QVariantMap &properties)


void initDone ()
void updatedRemotely ()
void updated ()

Public Member Functions

 AliasManager (QObject *parent=0)
AliasManageroperator= (const AliasManager &other)
int indexOf (const QString &name) const
bool contains (const QString &name) const
bool isEmpty () const
int count () const
void removeAt (int index)
Aliasoperator[] (int i)
const Aliasoperator[] (int i) const
const AliasListaliases () const
CommandList processInput (const BufferInfo &info, const QString &message)
virtual QVariantMap toVariantMap ()
 Stores the object's state into a QVariantMap.
virtual void fromVariantMap (const QVariantMap &properties)
 Initialize the object's state from a given QVariantMap.
virtual bool isInitialized () const
virtual const QMetaObject * syncMetaObject () const
void setAllowClientUpdates (bool allow)
bool allowClientUpdates () const

Static Public Member Functions

static AliasList defaults ()

Protected Member Functions

void setAliases (const QList< Alias > &aliases)
virtual const Networknetwork (NetworkId) const =0
void sync_call__ (SignalProxy::ProxyMode modeType, const char *funcname,...) const
void renameObject (const QString &newName)

Private Member Functions

void processInput (const BufferInfo &info, const QString &message, CommandList &previousCommands)
void expand (const QString &alias, const BufferInfo &bufferInfo, const QString &msg, CommandList &previousCommands)

Private Attributes

AliasList _aliases

Static Private Attributes

static const int _classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2

Detailed Description

Definition at line 31 of file aliasmanager.h.

Member Typedef Documentation

typedef QList<Alias> AliasList

Definition at line 45 of file aliasmanager.h.

typedef QList<QPair<BufferInfo, QString> > CommandList

Definition at line 58 of file aliasmanager.h.

Constructor & Destructor Documentation

AliasManager ( QObject *  parent = 0)

Definition at line 37 of file aliasmanager.h.

References SyncableObject::setAllowClientUpdates().

Member Function Documentation

AliasManager & operator= ( const AliasManager other)

Definition at line 28 of file aliasmanager.cpp.

References SyncableObject::operator=().

int indexOf ( const QString &  name) const

Definition at line 39 of file aliasmanager.cpp.

References _aliases.

Referenced by contains().

bool contains ( const QString &  name) const

Definition at line 48 of file aliasmanager.h.

References indexOf().

Referenced by addAlias(), AliasesModel::newAlias(), and AliasesModel::setData().

bool isEmpty ( ) const

Definition at line 49 of file aliasmanager.h.

References _aliases.

Referenced by AliasesModel::loadDefaults().

int count ( ) const

Definition at line 50 of file aliasmanager.h.

References _aliases.

Referenced by processInput(), and AliasesModel::rowCount().

void removeAt ( int  index)

Definition at line 51 of file aliasmanager.h.

References _aliases.

Referenced by AliasesModel::loadDefaults(), and AliasesModel::removeAlias().

Alias& operator[] ( int  i)

Definition at line 52 of file aliasmanager.h.

References _aliases.

const Alias& operator[] ( int  i) const

Definition at line 53 of file aliasmanager.h.

References _aliases.

const AliasList& aliases ( ) const

Definition at line 54 of file aliasmanager.h.

References _aliases.

Referenced by defaults(), initAliases(), and setAliases().

AliasManager::AliasList defaults ( )

Definition at line 95 of file aliasmanager.cpp.

References aliases().

Referenced by CoreAliasManager::loadDefaults(), and AliasesModel::loadDefaults().

AliasManager::CommandList processInput ( const BufferInfo info,
const QString &  message 
QVariantMap initAliases ( ) const

Definition at line 49 of file aliasmanager.cpp.

References _aliases, and aliases().

Referenced by CoreAliasManager::save().

void initSetAliases ( const QVariantMap &  aliases)

Definition at line 66 of file aliasmanager.cpp.

References _aliases.

void addAlias ( const QString &  name,
const QString &  expansion 
void setAliases ( const QList< Alias > &  aliases)

Definition at line 69 of file aliasmanager.h.

References _aliases, and aliases().

virtual const Network* network ( NetworkId  ) const
protectedpure virtual

Implemented in CoreAliasManager, and ClientAliasManager.

Referenced by expand().

void processInput ( const BufferInfo info,
const QString &  message,
CommandList previousCommands 

Definition at line 126 of file aliasmanager.cpp.

References count(), and expand().

void expand ( const QString &  alias,
const BufferInfo bufferInfo,
const QString &  msg,
CommandList previousCommands 
QVariantMap toVariantMap ( )

Stores the object's state into a QVariantMap.

The default implementation takes dynamic properties as well as getters that have names starting with "init" and stores them in a QVariantMap. Override this method in derived classes in order to store the object state in a custom form.

This is used by SignalProxy to transmit the state of the object to clients that request the initial object state. Later updates use a different mechanism and assume that the state is completely covered by properties and init* getters. DO NOT OVERRIDE THIS unless you know exactly what you do!
The object's state in a QVariantMap

Definition at line 91 of file syncableobject.cpp.

References SignalProxy::ExtendedMetaObject::methodBaseName(), and SignalProxy::ExtendedMetaObject::methodName().

Referenced by BufferViewSettingsPage::cloneConfig(), AliasesModel::commit(), IgnoreListModel::commit(), ClientBufferViewConfig::ensureDecoration(), IrcConnectionWizard::finishClicked(), SignalProxy::initData(), CoreNetworkConfig::save(), BufferViewSettingsPage::save(), and ClientBufferViewManager::setInitialized().

void fromVariantMap ( const QVariantMap &  properties)

Initialize the object's state from a given QVariantMap.

See Also
toVariantMap() for important information concerning this method.

Definition at line 135 of file syncableobject.cpp.

References SyncableObject::setInitValue().

Referenced by BufferViewConfig::BufferViewConfig(), BufferViewSettingsPage::cloneConfig(), Network::newIrcChannel(), Network::newIrcUser(), SignalProxy::setInitData(), and SyncableObject::update().

void setAllowClientUpdates ( bool  allow)
bool allowClientUpdates ( ) const

Definition at line 82 of file syncableobject.h.

References SyncableObject::_allowClientUpdates.

Referenced by SyncableObject::requestUpdate().

void update ( const QVariantMap &  properties)
void sync_call__ ( SignalProxy::ProxyMode  modeType,
const char *  funcname,
) const
void renameObject ( const QString &  newName)
void initDone ( )
void updatedRemotely ( )
void updated ( )

Member Data Documentation

const int _classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2

Definition at line 33 of file aliasmanager.h.

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