Yate
|
Base class for all client logics. More...
#include <yatecbase.h>
Public Member Functions | |
virtual | ~ClientLogic () |
const String & | name () const |
int | priority () const |
virtual const String & | toString () const |
bool | setParams (const NamedList ¶ms) |
virtual bool | action (Window *wnd, const String &name, NamedList *params=0) |
virtual bool | toggle (Window *wnd, const String &name, bool active) |
virtual bool | select (Window *wnd, const String &name, const String &item, const String &text=String::empty()) |
virtual bool | select (Window *wnd, const String &name, const NamedList &items) |
virtual bool | setClientParam (const String ¶m, const String &value, bool save, bool update) |
virtual bool | imIncoming (Message &msg) |
virtual bool | callIncoming (Message &msg, const String &dest) |
virtual bool | validateCall (NamedList ¶ms, Window *wnd=0) |
virtual bool | callStart (NamedList ¶ms, Window *wnd=0, const String &cmd=String::empty()) |
virtual bool | line (const String &name, Window *wnd=0) |
virtual bool | display (NamedList ¶ms, bool widget, Window *wnd=0) |
virtual bool | backspace (const String &name, Window *wnd=0) |
virtual bool | command (const String &name, Window *wnd=0) |
virtual bool | debug (const String &name, bool active, Window *wnd=0) |
virtual bool | editAccount (bool newAcc, NamedList *params, Window *wnd=0) |
virtual bool | acceptAccount (NamedList *params, Window *wnd=0) |
virtual bool | delAccount (const String &account, Window *wnd=0) |
virtual bool | updateAccount (const NamedList &account, bool login, bool save) |
virtual bool | loginAccount (const NamedList &account, bool login) |
virtual bool | updateContact (const NamedList &contact, bool save, bool update) |
virtual bool | acceptContact (NamedList *params, Window *wnd=0) |
virtual bool | editContact (bool newCont, NamedList *params=0, Window *wnd=0) |
virtual bool | delContact (const String &contact, Window *wnd=0) |
virtual bool | callContact (NamedList *params=0, Window *wnd=0) |
virtual bool | updateProviders (const NamedList &provider, bool save, bool update) |
virtual bool | callLogUpdate (const NamedList ¶ms, bool save, bool update) |
virtual bool | callLogDelete (const String &billid) |
virtual bool | callLogClear (const String &table, const String &direction) |
virtual bool | callLogCall (const String &billid, Window *wnd=0) |
virtual bool | callLogCreateContact (const String &billid) |
virtual bool | help (const String &action, Window *wnd) |
virtual bool | calltoLoaded () |
virtual void | loadedWindows () |
virtual void | initializedWindows () |
virtual bool | initializedClient () |
virtual void | exitingClient () |
virtual bool | handleUiAction (Message &msg, bool &stopLogic) |
virtual bool | handleCallCdr (Message &msg, bool &stopLogic) |
virtual bool | handleUserLogin (Message &msg, bool &stopLogic) |
virtual bool | handleUserNotify (Message &msg, bool &stopLogic) |
virtual bool | handleUserRoster (Message &msg, bool &stopLogic) |
virtual bool | handleResourceNotify (Message &msg, bool &stopLogic) |
virtual bool | handleResourceSubscribe (Message &msg, bool &stopLogic) |
virtual bool | handleClientChanUpdate (Message &msg, bool &stopLogic) |
virtual bool | handleContactInfo (Message &msg, bool &stopLogic) |
virtual bool | defaultMsgHandler (Message &msg, int id, bool &stopLogic) |
virtual void | engineStart (Message &msg) |
virtual bool | addDurationUpdate (DurationUpdate *duration, bool autoDelete=false) |
virtual bool | removeDurationUpdate (const String &name, bool delObj=false) |
virtual bool | removeDurationUpdate (DurationUpdate *duration, bool delObj=false) |
virtual DurationUpdate * | findDurationUpdate (const String &name, bool ref=true) |
virtual void | clearDurationUpdate () |
virtual void | destruct () |
Public Member Functions inherited from GenObject | |
GenObject () | |
virtual | ~GenObject () |
virtual bool | alive () const |
virtual void * | getObject (const String &name) const |
NamedCounter * | getObjCounter () const |
NamedCounter * | setObjCounter (NamedCounter *counter) |
Static Public Member Functions | |
static const String & | cdrRemoteParty (const NamedList ¶ms, bool outgoing) |
static const String & | cdrRemoteParty (const NamedList ¶ms) |
static void | initStaticData () |
static bool | saveContact (Configuration &cfg, ClientContact *c, bool save=true) |
static bool | clearContact (Configuration &cfg, ClientContact *c, bool save=true) |
Static Public Member Functions inherited from GenObject | |
static void * | getObject (const String &name, const GenObject *obj) |
static bool | getObjCounting () |
static void | setObjCounting (bool enable) |
static NamedCounter * | getObjCounter (const String &name, bool create=true) |
static ObjList & | getObjCounters () |
Static Public Attributes | |
static ObjList | s_accOptions |
static const char * | s_provParams [] |
static ObjList | s_protocols |
static Mutex | s_protocolsMutex |
Protected Member Functions | |
ClientLogic (const char *name, int priority) | |
virtual void | idleTimerTick (Time &time) |
Protected Attributes | |
ObjList | m_durationUpdate |
Mutex | m_durationMutex |
Friends | |
class | Client |
Base class for all client logics.
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.
|
virtual |
Destructor. Remove itself from the client's list
|
protected |
Constructor. Append itself to the client's list
name | The name of this logic (module) |
priority | The priority of this logic |
Called when the user wants to save account data
params | Initial parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
Called when the user wants to save account data
params | Initial parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
Handle actions from user interface
wnd | The window in which the user did something |
name | The action's name |
params | Optional action parameters |
Reimplemented in DefaultLogic.
|
virtual |
Add a duration object to this client's list
duration | The object to add |
autoDelete | True to delete the object when the list is cleared |
Erase the last digit from the given widget and set focus on it
name | The widget (it might be the window itself) |
wnd | Optional window containing the widget that triggered the action |
Called when the user wants to call an existing contact
params | Optional parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
Call execute handler called by the client. The default logic ask the client to build an incoming channel
msg | The call.execute message |
dest | The destination (target) |
Reimplemented in DefaultLogic.
Make an outgoing call to a target picked from the call log
billid | The bill id of the call |
wnd | Optional window starting the action |
Reimplemented in DefaultLogic.
Clear the specified log and the entries from the history file and save the history file
table | Tebale to clear |
direction | The 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 |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Create a contact from a call log entry
billid | The bill id of the call |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Remove a call log item
billid | The bill id of the call |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Update the call log history
params | Call log data |
save | True to save data to history file |
update | True to update the interface |
Reimplemented in DefaultLogic.
|
inlinevirtual |
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
params | List of call parameters |
wnd | Optional window containing the widget that triggered the action |
cmd | Optional command (widget name) |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Called by the client after loaded the callto history file
Reimplemented in DefaultLogic.
Retrieve the remote party from CDR parameters
params | CDR parameters |
outgoing | True if the call was an outgoing one |
References TelEngine::YSTRING().
Referenced by ClientLogic::cdrRemoteParty().
Retrieve the remote party from CDR parameters
params | CDR parameters |
References ClientLogic::cdrRemoteParty(), String::empty(), and TelEngine::YSTRING().
|
static |
Delete a contact from a configuration file
cfg | The configuration file |
c | The contact to delete |
save | True to save the file |
|
virtual |
Remove all duration objects
Enqueue an engine.command message
name | The command line |
wnd | Optional window containing the widget that triggered the action |
Enqueue an engine.debug message.
name | The 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 |
active | The widget's state |
wnd | Optional window containing the widget that triggered the action |
|
inlinevirtual |
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
msg | Received message |
id | Message id |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
Called when the user wants to delete an existing account
account | The account's name. Set to empty to delete the current selection |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
Called when the user wants to delete an existing contact
contact | The contact's id. Set to empty to delete the current selection |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
|
virtual |
Release memory. Remove from client's list
Reimplemented from GenObject.
Show/hide widget(s) or window(s) on 'display'/'show' action.
params | Widget(s) or window(s) to show/hide |
widget | True if the operation indicates widget(s), false otherwise |
wnd | Optional window owning the widget(s) to show or hide |
Called when the user wants to add a new account or edit an existing one
newAcc | True to add a new account, false to edit an exisiting one |
params | Initial parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
Called when the user wants to add a new contact or edit an existing one
newCont | True to add a new contact, false to edit an existing one |
params | Optional initial parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.
|
inlinevirtual |
|
inlinevirtual |
Called by the client before exiting. The default logic save client settings
Reimplemented in DefaultLogic.
|
virtual |
Find a duration update by its name
name | The name of the object to find |
ref | True to increase its reference counter before returning |
|
inlinevirtual |
Process call.cdr message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process clientchan.update message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process contact.info message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process resource.notify message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process resource.subscribe message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process ui.action message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process user.login message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process user.notify message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process user.roster message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented in DefaultLogic.
Process help related actions
action | The action's name |
wnd | The window owning the control |
Reimplemented in DefaultLogic.
|
inlineprotectedvirtual |
Method called by the client when idle. This method is called in the UI's thread
time | The current time |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Process an IM message
msg | The im.execute or chan.text message |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Called by the client after loaded and intialized the windows and loaded configuration files. The default logic update client settings
Reimplemented in DefaultLogic.
|
inlinevirtual |
Called by the client after loaded and intialized the windows
Reimplemented in DefaultLogic.
|
static |
Init static logic lists. Called by the client when start running
Called when the user selected a line
name | The line name |
wnd | Optional window containing the widget that triggered the action |
|
inlinevirtual |
Called by the client after loaded the windows
Reimplemented in DefaultLogic.
|
inlinevirtual |
Login/logout an account
account | The account's parameters. The name of the list must be the account's name |
login | True to login the account, false to logout |
Reimplemented in DefaultLogic.
|
inline |
Get the name of this logic
|
inline |
Get the priority of this logic
|
virtual |
Remove a duration object from list
name | The name of the object to remove |
delObj | True to destroy the object, false to remove it |
|
virtual |
Remove a duration object from list
duration | The object to remove |
delObj | True to destroy the object, false to remove it |
|
static |
Save a contact into a configuration file
cfg | The configuration file |
c | The contact to save |
save | True to save the file |
|
inlinevirtual |
Handle 'select' actions from user interface
wnd | The window in which the user did something |
name | The object's name |
item | Item identifying the selection |
text | Selection's text |
Reimplemented in DefaultLogic.
Handle 'select' with multiple items actions from user interface
wnd | The window in which the user did something |
name | The object's name |
items | List of selected items |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Set a client's parameter. Save the settings file and/or update interface
param | Parameter's name |
value | The value of the parameter |
save | True to save the configuration file |
update | True to update the interface |
Reimplemented in DefaultLogic.
bool setParams | ( | const NamedList & | params | ) |
Process a request to set client parameters
params | The parameter list |
Handle actions from checkable widgets
wnd | The window in which the user did something |
name | The object's name |
active | Object's state |
Reimplemented in DefaultLogic.
|
virtual |
Function that returns the name of the logic
Reimplemented from GenObject.
|
inlinevirtual |
Add/set an account. Login if required
account | The account's parameters. The name of the list must be the account's name |
login | True to login the account |
save | True to save the accounts file. If true and file save fails the method will fail |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Add/set a contact
contact | The 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 |
save | True to save data to contacts file |
update | True to update the interface |
Reimplemented in DefaultLogic.
|
inlinevirtual |
Add/set account providers data
provider | The provider's parameters. The name of the list must be the provider's id (name) |
save | True to save data to providers file |
update | True to update the interface |
Reimplemented in DefaultLogic.
Check presence of all necessary data to make a call
params | List of call parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented in DefaultLogic.