• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 class Launcher : public SliteAbility
28 {
29 public:
GetInstance()30     static Launcher *GetInstance()
31     {
32         static Launcher instance;
33         return &instance;
34     }
35 
36     void OnStart(const Want &want) override;
37     void OnInactive();
38     void OnActive(const Want &want) override;
39     void OnBackground() override;
40     void OnStop() override;
41 
42 private:
Launcher()43     Launcher() {}
44     ~Launcher();
45     void InitUI();
46     void DeleteUI();
47 
48     RootView *rootView_ = nullptr;
49     UIImageView *gifImageView_ = nullptr;
50 };
51 } // namespace OHOS
52 
53 extern "C" void InstallLauncher();
54 
55 #endif
56