2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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
8 // http://floralicense.org/license/
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.
18 * @file PhnAppUtility.h
19 * @brief This is the header file for the %AppUtility class.
21 * This header file contains the declarations for %AppUtility class.
23 #ifndef _PHN_APP_UTILITY_H_
24 #define _PHN_APP_UTILITY_H_
30 enum KeypadTextPosition
38 POSITION_BOTTOM_CENTER,
39 POSITION_SUGGESTION_NAME,
40 POSITION_SUGGESTION_NUMBER
45 TABLEVIEWITEMPOS_SINGLE_ITEM,
47 TABLEVIEWITEMPOS_CENTER,
48 TABLEVIEWITEMPOS_BOTTOM,
51 enum TableViewItemType
53 TABLEVIEWITEMTYPE_SINGLE_TXT,
54 TABLEVIEWITEMTYPE_MAIN_TXT,
55 TABLEVIEWITEMTYPE_SUB_TXT,
60 * @brief This class provides common functionalities across application through static member functions.
61 * Its instance cannot needed.
68 AppUtility(const AppUtility& obj);
69 virtual ~AppUtility(void);
73 * Fetches the String from resources based on
74 * resource id provided by "stringId".
76 static Tizen::Base::String GetResourceString(const Tizen::Base::String& stringId);
79 * Fetches the Bitmap from resources and
80 * scales it to specified width and height, if provided.
82 static Tizen::Graphics::Bitmap* GetBitmapFromResourcesN(const Tizen::Base::String& imagePath, int imgWidth = 0, int imgHeight = 0);
84 //Function used to set backgorund bitmap to table item based on its position in GroupedTableView.
85 static void SetBackgroundBitmapToTableItem(Tizen::Ui::Controls::TableViewItem* pTableItem, TableViewItemPos position);
86 //Function is used to set and change expand icon to expandable item based on its state.
87 static void SetExpandIconToTableItem(Tizen::Ui::Controls::TableViewItem* pTableItem, bool isExpanded);
88 //Function to get Font size for settings view
89 static int GetSettingsItemFontSize(void);
90 //Function to get the Item Size based on the Font size that is set
91 static int GetSettingsItemRectSize(void);
93 static int GetSettingsSubItemSize(void);
95 static int GetSettingsMainItemSize(void);
96 //function to get Global font size
97 static void GetGlobalFontAndItemHeight(float *fontSize, float *itemHeight);
98 //funcstion to convert string to pointer character array
99 static char* ConvertStringToPointerCharArrayN(const Tizen::Base::String& strToConvert);
102 #endif // _PHN_APP_UTILITY_H_