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 CallCommonUtils.h
19 * @brief This is the header file for the %DialUtil class.
21 * This header file contains the declarations for commonly used functions.
23 #ifndef _PHN_COMMON_UTILS_H_
24 #define _PHN_COMMON_UTILS_H_
38 FONT_SUGGESTION_MOBILE,
39 FONT_SUGGESTION_NUMBER,
40 FONT_SUGGESTION_LIST_NUMBER,
41 FONT_HIGHLIGHT_SEARCH_KEYWORD
44 //Command Ids used in Dialer tab. Always append new command ids at bottom.
66 enum LogContextActionIds
68 IDA_LIST_ELEMENT_CALL = 105,
69 IDA_LIST_ELEMENT_VIDEO_CALL,
70 IDA_LIST_ELEMENT_MESSAGE,
71 IDA_LIST_ELEMENT_DELETE,
76 extern const int ID_NAME_STRING;
77 extern const int ID_NUMBER_STRING;
78 extern const int ID_TIME_STRING;
79 extern const int ID_CONTACT_BITMAP;
80 extern const int ID_CALLTYPE_BITMAP;
83 extern const int X_TEXT_LINE1_ITEM;
84 extern const int Y_TEXT_LINE1_ITEM;
85 extern const int H_TEXT_LINE1_ITEM;
86 extern const int W_TEXT_LINE1_ITEM;
88 extern const int X_TEXT_LINE2_ITEM;
89 extern const int Y_TEXT_LINE2_ITEM;
90 extern const int H_TEXT_LINE2_ITEM;
91 extern const int W_TEXT_LINE2_ITEM;
93 extern const int X_TEXT_TIME_ITEM;
94 extern const int Y_TEXT_TIME_ITEM;
95 extern const int H_TEXT_TIME_ITEM;
96 extern const int W_TEXT_TIME_ITEM;
98 extern const int X_CONTACT_BITMAP_ITEM;
99 extern const int Y_CONTACT_BITMAP_ITEM;
100 extern const int H_CONTACT_BITMAP_ITEM;
101 extern const int W_CONTACT_BITMAP_ITEM;
103 extern const int X_CALLTYPE_BITMAP_ITEM;
104 extern const int Y_CALLTYPE_BITMAP_ITEM;
105 extern const int H_CALLTYPE_BITMAP_ITEM;
106 extern const int W_CALLTYPE_BITMAP_ITEM;
108 extern const int X_DIALER_BTN_TXT;
109 extern const int W_DIALER_BTN_NUM_TXT;
110 extern const int W_DIALER_BTN_ALPHA_TXT;
114 * @brief This class provides static public utility functions to dialer module.
121 DialUtil(const DialUtil& obj){};
122 virtual ~DialUtil(void){};
125 //used to get text font for button in dialer tab.
126 static Tizen::Graphics::Font* GetTextFontN(int textFontStyle);
127 //used to get text color for button in dialer tab.
128 static Tizen::Graphics::Color* GetTextColorN(int textColor, int buttonStatus);
129 //Function to check if keyword is numeric. This function assumes that a string starting with digit will be numeric.
130 //If needed, it might be implemented in more generic way to check all characters for digits.
131 static bool IsNumericString(Tizen::Base::String& keyWord);
132 //Sets the 'bgImg' image to 'pCanvas' Canvas, if image is a 9-patch image.
133 static void Draw9PatchToCanvas(Tizen::Graphics::Canvas& pCanvas, const Tizen::Base::String& bgImg);
134 //Used to set image to canvas.
135 static void DrawImageToCanvas(const Tizen::Base::String& image, Tizen::Graphics::Dimension imageDimention, Tizen::Graphics::Canvas& pCanvas, int pos);
136 //Used to convert text to Enriched text and set it to canvas.
137 static void DrawTextToCanvas(const Tizen::Base::String& buttonText1, int fontSize, Tizen::Graphics::Canvas& pCanvas, int pos, int buttonStatus);
138 //Used to set nnormal, pressed image to button.
139 static void DrawCanvasToButton(Tizen::Graphics::Canvas* pCanvasNormal, Tizen::Graphics::Canvas* pCanvasPressed, Tizen::Ui::Controls::Button* pButton);
140 //Used to convert provided digit to its equivalent String instance.
141 static Tizen::Base::String ConvertDialedNumberToString(int dialNumber);
142 //Function used to fetch a list of possible names mapped to 'nextCharPos'.
143 static Tizen::Base::Collection::IList* FetchPossibleNamesListN(const Tizen::Base::String& prevSearchStr, int nextCharPos);
144 //Function used to convert substring of 'name' to keys typed, eg. Ani -> 264
145 static void ConvertNameToNumericKeys(Tizen::Base::String& subContactName, Tizen::Base::String& possibleKeysTyped);
148 #endif /* _PHN_COMMON_UTILS_H_ */