mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-04 18:57:37 +00:00
Add emergency-call manager to interface with DBus
This commit is contained in:
parent
213b27bf20
commit
4bdb6945bd
4 changed files with 98 additions and 0 deletions
|
@ -44,6 +44,7 @@
|
||||||
<xi:include href="xml/calls-contacts-provider.xml"/>
|
<xi:include href="xml/calls-contacts-provider.xml"/>
|
||||||
<xi:include href="xml/calls-contacts-row.xml"/>
|
<xi:include href="xml/calls-contacts-row.xml"/>
|
||||||
<xi:include href="xml/calls-dbus-manager.xml"/>
|
<xi:include href="xml/calls-dbus-manager.xml"/>
|
||||||
|
<xi:include href="xml/calls-emergency-calls-manager.xml"/>
|
||||||
<xi:include href="xml/calls-history-box.xml"/>
|
<xi:include href="xml/calls-history-box.xml"/>
|
||||||
<xi:include href="xml/calls-in-app-notification.xml"/>
|
<xi:include href="xml/calls-in-app-notification.xml"/>
|
||||||
<xi:include href="xml/calls-main-window.xml"/>
|
<xi:include href="xml/calls-main-window.xml"/>
|
||||||
|
|
77
src/calls-emergency-calls-manager.c
Normal file
77
src/calls-emergency-calls-manager.c
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Purism SPC
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Author: Guido Günther <agx@sigxcpu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define G_LOG_DOMAIN "CallsEmergencyCallsManger"
|
||||||
|
|
||||||
|
#include "calls-emergency-calls-manager.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:calls-emergency-calls-manager
|
||||||
|
* @short_description: Provide a DBus interface for emergency calls
|
||||||
|
* @Title: CallsEmergencyCallsManager
|
||||||
|
*
|
||||||
|
* This tracks emergency call information from the various origins
|
||||||
|
* and makes them available for initiating emergency calls.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct _CallsEmergencyCallsManager
|
||||||
|
{
|
||||||
|
CallsDBusEmergencyCallsSkeleton parent;
|
||||||
|
|
||||||
|
int dbus_name_id;
|
||||||
|
} CallsEmergencyCallsManger;
|
||||||
|
|
||||||
|
static void calls_emergency_calls_iface_init (CallsDBusEmergencyCallsIface *iface);
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE (CallsEmergencyCallsManager,
|
||||||
|
calls_emergency_calls_manager,
|
||||||
|
CALLS_DBUS_TYPE_EMERGENCY_CALLS_SKELETON,
|
||||||
|
G_IMPLEMENT_INTERFACE (
|
||||||
|
CALLS_DBUS_TYPE_EMERGENCY_CALLS,
|
||||||
|
calls_emergency_calls_iface_init));
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
handle_call_emergency_contact (CallsDBusEmergencyCalls *object,
|
||||||
|
GDBusMethodInvocation *invocation,
|
||||||
|
const gchar *arg_id)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
handle_get_emergency_contacts (CallsDBusEmergencyCalls *object,
|
||||||
|
GDBusMethodInvocation *invocation)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
calls_emergency_calls_iface_init (CallsDBusEmergencyCallsIface *iface)
|
||||||
|
{
|
||||||
|
iface->handle_call_emergency_contact = handle_call_emergency_contact;
|
||||||
|
iface->handle_get_emergency_contacts = handle_get_emergency_contacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
calls_emergency_calls_manager_class_init (CallsEmergencyCallsManagerClass *klass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
calls_emergency_calls_manager_init (CallsEmergencyCallsManager *self)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CallsEmergencyCallsManager *
|
||||||
|
calls_emergency_calls_manager_new (void)
|
||||||
|
{
|
||||||
|
return g_object_new (CALLS_TYPE_EMERGENCY_CALLS_MANAGER, NULL);
|
||||||
|
}
|
19
src/calls-emergency-calls-manager.h
Normal file
19
src/calls-emergency-calls-manager.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Purism SPC
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Author: Guido Günther <agx@sigxcpu.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "dbus/calls-emergency-call-dbus.h"
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#define CALLS_TYPE_EMERGENCY_CALLS_MANAGER (calls_emergency_calls_manager_get_type ())
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE (CallsEmergencyCallsManager, calls_emergency_calls_manager, CALLS, EMERGENCY_CALLS_MANAGER,
|
||||||
|
CallsDBusEmergencyCallsSkeleton)
|
||||||
|
|
||||||
|
CallsEmergencyCallsManager * calls_emergency_calls_manager_new (void);
|
|
@ -101,6 +101,7 @@ calls_sources = files([
|
||||||
'calls-contacts-provider.c', 'calls-contacts-provider.h',
|
'calls-contacts-provider.c', 'calls-contacts-provider.h',
|
||||||
'calls-contacts-row.c', 'calls-contacts-row.h',
|
'calls-contacts-row.c', 'calls-contacts-row.h',
|
||||||
'calls-dbus-manager.c', 'calls-dbus-manager.h',
|
'calls-dbus-manager.c', 'calls-dbus-manager.h',
|
||||||
|
'calls-emergency-calls-manager.c', 'calls-emergency-calls-manager.h',
|
||||||
'calls-history-box.c', 'calls-history-box.h',
|
'calls-history-box.c', 'calls-history-box.h',
|
||||||
'calls-in-app-notification.c', 'calls-in-app-notification.h',
|
'calls-in-app-notification.c', 'calls-in-app-notification.h',
|
||||||
'calls-log.c', 'calls-log.h',
|
'calls-log.c', 'calls-log.h',
|
||||||
|
|
Loading…
Reference in a new issue