• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_TIME_WEATHER_H
17 #define OHOS_TIME_WEATHER_H
18 
19 #include <components/ui_label.h>
20 #include <components/ui_label_button.h>
21 #include <components/ui_view_group.h>
22 #include <components/ui_image_view.h>
23 
24 #include "app_info.h"
25 #include "native_base.h"
26 #include "ui_config.h"
27 
28 namespace OHOS {
29 enum DATE_LAUNCHER {
30     SUNDAY_LAUNCHER = 0,
31     MONDAY_LAUNCHER,
32     TUESDAY_LAUNCHER,
33     WEDNESDAY_LAUNCHER,
34     THURSDAY_LAUNCHER,
35     FRIDAY_LAUNCHER,
36     STAURDAY_LAUNCHER,
37     WEEKEND_LAUNCHER
38 };
39 
40 class TimeWeatherView : public NativeBase {
41 public:
42     TimeWeatherView() = delete;
43     explicit TimeWeatherView(UIViewGroup* viewGroup);
44     virtual ~TimeWeatherView();
45     void SetStyle(Style sty);
46     void SetPosion(int16_t x, int16_t y, int16_t height, int16_t width);
47     void SetUpView();
48     void SetUpTimeView();
49 
50 protected:
51     void SetUpWeatherView();
52     void GetWeekdayByYearday(int iY, int iM, int iD, char* date, int size);
53 
54 private:
55     UIViewGroup* viewTime_ { nullptr };
56     UIViewGroup* viewweather_ { nullptr };
57     UIViewGroup* viewGroup_ { nullptr };
58 };
59 } // namespace OHOS
60 #endif