GammaRay  2.2.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
protocol.h
1 /*
2  protocol.h
3 
4  This file is part of GammaRay, the Qt application inspection and
5  manipulation tool.
6 
7  Copyright (C) 2013-2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
8  Author: Volker Krause <volker.krause@kdab.com>
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23 
24 #ifndef GAMMARAY_PROTOCOL_H
25 #define GAMMARAY_PROTOCOL_H
26 
27 #include "gammaray_common_export.h"
28 #include <QAbstractItemModel>
29 #include <QVector>
30 #include <QModelIndex>
31 #include <QPair>
32 
33 namespace GammaRay {
34 
36 namespace Protocol {
37 
38 typedef qint32 PayloadSize;
39 typedef quint8 ObjectAddress;
40 typedef quint8 MessageType;
41 
42 static const ObjectAddress InvalidObjectAddress = 0;
43 static const ObjectAddress LauncherAddress = 255;
44 static const MessageType InvalidMessageType = 0;
45 
46 enum BuildInMessageType {
47  // object management
48  // client -> server
49  ObjectMonitored = InvalidMessageType + 1,
50  ObjectUnmonitored,
51 
52  // server -> client
53  ServerVersion,
54 
55  ObjectMapReply,
56  ObjectAdded,
57  ObjectRemoved,
58 
59  // remote model messages
60  // client -> server
61  ModelRowColumnCountRequest,
62  ModelContentRequest,
63  ModelHeaderRequest,
64  ModelSetDataRequest,
65  ModelSyncBarrier,
66 
67  // server -> client
68  ModelRowColumnCountReply,
69  ModelContentReply,
70  ModelContentChanged,
71  ModelHeaderReply,
72  ModelHeaderChanged,
73  ModelRowsAdded,
74  ModelRowsMoved,
75  ModelRowsRemoved,
76  ModelColumnsAdded,
77  ModelColumnsMoved,
78  ModelColumnsRemoved,
79  ModelReset,
80  ModelLayoutChanged,
81 
82  // server <-> client
83  SelectionModelSelect,
84  SelectionModelCurrent,
85 
86  MethodCall,
87 
88  ServerInfo,
89 
90  // probe settings provided by the launcher
91  ProbeSettings,
92  ServerPort
93 };
94 
95 typedef QVector<QPair<qint32, qint32> > ModelIndex;
96 
98 GAMMARAY_COMMON_EXPORT ModelIndex fromQModelIndex(const QModelIndex &index);
99 
101 GAMMARAY_COMMON_EXPORT QModelIndex toQModelIndex(const QAbstractItemModel *model, const ModelIndex &index);
102 
104 GAMMARAY_COMMON_EXPORT qint32 version();
105 
107 GAMMARAY_COMMON_EXPORT qint32 broadcastFormatVersion();
108 
109 }
110 
111 }
112 
113 #endif

Klarälvdalens Datakonsult AB (KDAB)
"The Qt Experts"
http://www.kdab.com/
GammaRay
Qt-application inspection and manipulation tool
http://www.kdab.com/kdab-products/gammaray/