Tizen 2.1 base
[platform/framework/native/telephony.git] / src / FTel_TelephonyUtility.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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
18 /**
19  * @file    FTel_TelephonyUtility.h
20  * @brief   This is the header file for the %_TelephonyUtility class.
21  *
22  * This header file contains the declarations of the %_TelephonyUtility class.
23  */
24
25 #ifndef _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
26 #define _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
27
28 #include <net_connection.h>
29 #include <TelNetwork.h>
30 #include "FTel_NetworkInfoImpl.h"
31
32 namespace Tizen { namespace Base
33 {
34 class String;
35 }}
36
37 namespace Tizen { namespace Telephony
38 {
39
40 struct _ConnectionDeleter
41 {
42     void operator()(void* pConnection)
43     {
44         connection_destroy(pConnection);
45     }
46 };
47
48 struct _CharDeleter
49 {
50     void operator()(char* pChar)
51     {
52         free(pChar);
53     }
54 };
55
56 class _TelephonyUtility
57 {
58 public:
59     /**
60      * Converts TelNetworkSystemType_t to _NetworkType Type
61      *
62      * @return      The network type
63      * @param[in]   networkSystem   network system type
64      */
65     static _NetworkType ConvertNetworkType(TelNetworkSystemType_t networkSystemType);
66
67     /**
68      * Converts _NetworkType to TelNetworkSystemType_t Type
69      *
70      * @return      The network type
71      * @param[in]   networkSystem   network type
72      */
73     static TelNetworkSystemType_t ConvertNetworkType(_NetworkType networkType);
74
75     static result ConvertErrorType(int error);
76
77     static void GetMccMncFromPlmn(const Tizen::Base::String& plmn, int& mcc, int& mnc);
78
79
80 private:
81     /**
82      * This default constructor is intentionally declared as private because this class cannot be constructed.
83      */
84     _TelephonyUtility(void);
85
86     /**
87      * This destructor is intentionally declared as private because this class cannot be constructed.
88      */
89     virtual ~_TelephonyUtility(void);
90
91 }; // _TelephonyUtility
92
93 } }  // Tizen::Telephony
94 #endif // _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
95