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_PICTURE_ABILITY_SLICE_H 17 #define OHOS_PICTURE_ABILITY_SLICE_H 18 19 #include <ability_loader.h> 20 #include "components/ui_image_view.h" 21 #include "components/ui_view_group.h" 22 #include "event_listener.h" 23 #include "gallery_config.h" 24 25 namespace OHOS { 26 class PictureAbilitySlice : public AbilitySlice { 27 public: 28 ~PictureAbilitySlice() override; 29 30 protected: 31 void OnStart(const Want &want) override; 32 void OnInactive() override; 33 void OnActive(const Want &want) override; 34 void OnBackground() override; 35 void OnStop() override; 36 37 private: 38 void Clear(); 39 void InitTitle(); 40 void InitPicture(const char* path); 41 42 RootView* rootView_ { nullptr }; 43 UIViewGroup* backArea_ { nullptr }; 44 UIImageView* backIcon_ { nullptr }; 45 EventListener* backIconListener_ { nullptr }; 46 UIImageView* picture_ { nullptr }; 47 char backIconAbsolutePath[MAX_PATH_LENGTH] = { 0 }; 48 }; 49 } 50 51 #endif // OHOS_PICTURE_ABILITY_SLICE_H