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