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

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

Collaboration diagram for Client:

Public Types

enum  ClientMode { LocalCore, RemoteCore }

Public Slots

void disconnectFromCore ()
void bufferRemoved (BufferId bufferId)
void bufferRenamed (BufferId bufferId, const QString &newName)
void buffersPermanentlyMerged (BufferId bufferId1, BufferId bufferId2)
void markBufferAsRead (BufferId id)

Signals

void requestNetworkStates ()
void showConfigWizard (const QVariantMap &coredata)
void connected ()
void disconnected ()
void coreConnectionStateChanged (bool)
void identityCreated (IdentityId id)
 The identity with the given ID has been newly created in core and client.
void identityRemoved (IdentityId id)
 The identity with the given ID has been removed.
void requestCreateIdentity (const Identity &, const QVariantMap &)
 Sent to the core when an identity shall be created. Should not be used elsewhere.
void requestRemoveIdentity (IdentityId)
 Sent to the core when an identity shall be removed. Should not be used elsewhere.
void networkCreated (NetworkId id)
void networkRemoved (NetworkId id)
void requestCreateNetwork (const NetworkInfo &info, const QStringList &persistentChannels=QStringList())
void requestRemoveNetwork (NetworkId)
void logUpdated (const QString &msg)
void bufferMarkedAsRead (BufferId id)
 Emitted when a buffer has been marked as read.
void requestPasswordChange (PeerPtr peer, const QString &userName, const QString &oldPassword, const QString &newPassword)
 Requests a password change (user name must match the currently logged in user)
void passwordChanged (bool success)

Static Public Member Functions

static bool instanceExists ()
static Clientinstance ()
static void destroy ()
static void init (AbstractUi *)
static AbstractUimainUi ()
static QList< NetworkIdnetworkIds ()
static const Networknetwork (NetworkId)
static QList< IdentityIdidentityIds ()
static const Identityidentity (IdentityId)
static void createIdentity (const CertIdentity &identity)
 Request creation of an identity with the given data.
static void updateIdentity (IdentityId id, const QVariantMap &serializedData)
 Request update of an identity with the given data.
static void removeIdentity (IdentityId id)
 Request removal of the identity with the given ID from the core (and all the clients, of course).
static void createNetwork (const NetworkInfo &info, const QStringList &persistentChannels=QStringList())
static void updateNetwork (const NetworkInfo &info)
static void removeNetwork (NetworkId id)
static NetworkModelnetworkModel ()
static BufferModelbufferModel ()
static MessageModelmessageModel ()
static AbstractMessageProcessormessageProcessor ()
static SignalProxysignalProxy ()
static ClientAliasManageraliasManager ()
static ClientBacklogManagerbacklogManager ()
static ClientIrcListHelperircListHelper ()
static ClientBufferViewManagerbufferViewManager ()
static BufferViewOverlaybufferViewOverlay ()
static ClientUserInputHandlerinputHandler ()
static NetworkConfignetworkConfig ()
static ClientIgnoreListManagerignoreListManager ()
static ClientTransferManagertransferManager ()
static CoreAccountModelcoreAccountModel ()
static CoreConnectioncoreConnection ()
static CoreAccount currentCoreAccount ()
static Quassel::Features coreFeatures ()
static void setCoreFeatures (Quassel::Features features)
static bool isConnected ()
static bool internalCore ()
static void userInput (const BufferInfo &bufferInfo, const QString &message)
static void setBufferLastSeenMsg (BufferId id, const MsgId &msgId)
static void setMarkerLine (BufferId id, const MsgId &msgId)
static MsgId markerLine (BufferId id)
static void removeBuffer (BufferId id)
static void renameBuffer (BufferId bufferId, const QString &newName)
static void mergeBuffersPermanently (BufferId bufferId1, BufferId bufferId2)
static void purgeKnownBufferIds ()
static void changePassword (const QString &oldPassword, const QString &newPassword)
static void logMessage (QtMsgType type, const char *msg)
static const QString & debugLog ()

