Tizen 2.0 Release
[profile/ivi/libscl-ui.git] / binary_xmlresource / include / nine_patch_file_list_bin_parser.h
1 /*
2  * Copyright 2012-2013 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://floralicense.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
18 #ifndef __Nine_patch_file_list_bin_Parser__H__
19 #define __Nine_patch_file_list_bin_Parser__H__
20 #include "iparserinfo_provider.h"
21 #include "sclres_type.h"
22 #include "string_collector.h"
23 #include "file_storage_impl.h"
24 #include "_auto_metadata.h"
25
26 class Nine_patch_file_list_bin_Parser {
27     static const int MAX_NINE_PATCH_FILE_LIST = 128;
28     public:
29         ~Nine_patch_file_list_bin_Parser();
30         static Nine_patch_file_list_bin_Parser *get_instance();
31     void init(const FileStorage& storage, int, int, IParserInfo_Provider*);
32     bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
33     SclNinePatchInfo* get_nine_patch_list();
34     private:
35     Nine_patch_file_list_bin_Parser();
36     void parsing_nine_patch_file_list();
37     private:
38         static Nine_patch_file_list_bin_Parser *m_instance;
39         SclNinePatchInfo m_nine_patch_file_list[MAX_NINE_PATCH_FILE_LIST];
40         int m_size;
41         StringCollector m_string_collector;
42         FileStorage m_storage;
43         IParserInfo_Provider* parser_info_provider;
44     private:
45     class DestructHelper {
46         public:
47         ~DestructHelper() {
48             if (Nine_patch_file_list_bin_Parser::m_instance != NULL)
49                 delete m_instance;
50         }
51     };
52     static DestructHelper des;
53 };
54
55
56 #endif