f77c660e3e0eff26cf953d76679e52fc7cdbac50
[framework/web/wrt-plugins-common.git] / src / modules / tizen / DEPRACATED / Device / Manager.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #include "Manager.h"
17 #include <commons/Exception.h>
18
19 namespace {
20 const bool CLAMSHELL_SUPPORTED = false;
21 const bool KEYPAD_SUPPORTED = false;
22 } // anonymous
23
24 namespace WrtPlugins {
25 namespace Platform {
26 namespace Device {
27 Manager& Manager::getInstance()
28 {
29     static Manager instance;
30     return instance;
31 }
32
33 Manager::~Manager()
34 {
35 }
36
37 bool Manager::hasClamshell() const
38 {
39     return CLAMSHELL_SUPPORTED;
40 }
41
42 Api::Device::IClamshell* Manager::getClamshell() const
43 {
44     ThrowMsg(Commons::UnsupportedException,
45              "Device is not equipped with clamshell.");
46 }
47
48 bool Manager::hasKeypad() const
49 {
50     return KEYPAD_SUPPORTED;
51 }
52
53 Api::Device::IKeypad* Manager::getKeypad() const
54 {
55     ThrowMsg(Commons::UnsupportedException,
56              "Device is not equipped with keypad.");
57 }
58
59 std::string Manager::getImei() const
60 {
61     Try {
62         return m_imei.getString();
63     }
64     Catch(Commons::ConversionException) {
65         ReThrow(Commons::PlatformException);
66     }
67 }
68
69 Manager::Manager() : m_imei(VCONFKEY_TELEPHONY_IMEI)
70 {
71 }
72 } // Device
73 } // Platform
74 } // WrtPlugins