SaX::SaXManipulateTablets Class Reference

SaX2 - Tablet manipulator class. More...

#include <pointers.h>

Inheritance diagram for SaX::SaXManipulateTablets:

Inheritance graph
[legend]
List of all members.

Public Member Functions

QDict< QString > getTabletData (const QString &)
QDict< QString > getTabletData (const QString &, const QString &)
QDict< QString > getPenData (const QString &)
QDict< QString > getPenData (const QString &, const QString &)
QList< QString > getTabletVendorList (void)
QList< QString > getTabletModelList (const QString &)
QList< QString > getTabletList (void)
QList< QString > getPenList (void)
QList< QString > getTabletDrivers (void)
QDict< QString > getTabletOptions (const QString &)
void setTablet (const QString &, const QString &)
void setTablet (const QString &)
void setType (const QString &)
void setMode (const QString &)
int addPen (const QString &)
int addPen (const QString &, const QString &)
int removePen (int)
QString getName (void)
QString getVendor (void)
QString getType (void)
QString getMode (void)
bool isTablet (void)
bool isPen (void)
bool isEraser (void)
 SaXManipulateTablets (SaXImport *, SaXImport *, int=1)

Detailed Description

SaX2 - Tablet manipulator class.

The tablet manipulator requires two import object (Pointers and Layout) to become created. Once created the manipulator object is able to get/set tablet configuration information. To set up a tablet a new input device needs to created first which get transformed into a tablet using the setTablet() method. Based on this tablet device the manipulator is able to add additional input devices using the addPen() method which results in a stylus or an eraser pointer for this tablet. The following example demonstrate how to add a tablet with one stylus-pen applied

 #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 is [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();
         QList<QString> penList = pointer.getPenList();
        QString* myTablet = tabletList.at (3);
         QString* myPen = penList.at(3);
         pointer.setTablet( *myTablet );
         pointer.addPen ( *myPen );
         printf ("Tablet: [%s] with pen: [%s] configured\n",
             myTablet->ascii(),myPen->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 355 of file pointers.h.


Constructor & Destructor Documentation

SaX::SaXManipulateTablets::SaXManipulateTablets SaXImport pointer,
SaXImport layout,
int  id = 1
 

An object of this type is used to configure tablet pointer devices including pens and erasers

Definition at line 781 of file pointers.cpp.


Member Function Documentation

int SaX::SaXManipulateTablets::addPen const QString &  vendor,
const QString &  model
[virtual]
 

add a new Pen or Eraser associated with the given vendor and model name to the current pointer data. The contents of the data record will set the InputFashion type for this addon pointer device

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1282 of file pointers.cpp.

References addPen().

Here is the call graph for this function:

int SaX::SaXManipulateTablets::addPen const QString &  group  )  [virtual]
 

add a new Pen or Eraser associated with the given group name to the current pointer data. The group name consists of the vendor and model name separated by a colon. The contents of the data record will set the InputFashion type for this addon pointer device

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1210 of file pointers.cpp.

References SaX::SaXException::errorString(), and SaX::SaXException::excCDBRecordNotFound().

Referenced by addPen().

Here is the call graph for this function:

QString SaX::SaXManipulateTablets::getMode void   )  [virtual]
 

return the mode of this pointer device which can be either Absolute or Relative

Implements SaX::SaXManipulateTabletsIF.

Definition at line 920 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

QString SaX::SaXManipulateTablets::getName void   )  [virtual]
 

return the CDB model name of this tablet

Implements SaX::SaXManipulateTabletsIF.

Definition at line 880 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

QDict< QString > SaX::SaXManipulateTablets::getPenData const QString &  vendor,
const QString &  name
[virtual]
 

return the pen data dictionary associated with the given vendor and model name.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1120 of file pointers.cpp.

References getPenData().

Here is the call graph for this function:

QDict< QString > SaX::SaXManipulateTablets::getPenData const QString &  group  )  [virtual]
 

return the pen data dictionary associated with the given CDB group name.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1096 of file pointers.cpp.

Referenced by getPenData().

QList< QString > SaX::SaXManipulateTablets::getPenList void   )  [virtual]
 

retrieve a list of supported Pen/Eraser groups. Each item contains the vendor and the model in its name separated by a colon

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1133 of file pointers.cpp.

QDict< QString > SaX::SaXManipulateTablets::getTabletData const QString &  vendor,
const QString &  name
[virtual]
 

return the tablet data dictionary associated with the given vendor and model name.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1083 of file pointers.cpp.

References getTabletData().

Here is the call graph for this function:

