Fix emulator build error
[platform/framework/web/chromium-efl.git] / components / login / localized_values_builder.h
1 // Copyright 2015 The Chromium Authors
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 COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
6 #define COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
7
8 #include <string>
9
10 #include "base/memory/raw_ptr.h"
11 #include "base/values.h"
12 #include "components/login/login_export.h"
13
14 namespace login {
15
16 // Class that collects Localized Values for translation.
17 class LOGIN_EXPORT LocalizedValuesBuilder {
18  public:
19   explicit LocalizedValuesBuilder(base::Value::Dict* dict);
20
21   // Method to declare localized value. |key| is the i18n key used in html.
22   // |message| is text of the message.
23   void Add(const std::string& key, const std::string& message);
24
25   // Method to declare localized value. |key| is the i18n key used in html.
26   // |message| is text of the message.
27   void Add(const std::string& key, const std::u16string& message);
28
29   // Method to declare localized value. |key| is the i18n key used in html.
30   // |message_id| is a resource id of message.
31   void Add(const std::string& key, int message_id);
32
33   // Method to declare localized value. |key| is the i18n key used in html.
34   // |message_id| is a resource id of message. Message is expected to have
35   // one format parameter subsituted by |a|.
36   void AddF(const std::string& key, int message_id, const std::u16string& a);
37
38   // Method to declare localized value. |key| is the i18n key used in html.
39   // |message_id| is a resource id of message. Message is expected to have
40   // two format parameters subsituted by |a| and |b| respectively.
41   void AddF(const std::string& key,
42             int message_id,
43             const std::u16string& a,
44             const std::u16string& b);
45
46   // Method to declare localized value. |key| is the i18n key used in html.
47   // |message_id| is a resource id of message. Message is expected to have
48   // two format parameters subsituted by |a|, |b| and |c| respectively.
49   void AddF(const std::string& key,
50             int message_id,
51             const std::u16string& a,
52             const std::u16string& b,
53             const std::u16string& c);
54
55   // Method to declare localized value. |key| is the i18n key used in html.
56   // |message_id| is a resource id of message. Message is expected to have
57   // one format parameter subsituted by resource identified by |message_id_a|.
58   void AddF(const std::string& key, int message_id, int message_id_a);
59
60   // Method to declare localized value. |key| is the i18n key used in html.
61   // |message_id| is a resource id of message. Message is expected to have
62   // two format parameters subsituted by resource identified by |message_id_a|
63   // and |message_id_b| respectively.
64   void AddF(const std::string& key,
65             int message_id,
66             int message_id_a,
67             int message_id_b);
68
69   // Method to declare localized value. |key| is the i18n key used in html.
70   // |message_id| is a resource id of message. Message is expected to have
71   // three format parameters subsituted by resource identified by
72   // |message_id_a|, |message_id_b| and |message_id_c| respectively.
73   void AddF(const std::string& key,
74             int message_id,
75             int message_id_a,
76             int message_id_b,
77             int message_id_c);
78
79  private:
80   std::string prefix_;
81
82   // Not owned.
83   raw_ptr<base::Value::Dict, ExperimentalAsh> dict_;
84 };
85
86 }  // namespace login
87
88 #endif  // COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_