dbusmenu-qt 0.8.2
|
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 00058 protected: 00065 virtual QString iconNameForAction(QAction *action); 00066 00067 private Q_SLOTS: 00068 void doUpdateActions(); 00069 void doEmitLayoutUpdated(); 00070 void slotActionDestroyed(QObject*); 00071 00072 private: 00073 Q_DISABLE_COPY(DBusMenuExporter) 00074 DBusMenuExporterPrivate *const d; 00075 00076 friend class DBusMenuExporterPrivate; 00077 friend class DBusMenuExporterDBus; 00078 friend class DBusMenu; 00079 }; 00080 00081 #endif /* DBUSMENUEXPORTER_H */