DOtherSide  0.7.1
C language library for creating bindings for the Qt QML language
DOtherSideTypes.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020 Filippo Cucchetto.
3  Contact: https://github.com/filcuc/dotherside
4 
5  This file is part of the DOtherSide library.
6 
7  The DOtherSide library is free software: you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation, either version 3 of the license, or (at your opinion) any later version.
10 
11  The DOtherSide library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with the DOtherSide library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
28 #ifndef DOTHERSIDETYPES_H
29 #define DOTHERSIDETYPES_H
30 
31 
32 #ifdef WIN32
33 #define DOS_CALL __cdecl
34 #else
35 #define DOS_CALL
36 #endif
37 
38 #ifndef __cplusplus
39 #include <stdbool.h>
40 #endif
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 
48 typedef void DosQVariant;
49 
51 typedef void DosQModelIndex;
52 
54 typedef void DosQAbstractItemModel;
55 
57 typedef void DosQAbstractListModel;
58 
61 
64 
66 typedef void DosQQuickView;
67 
69 typedef void DosQQmlContext;
70 
72 typedef void DosQHashIntQByteArray;
73 
75 typedef void DosQUrl;
76 
78 typedef void DosQMetaObject;
79 
81 typedef void DosQObject;
82 
85 
87 typedef void DosPixmap;
88 
90 typedef void DosQPointer;
91 
101 typedef void (DOS_CALL *RequestPixmapCallback)(const char *id, int *width, int *height, int requestedWidth, int requestedHeight, DosPixmap* result);
102 
114 typedef void (DOS_CALL *DObjectCallback)(void *self, DosQVariant *slotName, int argc, DosQVariant **argv);
115 
122 typedef void (DOS_CALL *RowCountCallback)(void *self, const DosQModelIndex *parent, int *result);
123 
130 typedef void (DOS_CALL *ColumnCountCallback)(void *self, const DosQModelIndex *parent, int *result);
131 
138 typedef void (DOS_CALL *DataCallback)(void *self, const DosQModelIndex *index, int role, DosQVariant *result);
139 
141 typedef void (DOS_CALL *SetDataCallback)(void *self, const DosQModelIndex *index, const DosQVariant *value, int role, bool *result);
142 
144 typedef void (DOS_CALL *RoleNamesCallback)(void *self, DosQHashIntQByteArray *result);
145 
147 typedef void (DOS_CALL *FlagsCallback)(void *self, const DosQModelIndex *index, int *result);
148 
150 typedef void (DOS_CALL *HeaderDataCallback)(void *self, int section, int orientation, int role, DosQVariant *result);
151 
153 typedef void (DOS_CALL *IndexCallback)(void *self, int row, int column, const DosQModelIndex *parent, DosQModelIndex *result);
154 
156 typedef void (DOS_CALL *ParentCallback)(void *self, const DosQModelIndex *child, DosQModelIndex *result);
157 
159 typedef void (DOS_CALL *HasChildrenCallback)(void *self, const DosQModelIndex *parent, bool *result);
160 
162 typedef void (DOS_CALL *CanFetchMoreCallback)(void *self, const DosQModelIndex *parent, bool *result);
163 
165 typedef void (DOS_CALL *FetchMoreCallback)(void *self, const DosQModelIndex *parent);
166 
168 
207 typedef void (DOS_CALL *CreateDObject)(int id, void *wrapper, void **bindedQObject, void **dosQObject);
208 
210 
217 typedef void (DOS_CALL *DeleteDObject)(int id, void *bindedQObject);
218 
224  int size;
227 };
228 
229 #ifndef __cplusplus
230 typedef struct DosQVariantArray DosQVariantArray;
231 #endif
232 
234 
243  int major;
245  int minor;
247  const char *uri;
249  const char *qml;
256 };
257 
258 #ifndef __cplusplus
259 typedef struct QmlRegisterType QmlRegisterType;
260 #endif
261 
265  const char *name;
267  int metaType;
268 };
269 
270 #ifndef __cplusplus
272 #endif
273 
277  const char *name;
282 };
283 
284 #ifndef __cplusplus
285 typedef struct SignalDefinition SignalDefinition;
286 #endif
287 
291  int count;
294 };
295 
296 #ifndef __cplusplus
297 typedef struct SignalDefinitions SignalDefinitions;
298 #endif
299 
303  const char *name;
310 };
311 
312 #ifndef __cplusplus
313 typedef struct SlotDefinition SlotDefinition;
314 #endif
315 
319  int count;
322 };
323 
324 #ifndef __cplusplus
325 typedef struct SlotDefinitions SlotDefinitions;
326 #endif
327 
331  const char *name;
335  const char *readSlot;
338  const char *writeSlot;
341  const char *notifySignal;
342 };
343 
344 #ifndef __cplusplus
346 #endif
347 
351  int count;
354 };
355 
356 #ifndef __cplusplus
358 #endif
359 
362  RowCountCallback rowCount;
363  ColumnCountCallback columnCount;
364  DataCallback data;
365  SetDataCallback setData;
366  RoleNamesCallback roleNames;
367  FlagsCallback flags;
368  HeaderDataCallback headerData;
369  IndexCallback index;
370  ParentCallback parent;
371  HasChildrenCallback hasChildren;
372  CanFetchMoreCallback canFetchMore;
373  FetchMoreCallback fetchMore;
374 };
375 
376 #ifndef __cplusplus
378 #endif
379 
380 enum DosQEventLoopProcessEventFlag {
381  DosQEventLoopProcessEventFlagProcessAllEvents = 0x00,
382  DosQEventLoopProcessEventFlagExcludeUserInputEvents = 0x01,
383  DosQEventLoopProcessEventFlagProcessExcludeSocketNotifiers = 0x02,
384  DosQEventLoopProcessEventFlagProcessAllEventsWaitForMoreEvents = 0x03
385 };
386 
387 enum DosQtConnectionType {
388  DosQtConnectionTypeAutoConnection = 0,
389  DosQtConnectionTypeDirectConnection = 1,
390  DosQtConnectionTypeQueuedConnection = 2,
391  DosQtConnectionTypeBlockingConnection = 3,
392  DosQtCOnnectionTypeUniqueConnection = 0x80,
393 };
394 
395 #ifdef __cplusplus
396 }
397 #endif
398 
399 #endif
PropertyDefinition::name
const char * name
The property name.
Definition: DOtherSideTypes.h:331
SlotDefinitions::definitions
SlotDefinition * definitions
The slot definitions array.
Definition: DOtherSideTypes.h:321
PropertyDefinitions::definitions
PropertyDefinition * definitions
The property definitions array.
Definition: DOtherSideTypes.h:353
DosQAbstractListModel
void DosQAbstractListModel
A pointer to a QAbstractListModel.
Definition: DOtherSideTypes.h:57
DosQAbstractItemModel
void DosQAbstractItemModel
A pointer to a QAbstractItemModel.
Definition: DOtherSideTypes.h:54
SignalDefinitions::count
int count
The total number of signals.
Definition: DOtherSideTypes.h:291
SlotDefinitions
Represents a set of slot definitions.
Definition: DOtherSideTypes.h:317
ParameterDefinition::metaType
int metaType
The parameter metatype.
Definition: DOtherSideTypes.h:267
SlotDefinition::name
const char * name
The slot name.
Definition: DOtherSideTypes.h:303
PropertyDefinitions
Represents a set of property definitions.
Definition: DOtherSideTypes.h:349
DosQQmlApplicationEngine
void DosQQmlApplicationEngine
A pointer to a QQmlApplicationEngine.
Definition: DOtherSideTypes.h:63
DosQVariantArray
Store an array of QVariant.
Definition: DOtherSideTypes.h:222
DosQObject
void DosQObject
A pointer to a QObject.
Definition: DOtherSideTypes.h:81
QmlRegisterType::qml
const char * qml
The type name to be used in QML files.
Definition: DOtherSideTypes.h:249
SignalDefinition
Represents a single signal definition.
Definition: DOtherSideTypes.h:275
QmlRegisterType
The data needed for registering a custom type in the QML environment.
Definition: DOtherSideTypes.h:241
PropertyDefinition::writeSlot
const char * writeSlot
The name of the property write slot.
Definition: DOtherSideTypes.h:338
DosPixmap
void DosPixmap
A pointer to a QPixmap.
Definition: DOtherSideTypes.h:87
SetDataCallback
void(* SetDataCallback)(void *self, const DosQModelIndex *index, const DosQVariant *value, int role, bool *result)
Called when the QAbstractItemModel::setData method must be executed.
Definition: DOtherSideTypes.h:141
PropertyDefinition::readSlot
const char * readSlot
The name of the property read slot.
Definition: DOtherSideTypes.h:335
DosQMetaObject
void DosQMetaObject
A pointer to a QMetaObject.
Definition: DOtherSideTypes.h:78
SlotDefinition::returnMetaType
int returnMetaType
The slot return type.
Definition: DOtherSideTypes.h:305
QmlRegisterType::staticMetaObject
DosQMetaObject * staticMetaObject
The type QMetaObject.
Definition: DOtherSideTypes.h:251
CreateDObject
void(* CreateDObject)(int id, void *wrapper, void **bindedQObject, void **dosQObject)
Callback called from QML for creating a registered type.
Definition: DOtherSideTypes.h:207
QmlRegisterType::createDObject
CreateDObject createDObject
The callback invoked from QML when this type should be created.
Definition: DOtherSideTypes.h:253
RowCountCallback
void(* RowCountCallback)(void *self, const DosQModelIndex *parent, int *result)
Definition: DOtherSideTypes.h:122
DosQVariantArray::size
int size
The number of elements.
Definition: DOtherSideTypes.h:224
RoleNamesCallback
void(* RoleNamesCallback)(void *self, DosQHashIntQByteArray *result)
Called when the QAbstractItemModel::roleNames method must be executed.
Definition: DOtherSideTypes.h:144
SignalDefinition::parameters
ParameterDefinition * parameters
The parameters.
Definition: DOtherSideTypes.h:281
DeleteDObject
void(* DeleteDObject)(int id, void *bindedQObject)
Callback invoked from QML for deleting a registered type.
Definition: DOtherSideTypes.h:217
DosQPointer
void DosQPointer
A pointer to a QPointer.
Definition: DOtherSideTypes.h:90
PropertyDefinitions::count
int count
The total number of properties.
Definition: DOtherSideTypes.h:351
SignalDefinitions
Represents a set of signal definitions.
Definition: DOtherSideTypes.h:289
DosQVariantArray::data
DosQVariant ** data
The array.
Definition: DOtherSideTypes.h:226
QmlRegisterType::minor
int minor
The Module minor version.
Definition: DOtherSideTypes.h:245
PropertyDefinition::notifySignal
const char * notifySignal
The name of the property notify signals.
Definition: DOtherSideTypes.h:341
DosQVariant
void DosQVariant
A pointer to a QVariant.
Definition: DOtherSideTypes.h:48
SlotDefinition::parameters
ParameterDefinition * parameters
The parameters.
Definition: DOtherSideTypes.h:309
DosQUrl
void DosQUrl
A pointer to a QUrl.
Definition: DOtherSideTypes.h:75
CanFetchMoreCallback
void(* CanFetchMoreCallback)(void *self, const DosQModelIndex *parent, bool *result)
Called when the QAbstractItemModel::canFetchMore method must be called.
Definition: DOtherSideTypes.h:162
ParameterDefinition
Represents a parameter definition.
Definition: DOtherSideTypes.h:263
DosQQmlContext
void DosQQmlContext
A pointer to a QQmlContext.
Definition: DOtherSideTypes.h:69
SlotDefinition::parametersCount
int parametersCount
The parameters count.
Definition: DOtherSideTypes.h:307
DosQHashIntQByteArray
void DosQHashIntQByteArray
A pointer to a QHash<int,QByteArray>
Definition: DOtherSideTypes.h:72
DataCallback
void(* DataCallback)(void *self, const DosQModelIndex *index, int role, DosQVariant *result)
Definition: DOtherSideTypes.h:138
QmlRegisterType::major
int major
The Module major version.
Definition: DOtherSideTypes.h:243
SignalDefinition::parametersCount
int parametersCount
The parameters count.
Definition: DOtherSideTypes.h:279
QmlRegisterType::uri
const char * uri
The Module uri.
Definition: DOtherSideTypes.h:247
ParentCallback
void(* ParentCallback)(void *self, const DosQModelIndex *child, DosQModelIndex *result)
Called when the QAbstractItemModel::parent method must be called.
Definition: DOtherSideTypes.h:156
RequestPixmapCallback
void(* RequestPixmapCallback)(const char *id, int *width, int *height, int requestedWidth, int requestedHeight, DosPixmap *result)
Definition: DOtherSideTypes.h:101
QmlRegisterType::deleteDObject
DeleteDObject deleteDObject
The callback invoked from QML when this type should be deleted.
Definition: DOtherSideTypes.h:255
DObjectCallback
void(* DObjectCallback)(void *self, DosQVariant *slotName, int argc, DosQVariant **argv)
Definition: DOtherSideTypes.h:114
FetchMoreCallback
void(* FetchMoreCallback)(void *self, const DosQModelIndex *parent)
Called when the QAbstractItemModel::fetchMore method must be called.
Definition: DOtherSideTypes.h:165
DosQModelIndex
void DosQModelIndex
A pointer to a QModelIndex.
Definition: DOtherSideTypes.h:51
FlagsCallback
void(* FlagsCallback)(void *self, const DosQModelIndex *index, int *result)
Called when the QAbstractItemModel::flags method must be called.
Definition: DOtherSideTypes.h:147
HasChildrenCallback
void(* HasChildrenCallback)(void *self, const DosQModelIndex *parent, bool *result)
Called when the QAbstractItemModel::hasChildren method must be called.
Definition: DOtherSideTypes.h:159
DosQAbstractTableModel
void DosQAbstractTableModel
A pointer to a QAbstractTableModel.
Definition: DOtherSideTypes.h:60
ParameterDefinition::name
const char * name
The parameter name.
Definition: DOtherSideTypes.h:265
IndexCallback
void(* IndexCallback)(void *self, int row, int column, const DosQModelIndex *parent, DosQModelIndex *result)
Called when the QAbstractItemModel::index method must be called.
Definition: DOtherSideTypes.h:153
SlotDefinition
Represents a single slot definition.
Definition: DOtherSideTypes.h:301
SignalDefinitions::definitions
SignalDefinition * definitions
The signals.
Definition: DOtherSideTypes.h:293
DosQQuickImageProvider
void DosQQuickImageProvider
A pointer to a QQuickImageProvider.
Definition: DOtherSideTypes.h:84
DosQAbstractItemModelCallbacks
Incapsulate all the QAbstractItemModel callbacks.
Definition: DOtherSideTypes.h:361
HeaderDataCallback
void(* HeaderDataCallback)(void *self, int section, int orientation, int role, DosQVariant *result)
Called when the QAbstractItemModel::headerData method must be called.
Definition: DOtherSideTypes.h:150
PropertyDefinition
Represents a single property definition.
Definition: DOtherSideTypes.h:329
SlotDefinitions::count
int count
The total number of slots.
Definition: DOtherSideTypes.h:319
DosQQuickView
void DosQQuickView
A pointer to a QQuickView.
Definition: DOtherSideTypes.h:66
ColumnCountCallback
void(* ColumnCountCallback)(void *self, const DosQModelIndex *parent, int *result)
Definition: DOtherSideTypes.h:130
PropertyDefinition::propertyMetaType
int propertyMetaType
The property metatype.
Definition: DOtherSideTypes.h:333
SignalDefinition::name
const char * name
The signal name.
Definition: DOtherSideTypes.h:277