~ricmm/platform-api/guards-for-null-sensors

« back to all changes in this revision

Viewing changes to include/ubuntu/application/lifecycle_delegate.h

* Add headers for new refactored platform API
* Implement new API for Android/hybris backend
* Implement lifecycle iteration 0 delegates infrastructure
* Do away with all old public headers and use only the new API.

Approved by Michael Frey, Ricardo Salveti, Thomas Voß, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "archive.h"
 
24
#include "options.h"
 
25
 
 
26
#ifdef __cplusplus
 
27
extern "C" {
 
28
#endif
 
29
    
 
30
    typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context);
 
31
    typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context);
 
32
    
 
33
    typedef void UApplicationLifecycleDelegate;
 
34
    
 
35
    UApplicationLifecycleDelegate*
 
36
    u_application_lifecycle_delegate_new();
 
37
    
 
38
    void
 
39
    u_application_lifecycle_delegate_destroy(
 
40
        UApplicationLifecycleDelegate *delegate);
 
41
    
 
42
    void
 
43
    u_application_lifecycle_delegate_ref(
 
44
        UApplicationLifecycleDelegate *delegate);
 
45
    
 
46
    void
 
47
    u_application_lifecycle_delegate_unref(
 
48
        UApplicationLifecycleDelegate *delegate);
 
49
    
 
50
    void
 
51
    u_application_lifecycle_delegate_set_application_resumed_cb(
 
52
        UApplicationLifecycleDelegate *delegate,
 
53
        u_on_application_resumed cb);
 
54
    
 
55
    u_on_application_resumed
 
56
    u_application_lifecycle_delegate_get_application_resumed_cb(
 
57
        UApplicationLifecycleDelegate *delegate);
 
58
    
 
59
    void
 
60
    u_application_lifecycle_delegate_set_application_about_to_stop_cb(
 
61
        UApplicationLifecycleDelegate *delegate,
 
62
        u_on_application_about_to_stop cb);
 
63
    
 
64
    u_on_application_about_to_stop
 
65
    u_application_lifecycle_delegate_get_application_about_to_stop_cb(
 
66
        UApplicationLifecycleDelegate *delegate);
 
67
    
 
68
    void
 
69
    u_application_lifecycle_delegate_set_context(
 
70
        UApplicationLifecycleDelegate *delegate,
 
71
        void *context);
 
72
    
 
73
    void*
 
74
    u_application_lifecycle_delegate_get_context(
 
75
        UApplicationLifecycleDelegate *delegate,
 
76
        void *context);
 
77
    
 
78
#ifdef __cplusplus
 
79
}
 
80
#endif
 
81
 
 
82
#endif  /* UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_ */