mce-setting.h 4.56 KB
Newer Older
1
/**
2 3
 * @file mce-setting.h
 * Headers for the runtime setting handling code for the Mode Control Entity
4 5
 * <p>
 * Copyright © 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
6
 * Copyright © 2014-2016 Jolla Ltd.
7 8
 * <p>
 * @author David Weinehall <david.weinehall@nokia.com>
9
 * @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * mce is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * mce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with mce.  If not, see <http://www.gnu.org/licenses/>.
 */
23 24
#ifndef MCE_SETTING_H_
# define MCE_SETTING_H_
25

26
# include "builtin-gconf.h"
27

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/* ========================================================================= *
 * Fingerprint Scanner Settings
 * ========================================================================= */

/** Fingerprint wakeup enable modes */
typedef enum
{
    /** Fingerprint wakeups disabled */
    FPWAKEUP_ENABLE_NEVER        = 0,

    /** Fingerprint wakeups always enabled */
    FPWAKEUP_ENABLE_ALWAYS       = 1,

    /** Fingerprint wakeups enabled when PS is not covered */
    FPWAKEUP_ENABLE_NO_PROXIMITY = 2,
} fpwakeup_mode_t;

/** Prefix for fingerprint setting keys */
# define MCE_SETTING_FINGERPRINT_PATH   "/system/osso/dsm/fingerprint"

/** When fingerprint wakeup is allowed */
# define MCE_SETTING_FPWAKEUP_MODE             MCE_SETTING_FINGERPRINT_PATH "/mode"
50
# define MCE_DEFAULT_FPWAKEUP_MODE             0 // = FPWAKEUP_ENABLE_NEVER
51 52 53 54 55 56 57 58 59 60 61 62 63

/** Delay between policy change and activating fingerprint daemon [ms] */
# define MCE_SETTING_FPWAKEUP_ALLOW_DELAY      MCE_SETTING_FINGERPRINT_PATH "/allow_delay"
# define MCE_DEFAULT_FPWAKEUP_ALLOW_DELAY      500

/** Delay between getting identified fingerprint and acting on it [ms] */
# define MCE_SETTING_FPWAKEUP_TRIGGER_DELAY    MCE_SETTING_FINGERPRINT_PATH "/trigger_delay"
# define MCE_DEFAULT_FPWAKEUP_TRIGGER_DELAY    100

/** Delay between ipc attempts with fingerprint daemon [ms] */
# define MCE_SETTING_FPWAKEUP_THROTTLE_DELAY   MCE_SETTING_FINGERPRINT_PATH "/throttle_delay"
# define MCE_DEFAULT_FPWAKEUP_THROTTLE_DELAY   250

64 65 66 67 68 69 70 71 72 73 74
/* ========================================================================= *
 * Button Backlight Settings
 * ========================================================================= */

/** Prefix for fingerprint setting keys */
# define MCE_SETTING_BUTTONBACKLIGHT_PATH   "/system/osso/dsm/buttonbacklight"

/** When fingerprint wakeup is allowed */
# define MCE_SETTING_BUTTONBACKLIGHT_OFF_DELAY MCE_SETTING_BUTTONBACKLIGHT_PATH "/off_delay"
# define MCE_DEFAULT_BUTTONBACKLIGHT_OFF_DELAY 5000 // = 5 seconds

75 76 77 78
/* ========================================================================= *
 * Functions
 * ========================================================================= */

79
gboolean      mce_setting_has_key           (const gchar *const key);
80
gboolean      mce_setting_set_bool          (const gchar *const key, const gboolean value);
81 82 83 84 85 86 87 88 89 90 91 92
gboolean      mce_setting_set_int           (const gchar *const key, const gint value);
gboolean      mce_setting_set_string        (const gchar *const key, const gchar *const value);
gboolean      mce_setting_get_bool          (const gchar *const key, gboolean *value);
gboolean      mce_setting_get_int           (const gchar *const key, gint *value);
gboolean      mce_setting_get_int_list      (const gchar *const key, GSList **values);
gboolean      mce_setting_get_string        (const gchar *const key, gchar **value);
gboolean      mce_setting_notifier_add      (const gchar *path, const gchar *key, const GConfClientNotifyFunc callback, guint *cb_id);
void          mce_setting_notifier_remove   (guint id);
void          mce_setting_notifier_remove_cb(gpointer cb_id, gpointer user_data);
void          mce_setting_track_int         (const gchar *key, gint *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void          mce_setting_track_bool        (const gchar *key, gboolean *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void          mce_setting_track_string      (const gchar *key, gchar **val, const gchar *def, GConfClientNotifyFunc cb, guint *cb_id);
93

94 95
gboolean      mce_setting_init              (void);
void          mce_setting_exit              (void);
96

97
#endif /* MCE_SETTING_H_ */