forked from nemomobile/mlite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmremoteaction.h
100 lines (86 loc) · 3.15 KB
/
mremoteaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation ([email protected])
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at [email protected].
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef MREMOTEACTION_H_
#define MREMOTEACTION_H_
#include <QObject>
#include <QVariantList>
#include "mlite-global.h"
class MRemoteActionPrivate;
/*!
* \class MRemoteAction
*
* \brief MRemoteAction implements a MAction that executes a D-Bus call when triggered.
* The D-Bus related parameters can be serialized and unserialized into a string.
*/
class MLITESHARED_EXPORT MRemoteAction : public QObject
{
Q_OBJECT
public:
/*!
* \brief Constructs a MRemoteAction from a D-Bus service path, object path, interface and arguments.
*
* \param serviceName the service path of the D-Bus object to be called
* \param objectPath the object path of the D-Bus object to be called
* \param interface the interface of the D-Bus object to be called
* \param methodName the name of the D-Bus method to call
* \param arguments the arguments of the D-Bus call. Defaults to no arguments.
* \param parent Parent object
*/
explicit MRemoteAction(const QString &serviceName, const QString &objectPath, const QString &interface, const QString &methodName, const QList<QVariant> &arguments = QList<QVariant>(), QObject *parent = NULL);
/*!
* \brief Constructs a MRemoteAction from a string representation of a D-Bus remote action acquired with toString().
*
* \param string the QString to construct the MRemoteAction from
* \param parent Parent object
*/
explicit MRemoteAction(const QString &string = QString(), QObject *parent = NULL);
/*!
* \brief Constructs a copy of another MRemoteAction.
*
* \param action the MRemoteAction to copy
*/
MRemoteAction(const MRemoteAction &action);
/*!
* \brief Destroys the MRemoteAction.
*/
virtual ~MRemoteAction();
/*!
* Returns a string representation of this remote action.
*
* \return a string representation of this remote action
*/
QString toString() const;
public Q_SLOTS:
/*!
* \brief A slot for calling the D-Bus function when the action is triggered
*/
void trigger();
protected:
//! A pointer to the private implementation class
MRemoteActionPrivate *d_ptr;
/*!
* \brief Initializes the MRemoteAction from a string representation
*
* \param string a string representation of a remote action
*/
void fromString(const QString &string);
private:
Q_DECLARE_PRIVATE(MRemoteAction)
};
#endif /* MREMOTEACTION_H_ */