Private Slots

void setSyncedToCore ()
void setDisconnectedFromCore ()
void connectionStateChanged (CoreConnection::ConnectionState)
void recvMessage (const Message &message)
void recvStatusMsg (QString network, QString message)
void networkDestroyed ()
void coreIdentityCreated (const Identity &)
void coreIdentityRemoved (IdentityId)
void coreNetworkCreated (NetworkId)
void coreNetworkRemoved (NetworkId)
void corePasswordChanged (PeerPtr, bool success)
void requestInitialBacklog ()
void sendBufferedUserInput ()

Private Member Functions

 Client (QObject *parent=0)
virtual ~Client ()
void init ()

Static Private Member Functions

static void addNetwork (Network *)
static BufferSyncerbufferSyncer ()

Private Attributes

SignalProxy_signalProxy
AbstractUi_mainUi
NetworkModel_networkModel
BufferModel_bufferModel
BufferSyncer_bufferSyncer
ClientAliasManager_aliasManager
ClientBacklogManager_backlogManager
ClientBufferViewManager_bufferViewManager
BufferViewOverlay_bufferViewOverlay
ClientIrcListHelper_ircListHelper
ClientUserInputHandler_inputHandler
NetworkConfig_networkConfig
ClientIgnoreListManager_ignoreListManager
ClientTransferManager_transferManager
MessageModel_messageModel
AbstractMessageProcessor_messageProcessor
CoreAccountModel_coreAccountModel
CoreConnection_coreConnection
ClientMode clientMode
QHash< NetworkId, Network * > _networks
QHash< IdentityId, Identity * > _identities
bool _connected
QString _debugLogBuffer
QTextStream _debugLog
QList< QPair< BufferInfo,
QString > > 
_userInputBuffer

Static Private Attributes

static QPointer< Clientinstanceptr = 0
static Quassel::Features _coreFeatures = 0

Friends

class CoreConnection

Detailed Description

Definition at line 63 of file client.h.

Member Enumeration Documentation

enum ClientMode
Enumerator:
LocalCore 
RemoteCore 

Definition at line 68 of file client.h.

Constructor & Destructor Documentation

Client ( QObject *  parent = 0)
private

Definition at line 92 of file client.cpp.

References _ircListHelper, _signalProxy, and SignalProxy::synchronize().

Referenced by instance().

~Client ( )
privatevirtual

Definition at line 119 of file client.cpp.

References disconnectFromCore().

Member Function Documentation

bool instanceExists ( )
static

Definition at line 61 of file client.cpp.

References instanceptr.

Referenced by logMessage().

Client * instance ( )
static

Definition at line 67 of file client.cpp.

References Client(), and instanceptr.

Referenced by addNetwork(), AliasesModel::AliasesModel(), aliasManager(), backlogManager(), BufferModel::BufferModel(), bufferModel(), bufferSyncer(), bufferViewManager(), bufferViewOverlay(), BufferViewSettingsPage::BufferViewSettingsPage(), changePassword(), ChatMonitorView::ChatMonitorView(), ConnectionSettingsPage::ConnectionSettingsPage(), CoreConnection::connectToCurrentAccount(), coreAccountModel(), coreConnection(), createIdentity(), createNetwork(), MainWin::currentBufferChanged(), debugLog(), DebugLogWidget::DebugLogWidget(), MainWin::event(), IrcConnectionWizard::finishClicked(), NetworkModelController::handleGeneralAction(), IdentitiesSettingsPage::IdentitiesSettingsPage(), identity(), identityIds(), IrcConnectionWizard::identityReady(), ignoreListManager(), IgnoreListModel::IgnoreListModel(), MainWin::init(), init(), inputHandler(), ircListHelper(), isConnected(), ChannelListDlg::joinChannel(), logMessage(), mainUi(), messageModel(), messageProcessor(), network(), networkConfig(), networkIds(), networkModel(), IrcConnectionWizard::networkReady(), NetworksSettingsPage::NetworksSettingsPage(), PasswordChangeDlg::PasswordChangeDlg(), QtUi::QtUi(), removeIdentity(), removeNetwork(), SaveIdentitiesDlg::SaveIdentitiesDlg(), SaveNetworksDlg::SaveNetworksDlg(), SettingsDlg::SettingsDlg(), MainWin::setupActions(), signalProxy(), CoreConnection::syncToCore(), ToolBarActionProvider::ToolBarActionProvider(), transferManager(), updateIdentity(), updateNetwork(), DockManagerNotificationBackend::updateProgress(), and userInput().

