SaX::SaXManipulateVNC Class Reference

SaX2 - VNC class. More...

#include <extensions.h>

Inheritance diagram for SaX::SaXManipulateVNC:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void addVNCKeyboard (void)
void addVNCMouse (void)
void removeVNCMouse (void)
void removeVNCKeyboard (void)
void enableVNC (void)
void disableVNC (void)
void setPassword (const QString &)
void enablePasswordProtection (const QString &)
void disablePasswordProtection (void)
void enableHTTPAccess (int=5800)
void disableHTTPAccess (void)
void allowMultipleConnections (bool=true)
int getHTTPPort (void)
bool isVNCEnabled (void)
bool isHTTPAccessEnabled (void)
bool isMultiConnectEnabled (void)
bool isPwdProtectionEnabled (void)
 SaXManipulateVNC (SaXImport *, SaXImport *, SaXImport *, SaXImport *, SaXImport *, int=0)

Detailed Description

SaX2 - VNC class.

The VNC manipulator requires five import objects (Card,Pointers,Keyboard, Layout and Path) to become created. Once created the manipulator object can enable/disable the exporting of the display via VNC protocol. The following example demonstrate how to enable/disable VNC for the current configuration:

 #include <sax/sax.h>

 int main (void) {
     SaXException().setDebug (true);
     QDict<SaXImport> section;
     int importID[] = {
         SAX_CARD,
         SAX_POINTERS,
         SAX_KEYBOARD,
         SAX_LAYOUT,
         SAX_PATH
     };
     printf ("Importing data...\n");
     SaXConfig* config = new SaXConfig;
     for (int id=0; id<5; id++) {
         SaXImport* import = new SaXImport ( importID[id] );
         import->setSource ( SAX_SYSTEM_CONFIG );
         import->doImport();
         config->addImport (import);
         section.insert (
             import->getSectionName(),import
         );
     }
     printf ("Exporting display for VNC access...\n");
     SaXManipulateVNC mVNC (
         section["Card"],section["Pointers"],section["Keyboard"],
         section["Layout"],section["Path"]
     );
     if (! mVNC.VNCEnabled()) {
         mVNC.enableVNC();
         mVNC.addVNCKeyboard();
         mVNC.addVNCMouse();
     }
     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 168 of file extensions.h.


Constructor & Destructor Documentation

SaX::SaXManipulateVNC::SaXManipulateVNC SaXImport card,
SaXImport pointer,
SaXImport kbd,
SaXImport layout,
SaXImport path,
int  id = 0
 

An object of this type is used to manipulate the configuration to be able to accesss the X-Server via VNC

Definition at line 55 of file extensions.cpp.

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

Here is the call graph for this function:


Member Function Documentation

void SaX::SaXManipulateVNC::addVNCKeyboard void   )  [virtual]
 

add the VNC keyboard to handle keyboard events properly

Implements SaX::SaXManipulateVNCIF.

Definition at line 207 of file extensions.cpp.

References SaX::SaXManipulateDevices::addInputDevice().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::addVNCMouse void   )  [virtual]
 

add the VNC mouse to handle mouse events properly

Implements SaX::SaXManipulateVNCIF.

Definition at line 226 of file extensions.cpp.

References SaX::SaXManipulateDevices::addInputDevice().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::allowMultipleConnections bool  allow = true  )  [virtual]
 

allow multiple connections at the same time. default is to allow only one connection at the same time

Implements SaX::SaXManipulateVNCIF.

Definition at line 191 of file extensions.cpp.

References SaX::SaXManipulateCard::addCardOption(), and SaX::SaXManipulateCard::removeCardOption().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::disableHTTPAccess void   )  [virtual]
 

disable HTTP access by removing the httpdir and httpport options

Implements SaX::SaXManipulateVNCIF.

Definition at line 179 of file extensions.cpp.

References SaX::SaXManipulateCard::removeCardOption().

Referenced by enableHTTPAccess().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::disablePasswordProtection void   )  [virtual]
 

disable the password protection will not remove the passwd file. Only the rfbauth option is removed which will disable the password prompt while connecting

Implements SaX::SaXManipulateVNCIF.

Definition at line 151 of file extensions.cpp.

References SaX::SaXManipulateCard::removeCardOption().

Referenced by enablePasswordProtection().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::disableVNC void   )  [virtual]
 

