demos/dbus-viewer/qdbusviewer.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the demonstration applications of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QDBUSVIEWER_H
00025 #define QDBUSVIEWER_H
00026 
00027 #include <QtGui/QtGui>
00028 #include <QtDBus/QtDBus>
00029 
00030 class QTreeView;
00031 class QDomDocument;
00032 class QDomElement;
00033 
00034 struct BusSignature
00035 {
00036     QString mService, mPath, mInterface, mName;
00037 };
00038 
00039 class QDBusViewer: public QWidget
00040 {
00041     Q_OBJECT
00042 public:
00043     QDBusViewer(const QDBusConnection &connection, QWidget *parent = 0);
00044 
00045 public slots:
00046     void refresh();
00047 
00048 private slots:
00049     void serviceChanged(QTreeWidgetItem *item);
00050     void showContextMenu(const QPoint &);
00051     void connectionRequested(const BusSignature &sig);
00052     void callMethod(const BusSignature &sig);
00053     void dumpMessage(const QDBusMessage &msg);
00054     void refreshChildren();
00055 
00056     void serviceRegistered(const QString &service);
00057     void serviceUnregistered(const QString &service);
00058     void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
00059 
00060     void activate(const QModelIndex &item);
00061 
00062     void logError(const QString &msg);
00063 
00064 private:
00065     void logMessage(const QString &msg);
00066 
00067     QDBusConnection c;
00068     QString currentService;
00069     QTreeView *tree;
00070     QAction *refreshAction;
00071     QTreeWidget *services;
00072     QTextEdit *log;
00073 };
00074 
00075 #endif

Generated on Thu Mar 15 11:52:32 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1