| 1 | /* |
| 2 | * This file is part of lomiri-online-accounts-ui |
| 3 | * |
| 4 | * Copyright (C) 2014 Canonical Ltd. |
| 5 | * |
| 6 | * Contact: Alberto Mardegan <[email protected]> |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 3, as published |
| 10 | * by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef SIGNON_UI_DIALOG_H |
| 22 | #define SIGNON_UI_DIALOG_H |
| 23 | |
| 24 | #include <QObject> |
| 25 | #include <QQuickView> |
| 26 | |
| 27 | namespace SignOnUi { |
| 28 | |
| 29 | class Dialog: public QQuickView |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | |
| 33 | public: |
| 34 | enum DialogCode { |
| 35 | Rejected = 0, |
| 36 | Accepted, |
| 37 | }; |
| 38 | enum ShowMode { |
| 39 | TopLevel = 0, |
| 40 | Transient, |
| 41 | Embedded, |
| 42 | }; |
| 43 | explicit Dialog(QWindow *parent = 0); |
| 44 | ~Dialog(); |
| 45 | |
| 46 | void show(WId parent, ShowMode mode); |
| 47 | |
| 48 | public Q_SLOTS: |
| 49 | void accept(); |
| 50 | void reject(); |
| 51 | void done(int result); |
| 52 | |
| 53 | Q_SIGNALS: |
| 54 | void finished(int result); |
| 55 | |
| 56 | protected: |
| 57 | bool event(QEvent *e); |
| 58 | }; |
| 59 | |
| 60 | } // namespace |
| 61 | |
| 62 | #endif // SIGNON_UI_DIALOG_H |