• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_ACELITE_HORIZON_PROGRESS_COMPONENT_H
17 #define OHOS_ACELITE_HORIZON_PROGRESS_COMPONENT_H
18 
19 #include "component.h"
20 #include "non_copyable.h"
21 #include "ui_abstract_progress.h"
22 
23 namespace OHOS {
24 namespace ACELite {
25 class HorizonProgressComponent final : public Component {
26 public:
27     ACE_DISALLOW_COPY_AND_MOVE(HorizonProgressComponent);
28     HorizonProgressComponent() = delete;
29     HorizonProgressComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager);
~HorizonProgressComponent()30     ~HorizonProgressComponent() override {}
31 
32 protected:
33     UIView *GetComponentRootView() const override;
34     bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override;
35     bool ApplyPrivateStyle(const AppStyleItem* style) override;
36     void PostUpdate(uint16_t attrKeyId) override;
37     void OnViewAttached() override;
38     void HandleExtraUpdate();
39     bool CreateNativeViews() override;
40 
41 private:
42     bool SetHorizonProgressStyle(const AppStyleItem* style);
43     UIBoxProgress progressView_;
44     int16_t hStrokeWidth_;
45 };
46 } // namespace ACELite
47 } // namespace OHOS
48 
49 #endif // OHOS_ACELITE_HORIZON_PROGRESS_COMPONENT_H
50