Public Member Functions | Protected Attributes

wosh::bundles::DesktopNotifierBundle Class Reference
[WOSH Bundles]

Communicator Service for desktops (such as Windows, Gnome, KDE). Supports user recognition (3rd-party authentication) and messaging. More...

#include <H:/WOSH/win32_vc2010/src/bundles/DesktopNotifier/DesktopNotifierBundle.h>

List of all members.

Public Member Functions

void busMessage (const Message &message, const Bus *source)
 Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.
IDesktopInteractionListener Interface
void monitor_MouseNotMoved ()
void monitor_MouseMoved ()
IDesktopNotifierListener Interface
void user_TrayIconClicked (short mode)
void user_TrayMessageClicked ()
DesktopNotifier Interface
virtual WRESULT setTrayIcon (QSystemTrayIcon *tray_icon)
WRESULT updateUserLogged (bool online, bool raiseEvent=true)
Communicator Interface
bool isUserReachable (const std::string &wosh_username) const
 Check if user is reachable (means online in most cases)
bool isUserRegistered (const std::string &username) const
 Check if user is registered to current server.
int64 getUserLastSeen (const std::string &) const
 Get the timestamp of last(seen) online-status of given user.
WRESULT sendMessageToUser (const std::string &wosh_username, const std::string &message)
 Send a text message to given (wosh) username.
WRESULT sendMessageTo (const std::string &custom_username, const std::string &message)
 Send a text message to given account name [example: asd123@gmail.com].
WRESULT notify (const Notification *notification, const Message *notification_message=NULL)
 Send a Notification translated into a text message.

Protected Member Functions

Internal methods
std::string getUsernameFromAccountName (const std::string &accountname)
WRESULT showMessage (const std::string &message)

Protected Attributes

BusConnector BusDevices
 register myself & work as Device too
BusConnector BusSecurity
 connector to Security bus (posting only)

Detailed Description

Communicator Service for desktops (such as Windows, Gnome, KDE). Supports user recognition (3rd-party authentication) and messaging.

Version:
0.8.711
Id:
DesktopNotifierBundle.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo

Definition at line 66 of file DesktopNotifierBundle.h.


Member Function Documentation

void wosh::bundles::DesktopNotifierBundle::busMessage ( const Message message,
const Bus source 
) [virtual]

Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Parameters:
[in]messagethe incoming message
[in]sourcethe source Bus of the incoming message
Warning:
The current thread is own and managed by the caller Bus. Heavy, dangerous or time expensive operations should be executed asynchronously and not inline!

Reimplemented from wosh::BundleGeneric.

Definition at line 215 of file DesktopNotifierBundle.cpp.

References wosh::MessageContent::asNotification(), BusCore, wosh::Message::getContent(), wosh::Message::getDestination(), wosh::Message::isEmpty(), wosh::MessageContent::isNotification(), wosh::BusConnector::postMessage(), and wosh::Message::replyTo().

int64 wosh::bundles::DesktopNotifierBundle::getUserLastSeen ( const std::string &  username ) const [inline, virtual]

Get the timestamp of last(seen) online-status of given user.

Parameters:
username[in] wosh-username to lookup
Returns:
epoc timestamp if user is still online, negative epoch if user is actually offline; 0 means not available

Implements wosh::interfaces::communication::Communicator.

Definition at line 119 of file DesktopNotifierBundle.h.

bool wosh::bundles::DesktopNotifierBundle::isUserReachable ( const std::string &  wosh_username ) const [virtual]

Check if user is reachable (means online in most cases)

Parameters:
wosh_username[in] wosh-username to lookup
Returns:
true if user is online; false else

Implements wosh::interfaces::communication::Communicator.

Definition at line 325 of file DesktopNotifierBundle.cpp.

bool wosh::bundles::DesktopNotifierBundle::isUserRegistered ( const std::string &  username ) const [inline, virtual]

Check if user is registered to current server.

Parameters:
username[in] wosh-username to lookup
Returns:
true if user is in friends' list

Implements wosh::interfaces::communication::Communicator.

Definition at line 118 of file DesktopNotifierBundle.h.

WRESULT wosh::bundles::DesktopNotifierBundle::notify ( const Notification notification,
const Message notification_message = NULL 
) [virtual]

Send a Notification translated into a text message.

Parameters:
notification[in] the Notification to communicate
notification_message[in] message containing the Notification to communicate
Returns:
WRET_ERR_PARAM if account wasn't found, WRET_OK when message was sent, WRET_ERR_INTERNAL else.

Implements wosh::interfaces::communication::Communicator.

Definition at line 355 of file DesktopNotifierBundle.cpp.

References wosh::ISerializable::clone(), wosh::LOG_CRITICAL, WRET_ERR_PARAM, and WRET_OK.

WRESULT wosh::bundles::DesktopNotifierBundle::sendMessageTo ( const std::string &  custom_username,
const std::string &  message 
) [virtual]

Send a text message to given account name [example: asd123@gmail.com].

Parameters:
custom_username[in] recipent of the message
message[in] message to be sent
Returns:
WRET_ERR_PARAM if account wasn't found, WRET_OK when message was sent, WRET_ERR_INTERNAL else.

Implements wosh::interfaces::communication::Communicator.

Definition at line 343 of file DesktopNotifierBundle.cpp.

References wosh::LOG_CRITICAL, wosh::LOG_WARNING, and WRET_ERR_PARAM.

WRESULT wosh::bundles::DesktopNotifierBundle::sendMessageToUser ( const std::string &  wosh_username,
const std::string &  message 
) [virtual]

Send a text message to given (wosh) username.

Parameters:
wosh_username[in] recipent of the message (as WOSH username)
message[in] message to be sent
Returns:
WRET_ERR_PARAM if account wasn't found, WRET_OK when message was sent, WRET_ERR_INTERNAL else.

Implements wosh::interfaces::communication::Communicator.

Definition at line 331 of file DesktopNotifierBundle.cpp.

References wosh::LOG_CRITICAL, wosh::LOG_WARNING, and WRET_ERR_PARAM.


Member Data Documentation

register myself & work as Device too

Definition at line 137 of file DesktopNotifierBundle.h.

connector to Security bus (posting only)

Definition at line 138 of file DesktopNotifierBundle.h.


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

Generated on Tue Feb 8 2011 09:33:33 for WOSH system 0.8.888 [wolf] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework