1 /***************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (directui@nokia.com)
9 ** If you have questions regarding the use of this file, please contact
10 ** Nokia at directui@nokia.com.
12 ** This library is free software; you can redistribute it and/or
13 ** modify it under the terms of the GNU Lesser General Public
14 ** License version 2.1 as published by the Free Software Foundation
15 ** and appearing in the file LICENSE.LGPL included in the packaging
18 ****************************************************************************/
20 #ifndef MREMOTEACTION_H_
21 #define MREMOTEACTION_H_
24 #include "mlite-global.h"
26 class MRemoteActionPrivate;
29 * \class MRemoteAction
31 * \brief MRemoteAction implements a MAction that executes a D-Bus call when triggered.
32 * The D-Bus related parameters can be serialized and unserialized into a string.
34 class MLITESHARED_EXPORT MRemoteAction : public MAction
40 * \brief Constructs a MRemoteAction from a D-Bus service path, object path, interface and arguments.
42 * \param serviceName the service path of the D-Bus object to be called
43 * \param objectPath the object path of the D-Bus object to be called
44 * \param interface the interface of the D-Bus object to be called
45 * \param methodName the name of the D-Bus method to call
46 * \param arguments the arguments of the D-Bus call. Defaults to no arguments.
47 * \param parent Parent object
49 explicit MRemoteAction(const QString &serviceName, const QString &objectPath, const QString &interface, const QString &methodName, const QList<QVariant> &arguments = QList<QVariant>(), QObject *parent = NULL);
52 * \brief Constructs a MRemoteAction from a string representation of a D-Bus remote action acquired with toString().
54 * \param string the QString to construct the MRemoteAction from
55 * \param parent Parent object
57 explicit MRemoteAction(const QString &string = QString(), QObject *parent = NULL);
60 * \brief Constructs a copy of another MRemoteAction.
62 * \param action the MRemoteAction to copy
64 MRemoteAction(const MRemoteAction &action);
67 * \brief Destroys the MRemoteAction.
69 virtual ~MRemoteAction();
72 * Returns a string representation of this remote action.
74 * \return a string representation of this remote action
76 QString toString() const;
80 * \brief A slot for calling the D-Bus function when the action is triggered
86 * \brief Initializes the MRemoteAction from a string representation
88 * \param string a string representation of a remote action
90 void fromString(const QString &string);
93 MRemoteAction(MRemoteActionPrivate &dd, QObject *parent = NULL);
97 Q_DECLARE_PRIVATE(MRemoteAction)
100 #endif /* MREMOTEACTION_H_ */