Elaztek Developer Hub
Blamite Game Engine - Keystone  00368.02.12.23.1347.blamite
A library that enables the use of Qt in Blamite's editing tools.
themes.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <map>
6 #include <Strings/components/resources/resources.h>
7 
9 
10 #ifndef KEYSTONE
11 #define KEYSTONE
12 #endif
13 
17 #define DEFAULT_QT_STYLE "windowsvista"
18 
23 {
25  User,
27 };
28 
35 {
36  std::string name;
37  std::map<std::string, std::string> properties;
38 };
39 
48 {
49 private:
50  std::string name;
51  std::string author;
52  std::string description;
53  std::string version;
54  std::string base_qt_style;
55 
56  BlamEditorThemeType theme_type;
57 
58  std::string stylesheet;
59  std::string content_dir;
60 
61  std::vector<BlamEditorThemeVariant> variants;
62  std::map<std::string, BlamResourceGroup> resource_group_overrides;
63 
64 public:
65 
78  BlamEditorTheme(std::string _name, std::string _author, std::string _desc, std::string _ver, BlamEditorThemeType type, std::string _content_dir);
79 
92  BlamEditorTheme(std::string _name, std::string _author, std::string _desc, std::string _ver, BlamEditorThemeType type, std::string _stylesheet,
93  std::string _qt_style, std::vector<BlamEditorThemeVariant> _variants, std::string _content_dir,
94  std::map<std::string, BlamResourceGroup> _resource_group_overrides);
95 
101  bool ApplyTheme();
102 
110  bool ApplyVariant(std::string variant_name);
111 
117  std::string GetName();
118 
124  std::string GetAuthor();
125 
131  std::string GetDescription();
132 
138  std::string GetVersion();
139 
146 
152  std::string GetStylesheet();
153 
159  std::vector<BlamEditorThemeVariant> GetVariants();
160 
170  std::string GetResource(std::string group_id, std::string id);
171 };
172 
177 {
183  KEYSTONE bool LoadThemes();
184 
192  KEYSTONE bool ApplyTheme(std::string name);
193 
199  KEYSTONE std::vector<BlamEditorTheme>* GetThemeList();
200 
208  KEYSTONE BlamEditorTheme* GetTheme(std::string name);
209 
216 
225 
232 
239 }
BlamEditorThemeVariant::properties
std::map< std::string, std::string > properties
The list of properties for this theme variant.
Definition: themes.h:37
BlamEditorTheme::GetResource
std::string GetResource(std::string group_id, std::string id)
Retrieves a resource path from the theme.
Definition: BlamEditorTheme.cpp:170
BlamEditorTheme::GetAuthor
std::string GetAuthor()
Retrieves the theme author.
Definition: BlamEditorTheme.cpp:140
KeystoneThemeChangeReceiver
Interface used to listen to theme change events.
Definition: KeystoneThemeChangeReceiver.h:10
BlamKeystone::Themes::UpdateActiveTheme
KEYSTONE void UpdateActiveTheme(BlamEditorTheme *theme)
Updates the stored index of the current active theme.
Definition: themes.cpp:345
BlamKeystone::Themes
Namespace containing functions for the Keystone theme component.
Definition: themes.h:176
BlamEditorThemeType
BlamEditorThemeType
Enumerator for all possible theme types.
Definition: themes.h:22
BuiltIn
@ BuiltIn
Indicates the theme is a built-in theme, provided by Elaztek.
Definition: themes.h:24
BlamEditorTheme::ApplyVariant
bool ApplyVariant(std::string variant_name)
Applies a specified theme variant to the application.
Definition: BlamEditorTheme.cpp:81
BlamEditorTheme
Class representing a Blamite Editor Theme.
Definition: themes.h:47
BlamEditorThemeVariant::name
std::string name
The name of this theme variant.
Definition: themes.h:36
KEYSTONE
#define KEYSTONE
Definition: themes.h:11
BlamEditorTheme::GetVariants
std::vector< BlamEditorThemeVariant > GetVariants()
Retrieves the list of theme variants.
Definition: BlamEditorTheme.cpp:165
BlamEditorThemeVariant
Structure representing a theme variant.
Definition: themes.h:34
BlamKeystone::Themes::ApplyTheme
KEYSTONE bool ApplyTheme(std::string name)
Applies a new theme to the application.
Definition: themes.cpp:300
BlamEditorTheme::GetVersion
std::string GetVersion()
Retrieves the theme version.
Definition: BlamEditorTheme.cpp:150
BlamKeystone::Themes::GetActiveTheme
KEYSTONE BlamEditorTheme * GetActiveTheme()
Retrieves the currently selected theme.
Definition: themes.cpp:335
BlamKeystone::Themes::RemoveReceiver
KEYSTONE void RemoveReceiver(KeystoneThemeChangeReceiver *receiver)
Unregisters a theme change receiver.
Definition: themes.cpp:378
BlamEditorTheme::ApplyTheme
bool ApplyTheme()
Applies this theme to the application.
Definition: BlamEditorTheme.cpp:37
BlamKeystone::Themes::LoadThemes
KEYSTONE bool LoadThemes()
Loads all themes from Qt and the keystone theme folders.
Definition: themes.cpp:259
BlamEditorTheme::GetDescription
std::string GetDescription()
Retrieves the theme description.
Definition: BlamEditorTheme.cpp:145
BlamKeystone::Themes::GetTheme
KEYSTONE BlamEditorTheme * GetTheme(std::string name)
Retrieves a theme.
Definition: themes.cpp:320
BlamEditorTheme::GetName
std::string GetName()
Retrieves the theme name.
Definition: BlamEditorTheme.cpp:135
BlamEditorTheme::GetThemeType
BlamEditorThemeType GetThemeType()
Retrieves the theme type.
Definition: BlamEditorTheme.cpp:155
User
@ User
Indicates the theme is a custom theme added by the user.
Definition: themes.h:25
BlamKeystone::Themes::AddReceiver
KEYSTONE void AddReceiver(KeystoneThemeChangeReceiver *receiver)
Registers a new theme change receiver, which will be notified whenever the active theme changes.
Definition: themes.cpp:370
KeystoneThemeChangeReceiver.h
BlamEditorTheme::BlamEditorTheme
BlamEditorTheme(std::string _name, std::string _author, std::string _desc, std::string _ver, BlamEditorThemeType type, std::string _content_dir)
Prepares a new Editor Theme.
Definition: BlamEditorTheme.cpp:25
BlamEditorTheme::GetStylesheet
std::string GetStylesheet()
Retrieves the theme stylesheet.
Definition: BlamEditorTheme.cpp:160
QtTheme
@ QtTheme
Indicates the theme is a default theme made available from Qt.
Definition: themes.h:26
BlamKeystone::Themes::GetThemeList
KEYSTONE std::vector< BlamEditorTheme > * GetThemeList()
Retrieves the list of loaded themes.
Definition: themes.cpp:315