blob: ae51ac6a78982e6fe9738669b42ddb95535e39e9 [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2020 by Savoir-faire Linux
3 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>
4 * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
5 * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <QFile>
24#include <QApplication>
25#include <QQmlApplicationEngine>
26#include <QQmlEngine>
27
28#include <memory>
29
30class MainApplication : public QApplication
31{
32 Q_OBJECT
33
34public:
35 explicit MainApplication(int &argc, char **argv);
36 ~MainApplication();
37
38 bool applicationSetup();
39 void exitApp();
40
41 static void applicationInitialization();
42 static QString getDebugFilePath();
43 static char **parseInputArgument(int &argc, char *argv[], char *argToParse);
44
45protected:
46 void consoleDebug();
47 void vsConsoleDebug();
48 void fileDebug(QFile *debugFile);
49
50private:
51 void loadTranslations();
52 void initLrc();
53 void processInputArgument(bool &startMinimized);
54 void setApplicationFont();
55 void qmlInitialization();
56
57 std::unique_ptr<QFile> debugFile_;
58 QQmlApplicationEngine *engine_;
59};