HarmattanSyncApplications
syncmlcommon/DeviceInfo.h
1/*
2 * This file is part of buteo-sync-plugins package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef DEFAULTDEVICEINFO_H
25#define DEFAULTDEVICEINFO_H
26
27#include <QString>
28#include <QStringList>
29#include <QMutex>
30#include <QMap>
31
32#ifdef HAS_SYSTEMSETTINGS
33 #include <deviceinfo.h>
34#else
35 #include <QDeviceInfo>
36#endif
37
38namespace Buteo {
39
44 {
45
46 public:
47
49 enum Source {
52
55 };
56
61
65 virtual ~DeviceInfo();
66
73
74
80
81
88 bool setDeviceXmlFile(QString &fileName);
89
90
96 QString DeviceXmlFile();
97
98
104 QMap<QString,QString> getDeviceInformation();
105
110 void saveDevInfoToFile(QMap<QString,QString> &aDevInfo , QString &aFileName);
111
112 protected:
113
114 private:
115 Source iSource;
116 QStringList iProperties;
117 QString iDeviceInfoFile;
118
119 QString iManufacturer;
120 QString iModel;
121 QString iSwVersion;
122 QString iHwVersion;
123 QString iFwVersion;
124 QString iDeviceIMEI;
125 QString iDeviceType;
126
127 QString getManufacturer();
128 QString getModel();
129 QString getSwVersion();
130 QString getHwVersion();
131 QString getFwVersion();
132 QString getDeviceIMEI();
133 QString getDeviceType();
134
135#if defined(HAS_SYSTEMSETTINGS)
136 ::DeviceInfo deviceInfo;
137#else
138 QDeviceInfo deviceInfo;
139#endif
140
141#ifdef SYNC_APP_UNITTESTS
142 friend class DeviceInfoTest;
143#endif
144 };
145}
146
147
148#endif // DEFAULTDEVICEINFO_H
Default Implementation of DeviceInfo class.
Definition syncmlcommon/DeviceInfo.h:44
QMap< QString, QString > getDeviceInformation()
Retrieves Device Information as Map.
DeviceInfo()
Constructor.
QString DeviceXmlFile()
get the file name from where the device information is read from
void saveDevInfoToFile(QMap< QString, QString > &aDevInfo, QString &aFileName)
Saves Device Information to the filename.
bool setDeviceXmlFile(QString &fileName)
set the file path to read device information from
void setSourceToRead(Source &)
set properties to read from the devicse
Source getSourceToRead()
get method for source
virtual ~DeviceInfo()
Destructor.
Source
getDeviceInformation call checks this enum
Definition debian/tmp/usr/include/syncmlcommon/DeviceInfo.h:49
@ ReadFromXml
read from xml
Definition debian/tmp/usr/include/syncmlcommon/DeviceInfo.h:54
@ ReadFromSystem
read from system
Definition debian/tmp/usr/include/syncmlcommon/DeviceInfo.h:51