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

#include </tmp/quassel/src/core/coreignorelistmanager.h>

Inheritance diagram for CoreIgnoreListManager:
Collaboration diagram for CoreIgnoreListManager:

Public Types

enum  IgnoreType { SenderIgnore, MessageIgnore, CtcpIgnore }
enum  StrictnessType { UnmatchedStrictness = 0, SoftStrictness = 1, HardStrictness = 2 }
enum  ScopeType { GlobalScope, NetworkScope, ChannelScope }
typedef QList< IgnoreListItemIgnoreList

Public Slots

virtual void requestToggleIgnoreRule (const QString &ignoreRule)
virtual void requestRemoveIgnoreListItem (const QString &ignoreRule)
virtual void requestAddIgnoreListItem (int type, const QString &ignoreRule, bool isRegEx, int strictness, int scope, const QString &scopeRule, bool isActive)
virtual QVariantMap initIgnoreList () const
virtual void initSetIgnoreList (const QVariantMap &ignoreList)
virtual void removeIgnoreListItem (const QString &ignoreRule)
virtual void toggleIgnoreRule (const QString &ignoreRule)
virtual void addIgnoreListItem (int type, const QString &ignoreRule, bool isRegEx, int strictness, int scope, const QString &scopeRule, bool isActive)
virtual void setInitialized ()
void requestUpdate (const QVariantMap &properties)
virtual void update (const QVariantMap &properties)

Signals

void ignoreAdded (IgnoreType type, const QString &ignoreRule, bool isRegex, StrictnessType strictness, ScopeType scope, const QVariant &scopeRule, bool isActive)
void initDone ()
void updatedRemotely ()
void updated ()

Public Member Functions

 CoreIgnoreListManager (CoreSession *parent)
virtual const QMetaObject * syncMetaObject () const
StrictnessType match (const RawMessage &rawMsg, const QString &networkName)
int indexOf (const QString &ignore) const
bool contains (const QString &ignore) const
bool isEmpty () const
int count () const
void removeAt (int index)
IgnoreListItemoperator[] (int i)
const IgnoreListItemoperator[] (int i) const
const IgnoreListignoreList () const
StrictnessType match (const Message &msg, const QString &network=QString())
 Check if a message matches the IgnoreRule.
bool ctcpMatch (const QString sender, const QString &network, const QString &type=QString())
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
void setAllowClientUpdates (bool allow)
bool allowClientUpdates () const

Protected Member Functions

void setIgnoreList (const QList< IgnoreListItem > &ignoreList)
bool scopeMatch (const QString &scopeRule, const QString &string) const
StrictnessType _match (const QString &msgContents, const QString &msgSender, Message::Type msgType, const QString &network, const QString &bufferName)
void sync_call__ (SignalProxy::ProxyMode modeType, const char *funcname,...) const
void renameObject (const QString &newName)

Private Slots

void save () const

Detailed Description

Definition at line 29 of file coreignorelistmanager.h.

Member Typedef Documentation

typedef QList<IgnoreListItem> IgnoreList
inherited

Definition at line 85 of file ignorelistmanager.h.

Member Enumeration Documentation

enum IgnoreType
inherited
Enumerator:
SenderIgnore 
MessageIgnore 
CtcpIgnore 

Definition at line 38 of file ignorelistmanager.h.

enum StrictnessType
inherited
Enumerator:
UnmatchedStrictness 
SoftStrictness 
HardStrictness 

Definition at line 44 of file ignorelistmanager.h.

enum ScopeType
inherited
Enumerator:
GlobalScope 
NetworkScope 
ChannelScope 

Definition at line 50 of file ignorelistmanager.h.

Constructor & Destructor Documentation

CoreIgnoreListManager ( CoreSession parent)
explicit

Member Function Documentation

virtual const QMetaObject* syncMetaObject ( ) const
inlinevirtual

Reimplemented from SyncableObject.