void destroy ( )
static
void init ( AbstractUi ui)
static

Definition at line 85 of file client.cpp.

References _mainUi, init(), and instance().

Referenced by init().

AbstractUi * mainUi ( )
static

Definition at line 177 of file client.cpp.

References _mainUi, and instance().

Referenced by init().

void createIdentity ( const CertIdentity identity)
static

Request creation of an identity with the given data.

The request will be sent to the core, and will be propagated back to all the clients with a new valid IdentityId.

Parameters
identityThe identity template for the new identity. It does not need to have a valid ID.

Definition at line 286 of file client.cpp.

References instance(), and requestCreateIdentity().

Referenced by IrcConnectionWizard::finishClicked(), init(), and SaveIdentitiesDlg::SaveIdentitiesDlg().

void updateIdentity ( IdentityId  id,
const QVariantMap &  serializedData 
)
static

Request update of an identity with the given data.

The request will be sent to the core, and will be propagated back to all the clients.

Parameters
idThe identity to be updated.
serializedDataThe identity's content (cf. SyncableObject::toVariantMap())

Definition at line 297 of file client.cpp.

References _identities, instance(), and SyncableObject::requestUpdate().

Referenced by IrcConnectionWizard::finishClicked(), and SaveIdentitiesDlg::SaveIdentitiesDlg().

void removeIdentity ( IdentityId  id)
static

Request removal of the identity with the given ID from the core (and all the clients, of course).

Parameters
idThe ID of the identity to be removed.

Definition at line 308 of file client.cpp.

References instance(), and requestRemoveIdentity().

Referenced by init(), and SaveIdentitiesDlg::SaveIdentitiesDlg().

void createNetwork ( const NetworkInfo info,
const QStringList &  persistentChannels = QStringList() 
)
static
void updateNetwork ( const NetworkInfo info)
static
void removeNetwork ( NetworkId  id)
static

Definition at line 222 of file client.cpp.

References instance(), and requestRemoveNetwork().

Referenced by init(), and SaveNetworksDlg::SaveNetworksDlg().

static NetworkModel* networkModel ( )
inlinestatic

Definition at line 108 of file client.h.

References _networkModel, and instance().

Referenced by ContextMenuActionProvider::addActions(), addNetwork(), BufferViewOverlay::addView(), BufferViewFilter::bufferIdLessThan(), MessageFilter::bufferName(), bufferRemoved(), bufferRenamed(), buffersPermanentlyMerged(), MessageFilter::bufferType(), TitleSetter::changeWindowTitle(), MainWin::clientNetworkUpdated(), NickListWidget::currentChanged(), BufferWidget::currentChanged(), ChatMonitorFilter::data(), BufferView::dropEvent(), AwayLogFilter::filterAcceptsRow(), MessageFilter::filterAcceptsRow(), ChatMonitorFilter::filterAcceptsRow(), BufferViewOverlay::filterBuffersByConfig(), ClientBacklogManager::filterNewBufferIds(), NetworkModelController::findQueryBuffer(), SenderChatItem::handleClick(), ContentsChatItem::handleClick(), ContentsChatItem::hoverMoveEvent(), ChatView::init(), ChatMonitorSettingsPage::load(), markerLine(), MainWin::messagesInserted(), BufferModel::networkConnectionChanged(), MessageFilter::networkId(), BufferModel::newBuffer(), BufferViewSettingsPage::newBufferView(), SystrayNotificationBackend::notify(), SnoreNotificationBackend::notify(), IndicatorNotificationBackend::notify(), MainWin::on_actionDebugNetworkModel_triggered(), AbstractMessageProcessor::preProcess(), MessageModel::requestBacklog(), PerBufferUnreadBacklogRequester::requestBacklog(), GlobalUnreadBacklogRequester::requestInitialBacklog(), BufferViewSettingsPage::saveConfig(), AbstractBufferContainer::setCurrentBuffer(), ClientBufferViewManager::setInitialized(), setSyncedToCore(), TopicWidget::setTopic(), ClientUserInputHandler::switchBuffer(), BufferModel::switchToBuffer(), BufferModel::switchToOrJoinBuffer(), CoreConnection::syncToCore(), InputWidget::updateEnabledState(), and BufferViewOverlay::updateHelper().

