Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Anthony LĂ©onard | 2fde81d | 2017-04-17 10:06:55 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015-2017 by Savoir-faire Linux * |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 3 | * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* |
| 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 | |
Edric Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 19 | #pragma once |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 20 | |
Edric Milaret | 2cf3429 | 2015-06-22 16:27:03 -0400 | [diff] [blame] | 21 | #include "globalsystemtray.h" |
| 22 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 23 | #include <QMainWindow> |
| 24 | #include <QMouseEvent> |
Edric Milaret | 28290e3 | 2016-09-07 15:51:41 -0400 | [diff] [blame] | 25 | #include <QNetworkConfigurationManager> |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 26 | |
Olivier SOLDANO | c1ca2df | 2017-09-06 16:01:46 -0400 | [diff] [blame] | 27 | #include "navwidget.h" |
| 28 | |
| 29 | // LRC |
| 30 | #include "call.h" |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 31 | |
Edric Milaret | ed0b280 | 2015-10-01 15:10:02 -0400 | [diff] [blame] | 32 | static constexpr char IDM_ABOUTBOX = 0x0010; |
| 33 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 34 | namespace Ui { |
| 35 | class MainWindow; |
| 36 | } |
| 37 | |
| 38 | class MainWindow : public QMainWindow |
| 39 | { |
| 40 | Q_OBJECT |
| 41 | |
| 42 | public: |
Edric Milaret | 9c3e7f7 | 2016-01-27 10:48:20 -0500 | [diff] [blame] | 43 | inline static MainWindow& instance() { |
| 44 | static auto instance = new MainWindow(); |
| 45 | return *instance; |
| 46 | } |
Edric Milaret | 2cf3429 | 2015-06-22 16:27:03 -0400 | [diff] [blame] | 47 | void createThumbBar(); |
Olivier SOLDANO | 2100f1c | 2017-09-06 16:45:20 -0400 | [diff] [blame] | 48 | bool init(); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 49 | |
Edric Milaret | ed0b280 | 2015-10-01 15:10:02 -0400 | [diff] [blame] | 50 | protected: |
Edric Milaret | db818e5 | 2016-02-02 14:53:19 -0500 | [diff] [blame] | 51 | bool nativeEvent(const QByteArray& eventType, void* message, long* result); |
| 52 | void closeEvent(QCloseEvent* event); |
Nicolas Jager | 97a21b4 | 2015-12-03 16:55:45 -0500 | [diff] [blame] | 53 | |
Edric Milaret | fe39094 | 2015-08-04 13:41:03 -0400 | [diff] [blame] | 54 | public slots: |
| 55 | void onRingEvent(const QString& uri); |
| 56 | |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 57 | private slots: |
| 58 | void trayActivated(QSystemTrayIcon::ActivationReason reason); |
Edric Milaret | db818e5 | 2016-02-02 14:53:19 -0500 | [diff] [blame] | 59 | void onIncomingCall(Call* call); |
Nicolas Jager | 97a21b4 | 2015-12-03 16:55:45 -0500 | [diff] [blame] | 60 | void switchNormalMaximize(); |
Edric Milaret | 568a0e5 | 2016-09-02 16:26:58 -0400 | [diff] [blame] | 61 | void notificationClicked(); |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 62 | |
| 63 | private: |
Edric Milaret | db818e5 | 2016-02-02 14:53:19 -0500 | [diff] [blame] | 64 | explicit MainWindow(QWidget* parent = 0); |
Edric Milaret | 9c3e7f7 | 2016-01-27 10:48:20 -0500 | [diff] [blame] | 65 | ~MainWindow(); |
Nicolas Jager | 97a21b4 | 2015-12-03 16:55:45 -0500 | [diff] [blame] | 66 | Ui::MainWindow* ui; |
Edric Milaret | 28290e3 | 2016-09-07 15:51:41 -0400 | [diff] [blame] | 67 | QNetworkConfigurationManager netManager_; |
Edric Milaret | 627500d | 2015-03-27 16:41:40 -0400 | [diff] [blame] | 68 | }; |