plptools
Loading...
Searching...
No Matches
rclip Class Reference

Remote ClipBoard services via PLP. More...

#include <rclip.h>

Collaboration diagram for rclip:

Public Member Functions

 rclip (TCPSocket *skt)
 Constructs a new rclip object. More...
 
 ~rclip ()
 Destructor. More...
 
void reset ()
 Initializes a connection to the remote machine. More...
 
void reconnect ()
 Attempts to re-establish a remote connection by first closing the socket, then connecting again to the ncpd daemon and finally calling reset. More...
 
Enum< rfsv::errsgetStatus ()
 Retrieves the current status of the connection. More...
 
Enum< rfsv::errsinitClipbd ()
 Send initialization frame. More...
 
Enum< rfsv::errssendListen ()
 Send listen request. More...
 
Enum< rfsv::errscheckNotify ()
 Check for clipboard notification. More...
 
Enum< rfsv::errswaitNotify ()
 Send listen request and wait for notification. More...
 
Enum< rfsv::errsnotify ()
 Send a notification to the Psion. More...
 

Protected Types

enum  commands { RCLIP_INIT = 0x00 , RCLIP_NOTIFY = 0x08 , RCLIP_LISTEN = 0x04 }
 The possible commands. More...
 

Protected Member Functions

bool sendCommand (enum commands cc)
 Sends a command to the remote side. More...
 
Enum< rfsv::errsgetResponse (bufferStore &data)
 
const char * getConnectName ()
 

Protected Attributes

TCPSocketskt
 The socket, used for communication with ncpd. More...
 
Enum< rfsv::errsstatus
 The current status of the connection. More...
 

Detailed Description

Remote ClipBoard services via PLP.

This class implements access to the remote clipboard notification feature of the Psion. The Psion uses the file 'C:\System\Data\Clpboard.cbd' for storing the content of its clipboard. This file can be accessed like any other regular file on the Psion using the rfsv implementation. This class handles notification about changes of this file. There are two methods of notification implemented. Using waitNotify , a blocking method can be used and using sendListen followed by checkNotify , a polling approach (usable for GUI programs) can be implemented.

Definition at line 43 of file rclip.h.

Member Enumeration Documentation

◆ commands

enum rclip::commands
protected

The possible commands.

Enumerator
RCLIP_INIT 
RCLIP_NOTIFY 
RCLIP_LISTEN 

Definition at line 140 of file rclip.h.

Constructor & Destructor Documentation

◆ rclip()

rclip::rclip ( TCPSocket skt)

Constructs a new rclip object.

Parameters
sktThe socket to be used by this object.

Definition at line 31 of file rclip.cc.

◆ ~rclip()

rclip::~rclip ( )

Destructor.

Definition at line 37 of file rclip.cc.

Member Function Documentation

◆ checkNotify()

Enum< rfsv::errs > rclip::checkNotify ( )

Check for clipboard notification.

If the Psion has sent a notification, this method returns rfsv::E_PSI_GEN_NONE . If there is no notification pending, this method returns rfsv::E_PSI_FILE_EOF All other return values are to be treated as errors

Returns
The connection status.

Definition at line 123 of file rclip.cc.

◆ getConnectName()

const char * rclip::getConnectName ( void  )
protected

Definition at line 75 of file rclip.cc.

◆ getResponse()

Enum< rfsv::errs > rclip::getResponse ( bufferStore data)
protected

Definition at line 185 of file rclip.cc.

◆ getStatus()

Enum< rfsv::errs > rclip::getStatus ( void  )

Retrieves the current status of the connection.

Returns
The connection status.

Definition at line 69 of file rclip.cc.

◆ initClipbd()

Enum< rfsv::errs > rclip::initClipbd ( )

Send initialization frame.

Must be called once after a new rclip object has be called. It sends an initialzation frame to the Psion's server and returns its status.

Returns
The connection status.

Definition at line 168 of file rclip.cc.

◆ notify()

Enum< rfsv::errs > rclip::notify ( )

Send a notification to the Psion.

If the application wishes to notify the Psion after changing the clipboard file, this method can be used.

Returns
The connection status.

Definition at line 155 of file rclip.cc.

◆ reconnect()

void rclip::reconnect ( void  )

Attempts to re-establish a remote connection by first closing the socket, then connecting again to the ncpd daemon and finally calling reset.

Definition at line 45 of file rclip.cc.

◆ reset()

void rclip::reset ( void  )

Initializes a connection to the remote machine.

Definition at line 53 of file rclip.cc.

◆ sendCommand()

bool rclip::sendCommand ( enum commands  cc)
protected

Sends a command to the remote side.

If communication fails, a reconnect is triggered and a second attempt to transmit the request is attempted. If that second attempt fails, the function returns an error an sets rpcs::status to E_PSI_FILE_DISC.

Parameters
ccThe command to execute on the remote side.
Returns
true on success, false on failure.

Definition at line 84 of file rclip.cc.

◆ sendListen()

Enum< rfsv::errs > rclip::sendListen ( )

Send listen request.

Calling this method arms the Psion's clipboard server. After that, every change of the Psion's clipboard file will be signaled. To poll the signal, subsequent calls to checkNotify should be made.

Returns
The connection status.

Definition at line 115 of file rclip.cc.

◆ waitNotify()

Enum< rfsv::errs > rclip::waitNotify ( )

Send listen request and wait for notification.

This method is the blocking version of the two above methods. It first sends a listen request and then blocks until a notification has sent by the Psion or an error occured.

Returns
The connection status, rfsv::E_PSI_GEN_NONE if a notification has been received.

Definition at line 142 of file rclip.cc.

Member Data Documentation

◆ skt

TCPSocket* rclip::skt
protected

The socket, used for communication with ncpd.

Definition at line 150 of file rclip.h.

◆ status

Enum<rfsv::errs> rclip::status
protected

The current status of the connection.

Definition at line 155 of file rclip.h.


The documentation for this class was generated from the following files: