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

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

Inheritance diagram for IgnoreListManager:
Collaboration diagram for IgnoreListManager:

Classes

struct  IgnoreListItem

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 QVariantMap initIgnoreList () const
virtual void initSetIgnoreList (const QVariantMap &ignoreList)
virtual void requestRemoveIgnoreListItem (const QString &ignoreRule)
 Request removal of an ignore rule based on the rule itself.
virtual void removeIgnoreListItem (const QString &ignoreRule)
virtual void requestToggleIgnoreRule (const QString &ignoreRule)
 Request toggling of "isActive" flag of a given ignore rule.
virtual void toggleIgnoreRule (const QString &ignoreRule)
virtual void requestAddIgnoreListItem (int type, const QString &ignoreRule, bool isRegEx, int strictness, int scope, const QString &scopeRule, bool isActive)
 Request an IgnoreListItem to be added to the ignore list.
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

 IgnoreListManager (QObject *parent=0)
IgnoreListManageroperator= (const IgnoreListManager &other)
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
virtual const QMetaObject * syncMetaObject () 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 Attributes

IgnoreList _ignoreList

Static Private Attributes

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

Detailed Description

Definition at line 30 of file ignorelistmanager.h.

Member Typedef Documentation

typedef QList<IgnoreListItem> IgnoreList

Definition at line 85 of file ignorelistmanager.h.

Member Enumeration Documentation

enum IgnoreType
Enumerator:
SenderIgnore 
MessageIgnore 
CtcpIgnore 

Definition at line 38 of file ignorelistmanager.h.

Enumerator:
UnmatchedStrictness 
SoftStrictness 
HardStrictness 

Definition at line 44 of file ignorelistmanager.h.

enum ScopeType
Enumerator:
GlobalScope 
NetworkScope 
ChannelScope 

Definition at line 50 of file ignorelistmanager.h.

Constructor & Destructor Documentation

IgnoreListManager ( QObject *  parent = 0)
inline

Definition at line 35 of file ignorelistmanager.h.

References SyncableObject::setAllowClientUpdates().

Member Function Documentation

IgnoreListManager & operator= ( const IgnoreListManager other)

Definition at line 28 of file ignorelistmanager.cpp.

References SyncableObject::operator=().

int indexOf ( const QString &  ignore) const

Definition at line 39 of file ignorelistmanager.cpp.

References _ignoreList.

Referenced by contains(), removeIgnoreListItem(), and toggleIgnoreRule().

bool contains ( const QString &  ignore) const
inline

Definition at line 88 of file ignorelistmanager.h.

References indexOf().

Referenced by addIgnoreListItem(), and IgnoreListModel::newIgnoreRule().

bool isEmpty ( ) const
inline

Definition at line 89 of file ignorelistmanager.h.

References _ignoreList.

int count ( ) const
inline

Definition at line 90 of file ignorelistmanager.h.

References _ignoreList.

Referenced by initSetIgnoreList(), and IgnoreListModel::rowCount().

void removeAt ( int  index)
inline

Definition at line 91 of file ignorelistmanager.h.

References _ignoreList.

Referenced by removeIgnoreListItem(), and IgnoreListModel::removeIgnoreRule().

IgnoreListItem& operator[] ( int  i)
inline

Definition at line 92 of file ignorelistmanager.h.

References _ignoreList.

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

Definition at line 93 of file ignorelistmanager.h.

References _ignoreList.

const IgnoreList& ignoreList ( ) const
inline

Definition at line 94 of file ignorelistmanager.h.

References _ignoreList.

Referenced by ClientIgnoreListManager::matchingRulesForHostmask(), and setIgnoreList().

StrictnessType match ( const Message msg,
const QString &  network = QString() 
)
inline

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 _match(), Message::bufferInfo(), BufferInfo::bufferName(), Message::contents, Message::sender, and Message::type.

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

QVariantMap initIgnoreList ( ) const
virtualslot

Definition at line 49 of file ignorelistmanager.cpp.

References _ignoreList.

Referenced by CoreIgnoreListManager::save().

void initSetIgnoreList ( const QVariantMap &  ignoreList)
virtualslot

Definition at line 81 of file ignorelistmanager.cpp.

References _ignoreList, count(), and toInt().

virtual void requestRemoveIgnoreListItem ( const QString &  ignoreRule)
inlinevirtualslot

Request removal of an ignore rule based on the rule itself.

Use this method if you want to remove a single ignore rule and get that synced with the core immediately.

Parameters
ignoreRuleA valid ignore rule

Definition at line 117 of file ignorelistmanager.h.

References ARG, and REQUEST.

void removeIgnoreListItem ( const QString &  ignoreRule)
virtualslot

Definition at line 177 of file ignorelistmanager.cpp.

References ARG, indexOf(), removeAt(), and SYNC.

Referenced by CoreIgnoreListManager::requestRemoveIgnoreListItem().

virtual void requestToggleIgnoreRule ( const QString &  ignoreRule)
inlinevirtualslot

Request toggling of "isActive" flag of a given ignore rule.

Use this method if you want to toggle the "isActive" flag of a single ignore rule and get that synced with the core immediately.

Parameters
ignoreRuleA valid ignore rule

Definition at line 125 of file ignorelistmanager.h.

References ARG, and REQUEST.

Referenced by NetworkModelController::handleNickAction().

void toggleIgnoreRule ( const QString &  ignoreRule)
virtualslot

Definition at line 184 of file ignorelistmanager.cpp.

References _ignoreList, ARG, indexOf(), and SYNC.

Referenced by CoreIgnoreListManager::requestToggleIgnoreRule().

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

Request an IgnoreListItem to be added to the ignore list.

Items added to the list with this method, get immediately synced with the core

Parameters
typeThe IgnoreType of the new rule
ignoreRuleThe rule itself
isRegExSignals if the rule should be interpreted as a regular expression
strictnessTh StrictnessType that should be applied
scopeThe ScopeType that should be set
scopeRuleA string of semi-colon separated network- or channelnames
isActiveSignals if the rule is enabled or not

Definition at line 138 of file ignorelistmanager.h.

References ARG, and REQUEST.

Referenced by NetworkModelController::handleNickAction().

void addIgnoreListItem ( int  type,
const QString &  ignoreRule,
bool  isRegEx,
int  strictness,
int  scope,
const QString &  scopeRule,
bool  isActive 
)
virtualslot
void setIgnoreList ( const QList< IgnoreListItem > &  ignoreList)
inlineprotected

Definition at line 149 of file ignorelistmanager.h.

References _ignoreList, and ignoreList().

bool scopeMatch ( const QString &  scopeRule,
const QString &  string 
) const
protected
void ignoreAdded ( IgnoreType  type,
const QString &  ignoreRule,
bool  isRegex,
StrictnessType  strictness,
ScopeType  scope,
const QVariant &  scopeRule,
bool  isActive 
)
signal
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

Member Data Documentation

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

Definition at line 32 of file ignorelistmanager.h.


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