kpilot

pilotSysInfo.h

Go to the documentation of this file.
00001 #ifndef _KPILOT_SYSINFO_H
00002 #define _KPILOT_SYSINFO_H
00003 /* sysInfo.h            KPilot
00004 **
00005 ** Copyright (C) 2003 by Reinhold Kainhofer
00006 **
00007 ** Wrapper for pilot-link's SysInfo Structure
00008 */
00009 
00010 /*
00011 ** This program is free software; you can redistribute it and/or modify
00012 ** it under the terms of the GNU Lesser General Public License as published by
00013 ** the Free Software Foundation; either version 2.1 of the License, or
00014 ** (at your option) any later version.
00015 **
00016 ** This program is distributed in the hope that it will be useful,
00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 ** GNU Lesser General Public License for more details.
00020 **
00021 ** You should have received a copy of the GNU Lesser General Public License
00022 ** along with this program in a file called COPYING; if not, write to
00023 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00024 ** MA 02110-1301, USA.
00025 */
00026 
00027 /*
00028 ** Bug reports and questions can be sent to kde-pim@kde.org
00029 */
00030 
00031 #include <stdlib.h>
00032 #include <string.h>
00033 #include <time.h>
00034 
00035 #include <pi-version.h>
00036 #include <pi-dlp.h>
00037 
00038 
00039 
00040 class KPilotSysInfo
00041 {
00042 public:
00044     KPilotSysInfo() 
00045     {
00046         ::memset(&fSysInfo,0,sizeof(struct SysInfo)); 
00047     }
00048 
00052     KPilotSysInfo(const SysInfo *sys_info) 
00053     {
00054         ::memset(&fSysInfo,0,sizeof(struct SysInfo)); 
00055         if (sys_info)
00056         {
00057             fSysInfo = *sys_info;
00058         }
00059     }
00060 
00062     SysInfo *sysInfo()
00063     {
00064         return &fSysInfo;
00065     }
00066 
00071     const unsigned long getRomVersion() const 
00072     {
00073         return fSysInfo.romVersion;
00074     }
00075 
00079     const unsigned long getLocale() const 
00080     {
00081         return fSysInfo.locale;
00082     }
00086     void setLocale(unsigned long newval)
00087     {
00088         fSysInfo.locale=newval;
00089     }
00090 
00092     const int getProductIDLength() const
00093     {
00094         return fSysInfo.prodIDLength;
00095     }
00099     const char* getProductID() const
00100     {
00101         return fSysInfo.prodID;
00102     }
00103 
00105     const unsigned short getMajorVersion() const 
00106     {
00107         return fSysInfo.dlpMajorVersion;
00108     }
00110     const unsigned short getMinorVersion() const 
00111     {
00112         return fSysInfo.dlpMinorVersion;
00113     }
00114 
00118     const unsigned short getCompatMajorVersion() const 
00119     {
00120         return fSysInfo.compatMajorVersion;
00121     }
00125     const unsigned short getCompatMinorVersion() const 
00126     {
00127         return fSysInfo.compatMinorVersion;
00128     }
00129 
00130 
00135     const unsigned short getMaxRecSize() const 
00136     {
00137         return fSysInfo.maxRecSize;
00138     }
00139 
00140 private:
00141     struct SysInfo fSysInfo;
00142 };
00143 
00144 #endif