call: Move state property into base class

This let's us get rid of a lot of duplication in the derived classes.

Additionally we set the initial state to CALLS_CALL_STATE_INCOMING if
inbound is TRUE and CALLS_CALL_STATE_DIALING otherwise.
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-12-10 09:02:39 +01:00
parent ddf1dd7349
commit a048b4c83d
10 changed files with 100 additions and 243 deletions

View File

@@ -53,7 +53,6 @@ struct _CallsCallClass
const char *(*get_id) (CallsCall *self);
const char *(*get_name) (CallsCall *self);
CallsCallState (*get_state) (CallsCall *self);
const char *(*get_protocol) (CallsCall *self);
void (*answer) (CallsCall *self);
void (*hang_up) (CallsCall *self);
@@ -61,19 +60,21 @@ struct _CallsCallClass
char key);
};
const char *calls_call_get_id (CallsCall *self);
const char *calls_call_get_name (CallsCall *self);
CallsCallState calls_call_get_state (CallsCall *self);
gboolean calls_call_get_inbound (CallsCall *self);
const char *calls_call_get_protocol (CallsCall *self);
void calls_call_answer (CallsCall *self);
void calls_call_hang_up (CallsCall *self);
gboolean calls_call_can_dtmf (CallsCall *self);
void calls_call_send_dtmf_tone (CallsCall *self,
char key);
CallsBestMatch *calls_call_get_contact (CallsCall *self);
void calls_call_silence_ring (CallsCall *self);
gboolean calls_call_get_silenced (CallsCall *self);
const char *calls_call_get_id (CallsCall *self);
const char *calls_call_get_name (CallsCall *self);
CallsCallState calls_call_get_state (CallsCall *self);
void calls_call_set_state (CallsCall *self,
CallsCallState state);
gboolean calls_call_get_inbound (CallsCall *self);
const char *calls_call_get_protocol (CallsCall *self);
void calls_call_answer (CallsCall *self);
void calls_call_hang_up (CallsCall *self);
gboolean calls_call_can_dtmf (CallsCall *self);
void calls_call_send_dtmf_tone (CallsCall *self,
char key);
CallsBestMatch *calls_call_get_contact (CallsCall *self);
void calls_call_silence_ring (CallsCall *self);
gboolean calls_call_get_silenced (CallsCall *self);
void calls_call_state_to_string (GString *string,
CallsCallState state);