kpilot/lib

pilotSysInfo.h

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:
00043     KPilotSysInfo() { ::memset(&fSysInfo,0,sizeof(struct SysInfo)); }
00044     KPilotSysInfo(const SysInfo* sys_info) { fSysInfo = *sys_info; }
00045 
00046     SysInfo *sysInfo() { return &fSysInfo; }
00047 
00052     void boundsCheck()
00053     {
00054     }
00055 
00056     const unsigned long getRomVersion() const {return fSysInfo.romVersion;}
00057     void setRomVersion(unsigned long newval)  {fSysInfo.romVersion=newval;}
00058 
00059     const unsigned long getLocale() const {return fSysInfo.locale;}
00060     void setLocale(unsigned long newval)  {fSysInfo.locale=newval;}
00061 
00062     const int getProductIDLength() const { return fSysInfo.prodIDLength; }
00063     const char* getProductID()
00064     {
00065         fSysInfo.prodID[fSysInfo.prodIDLength]='\0';
00066         return fSysInfo.prodID;
00067     }
00068     void setProductID(const char* prodid);
00069 
00070     const unsigned short getMajorVersion() const {return fSysInfo.dlpMajorVersion;}
00071     const unsigned short getMinorVersion() const {return fSysInfo.dlpMinorVersion;}
00072     const unsigned short getCompatMajorVersion() const {return fSysInfo.compatMajorVersion;}
00073     const unsigned short getCompatMinorVersion() const {return fSysInfo.compatMinorVersion;}
00074     const unsigned short getMaxRecSize() const {return fSysInfo.maxRecSize;}
00075 
00076 private:
00077     struct SysInfo fSysInfo;
00078 };
00079 
00080 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys