Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members

Device.h

Go to the documentation of this file.
00001 /*********************************************************************************
00002  *
00003  * Razor! Engine - A modular C++ presentation engine
00004  *
00005  * $Id: Device.h,v 1.4 2003/05/30 12:18:21 teacy Exp $
00006  *
00007  * Copyright (c) 2000-2003 Tilo Christ. All Rights Reserved.
00008  * 
00009  * Permission is hereby granted, free of charge, to any person obtaining a 
00010  * copy of this software and associated documentation files (the  "Software"), 
00011  * to deal in the Software without restriction, including without limitation 
00012  * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00013  * and/or sell copies of the Software, and to permit persons to whom the Software 
00014  * is furnished to do so, subject to the following conditions:
00015  *
00016  * The above copyright notice and this permission notice shall be included in all 
00017  * copies or substantial portions of the Software.
00018  *
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
00020  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
00021  * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
00022  * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
00023  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00024  *
00025  **********************************************************************************/
00026 
00027 
00028 #ifndef DEVICE_H
00029 #define DEVICE_H
00030 
00031 #include <PalmOS.h>
00032 #include "RazorSections.h"
00033 
00034 /**
00035  * Low level device operations.
00036  */
00037 class Device
00038 {
00039     public:
00040 
00041     /**
00042      * Initialize the Device subsystem. This operation needs to be invoked
00043      * before all others.
00044      */
00045     static void init() SEC_RAZOR_INIT;
00046 
00047     /**
00048      * Release the Device subsystem. This operation needs to be invoked
00049      * before application shutdown.
00050      */
00051     static void release() SEC_RAZOR_INIT;
00052     
00053     /**
00054      * Display an error message to the user, then exit the application.
00055      * Invoke this operation in case of an unresolvable runtime problem
00056      * that is not your fault (e.g. low memory). Use the macros from the
00057      * ErrorManager for all problems which are your fault (i.e. which
00058      * will be ironed out in the release version).
00059      */
00060     static void panic(const Char *message) SEC_RAZOR_INIT;
00061 
00062     /**
00063      * Check that the ROM version is meeting your minimum requirements.
00064      *
00065      * @param requiredVersion minimum ROM version required (see sysFtrNumROMVersion in SystemMgr.h for format)
00066      * @param launchFlags flags that indicate if the application UI is initialized.
00067      *
00068      * @return sysErrRomIncompatible, or errNone.
00069      */
00070     static Err romVersionCompatible(UInt32 minVersion, UInt32 maxVersion, UInt16 launchFlags);
00071 
00072     /// Does the Palm device support Palm OS 3.0 Feature Set?
00073     static Boolean supports30;
00074     /// Does the Palm device support Palm OS 3.1 Feature Set?
00075     static Boolean supports31;
00076     /// Does the Palm device support Palm OS 3.5 Feature Set?
00077     static Boolean supports35;
00078     /// Does the Palm device support Palm OS 4.0 Feature Set?
00079     static Boolean supports40;
00080     /// Does the Palm device support Palm OS 5.0 Feature Set?
00081     static Boolean supports50;
00082     
00083     /// Is the device equipped with an ARM processor?
00084     static Boolean isArmed;
00085 
00086     /**
00087      * Is the specified trap supported by the device?
00088      */
00089     static Boolean supportsTrap(UInt16 trapNum);    
00090 
00091 
00092     /// The Creator ID of the currently running app
00093     static UInt32 creatorID;
00094     /// The application version of the currently running app
00095     static UInt16 appVersionNum;
00096 
00097 
00098     private:
00099 
00100     static UInt32 romVersion;   
00101     // Stage is specified as sysROMStageDevelopment, because that is returned by some POSE ROMs.
00102     static const UInt32 RomVersion30 = sysMakeROMVersion(3,0,0,sysROMStageDevelopment,0);
00103     static const UInt32 RomVersion31 = sysMakeROMVersion(3,1,0,sysROMStageDevelopment,0);
00104     static const UInt32 RomVersion35 = sysMakeROMVersion(3,5,0,sysROMStageDevelopment,0);
00105     static const UInt32 RomVersion40 = sysMakeROMVersion(4,0,0,sysROMStageDevelopment,0);
00106     static const UInt32 RomVersion50 = sysMakeROMVersion(5,0,0,sysROMStageDevelopment,0);
00107 };
00108 
00109 
00110 #endif

Razor! Engine Developer's Guide. Copyright © by Tilo Christ. All Rights Reserved. Last updated: 31 May 2003