apply FSL(Flora Software License)
[apps/home/libug-worldclock-efl.git] / clock-common / include / clock_fwk_icu.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   * 
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   * 
8   *     http://www.tizenopensource.org/license
9   * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17 #ifndef __CLK_FWK_ICU_H__
18 #define __CLK_FWK_ICU_H__
19
20 #include "clock_fwk_define.h"
21 #include <unicode/uloc.h>
22 #include <unicode/udat.h>
23 #include <unicode/ustring.h>
24 #include <time.h>
25
26 #define MAX_PATTERN_LENGHT  (32)
27 #define MAX_TIMEZONE_LENGHT (64)
28
29 typedef enum {
30         CLK_DATE_FORMAT_DD_MM_YYYY = 0,
31         CLK_DATE_FORMAT_MM_DD_YYYY,
32         CLK_DATE_FORMAT_YYYY_MM_DD,
33         CLK_DATE_FORMAT_YYYY_DD_MM,
34 } CLK_DATE_FORMAT;
35
36 typedef enum {
37         CLK_TIME_FORMAT_12HOUR = 0,
38         CLK_TIME_FORMAT_24HOUR,
39 } CLK_TIME_FORMAT;
40
41 CLK_DATE_FORMAT clk_fwk_icu_date_format_get();
42 CLK_TIME_FORMAT clk_fwk_icu_time_format_get();
43
44 int clk_fwk_icu_get_data(time_t time, char *dstStr, int dstStr_num, char *loc,
45                          char *pattern, int pattern_num, const char *timezone);
46 int clk_timezone_get(char *dst, size_t number);
47 void clk_timezone_update();
48
49 #endif                          //__CLK_FWK_ICU_H__