summaryrefslogtreecommitdiff
path: root/viewer/include/email-viewer-utils.h
blob: 88aeeaa806bf569497ebffe4f342df8dcf225714 (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
/*
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.tizenopensource.org/license
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __DEF_email_viewer_utils_H__
#define __DEF_email_viewer_utils_H__

#include <glib.h>
#include <glib/gprintf.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <Elementary.h>
#include "email-viewer.h"

#undef STR_VALID
#define STR_VALID(str) \
	((str != NULL && strlen(str) > 0) ? TRUE : FALSE)

#undef STR_INVALID
#define STR_INVALID(str) \
	((str == NULL || strlen(str) == 0) ? TRUE : FALSE)

#undef STR_LEN
#define STR_LEN(str) \
	({ char *s = str; (s) ? strlen(s) : 0; })

/* GList iterator */
#define LIST_ITER_START(i, list) \
	for (i = 0; i < g_list_length(list); ++i)

#define LIST_ITER_START_REVERSE(i, list) \
	for (i = (g_list_length(list) - 1); i >= 0; --i)

#define LIST_ITER_GET(i, list) \
	g_list_nth(list, i)

#define LIST_ITER_GET_DATA(i, list) \
	g_list_nth_data(list, i)

typedef void (*popup_cb) (void *data, Evas_Object *obj, void *event_info);

Evas_Object *viewer_make_thumbnail(char *path, Evas_Object *parent);
void _create_notify(EmailViewerUGD *ug_data, char *header, char *content,
						int btn_num, char *btn1_lb, popup_cb resp_cb1,
						char *btn2_lb, popup_cb resp_cb2, popup_cb resp_block_cb);

int _find_folder_id_using_folder_type(EmailViewerUGD *ug_data, email_mailbox_type_e mailbox_type);

void _move_email(EmailViewerUGD *ug_data, int dest_folder_id, gboolean is_delete);
void _delete_email(EmailViewerUGD *ug_data);
void _notify_mailbox_size(EmailViewerUGD *ug_data, char *size);

#endif	/* __DEF_email_viewer_utils_H__ */

/* EOF */