libqmlbind
A C library for creating QML bindings for other languages easily through exporting objects to QML
qmlbind_global.h
Go to the documentation of this file.
1 #pragma once
2 
3 # if defined(_WIN32) || defined(_WIN64)
4 # ifdef QMLBIND_LIBRARY
5 # define QMLBIND_API __declspec(dllexport)
6 # else
7 # define QMLBIND_API __declspec(dllimport)
8 # endif
9 # else
10 # define QMLBIND_API
11 # endif
12 
20 // use the real declarations if libqmlbind is being built as a library (which means QMLBIND_LIBRARY is defined),
21 // but use opaque structs if this is another project and only libqmlbind's header files are included.
22 #ifdef QMLBIND_LIBRARY
23 
24 #include <memory>
25 
26 class QApplication;
27 class QQmlComponent;
28 class QJSValue;
29 class QJSValueIterator;
30 class QByteArray;
31 class QPluginLoader;
32 
33 namespace QmlBind {
34 
35 class Engine;
36 class Interface;
37 class MetaObject;
38 class MetaClass;
39 class SignalEmitter;
40 
41 }
42 
43 typedef QApplication qmlbind_application;
44 
45 typedef QmlBind::Engine qmlbind_engine;
46 typedef QQmlComponent qmlbind_component;
47 typedef QPluginLoader qmlbind_plugin;
48 
49 typedef QJSValue qmlbind_value;
50 typedef QJSValueIterator qmlbind_iterator;
51 typedef QByteArray qmlbind_string;
52 
53 typedef QmlBind::MetaClass qmlbind_metaclass;
54 typedef QmlBind::SignalEmitter qmlbind_signal_emitter;
55 
56 #else
57 
59 
60 typedef struct qmlbind_engine {} qmlbind_engine;
62 typedef struct qmlbind_plugin {} qmlbind_plugin;
63 
64 typedef struct qmlbind_value {} qmlbind_value;
66 typedef struct qmlbind_string {} qmlbind_string;
67 
70 
71 #endif
72 
97 
115 
116 
126 typedef struct qmlbind_client_callbacks {
138  qmlbind_client_object* (*new_object)(qmlbind_client_class *classRef, qmlbind_signal_emitter *signalEmitter);
139 
143  void (*delete_object)(qmlbind_client_object *object);
144 
157  qmlbind_value* (*call_method)(qmlbind_engine *engine, qmlbind_client_object *object,
158  const char *name, int argc, const qmlbind_value *const *argv);
159 
170  qmlbind_value* (*get_property)(qmlbind_engine *engine, qmlbind_client_object *object, const char *name);
171 
179  void (*set_property)(qmlbind_engine *engine, qmlbind_client_object *object, const char *name, const qmlbind_value *value);
180 
182 
an opaque struct mainly used as self argument in the methods defined in qmlbind_component.
Definition: qmlbind_global.h:61
an opaque struct mainly used as self argument in the methods defined in qmlbind_iterator.
Definition: qmlbind_global.h:65
struct qmlbind_client_callbacks qmlbind_client_callbacks
encapsulates client-side functions that are used from QML for C object creation, destruction, method calls and property modification.
an opaque struct mainly used as self argument in the methods defined in qmlbind_signal_emitter.
Definition: qmlbind_global.h:69
an opaque struct mainly used as self argument in the methods defined in qmlbind_value.
Definition: qmlbind_global.h:64
struct qmlbind_client_object qmlbind_client_object
an opaque struct to represent a client-side object exposed to the metaobject system to libqmlbind...
an opaque struct mainly used as self argument in the methods defined in qmlbind_metaclass.
Definition: qmlbind_global.h:68
struct qmlbind_client_class qmlbind_client_class
an opaque struct to represent a client-side class object (a.k.a. metaclass) to libqmlbind.
an opaque struct to represent a client-side class object (a.k.a. metaclass) to libqmlbind.
Definition: qmlbind_global.h:114
an opaque struct to be used as self argument in the methods defined in qmlbind_application.
Definition: qmlbind_global.h:58
encapsulates client-side functions that are used from QML for C object creation, destruction, method calls and property modification.
Definition: qmlbind_global.h:126
an opaque struct to represent a client-side object exposed to the metaobject system to libqmlbind...
Definition: qmlbind_global.h:96
an opaque struct mainly used as self argument in the methods defined in qmlbind_engine.
Definition: qmlbind_global.h:60
an opaque struct mainly used as self argument in the methods defined in qmlbind_string.
Definition: qmlbind_global.h:66
an opaque struct mainly used as self argument in the methods defined in qmlbind_plugin.
Definition: qmlbind_global.h:62