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

#include </tmp/quassel/src/client/clientignorelistmanager.h>

Inheritance diagram for ClientIgnoreListManager:
Collaboration diagram for ClientIgnoreListManager:

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 ignoreListChanged ()
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

 ClientIgnoreListManager (QObject *parent=0)
virtual const QMetaObject * syncMetaObject () const
QMap< QString, bool > matchingRulesForHostmask (const QString &hostmask, const QString &network, const QString &channel) const
 Fetch all matching ignore rules for a given hostmask.
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 Member Functions

bool pureMatch (const IgnoreListItem &item, const QString &string) const

Detailed Description

Definition at line 27 of file clientignorelistmanager.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

ClientIgnoreListManager ( QObject *  parent = 0)
explicit

Member Function Documentation

virtual const QMetaObject* syncMetaObject ( ) const
inlinevirtual

Reimplemented from SyncableObject.

Definition at line 34 of file clientignorelistmanager.h.

QMap< QString, bool > matchingRulesForHostmask ( const QString &  hostmask,
const QString &  network,
const QString &  channel 
) const

Fetch all matching ignore rules for a given hostmask.

Parameters
hostmaskThe hostmask of the user
networkThe network name
channelThe channel name
Returns
Returns a QMap with the rule as key and a bool, representing if the rule is enabled or not, as value

Definition at line 48 of file clientignorelistmanager.cpp.

References IgnoreListManager::ChannelScope, IgnoreListManager::GlobalScope, IgnoreListManager::ignoreList(), IgnoreListManager::IgnoreListItem::ignoreRule, IgnoreListManager::IgnoreListItem::isActive, IgnoreListManager::NetworkScope, pureMatch(), IgnoreListManager::IgnoreListItem::scope, IgnoreListManager::scopeMatch(), IgnoreListManager::IgnoreListItem::scopeRule, IgnoreListManager::SenderIgnore, and IgnoreListManager::IgnoreListItem::type.

Referenced by ContextMenuActionProvider::addIrcUserActions().

void ignoreListChanged ( )
signal
bool pureMatch ( const IgnoreListItem item,
const QString &  string 
) const
private
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 CoreIgnoreListManager::save().

void initSetIgnoreList ( const QVariantMap &  ignoreList)
virtualslotinherited
virtual void requestRemoveIgnoreListItem ( const QString &  ignoreRule)
inlinevirtualslotinherited

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)
virtualslotinherited
virtual void requestToggleIgnoreRule ( const QString &  ignoreRule)
inlinevirtualslotinherited

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)
virtualslotinherited
virtual void requestAddIgnoreListItem ( int  type,
const QString &  ignoreRule,
bool  isRegEx,
int  strictness,
int  scope,
const QString &  scopeRule,
bool  isActive 
)
inlinevirtualslotinherited

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 
)
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: