config.h

00001 /**************
00002 FILE          : config.h
00003 ***************
00004 PROJECT       : SaX2 - library interface [header]
00005               :
00006 AUTHOR        : Marcus Schäfer <ms@suse.de>
00007               :
00008 BELONGS TO    : SaX2 - SuSE advanced X11 configuration 
00009               : 
00010               :
00011 DESCRIPTION   : native C++ class library to access SaX2
00012               : functionality. Easy to use interface for
00013               : //.../
00014               : - importing/exporting X11 configurations
00015               : - modifying/creating X11 configurations 
00016               : ---
00017               :
00018               :
00019 STATUS        : Status: Development
00020 **************/
00021 #ifndef SAX_CONFIG_H
00022 #define SAX_CONFIG_H 1
00023 
00024 //====================================
00025 // Includes...
00026 //------------------------------------
00027 #include <stdarg.h>
00028 #include <dirent.h>
00029 extern "C" {
00030 #include <xf86Parser.h>
00031 }
00032 
00033 #include "export.h"
00034 
00035 namespace SaX {
00036 //====================================
00037 // Defines...
00038 //------------------------------------
00039 #define SAX_NEW         20
00040 #define SAX_MERGE       21
00041 #define SAX_CREATE_API  "/var/lib/sax/createAPI.pl"
00042 #define SAX_TEST_CONFIG "/var/lib/sax/createTST.pl"
00043 #define SAX_API_FILE    "/var/lib/sax/apidata"
00044 #define SAX_API_CONFIG  "/var/lib/sax/xorg.conf"
00045 #define SAX_API_MD5     "/var/lib/sax/xorg.conf.md5"
00046 #define SAX_SYS_MD5     "/etc/X11/xorg.conf.md5"
00047 #define SAX_SYS_CONFIG  "/etc/X11/xorg.conf"
00048 #define SAX_SYS_CSAVED  "/etc/X11/xorg.conf.saxsave"
00049 #define SAX_X11_LOADER  "/usr/X11R6/bin/Xorg"
00050 #define SAX_XFINE_CACHE "/var/cache/xfine"
00051 #define SAX_MD5_SUM     "/usr/bin/md5sum"
00052 #define CONFPATH        "%A,%R,/etc/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F"
00053 #define CONFERRORLINE   80
00054 
00055 //====================================
00056 // Interface class for dlopen ability
00057 //------------------------------------
00065 class SaXConfigIF : public SaXException {
00066         public:
00067         virtual void setParseErrorValue ( char* ) = 0;
00068         virtual void setParseError ( char* ) = 0;
00069         virtual void addImport ( SaXImport* ) = 0;
00070         virtual void setMode ( int ) = 0;
00071 
00072         public:
00073         virtual QString getParseErrorValue ( void ) = 0;
00074         virtual QString getParseError ( void ) = 0;
00075 
00076         public:
00077         virtual bool createConfiguration  ( void ) = 0;
00078         virtual void commitConfiguration  ( void ) = 0;
00079         virtual int  testConfiguration    ( void ) = 0;
00080         virtual bool isChecksumOK         ( void ) = 0;
00081 
00082         public:
00083         virtual ~SaXConfigIF ( void ) { }
00084 };
00085 //====================================
00086 // Class SaXConfig...
00087 //------------------------------------
00141 class SaXConfig : public SaXConfigIF {
00142         private:
00143         QList <SaXImport> mImportList;
00144         SaXImport* mDesktop;
00145         int configMode;
00146 
00147         private:
00148         QString* mParseErrorString;
00149         QString* mParseErrorValue;
00150 
00151         private:
00152         bool gotCard;
00153         bool gotDesktop;
00154         bool gotPointers;
00155         bool gotKeyboard;
00156         bool gotLayout;
00157         bool gotPath;
00158         bool gotExtensions;
00159 
00160         private:
00161         void enableXFineCache (bool = true);
00162         void removeXFineCache (void);
00163 
00164         public:
00165         void setParseErrorValue ( char* );
00166         void setParseError ( char* );
00167         void addImport ( SaXImport* );
00168         void setMode ( int );
00169         
00170         public:
00171         QString getParseErrorValue ( void );
00172         QString getParseError ( void );
00173 
00174         public:
00175         bool createConfiguration  ( void );
00176         void commitConfiguration  ( void );
00177         int  testConfiguration    ( void );
00178         bool isChecksumOK         ( void );
00179 
00180         public:
00181         SaXConfig ( int = SAX_MERGE );
00182 };
00183 } // end namespace
00184 #endif

Generated on Mon Jun 19 12:42:49 2006 for libsax by  doxygen 1.4.6