Initialize Tizen 2.3
[apps/osp/Internet.git] / inc / IntCommonLib.h
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //!Internet
18 /*@file: IntCommonLib.h
19  *@brief: To define the common method of Internet application
20  */
21
22 #ifndef _INT_COMMON_LIB_H_
23 #define _INT_COMMON_LIB_H_
24
25 #include <FGraphics.h>
26
27 /**
28 * @struct       CommonBitmapTable
29 *
30 * Defines the table to store a bitmap
31 *
32 */
33 struct CommonBitmapTable
34 {
35         Tizen::Graphics::Bitmap* ptr;
36         int refcount;
37         Tizen::Base::String filename;
38         int width;
39         int height;
40 };
41
42 /**
43 * @enum CommonBitmapId
44 *
45 * Defines a ID for a Bitmap path
46 *
47 */
48 enum CommonBitmapId
49 {
50
51 };
52
53 /**
54  * @class CommonUtil
55  * @brief This file declares common methods to be used
56  */
57 class CommonUtil
58 {
59 public:
60
61         /**
62          * Returns a pointer to a bitmap value using ID
63          *
64          * @return              Pointer to a bitmap value
65          * @param[in]   CommonBitmapId  The ID of the Bitmap
66          * @remarks             To work properly, the existing CommonBitmapId has to be passed.
67          */
68         static Tizen::Graphics::Bitmap* GetBitmap(uint id);
69
70         /**
71          * Returns a pointer to a bitmap value using bitmap path, bitmap width and bitmap height
72          *
73          * @return              Pointer to a bitmap value
74          * @param[in]   strPath The path of the existing bitmap stored in res folder
75          * @param[in]   width The width of the existing bitmap stored in res folder
76          * @param[in]   height The height of the existing bitmap stored in res folder
77          * @remarks             To work properly, the existing strPath, its width and height has to be passed.
78          */
79         static Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& strPath, const int width, const int height);
80
81         /**
82          * Gets a bitmap using ID assigned to it.
83          *
84          * @return              Bitmap
85          * @param[in]   Path
86          * @param[in]   width
87          * @param[in]   height
88          * @remarks             Releases all the bitmaps stored
89          */
90         static Tizen::Graphics::Bitmap* GetNinepatchedBitmapN(const Tizen::Base::String& strPath, const int width, const int height);
91
92         /**
93          * Returns the string value using ID
94          *
95          * @return              String
96          * @param[in]   resourceId      The ID of the resource string
97          * @remarks             To work properly, the existing resourceId has to be passed.
98          */
99         static Tizen::Base::String GetString(const Tizen::Base::String& resourceId);
100
101         /**
102          * Gets the font size from the settings
103          *
104          * @return              Int
105          * @param[in]   void
106          * @remarks             Gets the font size
107          */
108         static int GetFontSize(void);
109
110 private:
111         static CommonBitmapTable __commonBitmapTable[];
112 };
113
114 #endif //_INT_COMMON_LIB_H_