1 /*
2     SPDX-FileCopyrightText: 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
3 
4     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5 */
6 
7 #ifndef APPLICATION_H
8 #define APPLICATION_H
9 
10 #include "artikulatecore_export.h"
11 #include <QApplication>
12 
13 class IResourceRepository;
14 class IEditableRepository;
15 class Application;
16 
17 #if defined(artikulateApp)
18 #undef artikulateApp
19 #endif
20 #define artikulateApp (static_cast<Application *>(QCoreApplication::instance()))
21 
22 class ARTIKULATECORE_EXPORT Application : public QApplication
23 {
24     Q_OBJECT
25 
26 public:
27     explicit Application(int &argc, char **argv);
28 
29     /**
30      * @brief install global course data repository to application
31      * @param repository the concrete resource repository to install
32      */
33     void installResourceRepository(IResourceRepository *repository);
34 
35     /**
36      * @brief getter for global resource repository
37      * @return the repository
38      */
39     IResourceRepository *resourceRepository() const;
40 
41     /**
42      * @brief getter for global editable repository
43      * @return the repository
44      */
45     IEditableRepository *editableRepository() const;
46 
47 private:
48     void registerQmlTypes();
49     IResourceRepository *m_resourceRepository {nullptr};
50 };
51 
52 #endif
53