OSDN Git Service

Move the directories
[kita/kita.git] / src / viewmediator.h
diff --git a/src/viewmediator.h b/src/viewmediator.h
new file mode 100644 (file)
index 0000000..139d6cf
--- /dev/null
@@ -0,0 +1,73 @@
+/***************************************************************************
+ *   Copyright (C) 2007 by Kita Developers                                 *
+ *   ikemo@users.sourceforge.jp                                            *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ ***************************************************************************/
+#ifndef KITAVIEWMEDIATOR_H
+#define KITAVIEWMEDIATOR_H
+
+class QString;
+
+class KUrl;
+
+namespace Kita {
+    class BoardTabWidget;
+    class MainWindow;
+    class ThreadTabWidget;
+    class WriteTabWidget;
+    class FavoriteListView;
+
+    /**
+     * @author Hideki Ikemoto <ikemo@wakaba.jp>
+     */
+    class ViewMediator {
+        static ViewMediator* instance;
+        ThreadTabWidget* m_threadTabWidget;
+        BoardTabWidget* m_boardTabWidget;
+        WriteTabWidget* m_writeTabWidget;
+        MainWindow* m_mainWindow;
+        FavoriteListView* m_favoriteListView;
+
+        ViewMediator();
+        ~ViewMediator();
+
+    public:
+        static ViewMediator* getInstance();
+
+        void setThreadTabWidget(ThreadTabWidget* threadTabWidget)
+        { m_threadTabWidget = threadTabWidget; }
+        void setBoardTabWidget(BoardTabWidget* boardTabWidget)
+        { m_boardTabWidget = boardTabWidget; }
+        void setWriteTabWidget(WriteTabWidget* writeTabWidget)
+        { m_writeTabWidget = writeTabWidget; }
+        void setMainWindow(MainWindow* mainWindow)
+        { m_mainWindow = mainWindow; }
+        void setFavoriteListView(FavoriteListView* favoriteListView)
+        { m_favoriteListView = favoriteListView; }
+
+        void closeThreadTab(const KUrl& url);
+        void showWriteView(const KUrl& url, const QString& resStr);
+        void openBoard(const KUrl& url);
+        void openThread(const KUrl& url);
+        void setMainStatus(const QString& statusStr);
+        void setMainUrlLine(const KUrl& url);
+        void setMainCaption(const QString& str);
+        void bookmark(const QString& datUrl, bool on);
+        bool isActive();
+        void updateBoardView(const KUrl& datUrl);
+        void updateThreadView(const KUrl& datUrl);
+        void changeWriteTab(const KUrl& datUrl);
+        void updateFavoriteListView();
+        void openUrl(const KUrl& url);
+
+    private:
+        ViewMediator(const ViewMediator&);
+        ViewMediator& operator=(const ViewMediator&);
+    };
+}
+
+#endif