LibrePCB Developers Documentation
application.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_CORE_APPLICATION_H
21 #define LIBREPCB_CORE_APPLICATION_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <QtCore>
27 
28 /*******************************************************************************
29  * Namespace / Forward Declarations
30  ******************************************************************************/
31 namespace librepcb {
32 
33 class FilePath;
34 class StrokeFont;
35 class StrokeFontPool;
36 class Version;
37 
38 /*******************************************************************************
39  * Class Application
40  ******************************************************************************/
41 
45 class Application final {
46 public:
47  // Constructors / Destructor
48  Application() = delete;
49  Application(const Application& other) = delete;
50  ~Application() = delete;
51 
52  // Getters
53 
61  static QString getVersion() noexcept;
62 
70  static QString getGitRevision() noexcept;
71 
79  static QDateTime getBuildDate() noexcept;
80 
88  static QString getBuildAuthor() noexcept;
89 
97  static const Version& getFileFormatVersion() noexcept;
98 
107  static bool isFileFormatStable() noexcept;
108 
116  static const FilePath& getResourcesDir() noexcept;
117 
123  static QStringList getTranslationLocales() noexcept;
124 
134  static const QFont& getDefaultSansSerifFont() noexcept;
135 
145  static const QFont& getDefaultMonospaceFont() noexcept;
146 
154  static const StrokeFontPool& getStrokeFonts() noexcept;
155 
163  static const StrokeFont& getDefaultStrokeFont() noexcept;
164 
172  static QString getDefaultStrokeFontName() noexcept;
173 
174  // General Methods
175 
181  static void loadBundledFonts() noexcept;
182 
188  static void setTranslationLocale(const QLocale& locale) noexcept;
189 
190  // Operator Overloadings
191  Application& operator=(const Application& rhs) = delete;
192 };
193 
194 /*******************************************************************************
195  * End of File
196  ******************************************************************************/
197 
198 } // namespace librepcb
199 
200 #endif
static const Version & getFileFormatVersion() noexcept
Get the used file format version.
Definition: application.cpp:62
The Version class represents a version number in the format "1.42.7".
Definition: version.h:58
static bool isFileFormatStable() noexcept
Check whether the used file format is stable.
Definition: application.cpp:69
static QString getGitRevision() noexcept
Get the git revision of the sources used to build the application.
Definition: application.cpp:46
static void loadBundledFonts() noexcept
Load all bundled fonts to make them available in the application.
Definition: application.cpp:202
Definition: occmodel.cpp:76
static const QFont & getDefaultMonospaceFont() noexcept
Get the default monospace font.
Definition: application.cpp:157
static QDateTime getBuildDate() noexcept
Get the date/time when the application was built.
Definition: application.cpp:50
static const FilePath & getResourcesDir() noexcept
Get the path to the resources directory.
Definition: application.cpp:73
Application & operator=(const Application &rhs)=delete
static void setTranslationLocale(const QLocale &locale) noexcept
Install all translators for a given locale.
Definition: application.cpp:215
static QString getVersion() noexcept
Get the application version.
Definition: application.cpp:42
static QString getDefaultStrokeFontName() noexcept
Get the name of the default stroke font.
Definition: application.cpp:194
static const StrokeFont & getDefaultStrokeFont() noexcept
Get the default stroke font.
Definition: application.cpp:190
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:127
static const StrokeFontPool & getStrokeFonts() noexcept
Get all globally available stroke fonts.
Definition: application.cpp:171
static QStringList getTranslationLocales() noexcept
Get all available translation locales.
Definition: application.cpp:126
The StrokeFontPool class.
Definition: strokefontpool.h:46
The StrokeFont class.
Definition: strokefont.h:54
static QString getBuildAuthor() noexcept
Get the author who has built the application.
Definition: application.cpp:58
static const QFont & getDefaultSansSerifFont() noexcept
Get the default sans serif font.
Definition: application.cpp:143
Static functions to access some global application configuration.
Definition: application.h:45