qdbusmessage.h

00001 /* qdbusmessage.h QDBusMessage object
00002  *
00003  * Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
00004  *
00005  * Licensed under the Academic Free License version 2.1
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 #ifndef QDBUSMESSAGE_H
00024 #define QDBUSMESSAGE_H
00025 
00026 #include "dbus/qdbus.h"
00027 
00028 #include <QtCore/qlist.h>
00029 #include <QtCore/qvariant.h>
00030 
00031 #include <limits.h>
00032 
00033 class QDBusMessagePrivate;
00034 struct DBusMessage;
00035 
00036 class QDBUS_EXPORT QDBusMessage: public QList<QVariant>
00037 {
00038     friend class QDBusConnection;
00039 public:
00040     enum { DefaultTimeout = -1, NoTimeout = INT_MAX};
00041     enum MessageType { InvalidMessage, MethodCallMessage, ReplyMessage,
00042                        ErrorMessage, SignalMessage };
00043 
00044     QDBusMessage();
00045     QDBusMessage(const QDBusMessage &other);
00046     ~QDBusMessage();
00047 
00048     QDBusMessage &operator=(const QDBusMessage &other);
00049 
00050     static QDBusMessage signal(const QString &path, const QString &interface,
00051                                const QString &name);
00052     static QDBusMessage methodCall(const QString &service, const QString &path,
00053                                    const QString &interface, const QString &method);
00054     static QDBusMessage methodReply(const QDBusMessage &other);
00055 
00056     QString path() const;
00057     QString interface() const;
00058     QString name() const; //rename to member?
00059     QString sender() const; //rename to service?
00060     MessageType type() const;
00061 
00062     int timeout() const;
00063     void setTimeout(int ms);
00064 
00065 
00066 //protected:
00067     DBusMessage *toDBusMessage() const;
00068     static QDBusMessage fromDBusMessage(DBusMessage *dmsg);
00069     int serialNumber() const;
00070     int replySerialNumber() const;
00071 
00072 private:
00073     QDBusMessagePrivate *d;
00074 };
00075 
00076 #ifndef QT_NO_DEBUG
00077 QDebug operator<<(QDebug, const QDBusMessage &);
00078 #endif
00079 
00080 #endif
00081 

Generated on Wed Feb 27 10:13:38 2008 for D-BUS by  doxygen 1.4.6