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

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

Collaboration diagram for CoreConnection:

Public Types

enum  ConnectionState {
  Disconnected, Connecting, Connected, Synchronizing,
  Synchronized
}

Public Slots

bool connectToCore (AccountId=0)
void reconnectToCore ()
void disconnectFromCore ()
void setupCore (const Protocol::SetupData &setupData)

Signals

void stateChanged (CoreConnection::ConnectionState)
void encrypted (bool isEncrypted=true)
void synchronized ()
void lagUpdated (int msecs)
void connectionError (const QString &errorMsg)
void connectionErrorPopup (const QString &errorMsg)
void connectionMsg (const QString &msg)
void disconnected ()
void progressRangeChanged (int minimum, int maximum)
void progressValueChanged (int value)
void progressTextChanged (const QString &)
void startCoreSetup (const QVariantList &backendInfo)
void coreSetupSuccess ()
void coreSetupFailed (const QString &error)
void startInternalCore ()
void connectToInternalCore (InternalPeer *connection)
void userAuthenticationRequired (CoreAccount *, bool *valid, const QString &errorMessage=QString())
void handleNoSslInClient (bool *accepted)
void handleNoSslInCore (bool *accepted)

Public Member Functions

 CoreConnection (QObject *parent=0)
void init ()
bool isConnected () const
ConnectionState state () const
CoreAccount currentAccount () const
bool isEncrypted () const
bool isLocalConnection () const
int progressMinimum () const
int progressMaximum () const
int progressValue () const
QString progressText () const
bool wasReconnect () const
 Check if we consider the last connect as reconnect.
QPointer< Peerpeer ()

Private Slots

void connectToCurrentAccount ()
void disconnectFromCore (const QString &errorString, bool wantReconnect=true)
void coreSocketError (QAbstractSocket::SocketError error, const QString &errorString)
void coreSocketDisconnected ()
void networkInitDone ()
void checkSyncState ()
void loginToCore (const QString &user, const QString &password, bool remember)
void syncToCore (const Protocol::SessionState &sessionState)
void internalSessionStateReceived (const Protocol::SessionState &sessionState)
void resetConnection (bool wantReconnect=false)
void onConnectionReady ()
void onLoginSuccessful (const CoreAccount &account)
void onHandshakeComplete (RemotePeer *peer, const Protocol::SessionState &sessionState)
void updateProgress (int value, int maximum)
void setProgressText (const QString &text)
void setProgressValue (int value)
void setProgressMinimum (int minimum)
void setProgressMaximum (int maximum)
void setState (ConnectionState state)
void networkDetectionModeChanged (const QVariant &mode)
void pingTimeoutIntervalChanged (const QVariant &interval)
void reconnectIntervalChanged (const QVariant &interval)
void reconnectTimeout ()
void onlineStateChanged (bool isOnline)

Private Member Functions

CoreAccountModelaccountModel () const

Private Attributes

QPointer< ClientAuthHandler_authHandler
QPointer< Peer_peer
ConnectionState _state
QTimer _reconnectTimer
bool _wantReconnect
bool _wasReconnect
QSet< QObject * > _netsToSync
int _numNetsToSync
int _progressMinimum
int _progressMaximum
int _progressValue
QString _progressText
bool _resetting
CoreAccount _account
QPointer
< QNetworkConfigurationManager > 
_qNetworkConfigurationManager

Friends

class CoreConfigWizard

Detailed Description

Definition at line 44 of file coreconnection.h.

Member Enumeration Documentation

Enumerator:
Disconnected 
Connecting 
Connected 
Synchronizing 
Synchronized 

Definition at line 49 of file coreconnection.h.

Constructor & Destructor Documentation

CoreConnection ( QObject *  parent = 0)

Definition at line 37 of file coreconnection.cpp.

Member Function Documentation

bool isConnected ( ) const
inline

Definition at line 185 of file coreconnection.h.

References Connected, and state().

Referenced by connectToCore(), and isLocalConnection().

CoreConnection::ConnectionState state ( ) const
inline

Definition at line 184 of file coreconnection.h.

References _state.

Referenced by checkSyncState(), isConnected(), onlineStateChanged(), and setState().

CoreAccount currentAccount ( ) const
inline
bool isEncrypted ( ) const

Definition at line 187 of file coreconnection.cpp.

References _peer.

bool isLocalConnection ( ) const

Definition at line 193 of file coreconnection.cpp.

References _authHandler, _peer, currentAccount(), and isConnected().

Referenced by onlineStateChanged().

int progressMaximum ( ) const
inline
int progressValue ( ) const
inline

Definition at line 181 of file coreconnection.h.

References _progressValue.

Referenced by CoreConnectionStatusWidget::update().

QString progressText ( ) const
inline

Definition at line 182 of file coreconnection.h.

References _progressText.

Referenced by CoreConnectionStatusWidget::update().

bool wasReconnect ( ) const
inline

Check if we consider the last connect as reconnect.

Definition at line 74 of file coreconnection.h.

References _wasReconnect.

QPointer<Peer> peer ( )
inline

Definition at line 76 of file coreconnection.h.

References _peer.

Referenced by connectToCurrentAccount(), and onHandshakeComplete().

void reconnectToCore ( )
slot

Definition at line 312 of file coreconnection.cpp.

References _wasReconnect, connectToCore(), and currentAccount().

Referenced by onlineStateChanged(), and reconnectTimeout().

void disconnectFromCore ( )
slot
void setupCore ( const Protocol::SetupData setupData)
slot

Definition at line 414 of file coreconnection.cpp.

References _authHandler.

Referenced by CoreConfigWizard::prepareCoreSetup().

void stateChanged ( CoreConnection::ConnectionState  )
signal

