17 #ifndef NURIA_METAOBJECT_HPP
18 #define NURIA_METAOBJECT_HPP
20 #include "essentials.hpp"
21 #include "callback.hpp"
64 bool isValid ()
const;
67 QByteArray name ()
const;
70 QVariant value ()
const;
79 : m_meta (meta), m_category (category), m_index (index), m_nth (nth)
156 bool isValid ()
const;
159 QByteArray name ()
const;
165 QByteArray returnType ()
const;
168 QVector< QByteArray > argumentTypes ()
const;
171 QVector< QByteArray > argumentNames ()
const;
185 Callback callback (
void *instance =
nullptr)
const;
194 Callback unsafeCallback (
void *instance =
nullptr)
const;
201 Callback testCallback (
void *instance =
nullptr)
const;
207 int annotationCount ()
const;
219 int annotationLowerBound (
const QByteArray &name)
const;
225 int annotationUpperBound (
const QByteArray &name)
const;
231 : m_meta (meta), m_index (index)
234 mutable MetaObject *m_meta;
303 ReadWrite = ReadOnly | WriteOnly
310 bool isValid ()
const;
313 QByteArray name ()
const;
316 QByteArray typeName ()
const;
319 Access access ()
const;
322 QVariant read (
void *instance)
const;
328 bool write (
void *instance,
const QVariant &value);
334 int annotationCount ()
const;
346 int annotationLowerBound (
const QByteArray &name)
const;
352 int annotationUpperBound (
const QByteArray &name)
const;
358 : m_meta (meta), m_index (index)
361 mutable MetaObject *m_meta;
378 bool isValid ()
const;
381 QByteArray name ()
const;
384 int elementCount ()
const;
387 QByteArray key (
int at)
const;
390 int value (
int at)
const;
396 QByteArray valueToKey (
int value)
const;
402 int keyToValue (
const QByteArray &key)
const;
408 int annotationCount ()
const;
420 int annotationLowerBound (
const QByteArray &name)
const;
426 int annotationUpperBound (
const QByteArray &name)
const;
432 : m_meta (meta), m_index (index)
441 typedef QMap< QByteArray, MetaObject * > MetaObjectMap;
570 PointerMetaTypeId = 2,
578 AnnotationValue = 11,
582 MethodReturnType = 22,
583 MethodArgumentNames = 23,
584 MethodArgumentTypes = 24,
586 MethodUnsafeCallback = 26,
587 MethodArgumentTest = 27,
596 EnumElementCount = 41,
598 EnumElementValue = 43,
608 template<
typename T >
610 int id = qMetaTypeId< T * > ();
611 const char *typeName = QMetaType::typeName (
id);
619 static MetaObject *byName (
const QByteArray &type);
632 static MetaObjectMap typesInheriting (
const QByteArray &typeName);
638 static MetaObjectMap typesWithAnnotation (
const QByteArray &name);
643 static MetaObjectMap allTypes ();
655 static void registerMetaObject (
MetaObject *
object);
666 QByteArray className ();
677 int pointerMetaTypeId ();
682 QVector< QByteArray > parents ();
688 int annotationCount ();
700 int annotationLowerBound (
const QByteArray &name)
const;
706 int annotationUpperBound (
const QByteArray &name)
const;
724 int methodLowerBound (
const QByteArray &name);
730 int methodUpperBound (
const QByteArray &name);
740 MetaMethod method (
const QVector< QByteArray > &prototype);
747 void destroyInstance (
void *instance);
766 MetaField fieldByName (
const QByteArray &name);
785 MetaEnum enumByName (
const QByteArray &name);
793 virtual void gateCall (GateMethod method,
int category,
int index,
int nth,
794 void *result,
void *additional = 0) = 0;
806 #endif // NURIA_METAOBJECT_HPP
A modern style callback mechanism which can be bound to various method types including slots...
Definition: callback.hpp:140
Definition: abstractsessionmanager.hpp:24