7 #ifndef _FCITX_CONFIG_CONFIGURATION_H_ 8 #define _FCITX_CONFIG_CONFIGURATION_H_ 10 #include <fcitx-config/option.h> 11 #include <fcitx-utils/macros.h> 12 #include "fcitxconfig_export.h" 16 #define FCITX_CONFIGURATION_EXTEND(NAME, SUBCLASS, ...) \ 18 FCITX_SPECIALIZE_TYPENAME(NAME, #NAME) \ 19 FCITX_CONFIGURATION_CLASS_EXTEND(NAME, SUBCLASS, __VA_ARGS__) 21 #define FCITX_CONFIGURATION(NAME, ...) \ 22 FCITX_CONFIGURATION_EXTEND(NAME, ::fcitx::Configuration, __VA_ARGS__) 24 #define FCITX_CONFIGURATION_CLASS_EXTEND(NAME, SUBCLASS, ...) \ 25 class NAME : public SUBCLASS { \ 28 NAME(const NAME &other) : NAME() { copyHelper(other); } \ 29 NAME &operator=(const NAME &other) { \ 33 bool operator==(const NAME &other) const { \ 34 return compareHelper(other); \ 36 const char *typeName() const override { return #NAME; } \ 42 #define FCITX_CONFIGURATION_CLASS(NAME, ...) \ 43 FCITX_CONFIGURATION_CLASS_EXTEND(NAME, ::fcitx::Configuration, __VA_ARGS__) 47 class ConfigurationPrivate;
58 void load(
const RawConfig &config,
bool partial =
false);
60 void dumpDescription(
RawConfig &config)
const;
61 FCITX_NODISCARD
virtual const char *typeName()
const = 0;
69 void syncDefaultValueToCurrent();
76 void dumpDescriptionImpl(
RawConfig &config,
77 const std::vector<std::string> &parentPaths)
const;
81 std::unique_ptr<ConfigurationPrivate> d_ptr;
85 #endif // _FCITX_CONFIG_CONFIGURATION_H_