ProjectSettingsModel.hpp
1 #pragma once
2 #include <score/command/SettingsCommand.hpp>
3 #include <score/plugins/documentdelegate/plugin/DocumentPlugin.hpp>
4 
5 #include <score_lib_base_export.h>
6 namespace score
7 {
8 class SCORE_LIB_BASE_EXPORT ProjectSettingsModel : public SerializableDocumentPlugin
9 {
10 public:
11  using SerializableDocumentPlugin::SerializableDocumentPlugin;
12  virtual ~ProjectSettingsModel();
13 };
14 }
15 
16 #define SCORE_PROJECTSETTINGS_PARAMETER_TYPE(ModelType, Name) \
17  struct Name##Parameter \
18  { \
19  using model_type = ModelType; \
20  using param_type = decltype(ModelType().get##Name()); \
21  static const constexpr auto getter = &model_type::get##Name; \
22  static const constexpr auto setter = &model_type::set##Name; \
23  };
24 
25 #define SCORE_PROJECTSETTINGS_COMMAND(Name) \
26  struct Set##Name : public score::ProjectSettingsCommand<Name##Parameter> \
27  { \
28  SCORE_PROJECTSETTINGS_COMMAND_DECL(Set##Name) \
29  };
30 
31 #define SCORE_PROJECTSETTINGS_PARAMETER(ModelType, Name) \
32  SCORE_PROJECTSETTINGS_PARAMETER_TYPE(ModelType, Name) \
33  SCORE_PROJECTSETTINGS_COMMAND(Name)
Definition: ProjectSettingsModel.hpp:9
Document plug-in with serializable data.
Definition: SerializableDocumentPlugin.hpp:28
Base toolkit upon which the software is built.
Definition: Application.cpp:90