10 #ifndef KDSINGLEAPPLICATION_H
11 #define KDSINGLEAPPLICATION_H
13 #include <QtCore/QObject>
14 #include <QtCore/QFlags>
20 class KDSingleApplicationPrivate;
25 Q_PROPERTY(QString name READ name CONSTANT)
26 Q_PROPERTY(
bool isPrimaryInstance READ isPrimaryInstance CONSTANT)
33 IncludeUsernameInSocketName = 0x1,
34 IncludeSessionInSocketName = 0x2,
36 Q_DECLARE_FLAGS(Options, Option)
40 explicit KDSingleApplication(
const QString &name, Options options, QObject *parent =
nullptr);
44 bool isPrimaryInstance()
const;
48 bool sendMessage(
const QByteArray &message);
49 bool sendMessageWithTimeout(
const QByteArray &message,
int timeout);
56 std::unique_ptr<KDSingleApplicationPrivate> d_ptr;
59 Q_DECLARE_OPERATORS_FOR_FLAGS(KDSingleApplication::Options)
void messageReceived(const QByteArray &message)
#define KDSINGLEAPPLICATION_EXPORT