~charlesk/indicator-datetime/lp-1001595

« back to all changes in this revision

Viewing changes to include/datetime/utils.h

  • Committer: CI bot
  • Author(s): Charles Kerr
  • Date: 2014-01-31 11:46:08 UTC
  • mfrom: (290.2.86 cpp)
  • Revision ID: ps-jenkins@lists.canonical.com-20140131114608-8sfzhimcfdywmk46
Finally land this. Other, still open bugs will be fixed in subsequent commits. Fixes: 793450, 1271484, 1274046

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010, 2014 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 *   Michael Terry <michael.terry@canonical.com>
 
18
 *   Charles Kerr <charles.kerr@canonical.com>
 
19
 */
 
20
 
 
21
#ifndef INDICATOR_DATETIME_UTILS_H
 
22
#define INDICATOR_DATETIME_UTILS_H
 
23
 
 
24
#include <glib.h>
 
25
#include <gio/gio.h> /* GSettings */
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
/** \brief Returns true if the current locale prefers 12h display instead of 24h */
 
30
gboolean      is_locale_12h                        (void);
 
31
 
 
32
void          split_settings_location              (const char  * location,
 
33
                                                    char       ** zone,
 
34
                                                    char       ** name);
 
35
 
 
36
gchar *       get_timezone_name                    (const char  * timezone,
 
37
                                                    GSettings   * settings);
 
38
 
 
39
gchar *       get_beautified_timezone_name         (const char  * timezone,
 
40
                                                    const char  * saved_location);
 
41
 
 
42
gchar *       generate_full_format_string_at_time  (GDateTime   * now,
 
43
                                                    GDateTime   * then_begin,
 
44
                                                    GDateTime   * then_end);
 
45
 
 
46
/** \brief Translate the string based on LC_TIME instead of LC_MESSAGES.
 
47
           The intent of this is to let users set LC_TIME to override
 
48
           their other locale settings when generating time format string */
 
49
const char*   T_                                   (const char  * msg);
 
50
 
 
51
  
 
52
G_END_DECLS
 
53
 
 
54
#endif /* INDICATOR_DATETIME_UTILS_H */