7 #ifndef _FCITX_UTILS_DBUS_BUS_H_ 8 #define _FCITX_UTILS_DBUS_BUS_H_ 16 #include <fcitx-utils/event.h> 17 #include <fcitx-utils/fcitxutils_export.h> 19 #include <fcitx-utils/macros.h> 33 class FCITXUTILS_EXPORT
Slot {
38 enum class BusType { Default, Session, System };
39 enum class RequestNameFlag {
41 ReplaceExisting = 1ULL << 0,
42 AllowReplacement = 1ULL << 1,
51 class FCITXUTILS_EXPORT
Bus {
54 Bus(
const std::string &address);
60 Bus(
const Bus &other) =
delete;
64 FCITX_NODISCARD
bool isOpen()
const;
70 void detachEventLoop();
80 FCITX_NODISCARD
EventLoop *eventLoop()
const;
82 FCITX_NODISCARD std::unique_ptr<Slot> addMatch(
const MatchRule &rule,
83 MessageCallback callback);
84 FCITX_NODISCARD std::unique_ptr<Slot> addFilter(MessageCallback callback);
85 FCITX_NODISCARD std::unique_ptr<Slot> addObject(
const std::string &path,
86 MessageCallback callback);
95 bool addObjectVTable(
const std::string &path,
const std::string &interface,
99 Message createSignal(
const char *path,
const char *interface,
103 Message createMethodCall(
const char *destination,
const char *path,
104 const char *interface,
const char *member);
111 static const char *impl();
118 FCITX_NODISCARD
void *nativeHandle()
const;
130 bool releaseName(
const std::string &name);
139 std::string serviceOwner(
const std::string &name, uint64_t usec);
140 std::unique_ptr<Slot> serviceOwnerAsync(
const std::string &name,
142 MessageCallback callback);
149 std::string uniqueName();
156 std::string address();
164 std::unique_ptr<BusPrivate> d_ptr;
165 FCITX_DECLARE_PRIVATE(
Bus);
169 #endif // _FCITX_UTILS_DBUS_BUS_H_ Basic DBus type of a DBus message.
A dbus matching rule to be used with add match.
Virtual base class represent some internal registration of the bus.
A class that represents a connection to the Bus.
High level API for dbus objects.
API for DBus matching rule.
Class provides bit flag support for Enum.
Helper template class to make easier to use type safe enum flags.