static AbstractMessageProcessor* messageProcessor ( )
inlinestatic
static ClientAliasManager* aliasManager ( )
inlinestatic
static ClientIrcListHelper* ircListHelper ( )
inlinestatic

Definition at line 116 of file client.h.

References _ircListHelper, and instance().

Referenced by ChannelListDlg::ChannelListDlg(), and ChannelListDlg::requestSearch().

static ClientUserInputHandler* inputHandler ( )
inlinestatic

Definition at line 119 of file client.h.

References _inputHandler, and instance().

Referenced by init(), and userInput().

static ClientTransferManager* transferManager ( )
inlinestatic

Definition at line 122 of file client.h.

References _transferManager, and instance().

Referenced by MainWin::connectedToCore(), and setSyncedToCore().

void setCoreFeatures ( Quassel::Features  features)
static

Definition at line 183 of file client.cpp.

References _coreFeatures.

Referenced by ClientAuthHandler::handle(), and CoreConnection::internalSessionStateReceived().

bool internalCore ( )
static
void setBufferLastSeenMsg ( BufferId  id,
const MsgId msgId 
)
static
void setMarkerLine ( BufferId  id,
const MsgId msgId 
)
static

Definition at line 565 of file client.cpp.

References bufferSyncer(), and BufferSyncer::requestSetMarkerLine().

MsgId markerLine ( BufferId  id)
static
void removeBuffer ( BufferId  id)
static
void renameBuffer ( BufferId  bufferId,
const QString &  newName 
)
static

Definition at line 587 of file client.cpp.

References bufferSyncer(), and BufferSyncer::requestRenameBuffer().

Referenced by QueryBufferItem::setData().

void mergeBuffersPermanently ( BufferId  bufferId1,
BufferId  bufferId2 
)
static

Definition at line 595 of file client.cpp.

References bufferSyncer(), and BufferSyncer::requestMergeBuffersPermanently().

Referenced by BufferView::dropEvent().

void purgeKnownBufferIds ( )
static
void changePassword ( const QString &  oldPassword,
const QString &  newPassword 
)
static
void logMessage ( QtMsgType  type,
const char *  msg 
)
static
static const QString& debugLog ( )
inlinestatic

Definition at line 152 of file client.h.

References _debugLogBuffer, and instance().

Referenced by DebugLogWidget::DebugLogWidget().

void requestNetworkStates ( )
signal

Referenced by init().

void showConfigWizard ( const QVariantMap &  coredata)
signal
void connected ( )
signal

Referenced by init(), and setSyncedToCore().

void disconnected ( )
signal

Referenced by init(), and setDisconnectedFromCore().

void coreConnectionStateChanged ( bool  )
signal
void identityCreated ( IdentityId  id)
signal

The identity with the given ID has been newly created in core and client.

Parameters
idThe ID of the newly created identity.

Referenced by coreIdentityCreated(), and init().

void identityRemoved ( IdentityId  id)
signal

