class ClientLogic

Base class for all client logics. More...

Full nameTelEngine::ClientLogic
Definition#include <yatecbase.h>
InheritsTelEngine::GenObject [public ]
Inherited byDefaultLogic
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Public Members

Protected Methods

Protected Members


Detailed Description

This class implements the logic behind different actions in the client. It specifies the way the graphical interface of the client will behave in different circumstances.

 ~ClientLogic ()

~ClientLogic

[virtual]

Destructor. Remove itself from the client's list

inline const String&  name ()

name

[const]

Get the name of this logic

Returns: This logic's name

inline int  priority ()

priority

[const]

Get the priority of this logic

Returns: This logic's priority

const String&  toString ()

toString

[const virtual]

Function that returns the name of the logic

Returns: The name of this client logic

Reimplemented from GenObject.

bool  setParams (const NamedList& params)

setParams

Process a request to set client parameters

Parameters:
paramsThe parameter list

Returns: True on success

bool  action (Window* wnd, const String& name, NamedList* params = 0)

action

[virtual]

Handle actions from user interface

Parameters:
wndThe window in which the user did something
nameThe action's name
paramsOptional action parameters

Returns: True if the action was handled

bool  toggle (Window* wnd, const String& name, bool active)

toggle

[virtual]

Handle actions from checkable widgets

Parameters:
wndThe window in which the user did something
nameThe object's name
activeObject's state

Returns: True if the action was handled by a client logic

bool  select (Window* wnd, const String& name, const String& item, const String& text = String::empty())

select

[virtual]

Handle 'select' actions from user interface

Parameters:
wndThe window in which the user did something
nameThe object's name
itemItem identifying the selection
textSelection's text

Returns: True if the action was handled

bool  setClientParam (const String& param, const String& value, bool save, bool update)

setClientParam

[virtual]

Set a client's parameter. Save the settings file and/or update interface

Parameters:
paramParameter's name
valueThe value of the parameter
saveTrue to save the configuration file
updateTrue to update the interface

Returns: True on success

bool  imIncoming (Message& msg)

imIncoming

[virtual]

Process an IM message

Parameters:
msgThe im.execute or chan.text message

bool  callIncoming (Message& msg, const String& dest)

callIncoming

[virtual]

Call execute handler called by the client. The default logic ask the client to build an incoming channel

Parameters:
msgThe call.execute message
destThe destination (target)

Returns: True if a channel was created and connected

bool  validateCall (NamedList& params, Window* wnd = 0)

validateCall

[virtual]

Check presence of all necessary data to make a call

Parameters:
paramsList of call parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  callStart (NamedList& params, Window* wnd = 0, const String& cmd = String::empty())

callStart

[virtual]

Called when the user trigger a call start action The default logic fill the parameter list and ask the client to create an outgoing channel

Parameters:
paramsList of call parameters
wndOptional window containing the widget that triggered the action
cmdOptional command (widget name)

Returns: True on success

bool  line (const String& name, Window* wnd = 0)

line

[virtual]

Called when the user selected a line

Parameters:
nameThe line name
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  display (NamedList& params, bool widget, Window* wnd = 0)

display

[virtual]

Show/hide widget(s) or window(s) on 'display'/'show' action.

Parameters:
paramsWidget(s) or window(s) to show/hide
widgetTrue if the operation indicates widget(s), false otherwise
wndOptional window owning the widget(s) to show or hide

Returns: False if failed to show/hide all widgets/windows

bool  backspace (const String& name, Window* wnd = 0)

backspace

[virtual]

Erase the last digit from the given widget and set focus on it

Parameters:
nameThe widget (it might be the window itself)
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  command (const String& name, Window* wnd = 0)

command

[virtual]

Enqueue an engine.command message

Parameters:
nameThe command line
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  debug (const String& name, bool active, Window* wnd = 0)

debug

[virtual]

Enqueue an engine.debug message.

Parameters:
nameThe debug action content (following the prefix). The format of this parameter must be 'module:active-true:active-false'. The line parameter of the message will be filled with 'active-true' if active is true and with 'active-false' if active is false
activeThe widget's state
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  editAccount (bool newAcc, NamedList* params, Window* wnd = 0)

editAccount

[virtual]

Called when the user wants to add a new account or edit an existing one

Parameters:
newAccTrue to add a new account, false to edit an exisiting one
paramsInitial parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  acceptAccount (NamedList* params, Window* wnd = 0)

acceptAccount

