7 #ifndef _FCITX_CONFIG_CONFIGURATION_H_ 8 #define _FCITX_CONFIG_CONFIGURATION_H_ 13 #include <fcitx-config/fcitxconfig_export.h> 14 #include <fcitx-config/option.h> 15 #include <fcitx-config/optiontypename.h> 16 #include <fcitx-config/rawconfig.h> 17 #include <fcitx-utils/macros.h> 19 #define FCITX_CONFIGURATION_EXTEND(NAME, SUBCLASS, ...) \ 21 FCITX_SPECIALIZE_TYPENAME(NAME, #NAME) \ 22 FCITX_CONFIGURATION_CLASS_EXTEND(NAME, SUBCLASS, __VA_ARGS__) 24 #define FCITX_CONFIGURATION(NAME, ...) \ 25 FCITX_CONFIGURATION_EXTEND(NAME, ::fcitx::Configuration, __VA_ARGS__) 27 #define FCITX_CONFIGURATION_CLASS_EXTEND(NAME, SUBCLASS, ...) \ 28 class NAME : public SUBCLASS { \ 31 NAME(const NAME &other) : NAME() { copyHelper(other); } \ 32 NAME &operator=(const NAME &other) { \ 36 bool operator==(const NAME &other) const { \ 37 return compareHelper(other); \ 39 const char *typeName() const override { return #NAME; } \ 45 #define FCITX_CONFIGURATION_CLASS(NAME, ...) \ 46 FCITX_CONFIGURATION_CLASS_EXTEND(NAME, ::fcitx::Configuration, __VA_ARGS__) 50 class ConfigurationPrivate;
61 void load(
const RawConfig &config,
bool partial =
false);
63 void dumpDescription(
RawConfig &config)
const;
64 FCITX_NODISCARD
virtual const char *typeName()
const = 0;
72 void syncDefaultValueToCurrent();
79 void dumpDescriptionImpl(
RawConfig &config,
80 const std::vector<std::string> &parentPaths)
const;
84 std::unique_ptr<ConfigurationPrivate> d_ptr;
88 #endif // _FCITX_CONFIG_CONFIGURATION_H_