1a3e0fd82Sopenharmony_ci/*
2a3e0fd82Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3a3e0fd82Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4a3e0fd82Sopenharmony_ci * you may not use this file except in compliance with the License.
5a3e0fd82Sopenharmony_ci * You may obtain a copy of the License at
6a3e0fd82Sopenharmony_ci *
7a3e0fd82Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8a3e0fd82Sopenharmony_ci *
9a3e0fd82Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10a3e0fd82Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11a3e0fd82Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12a3e0fd82Sopenharmony_ci * See the License for the specific language governing permissions and
13a3e0fd82Sopenharmony_ci * limitations under the License.
14a3e0fd82Sopenharmony_ci */
15a3e0fd82Sopenharmony_ci
16a3e0fd82Sopenharmony_ci/**
17a3e0fd82Sopenharmony_ci * @addtogroup UI_Theme
18a3e0fd82Sopenharmony_ci * @{
19a3e0fd82Sopenharmony_ci *
20a3e0fd82Sopenharmony_ci * @brief Defines UI themes.
21a3e0fd82Sopenharmony_ci *
22a3e0fd82Sopenharmony_ci * @since 1.0
23a3e0fd82Sopenharmony_ci * @version 1.0
24a3e0fd82Sopenharmony_ci */
25a3e0fd82Sopenharmony_ci
26a3e0fd82Sopenharmony_ci/**
27a3e0fd82Sopenharmony_ci * @file theme.h
28a3e0fd82Sopenharmony_ci *
29a3e0fd82Sopenharmony_ci * @brief Declares the base class used to define the functions related to the styles of different components.
30a3e0fd82Sopenharmony_ci *
31a3e0fd82Sopenharmony_ci * @since 1.0
32a3e0fd82Sopenharmony_ci * @version 1.0
33a3e0fd82Sopenharmony_ci */
34a3e0fd82Sopenharmony_ci
35a3e0fd82Sopenharmony_ci#ifndef GRAPHIC_LITE_THEME_H
36a3e0fd82Sopenharmony_ci#define GRAPHIC_LITE_THEME_H
37a3e0fd82Sopenharmony_ci
38a3e0fd82Sopenharmony_ci#include "components/ui_view.h"
39a3e0fd82Sopenharmony_ci#include "gfx_utils/style.h"
40a3e0fd82Sopenharmony_ci
41a3e0fd82Sopenharmony_cinamespace OHOS {
42a3e0fd82Sopenharmony_ci/**
43a3e0fd82Sopenharmony_ci * @brief Stores styles of a button in its different states.
44a3e0fd82Sopenharmony_ci */
45a3e0fd82Sopenharmony_cistruct ButtonStyle {
46a3e0fd82Sopenharmony_ci    /** Style when released */
47a3e0fd82Sopenharmony_ci    Style released;
48a3e0fd82Sopenharmony_ci    /** Style when pressed */
49a3e0fd82Sopenharmony_ci    Style pressed;
50a3e0fd82Sopenharmony_ci    /** Style when inactive */
51a3e0fd82Sopenharmony_ci    Style inactive;
52a3e0fd82Sopenharmony_ci};
53a3e0fd82Sopenharmony_ci
54a3e0fd82Sopenharmony_ci/**
55a3e0fd82Sopenharmony_ci * @brief Defines the theme class used to define the functions related to the styles of different components.
56a3e0fd82Sopenharmony_ci *
57a3e0fd82Sopenharmony_ci * @since 1.0
58a3e0fd82Sopenharmony_ci * @version 1.0
59a3e0fd82Sopenharmony_ci */
60a3e0fd82Sopenharmony_ciclass Theme : public HeapBase {
61a3e0fd82Sopenharmony_cipublic:
62a3e0fd82Sopenharmony_ci    /**
63a3e0fd82Sopenharmony_ci     * @brief A constructor used to create a <b>Theme</b> instance.
64a3e0fd82Sopenharmony_ci     *
65a3e0fd82Sopenharmony_ci     * @since 1.0
66a3e0fd82Sopenharmony_ci     * @version 1.0
67a3e0fd82Sopenharmony_ci     */
68a3e0fd82Sopenharmony_ci    Theme();
69a3e0fd82Sopenharmony_ci
70a3e0fd82Sopenharmony_ci    /**
71a3e0fd82Sopenharmony_ci     * @brief A destructor used to delete the <b>Theme</b> instance.
72a3e0fd82Sopenharmony_ci     *
73a3e0fd82Sopenharmony_ci     * @since 1.0
74a3e0fd82Sopenharmony_ci     * @version 1.0
75a3e0fd82Sopenharmony_ci     */
76a3e0fd82Sopenharmony_ci    virtual ~Theme() {}
77a3e0fd82Sopenharmony_ci
78a3e0fd82Sopenharmony_ci    /**
79a3e0fd82Sopenharmony_ci     * @brief Obtains the basic style.
80a3e0fd82Sopenharmony_ci     *
81a3e0fd82Sopenharmony_ci     * @return Returns the basic style.
82a3e0fd82Sopenharmony_ci     * @since 1.0
83a3e0fd82Sopenharmony_ci     * @version 1.0
84a3e0fd82Sopenharmony_ci     */
85a3e0fd82Sopenharmony_ci    Style& GetMainStyle()
86a3e0fd82Sopenharmony_ci    {
87a3e0fd82Sopenharmony_ci        return basicStyle_;
88a3e0fd82Sopenharmony_ci    }
89a3e0fd82Sopenharmony_ci
90a3e0fd82Sopenharmony_ci    /**
91a3e0fd82Sopenharmony_ci     * @brief Obtains the style of this button.
92a3e0fd82Sopenharmony_ci     *
93a3e0fd82Sopenharmony_ci     * @return Returns the button style.
94a3e0fd82Sopenharmony_ci     * @since 1.0
95a3e0fd82Sopenharmony_ci     * @version 1.0
96a3e0fd82Sopenharmony_ci     */
97a3e0fd82Sopenharmony_ci    ButtonStyle& GetButtonStyle()
98a3e0fd82Sopenharmony_ci    {
99a3e0fd82Sopenharmony_ci        return buttonStyle_;
100a3e0fd82Sopenharmony_ci    }
101a3e0fd82Sopenharmony_ci
102a3e0fd82Sopenharmony_ci    /**
103a3e0fd82Sopenharmony_ci     * @brief Obtains the style of this label.
104a3e0fd82Sopenharmony_ci     *
105a3e0fd82Sopenharmony_ci     * @return Returns the label style.
106a3e0fd82Sopenharmony_ci     * @since 1.0
107a3e0fd82Sopenharmony_ci     * @version 1.0
108a3e0fd82Sopenharmony_ci     */
109a3e0fd82Sopenharmony_ci    Style& GetLabelStyle()
110a3e0fd82Sopenharmony_ci    {
111a3e0fd82Sopenharmony_ci        return labelStyle_;
112a3e0fd82Sopenharmony_ci    }
113a3e0fd82Sopenharmony_ci
114a3e0fd82Sopenharmony_ci    /**
115a3e0fd82Sopenharmony_ci     * @brief Obtains the style of this edit text.
116a3e0fd82Sopenharmony_ci     *
117a3e0fd82Sopenharmony_ci     * @return Returns the edit text style.
118a3e0fd82Sopenharmony_ci     */
119a3e0fd82Sopenharmony_ci    Style& GetEditTextStyle()
120a3e0fd82Sopenharmony_ci    {
121a3e0fd82Sopenharmony_ci        return editTextStyle_;
122a3e0fd82Sopenharmony_ci    }
123a3e0fd82Sopenharmony_ci
124a3e0fd82Sopenharmony_ci    /**
125a3e0fd82Sopenharmony_ci     * @brief Obtains the background style of this picker.
126a3e0fd82Sopenharmony_ci     *
127a3e0fd82Sopenharmony_ci     * @return Returns the background style of this picker.
128a3e0fd82Sopenharmony_ci     * @since 1.0
129a3e0fd82Sopenharmony_ci     * @version 1.0
130a3e0fd82Sopenharmony_ci     */
131a3e0fd82Sopenharmony_ci    Style& GetPickerBackgroundStyle()
132a3e0fd82Sopenharmony_ci    {
133a3e0fd82Sopenharmony_ci        return pickerBackgroundStyle_;
134a3e0fd82Sopenharmony_ci    }
135a3e0fd82Sopenharmony_ci
136a3e0fd82Sopenharmony_ci    /**
137a3e0fd82Sopenharmony_ci     * @brief Obtains the highlight style of this picker.
138a3e0fd82Sopenharmony_ci     *
139a3e0fd82Sopenharmony_ci     * @return Returns the highlight style of this picker.
140a3e0fd82Sopenharmony_ci     * @since 1.0
141a3e0fd82Sopenharmony_ci     * @version 1.0
142a3e0fd82Sopenharmony_ci     */
143a3e0fd82Sopenharmony_ci    Style& GetPickerHighlightStyle()
144a3e0fd82Sopenharmony_ci    {
145a3e0fd82Sopenharmony_ci        return pickerHighlightStyle_;
146a3e0fd82Sopenharmony_ci    }
147a3e0fd82Sopenharmony_ci
148a3e0fd82Sopenharmony_ci    /**
149a3e0fd82Sopenharmony_ci     * @brief Obtains the background style of this progress bar.
150a3e0fd82Sopenharmony_ci     *
151a3e0fd82Sopenharmony_ci     * @return Returns the background style of this progress bar.
152a3e0fd82Sopenharmony_ci     * @since 1.0
153a3e0fd82Sopenharmony_ci     * @version 1.0
154a3e0fd82Sopenharmony_ci     */
155a3e0fd82Sopenharmony_ci    Style& GetProgressBackgroundStyle()
156a3e0fd82Sopenharmony_ci    {
157a3e0fd82Sopenharmony_ci        return progressBackgroundStyle_;
158a3e0fd82Sopenharmony_ci    }
159a3e0fd82Sopenharmony_ci
160a3e0fd82Sopenharmony_ci    /**
161a3e0fd82Sopenharmony_ci     * @brief Obtains the foreground style of this progress bar.
162a3e0fd82Sopenharmony_ci     *
163a3e0fd82Sopenharmony_ci     * @return Returns the foreground style of this progress bar.
164a3e0fd82Sopenharmony_ci     * @since 1.0
165a3e0fd82Sopenharmony_ci     * @version 1.0
166a3e0fd82Sopenharmony_ci     */
167a3e0fd82Sopenharmony_ci    Style& GetProgressForegroundStyle()
168a3e0fd82Sopenharmony_ci    {
169a3e0fd82Sopenharmony_ci        return progressForegroundStyle_;
170a3e0fd82Sopenharmony_ci    }
171a3e0fd82Sopenharmony_ci
172a3e0fd82Sopenharmony_ci    /**
173a3e0fd82Sopenharmony_ci     * @brief Obtains the style of this slider knob.
174a3e0fd82Sopenharmony_ci     *
175a3e0fd82Sopenharmony_ci     * @return Returns the style of this slider knob.
176a3e0fd82Sopenharmony_ci     * @since 1.0
177a3e0fd82Sopenharmony_ci     * @version 1.0
178a3e0fd82Sopenharmony_ci     */
179a3e0fd82Sopenharmony_ci    Style& GetSliderKnobStyle()
180a3e0fd82Sopenharmony_ci    {
181a3e0fd82Sopenharmony_ci        return sliderKnobStyle_;
182a3e0fd82Sopenharmony_ci    }
183a3e0fd82Sopenharmony_ci
184a3e0fd82Sopenharmony_ciprotected:
185a3e0fd82Sopenharmony_ci    Style basicStyle_;
186a3e0fd82Sopenharmony_ci    ButtonStyle buttonStyle_;
187a3e0fd82Sopenharmony_ci    Style labelStyle_;
188a3e0fd82Sopenharmony_ci    Style editTextStyle_;
189a3e0fd82Sopenharmony_ci    Style pickerBackgroundStyle_;
190a3e0fd82Sopenharmony_ci    Style pickerHighlightStyle_;
191a3e0fd82Sopenharmony_ci    Style progressBackgroundStyle_;
192a3e0fd82Sopenharmony_ci    Style progressForegroundStyle_;
193a3e0fd82Sopenharmony_ci    Style sliderKnobStyle_;
194a3e0fd82Sopenharmony_ci
195a3e0fd82Sopenharmony_ci    virtual void InitBasicStyle();
196a3e0fd82Sopenharmony_ci    virtual void InitButtonStyle();
197a3e0fd82Sopenharmony_ci    virtual void InitLabelStyle();
198a3e0fd82Sopenharmony_ci    virtual void InitEditTextStyle();
199a3e0fd82Sopenharmony_ci    virtual void InitPickerStyle();
200a3e0fd82Sopenharmony_ci    virtual void InitProgressStyle();
201a3e0fd82Sopenharmony_ci    virtual void InitSliderStyle();
202a3e0fd82Sopenharmony_ci};
203a3e0fd82Sopenharmony_ci} // namespace OHOS
204a3e0fd82Sopenharmony_ci#endif // GRAPHIC_LITE_THEME_H
205