/
mms_attachment.h
101 lines (86 loc) · 2.94 KB
/
mms_attachment.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
101
/*
* Copyright (C) 2013-2020 Jolla Ltd.
* Copyright (C) 2013-2020 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2020 Open Mobile Platform LLC.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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.
*
*/
#ifndef SAILFISH_MMS_ATTACHMENT_H
#define SAILFISH_MMS_ATTACHMENT_H
#include "mms_lib_types.h"
/* Attachment object */
struct _mms_attachment {
GObject parent; /* Parent object */
const MMSConfig* config; /* Immutable configuration */
char* original_file; /* Full path to the original file */
const char* file_name; /* Actual file name */
char* content_type; /* Content type */
char* content_id; /* Content id */
char* content_location; /* Content location */
GMappedFile* map; /* Mapped attachment file */
unsigned int flags; /* Flags: */
#define MMS_ATTACHMENT_SMIL (0x01)
#define MMS_ATTACHMENT_RESIZABLE (0x02)
};
#define CONTENT_TYPE_PARAM_NAME "name"
#define CONTENT_TYPE_PARAM_CHARSET "charset"
#define MMS_DEFAULT_CHARSET "utf-8"
typedef struct mms_attachment_class {
GObjectClass parent;
gboolean (*fn_init)(
MMSAttachment* attachment);
void (*fn_reset)(
MMSAttachment* attachment);
gboolean (*fn_resize)(
MMSAttachment* attachment,
const MMSSettingsSimData* settings);
} MMSAttachmentClass;
GType mms_attachment_get_type(void);
GType mms_attachment_text_get_type(void);
GType mms_attachment_image_get_type(void);
GType mms_attachment_jpeg_get_type(void);
#define MMS_TYPE_ATTACHMENT (mms_attachment_get_type())
#define MMS_TYPE_ATTACHMENT_TEXT (mms_attachment_text_get_type())
#define MMS_TYPE_ATTACHMENT_IMAGE (mms_attachment_image_get_type())
#define MMS_TYPE_ATTACHMENT_JPEG (mms_attachment_jpeg_get_type())
MMSAttachment*
mms_attachment_new(
const MMSConfig* config,
const MMSAttachmentInfo* info,
GError** error);
MMSAttachment*
mms_attachment_new_smil(
const MMSConfig* config,
const char* path,
MMSAttachment** attachments,
int count,
GError** error);
MMSAttachment*
mms_attachment_ref(
MMSAttachment* attachment);
void
mms_attachment_unref(
MMSAttachment* attachment);
void
mms_attachment_reset(
MMSAttachment* attachment);
gboolean
mms_attachment_resize(
MMSAttachment* attachment,
const MMSSettingsSimData* settings);
#endif /* SAILFISH_MMS_ATTACHMENT_H */
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/