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_MAIN_ABILITY_SLICE_H 17 #define OHOS_MAIN_ABILITY_SLICE_H 18 19 #include <ability_info.h> 20 #include <ability_loader.h> 21 #include <bundle_info.h> 22 #include <components/root_view.h> 23 #include <components/ui_image_view.h> 24 #include <components/ui_label.h> 25 #include <components/ui_label_button.h> 26 #include <components/ui_swipe_view.h> 27 28 #include "event_listener.h" 29 #include "gfx_utils/list.h" 30 #include "swipe_view.h" 31 #include "ui_config.h" 32 33 namespace OHOS { 34 class MainAbilitySlice : public AbilitySlice { 35 public: 36 MainAbilitySlice() = default; 37 ~MainAbilitySlice() override; 38 39 protected: 40 void OnStart(const Want& want) override; 41 void OnInactive() override; 42 void OnActive(const Want& want) override; 43 void OnBackground() override; 44 void OnStop() override; 45 void SetHead(); 46 void SetTail(); 47 void SetSwipe(); 48 void ReleaseView(); 49 void SetImageView(); 50 51 private: 52 SwipeView* swipeView_ { nullptr }; 53 UIImageView* uiImageView_ { nullptr }; 54 UILabel* lableHead_ { nullptr }; 55 UILabel* lableTail_ { nullptr }; 56 RootView *rootview_ { nullptr }; 57 }; 58 } // namespace OHOS 59 #endif 60