Add server and client files
[miniature:miniature.git] / src / telepathy / tphelpers.h
1 #ifndef TPHELPERS_H
2 #define TPHELPERS_H
3
4 #include <QtDBus/QDBusArgument>
5
6 struct StreamTubeAddress
7 {
8     QString address;
9     uint port;
10 };
11
12 Q_DECLARE_METATYPE(StreamTubeAddress);
13
14 QDBusArgument &operator<<(QDBusArgument &argument,
15         const StreamTubeAddress &streamTubeAddress);
16 const QDBusArgument &operator>>(const QDBusArgument &argument,
17         StreamTubeAddress &streamTubeAddress);
18
19 namespace Miniature
20 {
21
22 enum Command
23 {
24     NewGame,
25     NewGameStarted,
26     NextMove,
27     BackMove,
28     PauseGame,
29     ProposeDraw,
30     AdjournGame,
31     ResignGame,
32     Nop
33 };
34
35 typedef std::map<Miniature::Command, QString> TCommandsMap;
36
37 TCommandsMap createCommandsMap();
38 };
39
40 QString commandToString(Miniature::Command c);
41 Miniature::Command commandFromString(QString c);
42
43
44
45 #endif // TPHELPERS_H