Definition at line 37 of file coreignorelistmanager.h.

IgnoreListManager::StrictnessType match ( const RawMessage rawMsg,
const QString &  networkName 
)
virtual void requestToggleIgnoreRule ( const QString &  ignoreRule)
inlinevirtualslot

Definition at line 42 of file coreignorelistmanager.h.

References IgnoreListManager::toggleIgnoreRule().

virtual void requestRemoveIgnoreListItem ( const QString &  ignoreRule)
inlinevirtualslot

Definition at line 43 of file coreignorelistmanager.h.

References IgnoreListManager::removeIgnoreListItem().

virtual void requestAddIgnoreListItem ( int  type,
const QString &  ignoreRule,
bool  isRegEx,
int  strictness,
int  scope,
const QString &  scopeRule,
bool  isActive 
)
inlinevirtualslot

Definition at line 44 of file coreignorelistmanager.h.

References IgnoreListManager::addIgnoreListItem().

void save ( ) const
privateslot
int indexOf ( const QString &  ignore) const
inherited
bool contains ( const QString &  ignore) const
inlineinherited
bool isEmpty ( ) const
inlineinherited

Definition at line 89 of file ignorelistmanager.h.

References IgnoreListManager::_ignoreList.

int count ( ) const
inlineinherited
void removeAt ( int  index)
inlineinherited
IgnoreListItem& operator[] ( int  i)
inlineinherited

Definition at line 92 of file ignorelistmanager.h.

References IgnoreListManager::_ignoreList.

const IgnoreListItem& operator[] ( int  i) const
inlineinherited

Definition at line 93 of file ignorelistmanager.h.

References IgnoreListManager::_ignoreList.

const IgnoreList& ignoreList ( ) const
inlineinherited
StrictnessType match ( const Message msg,
const QString &  network = QString() 
)
inlineinherited

Check if a message matches the IgnoreRule.

This method checks if a message matches the users ignorelist.

Parameters
msgThe Message that should be checked
networkThe networkname the message belongs to
Returns
UnmatchedStrictness, HardStrictness or SoftStrictness representing the match type

Definition at line 102 of file ignorelistmanager.h.

References IgnoreListManager::_match(), Message::bufferInfo(), BufferInfo::bufferName(), Message::contents, Message::sender, and Message::type.

Referenced by ChatMonitorFilter::filterAcceptsRow(), and BufferItem::updateActivityLevel().

QVariantMap initIgnoreList ( ) const
virtualslotinherited

Definition at line 49 of file ignorelistmanager.cpp.

References IgnoreListManager::_ignoreList.

Referenced by save().

void initSetIgnoreList ( const QVariantMap &  ignoreList)
virtualslotinherited
void removeIgnoreListItem ( const QString &  ignoreRule)
virtualslotinherited
void toggleIgnoreRule ( const QString &  ignoreRule)
virtualslotinherited
void addIgnoreListItem ( int  type,
const QString &  ignoreRule,
bool  isRegEx,
int  strictness,
int  scope,
const QString &  scopeRule,
bool  isActive 
)
virtualslotinherited
void setIgnoreList ( const QList< IgnoreListItem > &  ignoreList)
inlineprotectedinherited
bool scopeMatch ( const QString &  scopeRule,
const QString &  string 
) const
protectedinherited
void ignoreAdded ( IgnoreType  type,
const QString &  ignoreRule,
bool  isRegex,
StrictnessType  strictness,
ScopeType  scope,
const QVariant &  scopeRule,
bool  isActive 
)
signalinherited
QVariantMap toVariantMap ( )
virtualinherited

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.

Note
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!
Returns
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)
virtualinherited

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)
inlineinherited
bool allowClientUpdates ( ) const
inlineinherited

Definition at line 82 of file syncableobject.h.

References SyncableObject::_allowClientUpdates.

Referenced by SyncableObject::requestUpdate().

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

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