application.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. */
  14. #ifndef APPLICATION_H
  15. #define APPLICATION_H
  16. #include <QApplication>
  17. #include <QSystemTrayIcon>
  18. #include "mirall/syncresult.h"
  19. #include "mirall/folder.h"
  20. #include "mirall/folderman.h"
  21. class QAction;
  22. class QMenu;
  23. class QSystemTrayIcon;
  24. class QNetworkConfigurationManager;
  25. class QSignalMapper;
  26. class QSplashScreen;
  27. namespace Mirall {
  28. class Theme;
  29. class FolderWatcher;
  30. class FolderWizard;
  31. class StatusDialog;
  32. class OwncloudSetupWizard;
  33. class Application : public QApplication
  34. {
  35. Q_OBJECT
  36. public:
  37. explicit Application(int argc, char **argv);
  38. ~Application();
  39. signals:
  40. protected slots:
  41. void slotAddFolder();
  42. void slotRemoveFolder( const QString& );
  43. #ifdef HAVE_FETCH_AND_PUSH
  44. void slotFetchFolder( const QString& );
  45. void slotPushFolder( const QString& );
  46. #endif
  47. void slotEnableFolder( const QString&, const bool );
  48. void slotInfoFolder( const QString& );
  49. void slotConfigure();
  50. void slotSyncStateChange( const QString& );
  51. protected:
  52. void setupActions();
  53. void setupSystemTray();
  54. void setupContextMenu();
  55. //folders have to be disabled while making config changes
  56. void computeOverallSyncStatus();
  57. protected slots:
  58. void slotTrayClicked( QSystemTrayIcon::ActivationReason );
  59. void slotFolderOpenAction(const QString & );
  60. void slotHideSplash();
  61. private:
  62. // configuration file -> folder
  63. QSystemTrayIcon *_tray;
  64. QAction *_actionQuit;
  65. QAction *_actionAddFolder;
  66. QAction *_actionConfigure;
  67. QNetworkConfigurationManager *_networkMgr;
  68. FolderWizard *_folderWizard;
  69. OwncloudSetupWizard *_owncloudSetupWizard;
  70. // tray's menu
  71. QMenu *_contextMenu;
  72. StatusDialog *_statusDialog;
  73. FolderMan *_folderMan;
  74. Theme *_theme;
  75. QSignalMapper *_folderOpenActionMapper;
  76. QSplashScreen *_splash;
  77. };
  78. } // namespace Mirall
  79. #endif // APPLICATION_H