Qt 4.8
Public Functions | Static Public Functions | Public Variables | Private Functions | List of all members
QDBusMetaObject Struct Reference

#include <qdbusmetaobject_p.h>

Inheritance diagram for QDBusMetaObject:
QMetaObject

Public Functions

const char * dbusNameForMethod (int id) const
 
const char * inputSignatureForMethod (int id) const
 
const int * inputTypesForMethod (int id) const
 
const char * outputSignatureForMethod (int id) const
 
const int * outputTypesForMethod (int id) const
 
int propertyMetaType (int id) const
 
 ~QDBusMetaObject ()
 
- Public Functions inherited from QMetaObject
QObjectcast (QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
const QObjectcast (const QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
QMetaClassInfo classInfo (int index) const
 Returns the meta-data for the item of class information with the given index. More...
 
int classInfoCount () const
 Returns the number of items of class information in this class. More...
 
int classInfoOffset () const
 Returns the class information offset for this class; i.e. More...
 
const char * className () const
 Returns the class name. More...
 
QMetaMethod constructor (int index) const
 Returns the meta-data for the constructor with the given index. More...
 
int constructorCount () const
 Returns the number of constructors in this class. More...
 
QMetaEnum enumerator (int index) const
 Returns the meta-data for the enumerator with the given index. More...
 
int enumeratorCount () const
 Returns the number of enumerators in this class. More...
 
int enumeratorOffset () const
 Returns the enumerator offset for this class; i.e. More...
 
int indexOfClassInfo (const char *name) const
 Finds class information item name and returns its index; otherwise returns -1. More...
 
int indexOfConstructor (const char *constructor) const
 Finds constructor and returns its index; otherwise returns -1. More...
 
int indexOfEnumerator (const char *name) const
 Finds enumerator name and returns its index; otherwise returns -1. More...
 
int indexOfMethod (const char *method) const
 Finds method and returns its index; otherwise returns -1. More...
 
int indexOfProperty (const char *name) const
 Finds property name and returns its index; otherwise returns -1. More...
 
int indexOfSignal (const char *signal) const
 Finds signal and returns its index; otherwise returns -1. More...
 
int indexOfSlot (const char *slot) const
 Finds slot and returns its index; otherwise returns -1. More...
 
QMetaMethod method (int index) const
 Returns the meta-data for the method with the given index. More...
 
int methodCount () const
 Returns the number of methods known to the meta-object system in this class, including the number of properties provided by each base class. More...
 
int methodOffset () const
 Returns the method offset for this class; i.e. More...
 
QObjectnewInstance (QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument()) const
 Constructs a new instance of this class. More...
 
QMetaProperty property (int index) const
 Returns the meta-data for the property with the given index. More...
 
int propertyCount () const
 Returns the number of properties in this class, including the number of properties provided by each base class. More...
 
int propertyOffset () const
 Returns the property offset for this class; i.e. More...
 
int static_metacall (Call, int, void **) const
 
const QMetaObjectsuperClass () const
 Returns the meta-object of the superclass, or 0 if there is no such object. More...
 
QString tr (const char *s, const char *c) const
 
QString tr (const char *s, const char *c, int n) const
 
QString trUtf8 (const char *s, const char *c) const
 
QString trUtf8 (const char *s, const char *c, int n) const
 
QMetaProperty userProperty () const
 Returns the property that has the USER flag set to true. More...
 

Static Public Functions

static QDBusMetaObjectcreateMetaObject (const QString &interface, const QString &xml, QHash< QString, QDBusMetaObject *> &map, QDBusError &error)
 
- Static Public Functions inherited from QMetaObject
static void activate (QObject *sender, int signal_index, void **argv)
 
static void activate (QObject *sender, int from_signal_index, int to_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int local_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv)
 
static void addGuard (QObject **ptr)
 
static void changeGuard (QObject **ptr, QObject *o)
 
static bool checkConnectArgs (const char *signal, const char *method)
 Returns true if the signal and method arguments are compatible; otherwise returns false. More...
 
static bool connect (const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
 
static void connectSlotsByName (QObject *o)
 Searches recursively for all child objects of the given object, and connects matching signals from them to slots of object that follow the following form: More...
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool disconnectOne (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 Invokes the member (a signal or a slot name) on the object obj. More...
 
static bool invokeMethod (QObject *obj, const char *member, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType type, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static int metacall (QObject *, Call, int, void **)
 
static QByteArray normalizedSignature (const char *method)
 Normalizes the signature of the given method. More...
 
static QByteArray normalizedType (const char *type)
 Normalizes a type. More...
 
static void removeGuard (QObject **ptr)
 

Public Variables

bool cached
 
- Public Variables inherited from QMetaObject
struct {
   const uint *   data
 
   const void *   extradata
 
   const char *   stringdata
 
   const QMetaObject *   superdata
 
d
 

Private Functions

 QDBusMetaObject ()
 

Additional Inherited Members

- Public Types inherited from QMetaObject
enum  Call {
  InvokeMetaMethod, ReadProperty, WriteProperty, ResetProperty,
  QueryPropertyDesignable, QueryPropertyScriptable, QueryPropertyStored, QueryPropertyEditable,
  QueryPropertyUser, CreateInstance
}
 

Detailed Description

Definition at line 65 of file qdbusmetaobject_p.h.

Constructors and Destructors

◆ ~QDBusMetaObject()

QDBusMetaObject::~QDBusMetaObject ( )
inline

Definition at line 72 of file qdbusmetaobject_p.h.

73  {
74  delete [] d.stringdata;
75  delete [] d.data;
76  }
struct QMetaObject::@38 d

◆ QDBusMetaObject()

QDBusMetaObject::QDBusMetaObject ( )
private

Definition at line 642 of file qdbusmetaobject.cpp.

643 {
644 }

Functions

◆ createMetaObject()

QDBusMetaObject * QDBusMetaObject::createMetaObject ( const QString interface,
const QString xml,
QHash< QString, QDBusMetaObject *> &  map,
QDBusError error 
)
static

Definition at line 568 of file qdbusmetaobject.cpp.

Referenced by QDBusConnectionPrivate::findMetaObject().

571 {
572  error = QDBusError();
574 
575  QDBusMetaObject *we = 0;
578  for ( ; it != end; ++it) {
579  // check if it's in the cache
580  bool us = it.key() == interface;
581 
582  QDBusMetaObject *obj = cache.value(it.key(), 0);
583  if ( !obj && ( us || !interface.startsWith( QLatin1String("local.") ) ) ) {
584  // not in cache; create
585  obj = new QDBusMetaObject;
586  QDBusMetaObjectGenerator generator(it.key(), it.value().constData());
587  generator.write(obj);
588 
589  if ( (obj->cached = !it.key().startsWith( QLatin1String("local.") )) )
590  // cache it
591  cache.insert(it.key(), obj);
592  else if (!us)
593  delete obj;
594 
595  }
596 
597  if (us)
598  // it's us
599  we = obj;
600  }
601 
602  if (we)
603  return we;
604  // still nothing?
605 
606  if (parsed.isEmpty()) {
607  // object didn't return introspection
608  we = new QDBusMetaObject;
609  QDBusMetaObjectGenerator generator(interface, 0);
610  generator.write(we);
611  we->cached = false;
612  return we;
613  } else if (interface.isEmpty()) {
614  // merge all interfaces
615  it = parsed.constBegin();
616  QDBusIntrospection::Interface merged = *it.value().constData();
617 
618  for (++it; it != end; ++it) {
619  merged.annotations.unite(it.value()->annotations);
620  merged.methods.unite(it.value()->methods);
621  merged.signals_.unite(it.value()->signals_);
622  merged.properties.unite(it.value()->properties);
623  }
624 
625  merged.name = QLatin1String("local.Merged");
626  merged.introspection.clear();
627 
628  we = new QDBusMetaObject;
629  QDBusMetaObjectGenerator generator(merged.name, &merged);
630  generator.write(we);
631  we->cached = false;
632  return we;
633  }
634 
635  // mark as an error
637  QString::fromLatin1("Interface '%1' was not found")
638  .arg(interface));
639  return 0;
640 }
#define it(className, varName)
static Interfaces parseInterfaces(const QString &xml)
Parses the XML document fragment (given by xml) containing several interfaces.
Signals signals_
The signals available in this interface.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
Definition: qdbuserror.h:60
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Properties properties
The properties available in this interface.
QMap< Key, T > & unite(const QMap< Key, T > &other)
Inserts all the items in the other map into this map.
Definition: qmap.h:625
QString name
The interface&#39;s name.
const_iterator ConstIterator
Qt-style synonym for QMap::const_iterator.
Definition: qmap.h:389
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void write(QDBusMetaObject *obj)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Definition: qmap.h:374
Annotations annotations
The annotations associated with the interface.
QString introspection
The XML document fragment describing this interface.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
Definition: qmap.h:380
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723
Methods methods
The methods available in this interface.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
Information about one interface on the bus.
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
Definition: qmap.h:203
static const KeyPair *const end

◆ dbusNameForMethod()

const char * QDBusMetaObject::dbusNameForMethod ( int  id) const

Definition at line 651 of file qdbusmetaobject.cpp.

652 {
653  //id -= methodOffset();
654  if (id >= 0 && id < priv(d.data)->methodCount) {
655  int handle = priv(d.data)->methodDBusData + id*intsPerMethod;
656  return d.stringdata + d.data[handle];
657  }
658  return 0;
659 }
static const int intsPerMethod
static const QDBusMetaObjectPrivate * priv(const uint *data)
struct QMetaObject::@38 d

◆ inputSignatureForMethod()

const char * QDBusMetaObject::inputSignatureForMethod ( int  id) const

Definition at line 661 of file qdbusmetaobject.cpp.

662 {
663  //id -= methodOffset();
664  if (id >= 0 && id < priv(d.data)->methodCount) {
665  int handle = priv(d.data)->methodDBusData + id*intsPerMethod;
666  return d.stringdata + d.data[handle + 1];
667  }
668  return 0;
669 }
static const int intsPerMethod
static const QDBusMetaObjectPrivate * priv(const uint *data)
struct QMetaObject::@38 d

◆ inputTypesForMethod()

const int * QDBusMetaObject::inputTypesForMethod ( int  id) const

Definition at line 681 of file qdbusmetaobject.cpp.

682 {
683  //id -= methodOffset();
684  if (id >= 0 && id < priv(d.data)->methodCount) {
685  int handle = priv(d.data)->methodDBusData + id*intsPerMethod;
686  return reinterpret_cast<const int*>(d.data + d.data[handle + 3]);
687  }
688  return 0;
689 }
static const int intsPerMethod
static const QDBusMetaObjectPrivate * priv(const uint *data)
struct QMetaObject::@38 d

◆ outputSignatureForMethod()

const char * QDBusMetaObject::outputSignatureForMethod ( int  id) const

Definition at line 671 of file qdbusmetaobject.cpp.

672 {
673  //id -= methodOffset();
674  if (id >= 0 && id < priv(d.data)->methodCount) {
675  int handle = priv(d.data)->methodDBusData + id*intsPerMethod;
676  return d.stringdata + d.data[handle + 2];
677  }
678  return 0;
679 }
static const int intsPerMethod
static const QDBusMetaObjectPrivate * priv(const uint *data)
struct QMetaObject::@38 d

◆ outputTypesForMethod()

const int * QDBusMetaObject::outputTypesForMethod ( int  id) const

Definition at line 691 of file qdbusmetaobject.cpp.

692 {
693  //id -= methodOffset();
694  if (id >= 0 && id < priv(d.data)->methodCount) {
695  int handle = priv(d.data)->methodDBusData + id*intsPerMethod;
696  return reinterpret_cast<const int*>(d.data + d.data[handle + 4]);
697  }
698  return 0;
699 }
static const int intsPerMethod
static const QDBusMetaObjectPrivate * priv(const uint *data)
struct QMetaObject::@38 d

◆ propertyMetaType()

int QDBusMetaObject::propertyMetaType ( int  id) const

Definition at line 701 of file qdbusmetaobject.cpp.

702 {
703  //id -= propertyOffset();
704  if (id >= 0 && id < priv(d.data)->propertyCount) {
705  int handle = priv(d.data)->propertyDBusData + id*intsPerProperty;
706  return d.data[handle + 1];
707  }
708  return 0;
709 }
static const QDBusMetaObjectPrivate * priv(const uint *data)
static const int intsPerProperty
struct QMetaObject::@38 d

Properties

◆ cached

bool QDBusMetaObject::cached

The documentation for this struct was generated from the following files: