ui_test_button.h 3.8 KB
Newer Older
M
mamingshuai 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef UI_TEST_BUTTON_H
#define UI_TEST_BUTTON_H

Z
zhdengc 已提交
19 20
#include "components/ui_button.h"
#include "components/ui_checkbox.h"
M
mamingshuai 已提交
21 22 23 24 25 26 27 28 29 30
#include "components/ui_scroll_view.h"
#include "ui_test.h"

namespace OHOS {
class UITestBUTTON : public UITest {
public:
    UITestBUTTON() {}
    ~UITestBUTTON() {}
    void SetUp() override;
    void TearDown() override;
G
guyuanzhang 已提交
31
    const UIView* GetTestView() override;
M
mamingshuai 已提交
32 33 34 35

    /**
     * @brief Test Checkbox Function
     */
W
wangtiantian 已提交
36
    void UIKit_Check_Box_Test_001();
M
mamingshuai 已提交
37 38 39 40 41 42 43 44 45

    /**
     * @brief Test Checkbox's SetImage Function
     */
    void UIKit_Check_Box_Test_002() const;

    /**
     * @brief Test Radiobutton Function
     */
W
wangtiantian 已提交
46
    void UIKit_Radio_Button_Test_001();
M
mamingshuai 已提交
47 48 49 50 51 52 53 54 55

    /**
     * @brief Test Radiobutton's SetImage Function
     */
    void UIKit_Radio_Button_Test_002() const;

    /**
     * @brief Test Togglebutton Function
     */
Z
zhdengc 已提交
56
    void UIKit_Toggle_Button_Test_001();
M
mamingshuai 已提交
57 58 59 60

    /**
     * @brief Test Togglebutton's SetImage Function
     */
Z
zhdengc 已提交
61
    void UIKit_Toggle_Button_Test_002();
M
mamingshuai 已提交
62 63 64 65

    /**
     * @brief Test button Function
     */
Z
zhdengc 已提交
66
    void UIKit_Button_Test_001();
M
mamingshuai 已提交
67 68

private:
Z
zhdengc 已提交
69
    void UIKit_Button_Test_002(UIScrollView* container, UIButton* button);
W
wangtiantian 已提交
70 71 72 73
    UIViewGroup* CreateButtonGroup(int16_t posX, int16_t posY, int16_t width, int16_t height,
                                    UICheckBox::OnChangeListener** listener,
                                    UIViewType type = UI_CHECK_BOX,
                                    const char* name = "aa");
M
mamingshuai 已提交
74 75
    static constexpr int16_t CHANGE_SIZE = 10;
    UIScrollView* container_ = nullptr;
Z
zhdengc 已提交
76

W
wangtiantian 已提交
77 78 79 80 81 82
    UICheckBox::OnChangeListener* checkBoxChangeListener_ = nullptr;
    UICheckBox::OnChangeListener* checkBoxChangeListener1_ = nullptr;
    UICheckBox::OnChangeListener* checkBoxChangeListener2_ = nullptr;
    UICheckBox::OnChangeListener* radioChangeListener_ = nullptr;
    UICheckBox::OnChangeListener* radioChangeListener1_ = nullptr;
    UICheckBox::OnChangeListener* radioChangeListener2_ = nullptr;
Z
zhdengc 已提交
83 84
    UICheckBox::OnChangeListener* toggleChangeListener_ = nullptr;
    UICheckBox::OnChangeListener* toggleChangeListener1_ = nullptr;
W
wangtiantian 已提交
85
    UICheckBox::OnChangeListener* toggleChangeListener2_ = nullptr;
Z
zhdengc 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

    UIView::OnClickListener* clickEnableVisiableListener_ = nullptr;
    UIView::OnClickListener* clickDisableVisiableListener_ = nullptr;
    UIView::OnClickListener* clickEnableTouchableListener_ = nullptr;
    UIView::OnClickListener* clickDisableTouchableListener_ = nullptr;
    UIView::OnClickListener* clickColorToWhiteListener_ = nullptr;
    UIView::OnClickListener* clickColorToRedListener_ = nullptr;
    UIView::OnClickListener* clickRevetColorListener_ = nullptr;
    UIView::OnClickListener* clickRevetToOriginListener_ = nullptr;
    UIView::OnClickListener* clickBigListener_ = nullptr;
    UIView::OnClickListener* clickLeftListener_ = nullptr;
    UIView::OnClickListener* clickRightListener_ = nullptr;
    UIView::OnClickListener* clickUpListener_ = nullptr;
    UIView::OnClickListener* clickDownListener_ = nullptr;
    UIView::OnClickListener* clickSmallListener_ = nullptr;
Y
YueBiang 已提交
101 102
    UIView::OnClickListener* enableAnimationListener_ = nullptr;
    UIView::OnClickListener* disableAnimationListener_ = nullptr;
M
mamingshuai 已提交
103 104 105
};
} // namespace OHOS
#endif // UI_TEST_BUTTON_H