[virtual]

Called when the user wants to save account data

Parameters:
paramsInitial parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  delAccount (const String& account, Window* wnd = 0)

delAccount

[virtual]

Called when the user wants to delete an existing account

Parameters:
accountThe account's name. Set to empty to delete the current selection
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  updateAccount (const NamedList& account, bool login, bool save)

updateAccount

[virtual]

Add/set an account. Login if required

Parameters:
accountThe account's parameters. The name of the list must be the account's name
loginTrue to login the account
saveTrue to save the accounts file. If true and file save fails the method will fail

Returns: True on success

bool  loginAccount (const NamedList& account, bool login)

loginAccount

[virtual]

Login/logout an account

Parameters:
accountThe account's parameters. The name of the list must be the account's name
loginTrue to login the account, false to logout

Returns: True on success

bool  updateContact (const NamedList& contact, bool save, bool update)

updateContact

[virtual]

Add/set a contact

Parameters:
contactThe contact's parameters. The name of the list must be the contacts's id (name). If it starts with 'client/' this is a contact updated from server: it can't be changed
saveTrue to save data to contacts file
updateTrue to update the interface

Returns: True on success

bool  acceptContact (NamedList* params, Window* wnd = 0)

acceptContact

[virtual]

Called when the user wants to save account data

Parameters:
paramsInitial parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  editContact (bool newCont, NamedList* params = 0, Window* wnd = 0)

editContact

[virtual]

Called when the user wants to add a new contact or edit an existing one

Parameters:
newContTrue to add a new contact, false to edit an existing one
paramsOptional initial parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  delContact (const String& contact, Window* wnd = 0)

delContact

[virtual]

Called when the user wants to delete an existing contact

Parameters:
contactThe contact's id. Set to empty to delete the current selection
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  callContact (NamedList* params = 0, Window* wnd = 0)

callContact

[virtual]

Called when the user wants to call an existing contact

Parameters:
paramsOptional parameters
wndOptional window containing the widget that triggered the action

Returns: True on success

bool  updateProviders (const NamedList& provider, bool save, bool update)

updateProviders

[virtual]

Add/set account providers data

Parameters:
providerThe provider's parameters. The name of the list must be the provider's id (name)
saveTrue to save data to providers file
updateTrue to update the interface

Returns: True on success

bool  callLogUpdate (const NamedList& params, bool save, bool update)

callLogUpdate

[virtual]

Update the call log history

Parameters:
paramsCall log data
saveTrue to save data to history file
updateTrue to update the interface

Returns: True

bool  callLogDelete (const String& billid)

callLogDelete

[virtual]

Remove a call log item

Parameters:
billidThe bill id of the call

Returns: True on success

bool  callLogClear (const String& table, const String& direction)

callLogClear

[virtual]

Clear the specified log and the entries from the history file and save the history file

Parameters:
tableTebale to clear
directionThe call direction to clear (incoming,outgoing). Note that the direction is the value saved from call.cdr messages. If empty, all log entries will be cleared

Returns: True

bool  callLogCall (const String& billid, Window* wnd = 0)

callLogCall

[virtual]

Make an outgoing call to a target picked from the call log

Parameters:
billidThe bill id of the call
wndOptional window starting the action

Returns: True on success (call initiated)

bool  callLogCreateContact (const String& billid)

callLogCreateContact

[virtual]

Create a contact from a call log entry

Parameters:
billidThe bill id of the call

Returns: True on success (address book popup window was displayed)

bool  help (const String& action, Window* wnd)

help

[virtual]

Process help related actions

Parameters:
actionThe action's name
wndThe window owning the control

Returns: True on success

bool  calltoLoaded ()

calltoLoaded

[virtual]

Called by the client after loaded the callto history file

Returns: True to tell the client to stop notifying other logics

void  loadedWindows ()

loadedWindows

[virtual]

Called by the client after loaded the windows

void  initializedWindows ()

initializedWindows

[virtual]

Called by the client after loaded and intialized the windows

bool  initializedClient ()

initializedClient

[virtual]

Called by the client after loaded and intialized the windows and loaded configuration files. The default logic update client settings

Returns: True to stop processing this notification

void  exitingClient ()

exitingClient

[virtual]

Called by the client before exiting. The default logic save client settings

bool  handleUiAction (Message& msg, bool& stopLogic)

handleUiAction

[virtual]

Process ui.action message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleCallCdr (Message& msg, bool& stopLogic)

handleCallCdr

