Yate
|
The client's default logic. More...
#include <yatecbase.h>
Public Member Functions | |
DefaultLogic (const char *name="default", int prio=-100) | |
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 | 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 | callStart (NamedList ¶ms, Window *wnd=0) |
virtual bool | digitPressed (NamedList ¶ms, 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 (NamedList ¶ms, bool save, bool update) |
virtual bool | callLogClear (const String &table, const String &direction) |
virtual bool | callLogCall (const String &billid) |
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 | handleResourceNotify (Message &msg, bool &stopLogic) |
virtual bool | handleResourceSubscribe (Message &msg, bool &stopLogic) |
virtual bool | handleClientChanUpdate (Message &msg, bool &stopLogic) |
virtual bool | defaultMsgHandler (Message &msg, int id, bool &stopLogic) |
virtual void | updateSelectedChannel (const String *item=0) |
virtual void | engineStart (Message &msg) |
Protected Member Functions | |
virtual void | idleTimerTick (Time &time) |
virtual bool | enableCallActions (const String &id) |
virtual bool | fillCallStart (NamedList &p, Window *wnd=0) |
virtual void | channelSelectionChanged (const String &old) |
Protected Attributes | |
String | m_selectedChannel |
String | m_transferInitiated |
bool | m_accShowAdvanced |
The client's default logic.
This class implements the default client behaviour.
DefaultLogic | ( | const char * | name = "default" , |
int | prio = -100 |
||
) |
Constructor
name | The name of this logic |
prio | 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 from ClientLogic.
Called when the user wants to save account data
params | Initial parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented from ClientLogic.
Handle actions from user interface
wnd | The window in which the user did something |
name | The action's name |
params | Optional action parameters |
Reimplemented from ClientLogic.
Called when the user wants to call an existing contact
params | Optional parameters |
wnd | Optional window containing the widget that triggered the action |
Reimplemented from ClientLogic.
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 from ClientLogic.
virtual bool callLogCall | ( | const String & | billid | ) | [virtual] |
Make an outgoing call to a target picked from the call log
billid | The bill id of the call |
Reimplemented from ClientLogic.
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 from ClientLogic.
virtual bool callLogCreateContact | ( | const String & | billid | ) | [virtual] |
Create a contact from a call log entry
billid | The bill id of the call |
Reimplemented from ClientLogic.
virtual bool callLogUpdate | ( | NamedList & | params, |
bool | save, | ||
bool | update | ||
) | [virtual] |
Update the call log history
params | Call log data |
save | True to save data to history file |
update | True to update the interface |
Reimplemented from ClientLogic.
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 |
Reimplemented from ClientLogic.
virtual bool calltoLoaded | ( | ) | [virtual] |
Called by the client after loaded the callto history file
Reimplemented from ClientLogic.
virtual void channelSelectionChanged | ( | const String & | old | ) | [protected, virtual] |
Notification on selection changes in channels list. Enable call actions for currently selected channel
old | The old selection |
virtual bool defaultMsgHandler | ( | Message & | msg, |
int | id, | ||
bool & | stopLogic | ||
) | [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
msg | Received message |
id | Message id |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
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 from ClientLogic.
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 from ClientLogic.
Called when a digit is pressed. The default logic will send the digit(s) as DTMFs on the active channel
params | List of parameters. It should contain a 'digits' parameter |
wnd | Optional window containing the widget that triggered the action |
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 from ClientLogic.
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 from ClientLogic.
virtual bool enableCallActions | ( | const String & | id | ) | [protected, virtual] |
virtual void engineStart | ( | Message & | msg | ) | [inline, virtual] |
virtual void exitingClient | ( | ) | [virtual] |
Called by the client before exiting. The default logic save client settings
Reimplemented from ClientLogic.
Fill call start parameter list from UI
p | The list of parameters to fill |
wnd | Optional window owning the widget triggering the action |
virtual bool handleCallCdr | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process call.cdr message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleClientChanUpdate | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process clientchan.update message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleResourceNotify | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process resource.notify message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleResourceSubscribe | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process resource.subscribe message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleUiAction | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process ui.action message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleUserLogin | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process user.login message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
virtual bool handleUserNotify | ( | Message & | msg, |
bool & | stopLogic | ||
) | [virtual] |
Process user.notify message
msg | Received message |
stopLogic | Set to true on exit to tell the client to stop asking other logics |
Reimplemented from ClientLogic.
Process help related actions
action | The action's name |
wnd | The window owning the control |
Reimplemented from ClientLogic.
virtual void idleTimerTick | ( | Time & | time | ) | [protected, virtual] |
Method called by the client when idle. This method is called in the UI's thread
time | The current time |
Reimplemented from ClientLogic.
virtual bool imIncoming | ( | Message & | msg | ) | [inline, virtual] |
Process an IM message
msg | The im.execute of chan.text message |
Reimplemented from ClientLogic.
virtual bool initializedClient | ( | ) | [virtual] |
Called by the client after loaded and intialized the windows and loaded configuration files. The default logic update client settings
Reimplemented from ClientLogic.
virtual void initializedWindows | ( | ) | [virtual] |
Called by the client after loaded and intialized the windows
Reimplemented from ClientLogic.
virtual void loadedWindows | ( | ) | [inline, virtual] |
Called by the client after loaded the windows
Reimplemented from ClientLogic.
virtual bool loginAccount | ( | const NamedList & | account, |
bool | login | ||
) | [virtual] |
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 from ClientLogic.
virtual bool select | ( | Window * | wnd, |
const String & | name, | ||
const String & | item, | ||
const String & | text = String::empty() |
||
) | [virtual] |
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 from ClientLogic.
virtual bool setClientParam | ( | const String & | param, |
const String & | value, | ||
bool | save, | ||
bool | update | ||
) | [virtual] |
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 from ClientLogic.
Handle actions from checkable widgets
wnd | The window in which the user did something |
name | The object's name |
active | Object's state |
Reimplemented from ClientLogic.
virtual bool updateAccount | ( | const NamedList & | account, |
bool | login, | ||
bool | save | ||
) | [virtual] |
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 from ClientLogic.
virtual bool updateContact | ( | const NamedList & | contact, |
bool | save, | ||
bool | update | ||
) | [virtual] |
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 from ClientLogic.
virtual bool updateProviders | ( | const NamedList & | provider, |
bool | save, | ||
bool | update | ||
) | [virtual] |
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 from ClientLogic.
virtual void updateSelectedChannel | ( | const String * | item = 0 | ) | [virtual] |
Update from UI or from a given value the selected item in channels list. The selected channel may not be the active one
item | Optional new value for current selection. Set to 0 to upadte from UI |