1 /* 2 * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved. 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 #ifndef LAUNCHER_H 16 #define LAUNCHER_H 17 18 #include "ability_info.h" 19 #include "ability_state.h" 20 #include "slite_ability.h" 21 #include "want.h" 22 #include "common/screen.h" 23 #include "components/root_view.h" 24 #include "components/ui_image_view.h" 25 26 namespace OHOS 27 { 28 class Launcher : public SliteAbility 29 { 30 public: GetInstance()31 static Launcher *GetInstance() 32 { 33 static Launcher instance; 34 return &instance; 35 } 36 37 void OnStart(const Want &want) override; 38 void OnInactive(); 39 void OnActive(const Want &want) override; 40 void OnBackground() override; 41 void OnStop() override; 42 43 private: Launcher()44 Launcher() {} 45 ~Launcher(); 46 void InitUI(); 47 void DeleteUI(); 48 49 RootView *rootView_ = nullptr; 50 UIImageView *gifImageView_ = nullptr; 51 }; 52 } // namespace OHOS 53 54 extern "C" void InstallLauncher(); 55 56 #endif 57