[virtual]

Process call.cdr message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleUserLogin (Message& msg, bool& stopLogic)

handleUserLogin

[virtual]

Process user.login message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleUserNotify (Message& msg, bool& stopLogic)

handleUserNotify

[virtual]

Process user.notify message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleUserRoster (Message& msg, bool& stopLogic)

handleUserRoster

[virtual]

Process user.roster message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleResourceNotify (Message& msg, bool& stopLogic)

handleResourceNotify

[virtual]

Process resource.notify message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleResourceSubscribe (Message& msg, bool& stopLogic)

handleResourceSubscribe

[virtual]

Process resource.subscribe message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleClientChanUpdate (Message& msg, bool& stopLogic)

handleClientChanUpdate

[virtual]

Process clientchan.update message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  handleContactInfo (Message& msg, bool& stopLogic)

handleContactInfo

[virtual]

Process contact.info message

Parameters:
msgReceived message
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

bool  defaultMsgHandler (Message& msg, int id, bool& stopLogic)

defaultMsgHandler

[virtual]

Default message processor called for id's not defined in client. Descendants may override it to process custom messages installed by them and relayed through the client

Parameters:
msgReceived message
idMessage id
stopLogicSet to true on exit to tell the client to stop asking other logics

Returns: True to stop further processing by the engine

void  engineStart (Message& msg)

engineStart

[virtual]

Engine start notification

Parameters:
msgThe engine.start message

bool  addDurationUpdate (DurationUpdate* duration, bool autoDelete = false)

addDurationUpdate

[virtual]

Add a duration object to this client's list

Parameters:
durationThe object to add
autoDeleteTrue to delete the object when the list is cleared

Returns: True on success

bool  removeDurationUpdate (const String& name, bool delObj = false)

removeDurationUpdate

[virtual]

Remove a duration object from list

Parameters:
nameThe name of the object to remove
delObjTrue to destroy the object, false to remove it

Returns: True on success

bool  removeDurationUpdate (DurationUpdate* duration, bool delObj = false)

removeDurationUpdate

[virtual]

Remove a duration object from list

Parameters:
durationThe object to remove
delObjTrue to destroy the object, false to remove it

Returns: True on success

DurationUpdate*  findDurationUpdate (const String& name, bool ref = true)

findDurationUpdate

[virtual]

Find a duration update by its name

Parameters:
nameThe name of the object to find
refTrue to increase its reference counter before returning

Returns: DurationUpdate pointer or 0

void  clearDurationUpdate ()

clearDurationUpdate

[virtual]

Remove all duration objects

void  destruct ()

destruct

[virtual]

Release memory. Remove from client's list

Reimplemented from GenObject.

const String&  cdrRemoteParty (const NamedList& params, bool outgoing)

cdrRemoteParty

[static]

Retrieve the remote party from CDR parameters

Parameters:
paramsCDR parameters
outgoingTrue if the call was an outgoing one

Returns: The remote party (may be empty)

const String&  cdrRemoteParty (const NamedList& params)

cdrRemoteParty

[static]

Retrieve the remote party from CDR parameters

Parameters:
paramsCDR parameters

Returns: The remote party (may be empty)

void  initStaticData ()

initStaticData

[static]

Init static logic lists. Called by the client when start running

bool  saveContact (Configuration& cfg, ClientContact* c, bool save = true)

saveContact

[static]

Save a contact into a configuration file

Parameters:
cfgThe configuration file
cThe contact to save
saveTrue to save the file

Returns: True on success

bool  clearContact (Configuration& cfg, ClientContact* c, bool save = true)

clearContact

[static]

Delete a contact from a configuration file

Parameters:
cfgThe configuration file
cThe contact to delete
saveTrue to save the file

Returns: True on success

static ObjList s_accOptions

s_accOptions

static const char* s_provParams[]

s_provParams[]

static ObjList s_protocols

s_protocols

static Mutex s_protocolsMutex

s_protocolsMutex

 ClientLogic (const char* name, int priority)

ClientLogic

[protected]

Constructor. Append itself to the client's list

Parameters:
nameThe name of this logic (module)
priorityThe priority of this logic

void  idleTimerTick (Time& time)

idleTimerTick

[protected virtual]

Method called by the client when idle. This method is called in the UI's thread

Parameters:
timeThe current time

ObjList m_durationUpdate

m_durationUpdate

[protected]

Mutex m_durationMutex

m_durationMutex

[protected]


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.