Referenced by setState().

void encrypted ( bool  isEncrypted = true)
signal
void synchronized ( )
signal
void lagUpdated ( int  msecs)
signal

Referenced by init(), and resetConnection().

void connectionError ( const QString &  errorMsg)
signal
void connectionErrorPopup ( const QString &  errorMsg)
signal

Referenced by connectToCurrentAccount().

void connectionMsg ( const QString &  msg)
signal
void disconnected ( )
signal
void progressRangeChanged ( int  minimum,
int  maximum 
)
signal
void progressValueChanged ( int  value)
signal

Referenced by setProgressValue().

void progressTextChanged ( const QString &  )
signal

Referenced by setProgressText().

void startCoreSetup ( const QVariantList &  backendInfo)
signal

Referenced by connectToCurrentAccount().

void coreSetupSuccess ( )
signal

Referenced by connectToCurrentAccount().

void coreSetupFailed ( const QString &  error)
signal

Referenced by connectToCurrentAccount().

void startInternalCore ( )
signal

Referenced by connectToCurrentAccount().

void connectToInternalCore ( InternalPeer connection)
signal

Referenced by connectToCurrentAccount().

void userAuthenticationRequired ( CoreAccount ,
bool *  valid,
const QString &  errorMessage = QString() 
)
signal

Referenced by connectToCurrentAccount().

void handleNoSslInClient ( bool *  accepted)
signal

Referenced by connectToCurrentAccount().

void handleNoSslInCore ( bool *  accepted)
signal

Referenced by connectToCurrentAccount().

void disconnectFromCore ( const QString &  errorString,
bool  wantReconnect = true 
)
privateslot
void coreSocketError ( QAbstractSocket::SocketError  error,
const QString &  errorString 
)
privateslot

Definition at line 225 of file coreconnection.cpp.

References disconnectFromCore().

Referenced by connectToCurrentAccount(), and onHandshakeComplete().

void coreSocketDisconnected ( )
privateslot
void networkInitDone ( )
privateslot

Definition at line 510 of file coreconnection.cpp.

References _netsToSync, _numNetsToSync, checkSyncState(), and updateProgress().

Referenced by syncToCore().

void checkSyncState ( )
privateslot
void loginToCore ( const QString &  user,
const QString &  password,
bool  remember 
)
privateslot

Definition at line 420 of file coreconnection.cpp.

References _authHandler.

Referenced by CoreConfigWizard::coreSetupSuccess().

void internalSessionStateReceived ( const Protocol::SessionState sessionState)
privateslot
void onConnectionReady ( )
privateslot

Definition at line 208 of file coreconnection.cpp.

References Connected, and setState().

Referenced by connectToCurrentAccount().

void onHandshakeComplete ( RemotePeer peer,
const Protocol::SessionState sessionState 
)
privateslot
void updateProgress ( int  value,
int  maximum 
)
privateslot
void setProgressText ( const QString &  text)
privateslot

Definition at line 77 of file coreconnection.cpp.

References _progressText, and progressTextChanged().

Referenced by checkSyncState(), onLoginSuccessful(), and syncToCore().

void setProgressValue ( int  value)
privateslot

Definition at line 86 of file coreconnection.cpp.

References _progressValue, and progressValueChanged().

Referenced by updateProgress().

void setProgressMinimum ( int  minimum)
privateslot

Definition at line 95 of file coreconnection.cpp.

References _progressMaximum, _progressMinimum, and progressRangeChanged().

void setProgressMaximum ( int  maximum)
privateslot

Definition at line 104 of file coreconnection.cpp.

References _progressMaximum, _progressMinimum, and progressRangeChanged().

Referenced by checkSyncState(), and resetConnection().

void networkDetectionModeChanged ( const QVariant &  mode)
privateslot
void pingTimeoutIntervalChanged ( const QVariant &  interval)
privateslot
void reconnectIntervalChanged ( const QVariant &  interval)
privateslot

Definition at line 160 of file coreconnection.cpp.

References _reconnectTimer.

Referenced by init().

CoreAccountModel * accountModel ( ) const
private

Definition at line 71 of file coreconnection.cpp.

References Client::coreAccountModel().

Referenced by connectToCore(), and onLoginSuccessful().

Friends And Related Function Documentation

friend class CoreConfigWizard
friend

Definition at line 172 of file coreconnection.h.

Member Data Documentation

ConnectionState _state
private

Definition at line 154 of file coreconnection.h.

Referenced by setState(), and state().

QTimer _reconnectTimer
private
bool _wantReconnect
private
bool _wasReconnect
private
QSet<QObject *> _netsToSync
private

Definition at line 160 of file coreconnection.h.

Referenced by checkSyncState(), networkInitDone(), resetConnection(), and syncToCore().

int _numNetsToSync
private

Definition at line 161 of file coreconnection.h.

Referenced by networkInitDone(), resetConnection(), and syncToCore().

int _progressMinimum
private

Definition at line 162 of file coreconnection.h.

Referenced by setProgressMaximum(), setProgressMinimum(), and updateProgress().

int _progressMaximum
private
int _progressValue
private

Definition at line 162 of file coreconnection.h.

Referenced by progressValue(), and setProgressValue().

QString _progressText
private

Definition at line 163 of file coreconnection.h.

Referenced by progressText(), and setProgressText().

bool _resetting
private

Definition at line 165 of file coreconnection.h.

Referenced by resetConnection().

CoreAccount _account
private

Definition at line 167 of file coreconnection.h.

Referenced by connectToCore(), and currentAccount().

QPointer<QNetworkConfigurationManager> _qNetworkConfigurationManager
private

Definition at line 170 of file coreconnection.h.

Referenced by init(), and reconnectTimeout().


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