libkeepalive
Loading...
Searching...
No Matches
keepalive-backgroundactivity.h
Go to the documentation of this file.
1/****************************************************************************************
2**
3** Copyright (c) 2014 - 2020 Jolla Ltd.
4 * Copyright (c) 2020 Open Mobile Platform LLC.
5**
6** Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
7**
8** All rights reserved.
9**
10** This file is part of nemo-keepalive package.
11**
12** You may use this file under the terms of the GNU Lesser General
13** Public License version 2.1 as published by the Free Software Foundation
14** and appearing in the file license.lgpl included in the packaging
15** of this file.
16**
17** This library is free software; you can redistribute it and/or
18** modify it under the terms of the GNU Lesser General Public
19** License version 2.1 as published by the Free Software Foundation
20** and appearing in the file license.lgpl included in the packaging
21** of this file.
22**
23** This library is distributed in the hope that it will be useful,
24** but WITHOUT ANY WARRANTY; without even the implied warranty of
25** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26** Lesser General Public License for more details.
27**
28****************************************************************************************/
29
34
35#ifndef KEEPALIVE_GLIB_BACKGROUNDACTIVITY_H_
36# define KEEPALIVE_GLIB_BACKGROUNDACTIVITY_H_
37
38# include <stdbool.h>
39
40# ifdef __cplusplus
41extern "C" {
42# elif 0
43} /* fool JED indentation ... */
44# endif
45
46# pragma GCC visibility push(default)
47
54
60typedef void (*background_activity_event_fn)(background_activity_t *activity, void *user_data);
61
71typedef void (*background_activity_free_fn)(void *);
72
114
127
137
147
179
188
214void background_activity_set_wakeup_range(background_activity_t *self, int range_lo, int range_hi);
215
226 int *range_lo, int *range_hi);
227
238
249
260
269
282
290
302
314
316 void *user_data,
318
326
332
348
363
374
385# pragma GCC visibility pop
386
387# ifdef __cplusplus
388};
389# endif
390
391#endif // KEEPALIVE_GLIB_BACKGROUNDACTIVITY_H_
void background_activity_get_wakeup_range(background_activity_t *self, int *range_lo, int *range_hi)
void(* background_activity_event_fn)(background_activity_t *activity, void *user_data)
Definition keepalive-backgroundactivity.h:60
void background_activity_free_user_data(background_activity_t *self)
background_activity_t * background_activity_ref(background_activity_t *self)
const char * background_activity_get_id(const background_activity_t *self)
void background_activity_set_wakeup_slot(background_activity_t *self, background_activity_frequency_t slot)
void background_activity_wait(background_activity_t *self)
bool background_activity_is_running(background_activity_t *self)
void(* background_activity_free_fn)(void *)
Definition keepalive-backgroundactivity.h:71
background_activity_frequency_t background_activity_get_wakeup_slot(background_activity_t *self)
background_activity_frequency_t
Definition keepalive-backgroundactivity.h:80
@ BACKGROUND_ACTIVITY_FREQUENCY_EIGHT_HOURS
Definition keepalive-backgroundactivity.h:103
@ BACKGROUND_ACTIVITY_FREQUENCY_TEN_MINUTES
Definition keepalive-backgroundactivity.h:91
@ BACKGROUND_ACTIVITY_FREQUENCY_TWENTY_FOUR_HOURS
Definition keepalive-backgroundactivity.h:109
@ BACKGROUND_ACTIVITY_FREQUENCY_RANGE
Definition keepalive-backgroundactivity.h:83
@ BACKGROUND_ACTIVITY_FREQUENCY_FIVE_MINUTES
Definition keepalive-backgroundactivity.h:89
@ BACKGROUND_ACTIVITY_FREQUENCY_TEN_HOURS
Definition keepalive-backgroundactivity.h:105
@ BACKGROUND_ACTIVITY_FREQUENCY_THIRTY_MINUTES
Definition keepalive-backgroundactivity.h:95
@ BACKGROUND_ACTIVITY_FREQUENCY_ONE_HOUR
Definition keepalive-backgroundactivity.h:97
@ BACKGROUND_ACTIVITY_FREQUENCY_TWELVE_HOURS
Definition keepalive-backgroundactivity.h:107
@ BACKGROUND_ACTIVITY_FREQUENCY_FOUR_HOURS
Definition keepalive-backgroundactivity.h:101
@ BACKGROUND_ACTIVITY_FREQUENCY_TWO_HOURS
Definition keepalive-backgroundactivity.h:99
@ BACKGROUND_ACTIVITY_FREQUENCY_TWO_AND_HALF_MINUTES
Definition keepalive-backgroundactivity.h:87
@ BACKGROUND_ACTIVITY_FREQUENCY_MAXIMUM_FREQUENCY
Definition keepalive-backgroundactivity.h:111
@ BACKGROUND_ACTIVITY_FREQUENCY_FIFTEEN_MINUTES
Definition keepalive-backgroundactivity.h:93
@ BACKGROUND_ACTIVITY_FREQUENCY_THIRTY_SECONDS
Definition keepalive-backgroundactivity.h:85
bool background_activity_is_waiting(background_activity_t *self)
void * background_activity_steal_user_data(background_activity_t *self)
void background_activity_set_user_data(background_activity_t *self, void *user_data, background_activity_free_fn free_cb)
void background_activity_run(background_activity_t *self)
bool background_activity_is_stopped(background_activity_t *self)
void * background_activity_get_user_data(background_activity_t *self)
void background_activity_unref(background_activity_t *self)
void background_activity_stop(background_activity_t *self)
background_activity_t * background_activity_new(void)
void background_activity_set_waiting_callback(background_activity_t *self, background_activity_event_fn cb)
void background_activity_set_wakeup_range(background_activity_t *self, int range_lo, int range_hi)
void background_activity_set_stopped_callback(background_activity_t *self, background_activity_event_fn cb)
void background_activity_set_running_callback(background_activity_t *self, background_activity_event_fn cb)
struct background_activity_t background_activity_t
Definition keepalive-backgroundactivity.h:53