QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLocalPeer.h
Go to the documentation of this file.
1 #ifndef RLOCALPEER_H
2 #define RLOCALPEER_H
3 
4 #include <QLocalServer>
5 #include <QLocalSocket>
6 #include <QDir>
7 
8 #include "RLockedFile.h"
9 
10 class RLocalPeer : public QObject {
11  Q_OBJECT
12 
13 public:
14  RLocalPeer(QObject* parent=0, const QString& appId = QString());
15  bool isClient();
16  bool sendMessage(const QString &message, int timeout);
17  QString applicationId() const {
18  return id;
19  }
20 
21 signals:
22  void messageReceived(const QString& message);
23 
24 protected slots:
25  void receiveConnection();
26 
27 protected:
28  QString id;
29  QString socketName;
30  QLocalServer* server;
32 
33 private:
34  static const char* ack;
35 };
36 
37 #endif