dbusmenu-qt  0.9.0
/srv/build/STABLE_8/pkgs/dbusmenu-qt/BUILD/libdbusmenu-qt-0.9.0/src/dbusmenuexporter.h
00001 /* This file is part of the dbusmenu-qt library
00002    Copyright 2009 Canonical
00003    Author: Aurelien Gateau <aurelien.gateau@canonical.com>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License (LGPL) as published by the Free Software Foundation;
00008    either version 2 of the License, or (at your option) any later
00009    version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef DBUSMENUEXPORTER_H
00022 #define DBUSMENUEXPORTER_H
00023 
00024 // Qt
00025 #include <QtCore/QObject>
00026 #include <QtDBus/QDBusConnection>
00027 
00028 // Local
00029 #include <dbusmenu_export.h>
00030 
00031 class QAction;
00032 class QMenu;
00033 
00034 class DBusMenuExporterPrivate;
00035 
00039 class DBUSMENU_EXPORT DBusMenuExporter : public QObject
00040 {
00041     Q_OBJECT
00042 public:
00048     DBusMenuExporter(const QString &dbusObjectPath, QMenu *menu, const QDBusConnection &dbusConnection = QDBusConnection::sessionBus());
00049 
00050     ~DBusMenuExporter();
00051 
00056     void activateAction(QAction *action);
00057 
00064     void setStatus(const QString &status);
00065 
00070     QString status() const;
00071 
00072 protected:
00079     virtual QString iconNameForAction(QAction *action);
00080 
00081 private Q_SLOTS:
00082     void doUpdateActions();
00083     void doEmitLayoutUpdated();
00084     void slotActionDestroyed(QObject*);
00085 
00086 private:
00087     Q_DISABLE_COPY(DBusMenuExporter)
00088     DBusMenuExporterPrivate *const d;
00089 
00090     friend class DBusMenuExporterPrivate;
00091     friend class DBusMenuExporterDBus;
00092     friend class DBusMenu;
00093 };
00094 
00095 #endif /* DBUSMENUEXPORTER_H */
 All Classes Functions