source: SMSSender/frontend/gui/ui/guimanager.h @ 319:1ec456878bcb

separation-frontend-backend
Last change on this file since 319:1ec456878bcb was 319:1ec456878bcb, checked in by Sämy Zehnder <saemy.zehnder@…>, 8 years ago
  • Adjusts header guards to follow common pattern based on the filename.
File size: 2.4 KB
Line 
1/*
2 smssender - A frontend for fast and easy SMS sending over different gateways.
3 Copyright (C) 2007-2014, gorrión. See http://smssender.gorrion.ch
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef FRONTEND_GUI_UI_GUIMANAGER_H
19#define FRONTEND_GUI_UI_GUIMANAGER_H
20
21#include <QMenu>
22#include <QMessageBox>
23#include <QWaitCondition>
24
25#include "common/business/iintegration.h"
26#include "common/domain/sdatatypes.h"
27#include "common/exceptions/eexception.h"
28#include "common/gui/ui/isendingdialog.h"
29#include "frontend/business/settings.h"
30
31namespace UI {
32
33struct _DialogData;
34class GuiManager : public QObject {
35    Q_OBJECT
36
37public:
38    explicit GuiManager(Settings *settings);
39
40public:
41    int execDialog(IDialogWrapper* wrapper);
42    int execDialog(QMessageBox* msgBox);
43    int execErrorDialog(const QString& message, const EException& exception);
44
45    void addMenuAction(IGuiIntegrationHelper::Menu menu, QAction* action);
46
47    void setMainMenu(IGuiIntegrationHelper::Menu menu, QMenu* mainMenu, QAction* actionBefore);
48    ISendingDialog* createNewSendingDialog(QWidget* parent, ISMSSendTask* smsSendTask);
49
50// for execDialog
51signals:
52    void sendingDialogCreated(ISendingDialog *sendingDialog);
53    void sigExecDialog(_DialogData* data);
54
55private slots:
56    void onExecDialog(_DialogData* data);
57
58private:
59    void installMenuAction(IGuiIntegrationHelper::Menu menu, QAction* action);
60
61private:
62    struct MenuEntry {
63        QMenu* menu;
64        QAction* insertPoint;
65
66        bool operator!=(const MenuEntry& other) {
67            return menu != other.menu || insertPoint != other.insertPoint;
68        }
69    };
70
71    Settings * const m_settings;
72    QMap<IGuiIntegrationHelper::Menu, QList<QAction*> > m_menuActions;
73    QMap<IGuiIntegrationHelper::Menu, MenuEntry> m_mainMenues;
74};
75
76} // namespace UI
77
78#endif // FRONTEND_GUI_UI_GUIMANAGER_H
Note: See TracBrowser for help on using the repository browser.