summaryrefslogtreecommitdiff
path: root/src/mm-sms-list.h
blob: 2937065780c3eb7655ba947b102a4c8dad64e1f6 (plain)
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
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details:
 *
 * Copyright (C) 2012 Google, Inc.
 */

#ifndef MM_SMS_LIST_H
#define MM_SMS_LIST_H

#include <glib.h>
#include <glib-object.h>

#include "mm-base-modem.h"
#include "mm-sms-part.h"

#define MM_TYPE_SMS_LIST            (mm_sms_list_get_type ())
#define MM_SMS_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SMS_LIST, MMSmsList))
#define MM_SMS_LIST_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  MM_TYPE_SMS_LIST, MMSmsListClass))
#define MM_IS_SMS_LIST(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SMS_LIST))
#define MM_IS_SMS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  MM_TYPE_SMS_LIST))
#define MM_SMS_LIST_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  MM_TYPE_SMS_LIST, MMSmsListClass))

typedef struct _MMSmsList MMSmsList;
typedef struct _MMSmsListClass MMSmsListClass;
typedef struct _MMSmsListPrivate MMSmsListPrivate;

#define MM_SMS_LIST_MODEM "sms-list-modem"

#define MM_SMS_ADDED     "sms-added"
#define MM_SMS_DELETED   "sms-deleted"

struct _MMSmsList {
    GObject parent;
    MMSmsListPrivate *priv;
};

struct _MMSmsListClass {
    GObjectClass parent;

    /* Signals */
    void (*sms_added)     (MMSmsList *self,
                           const gchar *sms_path,
                           gboolean received);
    void (*sms_deleted)   (MMSmsList *self,
                           const gchar *sms_path);
};

GType mm_sms_list_get_type (void);

MMSmsList *mm_sms_list_new (MMBaseModem *modem);

GStrv mm_sms_list_get_paths (MMSmsList *self);
guint mm_sms_list_get_count (MMSmsList *self);

gboolean mm_sms_list_has_part (MMSmsList *self,
                               MMSmsStorage storage,
                               guint index);

gboolean mm_sms_list_take_part (MMSmsList *self,
                                MMSmsPart *part,
                                MMSmsState state,
                                MMSmsStorage storage,
                                GError **error);

void mm_sms_list_add_sms (MMSmsList *self,
                          MMBaseSms *sms);

void     mm_sms_list_delete_sms        (MMSmsList *self,
                                        const gchar *sms_path,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);
gboolean mm_sms_list_delete_sms_finish (MMSmsList *self,
                                        GAsyncResult *res,
                                        GError **error);

gboolean mm_sms_list_has_local_multipart_reference (MMSmsList *self,
                                                    const gchar *number,
                                                    guint8 reference);

#endif /* MM_SMS_LIST_H */