Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Examples

LCDClient Class Reference
[Main components]

#include "api/LCDClient.h"

Inheritance diagram for LCDClient:

Inheritance graph
[legend]
Collaboration diagram for LCDClient:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class let a client program connect to the LCDproc server and get information from it. It will also contain information about the current LCD such as dimension.
Examples:

client.cpp.

Definition at line 28 of file LCDClient.h.

Public Member Functions

 LCDClient (const std::string &server, int port=13666)
 Constructor.

 ~LCDClient ()
 Destructor.

void sendCommand (const std::string &cmd, const std::string &parameters="")
 Send raw commands to server.

const std::string & getServerVersion () const
 Returns connected server version.

const std::string & getProtocolVersion () const
 Returns protocol version used by the server.

int getWidth () const
 Returns LCD width.

int getHeight () const
 Returns LCD height.

int getCharWidth () const
 Get width of a character on LCD.

int getCharHeight () const
 Get height of a character on LCD.

void setName (std::string name)
 Change the name of the client.

void setBackLight (std::string backlight)
 Enable or disable backlight.

void assignKey (KeyEvent key, LCDCallback *callback)
 Assign a callback to a key.

void add (LCDElement *child)
 Add a child to the component.

const std::string & getId ()
 Returns Id of the element.


Static Public Member Functions

bool exists (std::string id)
 Test if a widget with given Id exists.


Constructor & Destructor Documentation

LCDClient const std::string &  server,
int  port = 13666
 

This constructor needs information to connect to the LCDproc server.

Parameters:
server Name or IP of the machine where the server runs. If it is on the same machine, you can use "localhost".
port Port number to connect to. For a classic LCDproc configuration, it should be 13666 (default value).

Definition at line 11 of file LCDClient.cpp.


Member Function Documentation

void add LCDElement child  )  [inherited]
 

This method is used to add a child to a component.

Parameters:
child The element to be added in the children list.
Examples:
client.cpp.

Definition at line 110 of file LCDElement.cpp.

void assignKey KeyEvent  key,
LCDCallback callback
 

Used to call a user function when a key is pressed.

Parameters:
key The key to assign to the function.
callback The function to call. It has to be a class inherited from LCDCallback defining the operator(). You can also use the LCD_CALLBACK_FUNCTION_BEGIN and LCD_CALLBACK_FUNCTION_END macros to define only a function.
Examples:
client.cpp.

Definition at line 109 of file LCDClient.cpp.

bool exists std::string  id  )  [static, inherited]
 

This static method is used to test the existence of a widget.

Parameters:
id The identifier of the widget to test.

Definition at line 76 of file LCDElement.cpp.

int getCharHeight  )  const
 

Returns the maximum height (in number of pixels) of a displayed char on the LCD.

Returns:
An integer containing the number of pixel used in a column of a character.
Examples:
client.cpp.

Definition at line 125 of file LCDClient.h.

int getCharWidth  )  const
 

Returns the maximum width (in number of pixels) of a displayed char on the LCD.

Returns:
An integer containing the number of pixel used in a row of a character.
Examples:
client.cpp.

Definition at line 117 of file LCDClient.h.

int getHeight  )  const
 

Returns the height (in number of characters) of the physical LCD the server is using.

Returns:
An integer containing the number of characters per LCD column.
Examples:
client.cpp.

Definition at line 109 of file LCDClient.h.

const string & getId  )  [inherited]
 

With this method one can have read access to the element identifier.

Returns:
A string.

Definition at line 82 of file LCDElement.cpp.

const std::string& getProtocolVersion  )  const
 

Useful to know the protocol version the LCDproc server (LCDd) is using.

Returns:
A string containing the protocol version.
Examples:
client.cpp.

Definition at line 93 of file LCDClient.h.

const std::string& getServerVersion  )  const
 

Useful to know the version of the LCDproc server the object is connected to.

Returns:
A string containing the server version.
Examples:
client.cpp.

Definition at line 85 of file LCDClient.h.

int getWidth  )  const
 

Returns the width (in number of characters) of the physical LCD the server is using.

Returns:
An integer containing the number of characters per LCD row.
Examples:
client.cpp.

Definition at line 101 of file LCDClient.h.

void sendCommand const std::string &  cmd,
const std::string &  parameters = ""
[virtual]
 

With this method, user can send raw commands to the server.

Parameters:
cmd The command to be sent.
parameters All the parameters for the command as a space separated string.

Reimplemented from LCDElement.

Definition at line 65 of file LCDClient.cpp.

void setBackLight std::string  backlight  ) 
 

Enable or disable the backlight for all the screens.

Parameters:
backlight A string with the value to set. Constants LCD_BACKLIGHT_ON, LCD_BACKLIGHT_OFF, LCD_BACKLIGHT_OPEN, LCD_BACKLIGHT_TOGGLE, LCD_BACKLIGHT_BLINK and LCD_BACKLIGHT_FLASH can be used.
Examples:
client.cpp.

Definition at line 104 of file LCDClient.cpp.

void setName std::string  name  ) 
 

Sets the client's name as visible to a user.

Parameters:
name A string containing the new name.

Definition at line 94 of file LCDClient.cpp.


Generated on Wed Aug 4 19:39:09 2004 for LCDApi by doxygen 1.3.6