disable VNC support by unloading the vnc module and switch off the service with: usevnc -> no NOTE: The X-Server must be restarted in order the changes to become effective

Implements SaX::SaXManipulateVNCIF.

Definition at line 96 of file extensions.cpp.

References SaX::SaXManipulateCard::addCardOption(), SaX::SaXManipulateCard::removeCardOption(), and SaX::SaXManipulatePath::removeLoadableModule().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::enableHTTPAccess int  port = 5800  )  [virtual]
 

enable VNC HTTP access on the given port. This is done by setting up the httpdir option in combination with the httpport option

Implements SaX::SaXManipulateVNCIF.

Definition at line 163 of file extensions.cpp.

References SaX::SaXManipulateCard::addCardOption(), and disableHTTPAccess().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::enablePasswordProtection const QString &  pwd  )  [virtual]
 

enable the password protection by setting a password and activating it with the rfbauth option. A user who will access the display is asked for this password while connecting

Implements SaX::SaXManipulateVNCIF.

Definition at line 136 of file extensions.cpp.

References SaX::SaXManipulateCard::addCardOption(), disablePasswordProtection(), and setPassword().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::enableVNC void   )  [virtual]
 

export the display using the VNC protocol. This method will enable VNC by loading the vnc module and applying the usevnc option into the Device section

Implements SaX::SaXManipulateVNCIF.

Definition at line 81 of file extensions.cpp.

References SaX::SaXManipulateCard::addCardOption(), SaX::SaXManipulatePath::addLoadableModule(), SaX::SaXManipulateCard::removeCardOption(), and SaX::SaXManipulatePath::removeLoadableModule().

Here is the call graph for this function:

int SaX::SaXManipulateVNC::getHTTPPort void   )  [virtual]
 

check if HTTP access is activated and return the current port number set for HTTP access

Implements SaX::SaXManipulateVNCIF.

Definition at line 373 of file extensions.cpp.

References SaX::SaXManipulateCard::getOptions().

Here is the call graph for this function:

bool SaX::SaXManipulateVNC::isHTTPAccessEnabled void   )  [virtual]
 

check if HTTP access is enabled

Implements SaX::SaXManipulateVNCIF.

Definition at line 330 of file extensions.cpp.

References SaX::SaXManipulateCard::getOptions().

Here is the call graph for this function:

bool SaX::SaXManipulateVNC::isMultiConnectEnabled void   )  [virtual]
 

check if multiple connections at the same time are allowed

Implements SaX::SaXManipulateVNCIF.

Definition at line 344 of file extensions.cpp.

References SaX::SaXManipulateCard::getOptions().

Here is the call graph for this function:

bool SaX::SaXManipulateVNC::isPwdProtectionEnabled void   )  [virtual]
 

check if the password protection is enabled

Implements SaX::SaXManipulateVNCIF.

Definition at line 359 of file extensions.cpp.

References SaX::SaXManipulateCard::getOptions().

Here is the call graph for this function:

bool SaX::SaXManipulateVNC::isVNCEnabled void   )  [virtual]
 

check if VNC has been enabled

Implements SaX::SaXManipulateVNCIF.

Definition at line 316 of file extensions.cpp.

References SaX::SaXManipulateCard::getOptions().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::removeVNCKeyboard void   )  [virtual]
 

remove the VNC keyboard -> no kbd events in VNC session

Implements SaX::SaXManipulateVNCIF.

Definition at line 262 of file extensions.cpp.

References SaX::SaXManipulateDevices::removeInputDevice().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::removeVNCMouse void   )  [virtual]
 

remove the VNC mouse -> no mouse events in VNC session

Implements SaX::SaXManipulateVNCIF.

Definition at line 244 of file extensions.cpp.

References SaX::SaXManipulateDevices::removeInputDevice().

Here is the call graph for this function:

void SaX::SaXManipulateVNC::setPassword const QString &  pwd  )  [virtual]
 

restricted access can be set up by creating a password file. This file is set within the rfbauth option. This method is used to create the password file by using the vncp program

Implements SaX::SaXManipulateVNCIF.

Definition at line 111 of file extensions.cpp.

References SaX::SaXException::errorString(), SaX::SaXException::excProcessFailed(), SaX::SaXException::setLock(), and SaX::SaXException::unsetLock().

Referenced by enablePasswordProtection().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 17:33:32 2008 for libsax by  doxygen 1.4.6