GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
resource-manager.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_resource_manager_h)
27 #define octave_resource_manager_h 1
28 
29 #include <QComboBox>
30 #include <QIcon>
31 #include <QPointer>
32 #include <QTranslator>
33 #include <QTemporaryFile>
34 
35 #include "gui-settings.h"
36 
37 namespace octave
38 {
39  class resource_manager : public QObject
40  {
41  Q_OBJECT
42 
43  protected:
44 
45  public:
46 
47  resource_manager (void);
48 
49  // No copying!
50 
52 
54 
56 
57  QString get_gui_translation_dir (void);
58 
59  void config_translators (QTranslator *qt_tr, QTranslator *qsci_tr,
60  QTranslator *gui_tr);
61 
62  gui_settings * get_settings (void) const;
63 
64  gui_settings * get_default_settings (void) const;
65 
66  QString get_settings_directory (void);
67 
68  QString get_settings_file (void);
69 
70  QString get_default_font_family (void);
71 
72  QPointer<QTemporaryFile>
73  create_tmp_file (const QString& extension = QString (),
74  const QString& contents = QString ());
75 
76  void remove_tmp_file (QPointer<QTemporaryFile> tmp_file);
77 
78  void reload_settings (void);
79 
80  void set_settings (const QString& file);
81 
82  bool update_settings_key (const QString& new_key, const QString& old_key);
83 
84  bool is_first_run (void) const;
85 
86  void update_network_settings (void);
87 
88  QIcon icon (const QString& icon_name, bool fallback = true);
89 
90  void get_codecs (QStringList *codecs);
91 
92  void combo_encoding (QComboBox *combo, const QString& current = QString ());
93 
94  private:
95 
97 
98  QString m_settings_file;
99 
101 
103 
105  };
106 }
107 
108 #endif
QString get_default_font_family(void)
void combo_encoding(QComboBox *combo, const QString &current=QString())
gui_settings * get_settings(void) const
resource_manager & operator=(const resource_manager &)=delete
gui_settings * get_default_settings(void) const
void get_codecs(QStringList *codecs)
resource_manager(const resource_manager &)=delete
gui_settings * m_default_settings
QString get_gui_translation_dir(void)
bool is_first_run(void) const
QList< QTemporaryFile * > m_temporary_files
QPointer< QTemporaryFile > create_tmp_file(const QString &extension=QString(), const QString &contents=QString())
QIcon icon(const QString &icon_name, bool fallback=true)
void remove_tmp_file(QPointer< QTemporaryFile > tmp_file)
bool update_settings_key(const QString &new_key, const QString &old_key)
QString get_settings_directory(void)
void set_settings(const QString &file)
void config_translators(QTranslator *qt_tr, QTranslator *qsci_tr, QTranslator *gui_tr)