SaX::SaXManipulateDevices Class Reference

SaX2 - Device manipulator class. More...

#include <device.h>

Inheritance diagram for SaX::SaXManipulateDevices:

Inheritance graph
[legend]
List of all members.

Public Member Functions

int addDesktopDevice (void)
int addInputDevice (const char *)
int removeDesktopDevice (int)
int removeInputDevice (int)
 SaXManipulateDevices (SaXImport *, SaXImport *, SaXImport *)
 SaXManipulateDevices (SaXImport *, SaXImport *)

Detailed Description

SaX2 - Device manipulator class.

The device manipulator is either used to create a new desktop- or a new input-Device. A new input-Device needs to be transformed into a standard Keyboard,Mouse,Tablet or Touchscreen device before it can be handled by the appropriate manipulator for the device. A new desktop-Device instead can be handled by the DesktopManipulator directly after the device has been created. To create a new input device the device manipulator requires two imports:

whereas the constructor to create a new desktop device requires three imports:

The following example will show how to use the device manipulator for adding a new Tablet to the configuration:

 #include <sax/sax.h>

 int main (void) {
     SaXException().setDebug (true);
     QDict<SaXImport> section;
     int importID[] = {
         SAX_POINTERS,
         SAX_LAYOUT
     };
     printf ("Importing data...\n");
     SaXConfig* config = new SaXConfig;
     for (int id=0; id < 2; id++) {
         SaXImport* import = new SaXImport ( importID[id] );
         import->setSource ( SAX_SYSTEM_CONFIG );
         import->doImport();
         config->addImport (import);
         section.insert (
             import->getSectionName(),import
         );
     }
     printf ("Adding new pointer device... ");
     SaXManipulateDevices dev (
         section["Pointers"],section["Layout"]
     );
     int tabletID = dev.addInputDevice (SAX_INPUT_TABLET);
     printf ("ID: %d [SAX_INPUT_TABLET] added\n",tabletID);
 
     printf ("Setting up tablet data... ");
     SaXManipulateTablets pointer (
         section["Pointers"],section["Layout"]
     );
     if (pointer.selectPointer (tabletID)) {
         QList<QString> tabletList = pointer.getTabletList();
         QString* myTablet = tabletList.at (3);
         pointer.setTablet( *myTablet );
         printf ("[%s]\n",myTablet->ascii());
     }
     printf ("writing configuration\n");
     config->setMode (SAX_MERGE);
     if ( ! config->createConfiguration() ) {
         printf ("%s\n",config->errorString().ascii());
         printf ("%s\n",config->getParseErrorValue().ascii());
         return 1;
     }
     return (0);
 }

Definition at line 138 of file device.h.


Constructor & Destructor Documentation

SaX::SaXManipulateDevices::SaXManipulateDevices ( SaXImport ,
SaXImport ,
SaXImport  
)

Definition at line 27 of file device.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excCardImportBindFailed(), SaX::SaXException::excDesktopImportBindFailed(), SaX::SaXException::excLayoutImportBindFailed(), SaX::SaXException::excNullPointerArgument(), and SaX::SaXImport::getSectionID().

Here is the call graph for this function:

SaX::SaXManipulateDevices::SaXManipulateDevices ( SaXImport ,
SaXImport  
)

Definition at line 71 of file device.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excLayoutImportBindFailed(), SaX::SaXException::excNullPointerArgument(), SaX::SaXException::excPointerImportBindFailed(), and SaX::SaXImport::getSectionID().

Here is the call graph for this function:


Member Function Documentation

int SaX::SaXManipulateDevices::addDesktopDevice ( void   )  [virtual]

Implements SaX::SaXManipulateDevicesIF.

Definition at line 112 of file device.cpp.

References SaX::SaXStorage::addID(), and SaX::SaXStorage::getCount().

Here is the call graph for this function:

int SaX::SaXManipulateDevices::addInputDevice ( const char *   )  [virtual]

Implements SaX::SaXManipulateDevicesIF.

Definition at line 160 of file device.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excWrongInputFashion(), SaX::SaXStorage::getCount(), and SaX::SaXStorage::getTablePointer().

Referenced by SaX::SaXManipulateTablets::addPen(), SaX::SaXManipulateVNC::addVNCKeyboard(), and SaX::SaXManipulateVNC::addVNCMouse().

Here is the call graph for this function:

int SaX::SaXManipulateDevices::removeDesktopDevice ( int   )  [virtual]

Implements SaX::SaXManipulateDevicesIF.

Definition at line 240 of file device.cpp.

References SaX::SaXStorage::delID(), SaX::SaXException::errorString(), SaX::SaXException::excInvalidArgument(), and SaX::SaXStorage::getCount().

Here is the call graph for this function:

int SaX::SaXManipulateDevices::removeInputDevice ( int   )  [virtual]

Implements SaX::SaXManipulateDevicesIF.

Definition at line 284 of file device.cpp.

References SaX::SaXStorage::delID(), SaX::SaXException::errorString(), SaX::SaXException::excInvalidArgument(), SaX::SaXStorage::getCount(), SaX::SaXStorage::getCurrentID(), SaX::SaXStorage::getTablePointer(), and SaX::SaXStorage::setID().

Referenced by SaX::SaXManipulateTablets::removePen(), SaX::SaXManipulateVNC::removeVNCKeyboard(), and SaX::SaXManipulateVNC::removeVNCMouse().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 19:09:23 2006 for libsax by  doxygen 1.5.0