• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kdedglobalaccel_interface.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE libraries
00003 
00004     Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later 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 
00022 #ifndef KDEDGLOBALACCELINTERFACE_H
00023 #define KDEDGLOBALACCELINTERFACE_H
00024 
00025 #include <QtCore/QObject>
00026 #include <QtCore/QByteArray>
00027 #include <QtCore/QList>
00028 #include <QtCore/QMap>
00029 #include <QtCore/QString>
00030 #include <QtCore/QStringList>
00031 #include <QtCore/QVariant>
00032 #include <QtDBus/QtDBus>
00033 
00034 Q_DECLARE_METATYPE(QList<int>)
00035 Q_DECLARE_METATYPE(QList<QStringList>)
00036 
00037 /*
00038  * Proxy class for interface org.kde.KdedGlobalAccel
00039  */
00040 class OrgKdeKdedGlobalAccelInterface: public QDBusAbstractInterface
00041 {
00042     Q_OBJECT
00043 public:
00044     static inline const char *staticInterfaceName()
00045     { return "org.kde.KdedGlobalAccel"; }
00046 
00047 public:
00048     OrgKdeKdedGlobalAccelInterface(const QString &service, const QString &path,
00049                                    const QDBusConnection &connection,
00050                                    QObject *parent = 0)
00051      : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
00052     {
00053         qDBusRegisterMetaType<QList<int> >();
00054         qDBusRegisterMetaType<QList<QStringList> >();
00055     }
00056 
00057     ~OrgKdeKdedGlobalAccelInterface() {}
00058 
00059 public Q_SLOTS: // METHODS
00060     QDBusReply<QStringList> action(int key)
00061     {
00062         QList<QVariant> argumentList;
00063         argumentList << qVariantFromValue(key);
00064         return callWithArgumentList(QDBus::Block, QLatin1String("action"),
00065                                     argumentList);
00066     }
00067 
00068     QDBusReply<QList<int> > shortcut(const QStringList &actionId)
00069     {
00070         QList<QVariant> argumentList;
00071         argumentList << qVariantFromValue(actionId);
00072         return callWithArgumentList(QDBus::Block, QLatin1String("shortcut"),
00073                                     argumentList);
00074     }
00075 
00076     QDBusReply<QList<int> > setShortcut(const QStringList &actionId,
00077                                         const QList<int> &keys, uint flags)
00078     {
00079         QList<QVariant> argumentList;
00080         argumentList << qVariantFromValue(actionId) << qVariantFromValue(keys)
00081                      << qVariantFromValue(flags);
00082         return callWithArgumentList(QDBus::Block, QLatin1String("setShortcut"),
00083                                     argumentList);
00084     }
00085 
00086     Q_NOREPLY void setForeignShortcut(const QStringList &actionId,
00087                                       const QList<int> &keys)
00088     {
00089         QList<QVariant> argumentList;
00090         argumentList << qVariantFromValue(actionId) << qVariantFromValue(keys);
00091         callWithArgumentList(QDBus::NoBlock, QLatin1String("setForeignShortcut"),
00092                              argumentList);
00093     }
00094 
00095     Q_NOREPLY void setInactive(const QStringList &actionId)
00096     {
00097         QList<QVariant> argumentList;
00098         argumentList << qVariantFromValue(actionId);
00099         callWithArgumentList(QDBus::NoBlock, QLatin1String("setInactive"),
00100                              argumentList);
00101     }
00102 
00103     Q_NOREPLY void doRegister(const QStringList &actionId)
00104     {
00105         QList<QVariant> argumentList;
00106         argumentList << qVariantFromValue(actionId);
00107         callWithArgumentList(QDBus::NoBlock, QLatin1String("doRegister"),
00108                              argumentList);
00109     }
00110 
00111     Q_NOREPLY void unRegister(const QStringList &actionId)
00112     {
00113         QList<QVariant> argumentList;
00114         argumentList << qVariantFromValue(actionId);
00115         callWithArgumentList(QDBus::NoBlock, QLatin1String("unRegister"),
00116                              argumentList);
00117     }
00118 
00119     QDBusReply<QList<QStringList> > allMainComponents()
00120     {
00121         QList<QVariant> argumentList;
00122         // argumentList << qVariantFromValue(void); :)
00123         return callWithArgumentList(QDBus::Block, QLatin1String("allMainComponents"),
00124                                     argumentList);
00125     }
00126 
00127 
00128     QDBusReply<QList<QStringList> > allActionsForComponent(const QStringList &actionId)
00129     {
00130         QList<QVariant> argumentList;
00131         argumentList << qVariantFromValue(actionId);
00132         return callWithArgumentList(QDBus::Block, QLatin1String("allActionsForComponent"),
00133                                     argumentList);
00134     }
00135     
00136 //The signals part seems to work by pure black magic, i.e. clever hacks
00137 //with the Qt meta-object / signals & slots system. Maybe.
00138 Q_SIGNALS: // SIGNALS
00139     void invokeAction(const QStringList &actionId, qlonglong timestamp);
00140     void yourShortcutGotChanged(const QStringList &actionId,
00141                                 const QList<int> &keys);
00142 };
00143 
00144 namespace org {
00145   namespace kde {
00146     typedef ::OrgKdeKdedGlobalAccelInterface KdedGlobalAccelInterface;
00147   }
00148 }
00149 
00150 #endif //KDEDGLOBALACCELINTERFACE_H

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal