46026317a94ebade80457536ba89039b5e33cd9d
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / manifest_handlers / tizen_setting_handler.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 #ifndef XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_TIZEN_SETTING_HANDLER_H_
5 #define XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_TIZEN_SETTING_HANDLER_H_
6
7 #include <map>
8 #include <string>
9 #include <vector>
10
11 #include "base/values.h"
12 #include "xwalk/application/common/application_data.h"
13 #include "xwalk/application/common/manifest_handler.h"
14
15 namespace xwalk {
16 namespace application {
17
18 class TizenSettingInfo : public ApplicationData::ManifestData {
19  public:
20   TizenSettingInfo();
21   virtual ~TizenSettingInfo();
22
23   enum ScreenOrientation {
24     PORTRAIT,
25     LANDSCAPE,
26     AUTO
27   };
28
29   void set_hwkey_enabled(bool enabled) { hwkey_enabled_ = enabled; }
30   bool hwkey_enabled() const { return hwkey_enabled_; }
31
32   void set_screen_orientation(ScreenOrientation orientation) {
33     screen_orientation_ = orientation;
34   }
35
36   ScreenOrientation screen_orientation() const { return screen_orientation_; }
37
38  private:
39   bool hwkey_enabled_;
40   ScreenOrientation screen_orientation_;
41 };
42
43 class TizenSettingHandler : public ManifestHandler {
44  public:
45   TizenSettingHandler();
46   virtual ~TizenSettingHandler();
47
48   virtual bool Parse(scoped_refptr<ApplicationData> application,
49                      base::string16* error) OVERRIDE;
50   virtual bool Validate(scoped_refptr<const ApplicationData> application,
51                         std::string* error) const OVERRIDE;
52   virtual std::vector<std::string> Keys() const OVERRIDE;
53
54  private:
55   DISALLOW_COPY_AND_ASSIGN(TizenSettingHandler);
56 };
57
58 }  // namespace application
59 }  // namespace xwalk
60
61 #endif  // XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_TIZEN_SETTING_HANDLER_H_