BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ApplicationSettings.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Application/ApplicationSettings.h
6 //! @brief Defines class ApplicationSettings
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_APPLICATION_APPLICATIONSETTINGS_H
16 #define BORNAGAIN_GUI_APPLICATION_APPLICATIONSETTINGS_H
17 
18 #include <QColor>
19 
20 class QWidget;
21 class QVariant;
22 
23 //! Application wide settings.
24 //!
25 //! Contains settings which the user can change. Also
26 //! contains settings which may be user editable in the future.
28 public:
29  enum class Style { native, light, dark };
30 
32 
33  bool useNativeFileDialog() const;
34  bool createNewProjectOnStartup() const;
35  void setCreateNewProjectOnStartup(bool b);
36  Style styleToUse() const;
37  void setStyleToUse(Style style);
38 
39  QVariant defaultFunctionalities(const QVariant& absenceValue) const;
40  void setDefaultFunctionalities(const QVariant& functionalities);
41 
42  bool defaultIsSingleInstrumentMode() const;
44 
45  bool defaultIsSingleSampleMode() const;
46  void setDefaultIsSingleSampleMode(bool b);
47 
48  bool defaultUnitIsAngstrom() const;
49  void setDefaultUnitIsAngstrom(bool b) const;
50 
51  void saveWindowSizeAndPos(const QWidget* w);
52  void loadWindowSizeAndPos(QWidget* w);
53 
56 
57  struct Palette {
58  QColor headlineText;
60  };
61 
62  const Palette& styleSheetPalette() const;
63 
64 private:
67 };
68 
69 extern ApplicationSettings* appSettings; //!< global pointer to the single instance
70 
71 #endif // BORNAGAIN_GUI_APPLICATION_APPLICATIONSETTINGS_H
ApplicationSettings * appSettings
global pointer to the single instance
Application wide settings.
void setStyleToUse(Style style)
void setDefaultIsSingleInstrumentMode(bool b)
void setDefaultUnitIsAngstrom(bool b) const
void loadWindowSizeAndPos(QWidget *w)
bool defaultIsSingleSampleMode() const
const Palette & styleSheetPalette() const
bool defaultIsSingleInstrumentMode() const
void saveWindowSizeAndPos(const QWidget *w)
bool useNativeFileDialog() const
ApplicationSettings::Style currentStyle()
bool createNewProjectOnStartup() const
void setDefaultFunctionalities(const QVariant &functionalities)
void setDefaultIsSingleSampleMode(bool b)
QVariant defaultFunctionalities(const QVariant &absenceValue) const
bool defaultUnitIsAngstrom() const
void loadStyle(ApplicationSettings::Style style)
ApplicationSettings::Style m_currentStyle
void setCreateNewProjectOnStartup(bool b)