The identity with the given ID has been removed.

Upon emitting this signal, the identity is already gone from the core, and it will be deleted from the client immediately afterwards, so connected slots need to clean up their stuff.

Parameters
idThe ID of the identity about to be removed.

Referenced by coreIdentityRemoved(), init(), and setDisconnectedFromCore().

void requestCreateIdentity ( const Identity ,
const QVariantMap &   
)
signal

Sent to the core when an identity shall be created. Should not be used elsewhere.

Referenced by createIdentity(), and init().

void requestRemoveIdentity ( IdentityId  )
signal

Sent to the core when an identity shall be removed. Should not be used elsewhere.

Referenced by init(), and removeIdentity().

void networkCreated ( NetworkId  id)
signal

Referenced by addNetwork(), and init().

void networkRemoved ( NetworkId  id)
signal
void requestCreateNetwork ( const NetworkInfo info,
const QStringList &  persistentChannels = QStringList() 
)
signal

Referenced by createNetwork(), and init().

void requestRemoveNetwork ( NetworkId  )
signal

Referenced by init(), and removeNetwork().

void logUpdated ( const QString &  msg)
signal

Referenced by logMessage().

void bufferMarkedAsRead ( BufferId  id)
signal

Emitted when a buffer has been marked as read.

This is currently triggered by setting lastSeenMsg, either local or remote, or by bringing the window to front.

Parameters
idThe buffer that has been marked as read

Referenced by setSyncedToCore().

void requestPasswordChange ( PeerPtr  peer,
const QString &  userName,
const QString &  oldPassword,
const QString &  newPassword 
)
signal

Requests a password change (user name must match the currently logged in user)

Referenced by changePassword(), and init().

void passwordChanged ( bool  success)
signal

Referenced by corePasswordChanged(), and init().

void disconnectFromCore ( )
slot

Definition at line 445 of file client.cpp.

References coreConnection(), CoreConnection::disconnectFromCore(), and isConnected().

Referenced by init(), and ~Client().

void bufferRenamed ( BufferId  bufferId,
const QString &  newName 
)
slot

Definition at line 631 of file client.cpp.

References NetworkModel::bufferIndex(), networkModel(), and TreeModel::setData().

Referenced by setSyncedToCore().

void buffersPermanentlyMerged ( BufferId  bufferId1,
BufferId  bufferId2 
)
slot
void markBufferAsRead ( BufferId  id)
slot
void connectionStateChanged ( CoreConnection::ConnectionState  state)
privateslot
void recvMessage ( const Message message)
privateslot

Definition at line 551 of file client.cpp.

References messageProcessor(), and AbstractMessageProcessor::process().

Referenced by init().

void recvStatusMsg ( QString  network,
QString  message 
)
privateslot

Definition at line 545 of file client.cpp.

Referenced by init().

void networkDestroyed ( )
privateslot

Definition at line 528 of file client.cpp.

References _networks.

Referenced by addNetwork().

void coreIdentityCreated ( const Identity other)
privateslot
void coreIdentityRemoved ( IdentityId  id)
privateslot

Definition at line 329 of file client.cpp.

References _identities, and identityRemoved().

Referenced by init().

void coreNetworkCreated ( NetworkId  id)
privateslot

Definition at line 250 of file client.cpp.

References _networks, and addNetwork().

Referenced by init().

void coreNetworkRemoved ( NetworkId  id)
privateslot

Definition at line 261 of file client.cpp.

References _networks, Network::networkId(), and networkRemoved().

Referenced by init().

void corePasswordChanged ( PeerPtr  ,
bool  success 
)
privateslot

Definition at line 663 of file client.cpp.

References coreAccountModel(), passwordChanged(), and CoreAccountModel::save().

Referenced by init().

void requestInitialBacklog ( )
privateslot
void sendBufferedUserInput ( )
privateslot

Definition at line 351 of file client.cpp.

References _userInputBuffer, and userInput().

