summaryrefslogtreecommitdiff
path: root/include/doc-data.h
blob: 70029c46dfe07278aa011582d46b11d48cd594d0 (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
90
91
92
93
94
95
96
97
98
/*
 * Copyright (c) 2015 Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://floralicense.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 _DOC_DATA_H_
#define _DOC_DATA_H_

#include "doc-local-data.h"
#include "attach-panel-document.h"


typedef enum _FILE_TYPE fsFileType;
enum _FILE_TYPE {
	FILE_TYPE_NONE = 0,
	FILE_TYPE_DIR,			/**< Folder category */
	FILE_TYPE_FILE,			/**< File category */
	FILE_TYPE_IMAGE,	   /**< Image category */
	FILE_TYPE_VIDEO,	   /**< Video category */
	FILE_TYPE_MUSIC,	   /**< Music category */
	FILE_TYPE_SOUND,	   /**< Sound category */
	FILE_TYPE_PDF,		   /**< Pdf category */
	FILE_TYPE_DOC,		   /**< Word category */
	FILE_TYPE_PPT,		   /**< Powerpoint category */
	FILE_TYPE_EXCEL,	   /**< Excel category */
	FILE_TYPE_VOICE,	   /**< Voice category */
	FILE_TYPE_HTML,		   /**< Html category */
	FILE_TYPE_FLASH,	   /**< Flash category */
	FILE_TYPE_GAME,		   /**< Game category */
	FILE_TYPE_APP,		   /**< Application category */
	FILE_TYPE_THEME,	   /**< Theme category */
	FILE_TYPE_TXT,		   /**< Txt category */
	FILE_TYPE_VCONTACT,	   /**< Vcontact category */
	FILE_TYPE_VCALENDAR,   /**< Vcalendar category */
	FILE_TYPE_VNOTE,	   /**< Vnote category */
	FILE_TYPE_VBOOKMARK,	   /**< Vbookmark category */
	FILE_TYPE_VIDEO_PROJECT,   /**< Video editor project category */
	FILE_TYPE_RADIO_RECORDED,  /**< radio recorded clips category */
	FILE_TYPE_MOVIE_MAKER,	   /**< Movie maker project category */
	FILE_TYPE_SVG,		   /**< Svg category */
	FILE_TYPE_RSS,		   /**< Rss reader file, *.opml */
	FILE_TYPE_CERTIFICATION,   /**< certification file, *.pem */
	FILE_TYPE_JAVA,		   /**< java file, *.jad, *.jar */
	FILE_TYPE_WGT,		   /**< wrt , *.wgt, *.wgt */
	FILE_TYPE_TPK,			/**< *.tpk>*/
	FILE_TYPE_SNB,			/**<*.snb> */
	FILE_TYPE_GUL,			/**<*.gul> */
	FILE_TYPE_HWP,			/**<*.hwp> */
	FILE_TYPE_ETC,			/**< Other files category */
	FILE_TYPE_TASK,
	FILE_TYPE_EML,
	FILE_TYPE_CSV,
	FILE_TYPE_SPD,
	FILE_TYPE_ZIP,
	FILE_TYPE_MAX
};

#ifdef _cplusplus
extern "C" {
#endif

#define SAFE_FREE_CHAR(x) do {\
					if ((x) != NULL) {\
						free(x); \
						x = NULL;\
					} \
				 } while (0)

	typedef int (*doc_restore_selected_cb) (Eina_List * sel_id,
											doc_item * ditem);

	int doc_data_get_item_cnt(doc_ugdata * ugd, int *item_cnt);
	int doc_data_get_sel_paths(doc_ugdata * ugd, char **filepath,
							   char ***filepath_arr, int *cnt);
	int document_file_category(const char *filepath,
							   fsFileType * category);
	int doc_data_get_media_data(doc_ugdata * ugd, int type, int start_pos,
								int end_pos, Eina_List ** pmedias_elist,
								doc_restore_selected_cb restore_cb,
								Eina_List * sel_id);
	int doc_del_media_data_by_id(doc_ugdata * ugd, const char *media_id);
	int doc_data_init(doc_ugdata * ugd);
	int doc_data_finalize(doc_ugdata * ugd);
#ifdef _cplusplus
}
#endif
#endif							/* _DOC_DATA_H_ */