7 #ifndef _FCITX_UTILS_DBUS_MATCHRULE_H_ 8 #define _FCITX_UTILS_DBUS_MATCHRULE_H_ 16 #include <fcitx-utils/fcitxutils_export.h> 17 #include <fcitx-utils/macros.h> 26 class MatchRulePrivate;
38 explicit MatchRule(std::string service, std::string path =
"",
39 std::string interface =
"", std::string name =
"",
40 std::vector<std::string> argumentMatch = {});
41 explicit MatchRule(MessageType type, std::string service,
42 std::string destination =
"", std::string path =
"",
43 std::string interface =
"", std::string name =
"",
44 std::vector<std::string> argumentMatch = {},
45 bool eavesdrop =
false);
47 FCITX_DECLARE_VIRTUAL_DTOR_COPY_AND_MOVE(
MatchRule)
49 MessageType messageType()
const noexcept;
51 const std::string &rule()
const noexcept;
53 const std::string &service()
const noexcept;
54 const std::string &destination()
const noexcept;
55 const std::string &path()
const noexcept;
56 const std::string &interface()
const noexcept;
57 const std::string &name()
const noexcept;
58 const std::vector<std::string> &argumentMatch()
const noexcept;
59 bool eavesdrop()
const noexcept;
61 bool check(
Message &,
const std::string &alterName = {})
const;
63 bool operator==(
const MatchRule &other)
const {
64 return rule() == other.rule();
67 bool operator!=(
const MatchRule &other)
const {
return !(*
this == other); }
69 static const std::string nullArg;
72 std::unique_ptr<MatchRulePrivate> d_ptr;
81 struct hash<
fcitx::dbus::MatchRule> {
83 return std::hash<std::string>()(rule.rule());
88 #endif // _FCITX_UTILS_DBUS_MATCHRULE_H_ Basic DBus type of a DBus message.
A dbus matching rule to be used with add match.