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

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/