webappmanager
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DeviceInfo.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2009-2012 Hewlett-Packard Development Company, L.P.
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 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef DEVICEINFO_H
23 #define DEVICEINFO_H
24 
25 #include "Common.h"
26 
27 #include <string>
28 
30 {
31 public:
32 
33  static DeviceInfo* instance();
34  ~DeviceInfo();
35 
36  std::string jsonString() const;
37 
38  bool keyboardSlider() const;
39  bool coreNaviButton() const;
40  bool wifiAvailable() const { return m_wifiAvailable; }
41  bool bluetoothAvailable() const { return m_bluetoothAvailable; }
42  bool carrierAvailable() const {return (m_radioType != 0);}
43  bool compassAvailable() const { return false; } // FIXME
44  bool accelerometerAvailable() const { return true; } // FIXME
45  bool dockModeEnabled() const { return true; }
46  bool keyboardAvailable() const { return m_keyboardAvailable; }
47 
48  const std::string& platformVersion() const { return m_platformVersion; }
49  unsigned int platformVersionMajor() const;
50  unsigned int platformVersionMinor() const;
51  unsigned int platformVersionDot() const;
52 
53 private:
54 
55  DeviceInfo();
56 
57  void gatherInfo();
58 
59 private:
60 
61  std::string m_jsonString;
62 
63  int m_screenWidth;
64  int m_screenHeight;
65 
66  int m_hardwareScreenWidth;
67  int m_hardwareScreenHeight;
68  float m_screenDensity;
69 
70  int m_minimumCardWidth;
71  int m_minimumCardHeight;
72  int m_maximumCardWidth;
73  int m_maximumCardHeight;
74 
75  int m_touchableRows;
76 
77  std::string m_modelName;
78  std::string m_modelNameAscii;
79  std::string m_platformVersion;
80 
81  // platform versions are <major>.<minor>.<dot>
82  unsigned int m_platformVersionMajor;
83  unsigned int m_platformVersionMinor;
84  unsigned int m_platformVersionDot;
85 
86  std::string m_carrierName;
87  std::string m_serialNumber;
88 
89  // double m_storageTotal;
90 
91  bool m_keyboardAvailable;
92  bool m_keyboardSlider;
93  std::string m_keyboardType;
94 
95  bool m_wifiAvailable;
96  bool m_bluetoothAvailable;
97 
98  bool m_coreNaviButton;
99 
100  bool m_swappableBattery;
101  int m_radioType;
102 };
103 
104 #endif /* DEVICEINFO_H */