src/dbus/qdbusabstractinterface.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the QtDBus module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef QDBUSABSTRACTINTERFACE_H
       
    43 #define QDBUSABSTRACTINTERFACE_H
       
    44 
       
    45 #include <QtCore/qstring.h>
       
    46 #include <QtCore/qvariant.h>
       
    47 #include <QtCore/qlist.h>
       
    48 #include <QtCore/qobject.h>
       
    49 
       
    50 #include <QtDBus/qdbusmessage.h>
       
    51 #include <QtDBus/qdbusextratypes.h>
       
    52 #include <QtDBus/qdbusconnection.h>
       
    53 
       
    54 QT_BEGIN_HEADER
       
    55 
       
    56 QT_BEGIN_NAMESPACE
       
    57 
       
    58 QT_MODULE(DBus)
       
    59 
       
    60 class QDBusError;
       
    61 class QDBusPendingCall;
       
    62 
       
    63 class QDBusAbstractInterfacePrivate;
       
    64 
       
    65 class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
       
    66 {
       
    67 public:
       
    68     int qt_metacall(QMetaObject::Call, int, void**);
       
    69 protected:
       
    70     QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &dd, QObject *parent);
       
    71 private:
       
    72     Q_DECLARE_PRIVATE(QDBusAbstractInterface)
       
    73 };
       
    74 
       
    75 class QDBUS_EXPORT QDBusAbstractInterface:
       
    76 #ifdef Q_QDOC
       
    77         public QObject
       
    78 #else
       
    79         public QDBusAbstractInterfaceBase
       
    80 #endif
       
    81 {
       
    82     Q_OBJECT
       
    83 
       
    84 public:
       
    85     virtual ~QDBusAbstractInterface();
       
    86     bool isValid() const;
       
    87 
       
    88     QDBusConnection connection() const;
       
    89 
       
    90     QString service() const;
       
    91     QString path() const;
       
    92     QString interface() const;
       
    93 
       
    94     QDBusError lastError() const;
       
    95 
       
    96     QDBusMessage call(const QString &method,
       
    97                       const QVariant &arg1 = QVariant(),
       
    98                       const QVariant &arg2 = QVariant(),
       
    99                       const QVariant &arg3 = QVariant(),
       
   100                       const QVariant &arg4 = QVariant(),
       
   101                       const QVariant &arg5 = QVariant(),
       
   102                       const QVariant &arg6 = QVariant(),
       
   103                       const QVariant &arg7 = QVariant(),
       
   104                       const QVariant &arg8 = QVariant());
       
   105 
       
   106     QDBusMessage call(QDBus::CallMode mode,
       
   107                       const QString &method,
       
   108                       const QVariant &arg1 = QVariant(),
       
   109                       const QVariant &arg2 = QVariant(),
       
   110                       const QVariant &arg3 = QVariant(),
       
   111                       const QVariant &arg4 = QVariant(),
       
   112                       const QVariant &arg5 = QVariant(),
       
   113                       const QVariant &arg6 = QVariant(),
       
   114                       const QVariant &arg7 = QVariant(),
       
   115                       const QVariant &arg8 = QVariant());
       
   116 
       
   117     QDBusMessage callWithArgumentList(QDBus::CallMode mode,
       
   118                                       const QString &method,
       
   119                                       const QList<QVariant> &args);
       
   120 
       
   121     bool callWithCallback(const QString &method,
       
   122                           const QList<QVariant> &args,
       
   123                           QObject *receiver, const char *member, const char *errorSlot);
       
   124     bool callWithCallback(const QString &method,
       
   125                           const QList<QVariant> &args,
       
   126                           QObject *receiver, const char *member);
       
   127 
       
   128     QDBusPendingCall asyncCall(const QString &method,
       
   129                                const QVariant &arg1 = QVariant(),
       
   130                                const QVariant &arg2 = QVariant(),
       
   131                                const QVariant &arg3 = QVariant(),
       
   132                                const QVariant &arg4 = QVariant(),
       
   133                                const QVariant &arg5 = QVariant(),
       
   134                                const QVariant &arg6 = QVariant(),
       
   135                                const QVariant &arg7 = QVariant(),
       
   136                                const QVariant &arg8 = QVariant());
       
   137     QDBusPendingCall asyncCallWithArgumentList(const QString &method,
       
   138                                                const QList<QVariant> &args);
       
   139 
       
   140 protected:
       
   141     QDBusAbstractInterface(const QString &service, const QString &path, const char *interface,
       
   142                            const QDBusConnection &connection, QObject *parent);
       
   143     QDBusAbstractInterface(QDBusAbstractInterfacePrivate &, QObject *parent);
       
   144 
       
   145     void connectNotify(const char *signal);
       
   146     void disconnectNotify(const char *signal);
       
   147     QVariant internalPropGet(const char *propname) const;
       
   148     void internalPropSet(const char *propname, const QVariant &value);
       
   149     QDBusMessage internalConstCall(QDBus::CallMode mode,
       
   150                                    const QString &method,
       
   151                                    const QList<QVariant> &args = QList<QVariant>()) const;
       
   152 
       
   153 private:
       
   154     Q_DECLARE_PRIVATE(QDBusAbstractInterface)
       
   155     Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString))
       
   156 };
       
   157 
       
   158 QT_END_NAMESPACE
       
   159 
       
   160 QT_END_HEADER
       
   161 
       
   162 #endif