18 #ifndef NURIA_METAOBJECT_HPP
19 #define NURIA_METAOBJECT_HPP
21 #include "essentials.hpp"
22 #include "callback.hpp"
65 bool isValid ()
const;
68 QByteArray name ()
const;
71 QVariant value ()
const;
80 : m_meta (meta), m_category (category), m_index (index), m_nth (nth)
157 bool isValid ()
const;
160 QByteArray name ()
const;
166 QByteArray returnType ()
const;
169 QVector< QByteArray > argumentTypes ()
const;
172 QVector< QByteArray > argumentNames ()
const;
186 Callback callback (
void *instance =
nullptr)
const;
195 Callback unsafeCallback (
void *instance =
nullptr)
const;
202 Callback testCallback (
void *instance =
nullptr)
const;
208 int annotationCount ()
const;
220 int annotationLowerBound (
const QByteArray &name)
const;
226 int annotationUpperBound (
const QByteArray &name)
const;
232 : m_meta (meta), m_index (index)
235 mutable MetaObject *m_meta;
304 ReadWrite = ReadOnly | WriteOnly
311 bool isValid ()
const;
314 QByteArray name ()
const;
317 QByteArray typeName ()
const;
320 Access access ()
const;
323 QVariant read (
void *instance)
const;
329 bool write (
void *instance,
const QVariant &value);
335 int annotationCount ()
const;
347 int annotationLowerBound (
const QByteArray &name)
const;
353 int annotationUpperBound (
const QByteArray &name)
const;
359 : m_meta (meta), m_index (index)
362 mutable MetaObject *m_meta;
379 bool isValid ()
const;
382 QByteArray name ()
const;
385 int elementCount ()
const;
388 QByteArray key (
int at)
const;
391 int value (
int at)
const;
397 QByteArray valueToKey (
int value)
const;
403 int keyToValue (
const QByteArray &key)
const;
409 int annotationCount ()
const;
421 int annotationLowerBound (
const QByteArray &name)
const;
427 int annotationUpperBound (
const QByteArray &name)
const;
433 : m_meta (meta), m_index (index)
442 typedef QMap< QByteArray, MetaObject * > MetaObjectMap;
573 PointerMetaTypeId = 2,
581 AnnotationValue = 11,
585 MethodReturnType = 22,
586 MethodArgumentNames = 23,
587 MethodArgumentTypes = 24,
589 MethodUnsafeCallback = 26,
590 MethodArgumentTest = 27,
599 EnumElementCount = 41,
601 EnumElementValue = 43,
611 template<
typename T >
613 int id = qMetaTypeId< T * > ();
614 const char *typeName = QMetaType::typeName (
id);
622 static MetaObject *byName (
const QByteArray &type);
628 static MetaObjectMap typesInheriting (
const QByteArray &typeName);
634 static MetaObjectMap typesWithAnnotation (
const QByteArray &name);
639 static MetaObjectMap allTypes ();
651 static void registerMetaObject (
MetaObject *
object);
662 QByteArray className ();
673 int pointerMetaTypeId ();
678 QVector< QByteArray > parents ();
684 int annotationCount ();
696 int annotationLowerBound (
const QByteArray &name)
const;
702 int annotationUpperBound (
const QByteArray &name)
const;
720 int methodLowerBound (
const QByteArray &name);
726 int methodUpperBound (
const QByteArray &name);
736 MetaMethod method (
const QVector< QByteArray > &prototype);
743 void destroyInstance (
void *instance);
762 MetaField fieldByName (
const QByteArray &name);
781 MetaEnum enumByName (
const QByteArray &name);
789 virtual void gateCall (GateMethod method,
int category,
int index,
int nth,
790 void *result,
void *additional = 0) = 0;
802 #endif // NURIA_METAOBJECT_HPP
A modern style callback mechanism which can be bound to various method types including slots...
Definition: callback.hpp:141