File indexing completed on 2024-04-28 08:47:32

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef CHOQOKUIGLOBAL_H
0010 #define CHOQOKUIGLOBAL_H
0011 
0012 #include <QObject>
0013 
0014 #include "choqokmainwindow.h"
0015 #include "choqok_export.h"
0016 
0017 #define choqokMainWindow Choqok::UI::Global::mainWindow()
0018 
0019 namespace Choqok
0020 {
0021 
0022 class Account;
0023 
0024 namespace UI
0025 {
0026 class PostWidget;
0027 class QuickPost;
0028 
0029 /**
0030 * This namespace contains the Choqok user interface's global widgets
0031 * UI Plugins can use these
0032 */
0033 namespace Global
0034 {
0035 /**
0036 * Set the main widget to widget
0037 */
0038 CHOQOK_EXPORT void setMainWindow(Choqok::UI::MainWindow *window);
0039 /**
0040 * Returns the main widget - this is the widget that message boxes
0041 * and KNotify stuff should use as a parent.
0042 */
0043 CHOQOK_EXPORT Choqok::UI::MainWindow *mainWindow();
0044 
0045 CHOQOK_EXPORT void setQuickPostWidget(QuickPost *quickPost);
0046 
0047 CHOQOK_EXPORT QuickPost *quickPostWidget();
0048 
0049 class CHOQOK_EXPORT SessionManager : public QObject
0050 {
0051     Q_OBJECT
0052 public:
0053     ~SessionManager();
0054     static SessionManager *self();
0055     void emitNewPostWidgetAdded(Choqok::UI::PostWidget *widget, Choqok::Account *theAccount,
0056                                 const QString &timelineName = QString());
0057 
0058 Q_SIGNALS:
0059     void newPostWidgetAdded(Choqok::UI::PostWidget *widget, Choqok::Account *theAccount,
0060                             const QString &timelineName);
0061 
0062 public Q_SLOTS:
0063     void resetNotifyManager();
0064 
0065 private:
0066     static SessionManager *m_self;
0067     SessionManager();
0068 };
0069 } //Global::UI
0070 
0071 } //UI
0072 
0073 }
0074 
0075 #endif