interface.h

00001 /**************
00002 FILE          : interface.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_INTERFACE_H
00022 #define SAX_INTERFACE_H 1
00023 
00024 //====================================
00025 // Includes STL...
00026 //------------------------------------
00027 #include <deque>
00028 #include <string>
00029 #include <map>
00030 
00031 //====================================
00032 // Includes...
00033 //------------------------------------
00034 #include <qdict.h>
00035 #include <qlist.h>
00036 #include <errno.h>
00037 
00038 #include "sax.h"
00039 
00040 typedef void* (*Factory) ();
00041 //====================================
00042 // Entrypoint...
00043 //------------------------------------
00127 struct EntryPoint {
00128         const char* name;
00129         const char* version;
00130         Factory factory;
00131 };
00132 
00133 //====================================
00134 // use namespace SaX for interface
00135 //------------------------------------
00136 using namespace SaX;
00137 
00138 //====================================
00139 // namespace LML
00140 //------------------------------------
00147 namespace LML {
00148 //====================================
00149 // Class saxPluglib abstract...
00150 //------------------------------------
00158 class saxPluglib {
00159         public:
00160         virtual SaXInit*    saxInit   ( void ) = 0;
00161         virtual SaXConfig*  saxConfig ( int = SAX_MERGE ) = 0;
00162         virtual SaXImport*  saxImport ( int ) = 0;
00163         virtual SaXImportSysp* saxImportSysp ( int ) = 0;
00164         virtual SaXImportCDB*  saxImportCDB  ( int ) = 0;
00165         virtual SaXImportProfile* saxImportProfile ( const char* ) = 0;
00166 
00167         public:
00168         virtual SaXManipulateDesktop* saxManipulateDesktop (
00169                 SaXImport*,SaXImport*,SaXImport*,int = 0
00170         ) = 0;
00171         virtual SaXManipulateCard* saxManipulateCard (
00172                 SaXImport*,int = 0
00173         ) = 0;
00174         virtual SaXManipulateKeyboard* saxManipulateKeyboard (
00175                 SaXImport*,int = 0
00176         ) = 0;
00177         virtual SaXManipulateDevices* saxManipulateDevices (
00178                 SaXImport*,SaXImport*,SaXImport*
00179         ) = 0;
00180         virtual SaXManipulateDevices* saxManipulateDevices (
00181                 SaXImport*,SaXImport*
00182         ) = 0;
00183         virtual SaXManipulateLayout* saxManipulateLayout (
00184                 SaXImport*,SaXImport*
00185         ) = 0;
00186         virtual SaXManipulatePath* saxManipulatePath (
00187                 SaXImport*,int = 0
00188         ) = 0;
00189         virtual SaXManipulateMice* saxManipulateMice (
00190                 SaXImport*,int = 1
00191         ) = 0;
00192         virtual SaXManipulateTablets* saxManipulateTablets (
00193                 SaXImport*,SaXImport*,int = 1
00194         ) = 0;
00195         virtual SaXManipulateVNC* saxManipulateVNC (
00196                 SaXImport*,SaXImport*,SaXImport*,SaXImport*,SaXImport*,int = 0
00197         ) = 0;
00198         virtual SaXManipulateTouchscreens* saxManipulateTouchscreens (
00199                 SaXImport*,int = 1
00200         ) = 0;
00201         virtual SaXManipulateExtensions* saxManipulateExtensions (
00202                 SaXImport*
00203         ) = 0;
00204 
00205         public:
00206         virtual std::string STLstring ( const QString& ) = 0;
00207         virtual std::deque<std::string> STLdeque ( const QList<QString>& ) = 0;
00208         virtual std::map<std::string,std::string> STLmap (
00209                 const QDict<QString>&
00210         ) = 0;
00211 
00212         public:
00213         virtual void setDebug  ( bool=true ) = 0;
00214 
00215         public:
00216         virtual ~saxPluglib ( void ) { }
00217 };
00218 //====================================
00219 // Class SaXPluglib...
00220 //------------------------------------
00227 class SaXPluglib : public saxPluglib {
00228         public:
00229         SaXPluglib ( void );
00230         static SaXPluglib* factory ( void );
00231 
00232         public:
00233         SaXInit*    saxInit   ( void );
00234         SaXConfig*  saxConfig ( int = SAX_MERGE );
00235         SaXImport*  saxImport ( int );
00236         SaXImportSysp* saxImportSysp ( int );
00237         SaXImportCDB*  saxImportCDB  ( int );
00238         SaXImportProfile* saxImportProfile ( const char* );
00239 
00240         public:
00241         SaXManipulateDesktop* saxManipulateDesktop (
00242                 SaXImport*,SaXImport*,SaXImport*,int = 0
00243         );
00244         SaXManipulateCard* saxManipulateCard (
00245                 SaXImport*,int = 0
00246         );
00247         SaXManipulateKeyboard* saxManipulateKeyboard (
00248                 SaXImport*,int = 0
00249         );
00250         SaXManipulateDevices* saxManipulateDevices (
00251                 SaXImport*,SaXImport*,SaXImport*
00252         );
00253         SaXManipulateDevices* saxManipulateDevices (
00254                 SaXImport*,SaXImport*
00255         );
00256         SaXManipulateLayout* saxManipulateLayout (
00257                 SaXImport*,SaXImport*
00258         );
00259         SaXManipulatePath* saxManipulatePath (
00260                 SaXImport*,int = 0
00261         );
00262         SaXManipulateMice* saxManipulateMice (
00263                 SaXImport*,int = 1
00264         );
00265         SaXManipulateTablets* saxManipulateTablets (
00266                 SaXImport*,SaXImport*,int = 1
00267         );
00268         SaXManipulateVNC* saxManipulateVNC (
00269                 SaXImport*,SaXImport*,SaXImport*,SaXImport*,SaXImport*,int = 0
00270         );
00271         SaXManipulateTouchscreens* saxManipulateTouchscreens (
00272                 SaXImport*,int = 1
00273         );
00274         SaXManipulateExtensions* saxManipulateExtensions (
00275                 SaXImport*
00276         );
00277 
00278         public:
00279         std::string STLstring ( const QString& );
00280         std::deque<std::string> STLdeque ( const QList<QString>& );
00281         std::map<std::string,std::string> STLmap ( const QDict<QString>& );
00282 
00283         public:
00284         void setDebug  ( bool=true );
00285 };
00286 } // end namespace
00287 #endif

Generated on Mon Jan 7 17:25:36 2008 for libsax by  doxygen 1.4.6