From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kommander/widgets/popupmenu.h | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 kommander/widgets/popupmenu.h (limited to 'kommander/widgets/popupmenu.h') diff --git a/kommander/widgets/popupmenu.h b/kommander/widgets/popupmenu.h new file mode 100644 index 00000000..f2db18a6 --- /dev/null +++ b/kommander/widgets/popupmenu.h @@ -0,0 +1,61 @@ +// +// C++ Interface: popupmenu +// +// Description: +// +// +// Author: Andras Mantia , (C) 2008 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef POPUPMENU_H +#define POPUPMENU_H + +#include +#include +#include + + +class KPopupMenu; + +/** + @author Andras Mantia +*/ +class PopupMenu : public QLabel, public KommanderWidget +{ + Q_OBJECT + Q_PROPERTY(QString populationText READ populationText WRITE setPopulationText DESIGNABLE false) + Q_PROPERTY(QStringList associations READ associatedText WRITE setAssociatedText DESIGNABLE false) + Q_PROPERTY(bool KommanderWidget READ isKommanderWidget) +public: + PopupMenu(QWidget *parent = 0, const char *name = 0); + ~PopupMenu(); + + virtual bool isKommanderWidget() const; + virtual QString currentState() const; + virtual bool isFunctionSupported(int function); + virtual QString handleDCOP(int function, const QStringList& args); + virtual QStringList associatedText() const; + virtual void setAssociatedText(const QStringList&); + virtual QString populationText() const; + virtual void setPopulationText(const QString&); + KPopupMenu *menu() {return m_menu;} + +public slots: + virtual void setWidgetText(const QString &); + virtual void populate(); + void popup(int x, int y); + +private slots: + void slotMenuItemActivated(int id); + +private: + QString insertSubmenu(const QString& title, const QString &menuWidget, int index, const QString& icon); + + KPopupMenu *m_menu; + QMap m_associations; + QStringList m_params; +}; + +#endif -- cgit v1.2.1