libqmlbind
A C library for creating QML bindings for other languages easily through exporting objects to QML
value.h
Go to the documentation of this file.
1 #pragma once
2 #include "qmlbind_global.h"
3 #include <time.h>
4 #include <stdlib.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
87 
95 
99 QMLBIND_API void qmlbind_value_release(qmlbind_value *self);
100 
110 QMLBIND_API qmlbind_value *qmlbind_value_clone(const qmlbind_value *other);
111 
133 QMLBIND_API int qmlbind_value_is_equal(const qmlbind_value *value1, const qmlbind_value *value2);
134 
156 QMLBIND_API int qmlbind_value_is_identical(const qmlbind_value *value1, const qmlbind_value *value2);
157 
163 QMLBIND_API int qmlbind_value_is_undefined(const qmlbind_value *self);
164 
170 QMLBIND_API int qmlbind_value_is_null(const qmlbind_value *self);
171 
177 QMLBIND_API int qmlbind_value_is_boolean(const qmlbind_value *self);
178 
184 QMLBIND_API int qmlbind_value_is_number(const qmlbind_value *self);
185 
191 QMLBIND_API int qmlbind_value_is_string(const qmlbind_value *self);
192 
201 QMLBIND_API int qmlbind_value_is_object(const qmlbind_value *self);
202 
210 QMLBIND_API int qmlbind_value_is_array(const qmlbind_value *self);
211 
219 QMLBIND_API int qmlbind_value_is_function(const qmlbind_value *self);
220 
226 QMLBIND_API int qmlbind_value_is_error(const qmlbind_value *self);
227 
233 QMLBIND_API int qmlbind_value_is_wrapper(const qmlbind_value *self);
234 
235 
241 QMLBIND_API qmlbind_value *qmlbind_value_new_boolean(int value);
242 
252 QMLBIND_API int qmlbind_value_get_boolean(const qmlbind_value *self);
253 
254 
260 QMLBIND_API qmlbind_value *qmlbind_value_new_number(double value);
261 
271 QMLBIND_API double qmlbind_value_get_number(const qmlbind_value *self);
272 
273 
279 QMLBIND_API qmlbind_value *qmlbind_value_new_string(int length, const char *value);
280 
286 QMLBIND_API qmlbind_value *qmlbind_value_new_string_cstr(const char *value);
287 
298 QMLBIND_API qmlbind_string *qmlbind_value_get_string(const qmlbind_value *self);
299 
300 
314 QMLBIND_API qmlbind_value *qmlbind_value_get_property(const qmlbind_value *self, const char *key);
315 
325 QMLBIND_API void qmlbind_value_set_property(qmlbind_value *self, const char *key, const qmlbind_value *value);
326 
343 QMLBIND_API int qmlbind_value_delete_property(qmlbind_value *self, const char *key);
344 
352 QMLBIND_API int qmlbind_value_has_property(const qmlbind_value *self, const char *key);
353 
354 
363 QMLBIND_API int qmlbind_value_has_own_property(const qmlbind_value *self, const char *key);
364 
374 
386 QMLBIND_API void qmlbind_value_set_prototype(qmlbind_value *self, const qmlbind_value *proto);
387 
388 
397 QMLBIND_API int qmlbind_value_has_index(const qmlbind_value *self, int index);
398 
409 QMLBIND_API qmlbind_value *qmlbind_value_get_array_item(const qmlbind_value *self, int index);
410 
411 
423 QMLBIND_API void qmlbind_value_set_array_item(qmlbind_value *self, int index, const qmlbind_value *property);
424 
425 
426 
444 QMLBIND_API qmlbind_value *qmlbind_value_call(
445  qmlbind_value *self,
446  int argc,
447  const qmlbind_value *const *argv
448 );
449 
471  qmlbind_value *function,
472  int argc,
473  const qmlbind_value *const *argv
474 );
475 
498  qmlbind_value *self,
499  qmlbind_value *instance,
500  int argc,
501  const qmlbind_value *const *argv
502 );
503 
512 
513 #ifdef __cplusplus
514 }
515 #endif
QMLBIND_API qmlbind_value * qmlbind_value_call_constructor(qmlbind_value *function, int argc, const qmlbind_value *const *argv)
Creates a new Object and calls this libqmlbind_value as a constructor, using the created object as th...
QMLBIND_API qmlbind_value * qmlbind_value_get_prototype(const qmlbind_value *self)
If this qmlbind_value is an object, returns the internal prototype (proto property) of this object; o...
QMLBIND_API int qmlbind_value_is_error(const qmlbind_value *self)
Returns true if this qmlbind_value is an object of the Error class; otherwise returns false...
QMLBIND_API void qmlbind_value_release(qmlbind_value *self)
Destroys this qmlbind_value.
QMLBIND_API int qmlbind_value_is_wrapper(const qmlbind_value *self)
Returns true if this qmlbind_value is a wrapper around a C object; otherwise returns false...
QMLBIND_API qmlbind_value * qmlbind_value_new_boolean(int value)
Constructs a new qmlbind_value with a boolean value.
QMLBIND_API void qmlbind_value_set_property(qmlbind_value *self, const char *key, const qmlbind_value *value)
Sets the value of this qmlbind_value&#39;s property with the given name to the given value.
QMLBIND_API qmlbind_value * qmlbind_value_clone(const qmlbind_value *other)
Constructs a new qmlbind_value that is a copy of other.
QMLBIND_API int qmlbind_value_is_object(const qmlbind_value *self)
Returns true if this qmlbind_value is of the Object type; otherwise returns false.
an opaque struct mainly used as self argument in the methods defined in qmlbind_value.
Definition: qmlbind_global.h:64
QMLBIND_API qmlbind_value * qmlbind_value_get_property(const qmlbind_value *self, const char *key)
Returns the value of this qmlbind_value&#39;s property with the given name. If no such property exists...
QMLBIND_API qmlbind_value * qmlbind_value_new_string(int length, const char *value)
Constructs a new qmlbind_value with a the first length chars of string value.
QMLBIND_API qmlbind_value * qmlbind_value_call_with_instance(qmlbind_value *self, qmlbind_value *instance, int argc, const qmlbind_value *const *argv)
Calls this qmlbind_value as a function, using instance as the `this&#39; object in the function call...
QMLBIND_API int qmlbind_value_is_equal(const qmlbind_value *value1, const qmlbind_value *value2)
Returns true if value1 is equal to value2, otherwise returns false.
QMLBIND_API qmlbind_value * qmlbind_value_new_null()
Constructs a new null qmlbind_value.
Contains all struct definitions of libqmlbind.
QMLBIND_API int qmlbind_value_is_undefined(const qmlbind_value *self)
Returns true if this qmlbind_value is of the primitive type Undefined; otherwise returns false...
QMLBIND_API int qmlbind_value_is_number(const qmlbind_value *self)
Returns true if this qmlbind_value is of the primitive type Number; otherwise returns false...
QMLBIND_API qmlbind_client_object * qmlbind_value_unwrap(const qmlbind_value *self)
If this qmlbind_value is a wrapper, returns the qmlbind_client_object inside the wrapper; otherwise...
QMLBIND_API qmlbind_value * qmlbind_value_new_string_cstr(const char *value)
Constructs a new qmlbind_value with a \0-terminated string value.
QMLBIND_API int qmlbind_value_get_boolean(const qmlbind_value *self)
Returns the boolean value of this qmlbind_value, as defined in ECMA-262 section 9.2, "ToBoolean".
QMLBIND_API int qmlbind_value_is_function(const qmlbind_value *self)
Returns true if this qmlbind_value can be called as function, otherwise returns false.
QMLBIND_API qmlbind_value * qmlbind_value_new_number(double value)
Constructs a new qmlbind_value with a number value.
QMLBIND_API int qmlbind_value_is_array(const qmlbind_value *self)
Returns true if this qmlbind_value is an object of the Array class; otherwise returns false...
an opaque struct to represent a client-side object exposed to the metaobject system to libqmlbind...
Definition: qmlbind_global.h:96
QMLBIND_API int qmlbind_value_is_null(const qmlbind_value *self)
Returns true if this qmlbind_value is of the primitive type Null; otherwise returns false...
QMLBIND_API void qmlbind_value_set_array_item(qmlbind_value *self, int index, const qmlbind_value *property)
Sets the property at the given index to the given value.
QMLBIND_API int qmlbind_value_has_own_property(const qmlbind_value *self, const char *key)
Returns true if this object has an own (not prototype-inherited) property of the given name...
QMLBIND_API int qmlbind_value_is_boolean(const qmlbind_value *self)
Returns true if this qmlbind_value is of the primitive type Boolean; otherwise returns false...
QMLBIND_API int qmlbind_value_has_property(const qmlbind_value *self, const char *key)
Returns true if this object has a property of the given name, otherwise returns false.
QMLBIND_API int qmlbind_value_delete_property(qmlbind_value *self, const char *key)
Attempts to delete this object&#39;s property of the given name. Returns true if the property was deleted...
an opaque struct mainly used as self argument in the methods defined in qmlbind_string.
Definition: qmlbind_global.h:66
QMLBIND_API void qmlbind_value_set_prototype(qmlbind_value *self, const qmlbind_value *proto)
If this qmlbind_value is an object, sets the internal prototype (proto property) of this object to be...
QMLBIND_API int qmlbind_value_is_identical(const qmlbind_value *value1, const qmlbind_value *value2)
Returns true if value1 is equal to value2 using strict comparison (no conversion), otherwise returns false.
QMLBIND_API qmlbind_string * qmlbind_value_get_string(const qmlbind_value *self)
Returns the string value of this qmlbind_value, as defined in ECMA-262 section 9.8, "ToString". Ownership is transfered to the caller.
QMLBIND_API qmlbind_value * qmlbind_value_new_undefined()
Constructs a new undefined qmlbind_value.
QMLBIND_API qmlbind_value * qmlbind_value_get_array_item(const qmlbind_value *self, int index)
Returns the property at the given index.
QMLBIND_API qmlbind_value * qmlbind_value_call(qmlbind_value *self, int argc, const qmlbind_value *const *argv)
Calls this qmlbind_value as a function, passing argc number of arguments from argv as arguments to th...
QMLBIND_API int qmlbind_value_is_string(const qmlbind_value *self)
Returns true if this qmlbind_value is of the primitive type String; otherwise returns false...
QMLBIND_API double qmlbind_value_get_number(const qmlbind_value *self)
Returns the number value of this qmlbind_value, as defined in ECMA-262 section 9.3, "ToNumber".
QMLBIND_API int qmlbind_value_has_index(const qmlbind_value *self, int index)
Returns true if this object has a property index, otherwise returns false.