-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgui.h
More file actions
59 lines (44 loc) · 1.45 KB
/
Copy pathgui.h
File metadata and controls
59 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef GUI_H
#define GUI_H
#include <iostream>
#include "sobject.h"
#include "command_string.h"
#include "thread.h"
#include "message_router.h"
#include "my_assert.h"
class Sip_Configuration;
class Contact_Db;
class Gui : public Runnable, public Command_Receiver
{
public:
virtual ~Gui();
virtual void set_sip_configuration(SRef<Sip_Configuration *> sipphoneconfig) = 0;
virtual void set_contact_db(SRef<Contact_Db *> contactDb) = 0;
virtual void handle_command(const Command_String &command) = 0;
void handle_command(std::string subsystem, const Command_String &cmd)
{
my_assert(subsystem == "gui");
handle_command(cmd);
}
Command_String handle_command_resp(std::string , const Command_String& )
{
std::cerr << "Warning: Gui::handle_command_resp called (BUG)"<<std::endl;
Command_String ret("","");
return ret;
}
virtual void set_callback(SRef<Command_Receiver*> cb);
SRef<Command_Receiver*> get_callback();
void send_command(std::string toSubsystem, const Command_String &cmd)
{
callback->handle_command(toSubsystem, cmd);
}
Command_String send_command_resp(std::string toSubsystem, const Command_String &cmd)
{
return callback->handle_command_resp(toSubsystem, cmd);
}
virtual bool config_dialog( SRef<Sip_Configuration *> conf ) = 0;
virtual void run() = 0;
protected:
SRef<Command_Receiver*> callback;
};
#endif // GUI_H