Ubuntu Platform API  2.2.0
A library helping with tight integration into the Ubuntu platform
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
29 extern "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 
57  UBUNTU_DLL_PUBLIC UApplicationLifecycleDelegate*
59 
67  UApplicationLifecycleDelegate *delegate);
68 
76  UApplicationLifecycleDelegate *delegate);
77 
85  UApplicationLifecycleDelegate *delegate);
86 
95  UApplicationLifecycleDelegate *delegate,
97 
106  UApplicationLifecycleDelegate *delegate);
107 
114  UBUNTU_DLL_PUBLIC void
116  UApplicationLifecycleDelegate *delegate,
118 
127  UApplicationLifecycleDelegate *delegate);
128 
135  UBUNTU_DLL_PUBLIC void
137  UApplicationLifecycleDelegate *delegate,
138  void *context);
139 
147  UBUNTU_DLL_PUBLIC void*
149  UApplicationLifecycleDelegate *delegate,
150  void *context);
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_ */
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_ref(UApplicationLifecycleDelegate *delegate)
Increments the reference count of the supplied lifecycle 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_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.
void(* u_on_application_resumed)(const UApplicationOptions *options, void *context)
Prototype for the callback that is invoked whenever the app has been resumed.
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.
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. Applications can serialize their state to the supplied archive.
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...
UBUNTU_DLL_PUBLIC void u_application_lifecycle_delegate_set_context(UApplicationLifecycleDelegate *delegate, void *context)
Sets the cb context for the supplied delegate.
UBUNTU_DLL_PUBLIC UApplicationLifecycleDelegate * u_application_lifecycle_delegate_new()
Creates a new instance of the lifecycle delegate with an initial refernce count of 1...
void UApplicationOptions
Encapsulates options as passed to the application.
Definition: options.h:35
void UApplicationLifecycleDelegate
Opaque type encapsulating all app-specific callback functions.
struct UbuntuApplicationArchive_ UApplicationArchive
Definition: archive.h:33
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
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.
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 void u_application_lifecycle_delegate_set_application_resumed_cb(UApplicationLifecycleDelegate *delegate, u_on_application_resumed cb)
Sets the resumed cb for the supplied delegate.