Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / tizen / tizen_locale_listener.h
1 // Copyright (c) 2014 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef XWALK_RUNTIME_BROWSER_TIZEN_TIZEN_LOCALE_LISTENER_H_
6 #define XWALK_RUNTIME_BROWSER_TIZEN_TIZEN_LOCALE_LISTENER_H_
7
8 #include <glib.h>
9 #include <string>
10
11 #include "base/threading/simple_thread.h"
12
13 namespace xwalk {
14
15 class TizenLocaleListener : public base::SimpleThread {
16   public:
17     TizenLocaleListener();
18     virtual ~TizenLocaleListener();
19
20     virtual void Run() OVERRIDE;
21
22     // Get the latest application locale from system.
23     // locale is a langtag defined in [BCP47]
24     std::string GetLocale() const;
25     // Set the locale and apply this locale to all applications.
26     // Locale is a langtag defined in [BCP47].
27     // This function will called by TizenLocaleListener when locale is changed.
28     void SetLocale(const std::string& locale);
29
30   private:
31     GMainLoop*  main_loop_;
32     // The locale is a langtag defined in [BCP47]
33     std::string locale_;
34 };
35
36 }  // namespace xwalk
37
38 #endif  // XWALK_RUNTIME_BROWSER_TIZEN_TIZEN_LOCALE_LISTENER_H_