Better time formatting by using an explicit format
[quassel.git] / src / uisupport / toolbaractionprovider.h
index 59661d0..391e037 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2012 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
 #ifndef TOOLBARACTIONPROVIDER_H_
 
 class QToolBar;
 
-class ToolBarActionProvider : public NetworkModelController {
-  Q_OBJECT
+class ToolBarActionProvider : public NetworkModelController
+{
+    Q_OBJECT
 
 public:
-  ToolBarActionProvider(QObject *parent = 0);
-  virtual ~ToolBarActionProvider();
+    ToolBarActionProvider(QObject *parent = 0);
+    virtual ~ToolBarActionProvider();
 
-  enum ToolBarType {
-    NetworkToolBar,
-    ChatViewToolBar,
-    NickToolBar
-  };
+    enum ToolBarType {
+        MainToolBar,
+        ChatViewToolBar,
+        NickToolBar
+    };
 
-  void addActions(QToolBar *, ToolBarType type);
+    void addActions(QToolBar *, ToolBarType type);
+
+public slots:
+    virtual void disconnectedFromCore();
+
+protected:
+    virtual void handleNetworkAction(ActionType, QAction *);
+    virtual void handleBufferAction(ActionType, QAction *);
+    virtual void handleNickAction(ActionType, QAction *);
+    virtual void handleGeneralAction(ActionType, QAction *);
 
 private slots:
-  void networkCreated(NetworkId id);
-  void networkRemoved(NetworkId id);
-  void networkUpdated(const Network *net = 0);
-  void connectOrDisconnectNet();
+    void networkCreated(NetworkId id);
+    void networkRemoved(NetworkId id);
+    void networkUpdated(const Network *net = 0);
+    void connectOrDisconnectNet();
 
-  //void currentBufferChanged(BufferId id);
+    void currentBufferChanged(const QModelIndex &);
+    void nickSelectionChanged(const QModelIndexList &);
 
+    void updateStates();
 
 private:
-  QMenu *_networksConnectMenu, *_networksDisconnectMenu;
-  QHash<NetworkId, Action *> _networkActions;
+    QMenu *_networksConnectMenu, *_networksDisconnectMenu;
+    QHash<NetworkId, Action *> _networkActions;
+    QModelIndex _currentBuffer;
+    QModelIndexList _selectedNicks;
 };
 
+
 #endif