summaryrefslogtreecommitdiffstats
path: root/chromeos/ime/input_method_config.h
blob: 7012dd0661562302c6b6f5ce3a109fd14cdf8ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_IME_INPUT_METHOD_CONFIG_H_
#define CHROMEOS_IME_INPUT_METHOD_CONFIG_H_

#include <string>
#include <vector>
#include "chromeos/chromeos_export.h"

namespace chromeos {
namespace input_method {

// A structure which represents a value of an input method configuration item.
// This struct is used by SetInputMethodConfig().
struct CHROMEOS_EXPORT InputMethodConfigValue {
  InputMethodConfigValue();
  ~InputMethodConfigValue();

  // Debug print function.
  std::string ToString() const;

  enum ValueType {
    kValueTypeString = 0,
    kValueTypeInt,
    kValueTypeBool,
    kValueTypeStringList,
  };

  // A value is stored on |string_value| member if |type| is kValueTypeString.
  // The same is true for other enum values.
  ValueType type;

  std::string string_value;
  int int_value;
  bool bool_value;
  std::vector<std::string> string_list_value;
};

}  // namespace input_method
}  // namespace chromeos

#endif  // CHROMEOS_IME_INPUT_METHOD_CONFIG_H_