File indexing completed on 2019-04-16 11:59:10

0001 /*
0002 This file is part of Choqok, the KDE micro-blogging client
0003 
0004 Copyright (C) 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006 This program is free software; you can redistribute it and/or
0007 modify it under the terms of the GNU General Public License as
0008 published by the Free Software Foundation; either version 2 of
0009 the License or (at your option) version 3 or any later version
0010 accepted by the membership of KDE e.V. (or its successor approved
0011 by the membership of KDE e.V.), which shall act as a proxy
0012 defined in Section 14 of version 3 of the license.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program; if not, see http://www.gnu.org/licenses/
0021 
0022 */
0023 
0024 #ifndef CHOQOKUIGLOBAL_H
0025 #define CHOQOKUIGLOBAL_H
0026 
0027 #include <QObject>
0028 
0029 #include "choqokmainwindow.h"
0030 #include "choqok_export.h"
0031 
0032 #define choqokMainWindow Choqok::UI::Global::mainWindow()
0033 
0034 namespace Choqok
0035 {
0036 
0037 class Account;
0038 
0039 namespace UI
0040 {
0041 class PostWidget;
0042 class QuickPost;
0043 
0044 /**
0045 * This namespace contains the Choqok user interface's global widgets
0046 * UI Plugins can use these
0047 */
0048 namespace Global
0049 {
0050 /**
0051 * Set the main widget to widget
0052 */
0053 CHOQOK_EXPORT void setMainWindow(Choqok::UI::MainWindow *window);
0054 /**
0055 * Returns the main widget - this is the widget that message boxes
0056 * and KNotify stuff should use as a parent.
0057 */
0058 CHOQOK_EXPORT Choqok::UI::MainWindow *mainWindow();
0059 
0060 CHOQOK_EXPORT void setQuickPostWidget(QuickPost *quickPost);
0061 
0062 CHOQOK_EXPORT QuickPost *quickPostWidget();
0063 
0064 class CHOQOK_EXPORT SessionManager : public QObject
0065 {
0066     Q_OBJECT
0067 public:
0068     ~SessionManager();
0069     static SessionManager *self();
0070     void emitNewPostWidgetAdded(Choqok::UI::PostWidget *widget, Choqok::Account *theAccount,
0071                                 const QString &timelineName = QString());
0072 
0073 Q_SIGNALS:
0074     void newPostWidgetAdded(Choqok::UI::PostWidget *widget, Choqok::Account *theAccount,
0075                             const QString &timelineName);
0076 
0077 public Q_SLOTS:
0078     void resetNotifyManager();
0079 
0080 private:
0081     static SessionManager *m_self;
0082     SessionManager();
0083 };
0084 } //Global::UI
0085 
0086 } //UI
0087 
0088 }
0089 
0090 #endif