~neon/project-neon/libmm-qt

« back to all changes in this revision

Viewing changes to modemmessaging.h

  • Committer: Jan Grulich
  • Date: 2013-10-06 11:42:12 UTC
  • Revision ID: git-v1:6b330d21e12353005970209902f3e02b2786e265
Rename files to mach classes and dbus interfaces

Update README a little bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2013 Anant Kamath <kamathanant@gmail.com>
 
3
Copyright 2013 Lukas Tinkl <ltinkl@redhat.com>
 
4
 
 
5
This library is free software; you can redistribute it and/or
 
6
modify it under the terms of the GNU Lesser General Public
 
7
License as published by the Free Software Foundation; either
 
8
version 2.1 of the License, or (at your option) version 3, or any
 
9
later version accepted by the membership of KDE e.V. (or its
 
10
successor approved by the membership of KDE e.V.), which shall
 
11
act as a proxy defined in Section 6 of version 3 of the license.
 
12
 
 
13
This library is distributed in the hope that it will be useful,
 
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
Lesser General Public License for more details.
 
17
 
 
18
You should have received a copy of the GNU Lesser General Public
 
19
License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
20
*/
 
21
 
 
22
#ifndef MODEMMANAGER_MODEMMESSAGING_H
 
23
#define MODEMMANAGER_MODEMMESSAGING_H
 
24
 
 
25
#include "ModemManagerQt-export.h"
 
26
 
 
27
#include <QObject>
 
28
#include <QSharedPointer>
 
29
 
 
30
#include "sms.h"
 
31
#include "generic-types.h"
 
32
#include "interface.h"
 
33
 
 
34
class ModemMessagingPrivate;
 
35
 
 
36
namespace ModemManager
 
37
{
 
38
class MODEMMANAGERQT_EXPORT ModemMessaging : public Interface
 
39
{
 
40
    Q_OBJECT
 
41
    Q_DECLARE_PRIVATE(ModemMessaging)
 
42
 
 
43
public:
 
44
 
 
45
    explicit ModemMessaging(const QString &path, QObject *parent = 0);
 
46
    ~ModemMessaging();
 
47
 
 
48
    // properties
 
49
    QList<MMSmsStorage> supportedStorages() const;
 
50
    MMSmsStorage defaultStorage() const;
 
51
 
 
52
    //methods
 
53
    /**
 
54
     * List all SMS messages
 
55
     */
 
56
    QList<QDBusObjectPath> listMessages();
 
57
 
 
58
    /**
 
59
     * Create a new SMS message
 
60
     */
 
61
    QDBusPendingReply<QDBusObjectPath> createMessage(const QVariantMap &properties);
 
62
 
 
63
    /**
 
64
     * Delete an SMS message
 
65
     */
 
66
    QDBusPendingReply<> deleteMessage(const QDBusObjectPath &path);
 
67
 
 
68
    /**
 
69
     * Create a new Sms object for a particular message
 
70
     */
 
71
    ModemManager::Sms::Ptr createSms(const QDBusObjectPath &path);
 
72
 
 
73
private Q_SLOTS:
 
74
    void onPropertiesChanged(const QString &interface, const QVariantMap &changedProperties, const QStringList &invalidatedProps);
 
75
    void onMessageAdded(const QDBusObjectPath &path, bool received);
 
76
    void onMessageDeleted(const QDBusObjectPath &path);
 
77
 
 
78
Q_SIGNALS:
 
79
    void messageAdded(const QDBusObjectPath &path, bool received);
 
80
    void messageDeleted(const QDBusObjectPath &path);
 
81
};
 
82
 
 
83
} // namespace ModemManager
 
84
 
 
85
#endif