Referenced by setSyncedToCore().

Friends And Related Function Documentation

friend class CoreConnection
friend

Definition at line 273 of file client.h.

Member Data Documentation

QPointer< Client > instanceptr = 0
staticprivate

Definition at line 237 of file client.h.

Referenced by destroy(), instance(), and instanceExists().

SignalProxy* _signalProxy
private

Definition at line 239 of file client.h.

Referenced by Client(), and signalProxy().

AbstractUi* _mainUi
private

Definition at line 240 of file client.h.

Referenced by init(), and mainUi().

NetworkModel* _networkModel
private

Definition at line 241 of file client.h.

Referenced by init(), networkModel(), setDisconnectedFromCore(), and setSyncedToCore().

BufferModel* _bufferModel
private

Definition at line 242 of file client.h.

Referenced by bufferModel(), and init().

BufferSyncer* _bufferSyncer
private

Definition at line 243 of file client.h.

Referenced by bufferSyncer(), setDisconnectedFromCore(), and setSyncedToCore().

ClientAliasManager* _aliasManager
private

Definition at line 244 of file client.h.

Referenced by aliasManager(), setDisconnectedFromCore(), and setSyncedToCore().

ClientBacklogManager* _backlogManager
private

Definition at line 245 of file client.h.

Referenced by backlogManager(), and requestInitialBacklog().

ClientBufferViewManager* _bufferViewManager
private

Definition at line 246 of file client.h.

Referenced by bufferViewManager(), setDisconnectedFromCore(), and setSyncedToCore().

BufferViewOverlay* _bufferViewOverlay
private

Definition at line 247 of file client.h.

Referenced by bufferViewOverlay(), setDisconnectedFromCore(), and setSyncedToCore().

ClientIrcListHelper* _ircListHelper
private

Definition at line 248 of file client.h.

Referenced by Client(), and ircListHelper().

ClientUserInputHandler* _inputHandler
private

Definition at line 249 of file client.h.

Referenced by init(), and inputHandler().

NetworkConfig* _networkConfig
private

Definition at line 250 of file client.h.

Referenced by networkConfig(), setDisconnectedFromCore(), and setSyncedToCore().

ClientIgnoreListManager* _ignoreListManager
private

Definition at line 251 of file client.h.

Referenced by ignoreListManager(), setDisconnectedFromCore(), and setSyncedToCore().

ClientTransferManager* _transferManager
private

Definition at line 252 of file client.h.

Referenced by setDisconnectedFromCore(), setSyncedToCore(), and transferManager().

MessageModel* _messageModel
private

Definition at line 254 of file client.h.

Referenced by init(), messageModel(), setDisconnectedFromCore(), and setSyncedToCore().

AbstractMessageProcessor* _messageProcessor
private

Definition at line 255 of file client.h.

Referenced by init(), and messageProcessor().

CoreAccountModel* _coreAccountModel
private

Definition at line 257 of file client.h.

Referenced by coreAccountModel().

CoreConnection* _coreConnection
private

Definition at line 258 of file client.h.

Referenced by coreConnection().

ClientMode clientMode
private

Definition at line 260 of file client.h.

QHash<IdentityId, Identity *> _identities
private
bool _connected
private

Definition at line 265 of file client.h.

Referenced by isConnected(), setDisconnectedFromCore(), and setSyncedToCore().

Quassel::Features _coreFeatures = 0
staticprivate

Definition at line 266 of file client.h.

Referenced by coreFeatures(), setCoreFeatures(), and setDisconnectedFromCore().

QString _debugLogBuffer
private

Definition at line 268 of file client.h.

Referenced by debugLog().

QTextStream _debugLog
private

Definition at line 269 of file client.h.

Referenced by logMessage().

QList<QPair<BufferInfo, QString> > _userInputBuffer
private

Definition at line 271 of file client.h.

Referenced by sendBufferedUserInput(), setDisconnectedFromCore(), and userInput().


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