File indexing completed on 2024-05-05 13:19:44
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 MAINWINDOW_H 0010 #define MAINWINDOW_H 0011 0012 #include <QHideEvent> 0013 #include <QPointer> 0014 #include <QShowEvent> 0015 0016 #include "choqokmainwindow.h" 0017 #include "account.h" 0018 #include "plugin.h" 0019 0020 class QAction; 0021 class QPushButton; 0022 class QSplashScreen; 0023 class ChoqokApplication; 0024 namespace Choqok 0025 { 0026 namespace UI 0027 { 0028 class QuickPost; 0029 } 0030 } 0031 class KCMultiDialog; 0032 0033 class SysTrayIcon; 0034 0035 /** 0036 * This class serves as the main window for Choqok. It handles the 0037 * menus, toolbars, and status bars. 0038 * 0039 * @short Main window class 0040 * @author Mehrdad Momeny \<mehrdad.momeny@gmail.com\> 0041 */ 0042 0043 class MainWindow : public Choqok::UI::MainWindow 0044 { 0045 Q_OBJECT 0046 public: 0047 /** 0048 * Default Constructor 0049 */ 0050 MainWindow(ChoqokApplication *application); 0051 0052 /** 0053 * Default Destructor 0054 */ 0055 virtual ~MainWindow(); 0056 0057 protected: 0058 virtual void hideEvent(QHideEvent *event) override; 0059 virtual void showEvent(QShowEvent *) override; 0060 0061 private Q_SLOTS: 0062 void nextTab(int delta, Qt::Orientation orientation); 0063 void loadAllAccounts(); 0064 void newPluginAvailable(Choqok::Plugin *plugin); 0065 void addBlog(Choqok::Account *account, bool isStartup = false); 0066 void updateBlog(Choqok::Account *account, bool enabled); 0067 void removeBlog(const QString &alias); 0068 void setTimeLineUpdatesEnabled(bool isEnabled); 0069 void setNotificationsEnabled(bool isEnabled); 0070 void triggerQuickPost(); 0071 void toggleMainWindow(); 0072 void slotMarkAllAsRead(); 0073 void slotUpdateTimelines(); 0074 void slotUploadMedium(); 0075 0076 void slotAppearanceConfigChanged(); 0077 void slotBehaviorConfigChanged(); 0078 void slotConfNotifications(); 0079 void slotConfigChoqok(); 0080 void settingsChanged(); 0081 void slotQuit(); 0082 void showBlog(); 0083 void slotUpdateUnreadCount(int change, int sum); 0084 void slotCurrentBlogChanged(int); 0085 0086 //Using this for splash screen 0087 void oneMicroblogLoaded(); 0088 void slotShowSpecialMenu(bool show); 0089 0090 private: 0091 void updateTabbarHiddenState(); 0092 void setupActions(); 0093 void createQuickPostDialog(); 0094 void disableApp(); 0095 void enableApp(); 0096 void updateSysTray(); 0097 0098 int mPrevUpdateInterval; 0099 SysTrayIcon *sysIcon; 0100 Choqok::UI::QuickPost *quickWidget; 0101 KCMultiDialog *s_settingsDialog; 0102 QPointer<QSplashScreen> m_splash; 0103 QAction *enableUpdates; 0104 QAction *newTwit; 0105 QAction *showMain; 0106 QAction *actQuit; 0107 QAction *actUpdate; 0108 QAction *prefs; 0109 QAction *aboutChoqok; 0110 QPushButton *choqokMainButton; 0111 ChoqokApplication *app; 0112 0113 int microblogCounter; 0114 bool choqokMainButtonVisible; 0115 }; 0116 0117 #endif