00001
00022 #ifndef _TelepathyQt_base_debug_h_HEADER_GUARD_
00023 #define _TelepathyQt_base_debug_h_HEADER_GUARD_
00024
00025 #ifndef IN_TP_QT_HEADER
00026 #error IN_TP_QT_HEADER
00027 #endif
00028
00029 #include <TelepathyQt/Callbacks>
00030 #include <TelepathyQt/Constants>
00031 #include <TelepathyQt/DBusService>
00032 #include <TelepathyQt/Global>
00033 #include <TelepathyQt/Types>
00034
00035 namespace Tp
00036 {
00037
00038 class TP_QT_EXPORT BaseDebug : public DBusService
00039 {
00040 Q_OBJECT
00041 public:
00042 explicit BaseDebug(const QDBusConnection &dbusConnection = QDBusConnection::sessionBus());
00043
00044 bool isEnabled() const;
00045 int getMessagesLimit() const;
00046
00047 typedef Callback1<DebugMessageList, DBusError*> GetMessagesCallback;
00048 void setGetMessagesCallback(const GetMessagesCallback &cb);
00049
00050 DebugMessageList getMessages(DBusError *error) const;
00051
00052 public Q_SLOTS:
00053 void setEnabled(bool enabled);
00054 void setGetMessagesLimit(int limit);
00055 void clear();
00056
00057 void newDebugMessage(const QString &domain, DebugLevel level, const QString &message);
00058 void newDebugMessage(double time, const QString &domain, DebugLevel level, const QString &message);
00059
00060 QVariantMap immutableProperties() const;
00061
00062 bool registerObject(DBusError *error = NULL);
00063
00064 protected:
00065 class Adaptee;
00066 friend class Adaptee;
00067 struct Private;
00068 friend struct Private;
00069 Private *mPriv;
00070 };
00071
00072 }
00073
00074 #endif // _TelepathyQt_base_debug_h_HEADER_GUARD_