QDict< QString > SaX::SaXManipulateTablets::getTabletData const QString &  group  )  [virtual]
 

return the tablet data dictionary associated with the given CDB group name.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1059 of file pointers.cpp.

Referenced by getTabletData().

QList< QString > SaX::SaXManipulateTablets::getTabletDrivers void   )  [virtual]
 

retrieve a list of supported tablet modules from the TabletModules file

Implements SaX::SaXManipulateTabletsIF.

Definition at line 934 of file pointers.cpp.

References SaX::SaXStorage::getTablePointerCDB().

Here is the call graph for this function:

QList< QString > SaX::SaXManipulateTablets::getTabletList void   )  [virtual]
 

retrieve a list of supported tablet groups. Each item contains the vendor and the model in its name separated by a colon

Implements SaX::SaXManipulateTabletsIF.

Definition at line 984 of file pointers.cpp.

Referenced by getTabletModelList(), and getTabletVendorList().

QList< QString > SaX::SaXManipulateTablets::getTabletModelList const QString &  vendor  )  [virtual]
 

retrieve a list of supported tablet model names

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1035 of file pointers.cpp.

References getTabletList().

Here is the call graph for this function:

QDict< QString > SaX::SaXManipulateTablets::getTabletOptions const QString &  driver  )  [virtual]
 

retrieve a list of tablet options refering to the tablet driver specified by (driver). The result is a dictionary saving the option name as key and the optional value as value. the value specify the type of the option (bool,any,string) and may contain additional information if type=string

Implements SaX::SaXManipulateTabletsIF.

Definition at line 955 of file pointers.cpp.

References SaX::SaXException::errorString(), and SaX::SaXException::excCDBRecordNotFound().

Here is the call graph for this function:

QList< QString > SaX::SaXManipulateTablets::getTabletVendorList void   )  [virtual]
 

retrieve a list of supported tablet vendor names

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1006 of file pointers.cpp.

References getTabletList().

Here is the call graph for this function:

QString SaX::SaXManipulateTablets::getType void   )  [virtual]
 

return the type of this pointer device which can be: cursor,stylus or eraser

Implements SaX::SaXManipulateTabletsIF.

Definition at line 906 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

QString SaX::SaXManipulateTablets::getVendor void   )  [virtual]
 

return the CDB vendor name of this tablet

Implements SaX::SaXManipulateTabletsIF.

Definition at line 893 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

bool SaX::SaXManipulateTablets::isEraser void   )  [virtual]
 

check if the current device is a tablet eraser. This is done by checking the InputFashion parameter.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 861 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

bool SaX::SaXManipulateTablets::isPen void   )  [virtual]
 

check if the current device is a tablet pen. This is done by checking the InputFashion parameter.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 843 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

bool SaX::SaXManipulateTablets::isTablet void   )  [virtual]
 

check if the current device is a tablet. This is done by checking the InputFashion parameter.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 825 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

int SaX::SaXManipulateTablets::removePen int  id  )  [virtual]
 

remove the Pen or Eraser located at section ID (id) If the InputFashion type is a valid SAX_INPUT_PEN or SAX_INPUT_ERASER the method will remove the pointer device and return the new current ID

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1297 of file pointers.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excPointerFashionTypeFailed(), SaX::SaXStorage::getItem(), SaX::SaXManipulatePointers::mImport, SaX::SaXManipulateDevices::removeInputDevice(), and SaX::SaXManipulatePointers::selectPointer().

Here is the call graph for this function:

void SaX::SaXManipulateTablets::setMode const QString &  mode  )  [virtual]
 

set the tablet mode for the currently selected pointer device

Implements SaX::SaXManipulateTabletsIF.

Definition at line 811 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.

void SaX::SaXManipulateTablets::setTablet const QString &  group  )  [virtual]
 

set all tablet data associated with the given group name to the current pointer data. The group name consists of the vendor and model name separated by a colon

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1155 of file pointers.cpp.

References SaX::SaXManipulatePointers::mPointer.

void SaX::SaXManipulateTablets::setTablet const QString &  vendor,
const QString &  model
[virtual]
 

set all tablet data associated with the given vendor and model name to the current pointer data.

Implements SaX::SaXManipulateTabletsIF.

Definition at line 1197 of file pointers.cpp.

void SaX::SaXManipulateTablets::setType const QString &  type  )  [virtual]
 

set the tablet type for the currently selected pointer device

Implements SaX::SaXManipulateTabletsIF.

Definition at line 797 of file pointers.cpp.

References SaX::SaXManipulatePointers::mImport.


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 12:43:13 2006 for libsax by  doxygen 1.4.6