Automatically create networks and buffers specified in networks.ini
[quassel.git] / src / client / client.h
index ac3663d..684cb58 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -90,7 +90,7 @@ public:
    */
   static void removeIdentity(IdentityId id);
 
-  static void createNetwork(const NetworkInfo &info);
+  static void createNetwork(const NetworkInfo &info, const QStringList &persistentChannels = QStringList());
   static void updateNetwork(const NetworkInfo &info);
   static void removeNetwork(NetworkId id);
 
@@ -108,16 +108,20 @@ public:
 
   static bool isConnected();
   static bool isSynced();
+  static inline bool internalCore() { return instance()->_internalCore; }
 
   static void userInput(BufferInfo bufferInfo, QString message);
 
   static void setBufferLastSeenMsg(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);
 
   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 sendInput(BufferInfo, QString message);
   void requestNetworkStates();
@@ -150,7 +154,7 @@ signals:
   void networkCreated(NetworkId id);
   void networkRemoved(NetworkId id);
 
-  void requestCreateNetwork(const NetworkInfo &info);
+  void requestCreateNetwork(const NetworkInfo &info, const QStringList &persistentChannels = QStringList());
   void requestRemoveNetwork(NetworkId);
 
   void newClientSyncer(ClientSyncer *);
@@ -164,6 +168,7 @@ public slots:
 
   void bufferRemoved(BufferId bufferId);
   void bufferRenamed(BufferId bufferId, const QString &newName);
+  void buffersPermanentlyMerged(BufferId bufferId1, BufferId bufferId2);
 
 private slots:
   void disconnectedFromCore();
@@ -180,6 +185,9 @@ private slots:
   void setConnectedToCore(AccountId id, QIODevice *socket = 0);
   void setSyncedToCore();
   void requestInitialBacklog();
+  void createDefaultBufferView();
+  void createDefaultIdentity();
+  void createDefaultNetworks();
   void setSecuredConnection();
 
 
@@ -209,6 +217,7 @@ private:
   ClientMode clientMode;
 
   bool _connectedToCore, _syncedToCore;
+  bool _internalCore;
 
   QHash<NetworkId, Network *> _networks;
   QHash<IdentityId, Identity *> _identities;