LunaSysMgr
 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 #include "Window.h"
27 
28 #include <string>
29 
31 {
32 public:
33 
34  static DeviceInfo* instance();
35  ~DeviceInfo();
36 
37  std::string jsonString() const;
38 
39  bool keyboardSlider() const;
40  bool coreNaviButton() const;
41  bool wifiAvailable() const { return m_wifiAvailable; }
42  bool bluetoothAvailable() const { return m_bluetoothAvailable; }
43  bool carrierAvailable() const {return (m_radioType != 0);}
44  bool compassAvailable() const { return false; } // FIXME
45  bool accelerometerAvailable() const { return true; } // FIXME
46  bool dockModeEnabled() const { return true; }
47  bool keyboardAvailable() const { return m_keyboardAvailable; }
48 
49  const std::string& platformVersion() const { return m_platformVersion; }
50  unsigned int platformVersionMajor() const;
51  unsigned int platformVersionMinor() const;
52  unsigned int platformVersionDot() const;
53 
54 private:
55 
56  DeviceInfo();
57 
58  void gatherInfo();
59 
60 private:
61 
62  std::string m_jsonString;
63 
64  int m_screenWidth;
65  int m_screenHeight;
66 
67  int m_hardwareScreenWidth;
68  int m_hardwareScreenHeight;
69  float m_screenDensity;
70 
71  int m_minimumCardWidth;
72  int m_minimumCardHeight;
73  int m_maximumCardWidth;
74  int m_maximumCardHeight;
75 
76  int m_touchableRows;
77 
78  std::string m_modelName;
79  std::string m_modelNameAscii;
80  std::string m_platformVersion;
81 
82  // platform versions are <major>.<minor>.<dot>
83  unsigned int m_platformVersionMajor;
84  unsigned int m_platformVersionMinor;
85  unsigned int m_platformVersionDot;
86 
87  std::string m_carrierName;
88  std::string m_serialNumber;
89 
90  // double m_storageTotal;
91 
92  bool m_keyboardAvailable;
93  bool m_keyboardSlider;
94  std::string m_keyboardType;
95 
96  bool m_wifiAvailable;
97  bool m_bluetoothAvailable;
98 
99  bool m_coreNaviButton;
100 
101  bool m_swappableBattery;
102  int m_radioType;
103 };
104 
105 #endif /* DEVICEINFO_H */