Ubuntu Platform API 3.0.0
A library helping with tight integration into the Ubuntu platform
lifecycle_delegate.h
Go to the documentation of this file.
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17 * Thomas Voß <thomas.voss@canonical.com>
18 */
19
20#ifndef UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_
21#define UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_
22
23#include <ubuntu/visibility.h>
24
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
38 typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context);
44 typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context);
45
51
59
68
77
86
97
107
118
128
138 void *context);
139
150 void *context);
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_ */
struct UbuntuApplicationArchive_ UApplicationArchive
Definition: archive.h:33
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_ref(UApplicationLifecycleDelegate *delegate)
Increments the reference count of the supplied lifecycle delegate.
UBUNTU_DLL_PUBLIC u_on_application_about_to_stop u_application_lifecycle_delegate_get_application_about_to_stop_cb(UApplicationLifecycleDelegate *delegate)
Queries the about-to-be-stopped cb from the supplied delegate.
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_set_context(UApplicationLifecycleDelegate *delegate, void *context)
Sets the cb context for the supplied delegate.
void UApplicationOptions
Encapsulates options as passed to the application.
Definition: options.h:35
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_unref(UApplicationLifecycleDelegate *delegate)
Decrements the reference count of the supplied lifecycle delegate and destroys it if the count reache...
void(* u_on_application_about_to_stop)(UApplicationArchive *archive, void *context)
Prototype for the callback that is invoked whenever the app is about to be stopped....
void UApplicationLifecycleDelegate
Opaque type encapsulating all app-specific callback functions.
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_set_application_resumed_cb(UApplicationLifecycleDelegate *delegate, u_on_application_resumed cb)
Sets the resumed cb for the supplied delegate.
UBUNTU_DLL_PUBLIC void * u_application_lifecycle_delegate_get_context(UApplicationLifecycleDelegate *delegate, void *context)
Queries the cb context from the supplied delegate.
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_destroy(UApplicationLifecycleDelegate *delegate)
Destroys an instance of the lifecycle delegate and releases all of its resources.
UBUNTU_DLL_PUBLIC UApplicationLifecycleDelegate * u_application_lifecycle_delegate_new()
Creates a new instance of the lifecycle delegate with an initial refernce count of 1.
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_set_application_about_to_stop_cb(UApplicationLifecycleDelegate *delegate, u_on_application_about_to_stop cb)
Sets the about-to-stop cb for the supplied delegate.
UBUNTU_DLL_PUBLIC u_on_application_resumed u_application_lifecycle_delegate_get_application_resumed_cb(UApplicationLifecycleDelegate *delegate)
Queries the resumed cb from the supplied delegate.
void(* u_on_application_resumed)(const UApplicationOptions *options, void *context)
Prototype for the callback that is invoked whenever the app has been resumed.
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26