X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclient.h;h=30ef2d9f1d8a4237d0f88ded95eeaec2e5967b6f;hp=2821ab9853976ab0fd76012e360ce8c96eff0e29;hb=7582ce11d6fb8b5123f7ac4794c57e981a634e93;hpb=9bd789919e5f539cc3b8c70fd25acf6d6631d268 diff --git a/src/client/client.h b/src/client/client.h index 2821ab98..30ef2d9f 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -21,12 +21,12 @@ #ifndef CLIENT_H_ #define CLIENT_H_ -#include -#include #include #include #include "bufferinfo.h" +#include "coreconnection.h" +#include "quassel.h" #include "types.h" class Message; @@ -42,14 +42,18 @@ class AbstractUiMsg; class NetworkModel; class BufferModel; class BufferSyncer; +class BufferViewOverlay; class ClientAliasManager; class ClientBacklogManager; class ClientBufferViewManager; +class ClientIgnoreListManager; class ClientIrcListHelper; -class ClientSyncer; class ClientUserInputHandler; +class CoreAccountModel; +class CoreConnection; class IrcUser; class IrcChannel; +class NetworkConfig; class SignalProxy; struct NetworkInfo; @@ -107,17 +111,23 @@ public: static inline ClientBacklogManager *backlogManager() { return instance()->_backlogManager; } static inline ClientIrcListHelper *ircListHelper() { return instance()->_ircListHelper; } static inline ClientBufferViewManager *bufferViewManager() { return instance()->_bufferViewManager; } + static inline BufferViewOverlay *bufferViewOverlay() { return instance()->_bufferViewOverlay; } static inline ClientUserInputHandler *inputHandler() { return instance()->_inputHandler; } + static inline NetworkConfig *networkConfig() { return instance()->_networkConfig; } + static inline ClientIgnoreListManager *ignoreListManager() { return instance()->_ignoreListManager; } - static AccountId currentCoreAccount(); + static inline CoreAccountModel *coreAccountModel() { return instance()->_coreAccountModel; } + static inline CoreConnection *coreConnection() { return instance()->_coreConnection; } + static inline CoreAccount currentCoreAccount() { return coreConnection()->currentAccount(); } + static inline Quassel::Features coreFeatures() { return _coreFeatures; } static bool isConnected(); - static bool isSynced(); - static inline bool internalCore() { return instance()->_internalCore; } + static bool internalCore(); static void userInput(const BufferInfo &bufferInfo, const QString &message); static void setBufferLastSeenMsg(BufferId id, const MsgId &msgId); // this is synced to core and other clients + static void setBufferMarkerLine(BufferId id, const MsgId &msgId); // this is synced to core and other clients static void removeBuffer(BufferId id); static void renameBuffer(BufferId bufferId, const QString &newName); static void mergeBuffersPermanently(BufferId bufferId1, BufferId bufferId2); @@ -126,8 +136,6 @@ public: static void logMessage(QtMsgType type, const char *msg); static inline const QString &debugLog() { return instance()->_debugLogBuffer; } - static inline void registerClientSyncer(ClientSyncer *syncer) { emit instance()->newClientSyncer(syncer); } - signals: void requestNetworkStates(); @@ -161,10 +169,15 @@ signals: void requestCreateNetwork(const NetworkInfo &info, const QStringList &persistentChannels = QStringList()); void requestRemoveNetwork(NetworkId); - void newClientSyncer(ClientSyncer *); - void logUpdated(const QString &msg); + //! 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. + * \param id The buffer that has been marked as read + */ + void bufferMarkedAsRead(BufferId id); + public slots: void disconnectFromCore(); @@ -172,8 +185,12 @@ public slots: void bufferRenamed(BufferId bufferId, const QString &newName); void buffersPermanentlyMerged(BufferId bufferId1, BufferId bufferId2); + void markBufferAsRead(BufferId id); + private slots: - void disconnectedFromCore(); + void setSyncedToCore(); + void setDisconnectedFromCore(); + void connectionStateChanged(CoreConnection::ConnectionState); void recvMessage(const Message &message); void recvStatusMsg(QString network, QString message); @@ -184,8 +201,6 @@ private slots: void coreNetworkCreated(NetworkId); void coreNetworkRemoved(NetworkId); - void setConnectedToCore(AccountId id, QIODevice *socket = 0); - void setSyncedToCore(); void requestInitialBacklog(); void createDefaultBufferView(); @@ -197,7 +212,7 @@ private: void init(); static void addNetwork(Network *); - static void setCurrentCoreAccount(AccountId); + static void setCoreFeatures(Quassel::Features); static inline BufferSyncer *bufferSyncer() { return instance()->_bufferSyncer; } static QPointer instanceptr; @@ -210,28 +225,32 @@ private: ClientAliasManager *_aliasManager; ClientBacklogManager *_backlogManager; ClientBufferViewManager *_bufferViewManager; + BufferViewOverlay *_bufferViewOverlay; ClientIrcListHelper *_ircListHelper; ClientUserInputHandler *_inputHandler; + NetworkConfig *_networkConfig; + ClientIgnoreListManager *_ignoreListManager; MessageModel *_messageModel; AbstractMessageProcessor *_messageProcessor; - ClientMode clientMode; + CoreAccountModel *_coreAccountModel; + CoreConnection *_coreConnection; - bool _connectedToCore, _syncedToCore; - bool _internalCore; + ClientMode clientMode; QHash _networks; QHash _identities; - static AccountId _currentCoreAccount; + bool _connected; + static Quassel::Features _coreFeatures; QString _debugLogBuffer; QTextStream _debugLog; QList > _userInputBuffer; - friend class ClientSyncer; + friend class CoreConnection; }; #endif