blob: f40b837a53c49729da335d0e03b517a262d8770f [file] [log] [blame]
Edric Milaret627500d2015-03-27 16:41:40 -04001/***************************************************************************
Edric Milaretbab169d2016-01-07 15:13:33 -05002 * Copyright (C) 2015-2016 by Savoir-faire Linux *
Edric Milaret627500d2015-03-27 16:41:40 -04003 * 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 Milaret5f316da2015-09-28 11:57:42 -040019#pragma once
Edric Milaret627500d2015-03-27 16:41:40 -040020
Edric Milaret2cf34292015-06-22 16:27:03 -040021#include "globalsystemtray.h"
22
Edric Milaret627500d2015-03-27 16:41:40 -040023#include <QMainWindow>
24#include <QMouseEvent>
Edric Milaret627500d2015-03-27 16:41:40 -040025
26#include "navstack.h"
27
Edric Milareted0b2802015-10-01 15:10:02 -040028static constexpr char IDM_ABOUTBOX = 0x0010;
29
Nicolas Jager97a21b42015-12-03 16:55:45 -050030class WindowBarUpOne;
31class MainWindowToolBar;
32
Edric Milaret627500d2015-03-27 16:41:40 -040033namespace Ui {
34class MainWindow;
35}
36
37class MainWindow : public QMainWindow
38{
39 Q_OBJECT
40
41public:
42 explicit MainWindow(QWidget *parent = 0);
43 ~MainWindow();
Edric Milaret2cf34292015-06-22 16:27:03 -040044 void createThumbBar();
Edric Milaret627500d2015-03-27 16:41:40 -040045
Edric Milareted0b2802015-10-01 15:10:02 -040046protected:
47 bool nativeEvent(const QByteArray &eventType, void *message, long *result);
Nicolas Jager97a21b42015-12-03 16:55:45 -050048
Edric Milaret627500d2015-03-27 16:41:40 -040049private slots:
50 void trayActivated(QSystemTrayIcon::ActivationReason reason);
Edric Milaret3a23e492015-04-29 14:23:48 -040051 void onIncomingCall(Call *call);
Nicolas Jager97a21b42015-12-03 16:55:45 -050052 void switchNormalMaximize();
Edric Milaret627500d2015-03-27 16:41:40 -040053
54private:
Nicolas Jager97a21b42015-12-03 16:55:45 -050055 Ui::MainWindow* ui;
Edric Milaret627500d2015-03-27 16:41:40 -040056 NavStack* navStack_;
Nicolas Jager97a21b42015-12-03 16:55:45 -050057 WindowBarUpOne* wbOne_;
58 MainWindowToolBar* mwToolBar_;
Edric Milaret627500d2015-03-27 16:41:40 -040059};