GammaRay  2.4.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  ModelSortRequest,
71  ModelSyncBarrier,
72 
73  // server -> client
74  ModelRowColumnCountReply,
75  ModelContentReply,
76  ModelContentChanged,
77  ModelHeaderReply,
78  ModelHeaderChanged,
79  ModelRowsAdded,
80  ModelRowsMoved,
81  ModelRowsRemoved,
82  ModelColumnsAdded,
83  ModelColumnsMoved,
84  ModelColumnsRemoved,
85  ModelReset,
86  ModelLayoutChanged,
87 
88  // server <-> client
89  SelectionModelSelect,
90  SelectionModelCurrent,
91 
92  MethodCall,
93  PropertySyncRequest,
94  PropertyValuesChanged,
95 
96  ServerInfo,
97 
98  // probe settings provided by the launcher
99  ProbeSettings,
100  ServerAddress
101 };
102 
103 typedef QVector<QPair<qint32, qint32> > ModelIndex;
104 
106 GAMMARAY_COMMON_EXPORT ModelIndex fromQModelIndex(const QModelIndex &index);
107 
109 GAMMARAY_COMMON_EXPORT QModelIndex toQModelIndex(const QAbstractItemModel *model, const ModelIndex &index);
110 
112 GAMMARAY_COMMON_EXPORT qint32 version();
113 
115 GAMMARAY_COMMON_EXPORT qint32 broadcastFormatVersion();
116 
117 }
118 
119 }
120 
121 #endif
ModelIndex fromQModelIndex(const QModelIndex &index)
qint32 broadcastFormatVersion()
QModelIndex toQModelIndex(const QAbstractItemModel *model, const ModelIndex &index)
Definition: endpoint.h:42

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/