1 /* 2 * Copyright (C) 2023 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 #ifndef INTERFACES_KITS_JS_MEDIALIBRARY_INCLUDE_MODAL_UI_CALLBACK_H 16 #define INTERFACES_KITS_JS_MEDIALIBRARY_INCLUDE_MODAL_UI_CALLBACK_H 17 18 #include "ability_context.h" 19 #include "want.h" 20 #include "want_params.h" 21 #include <string> 22 #include "media_library_napi.h" 23 24 namespace OHOS { 25 namespace Media { 26 27 28 class ModalUICallback { 29 public: 30 explicit ModalUICallback(Ace::UIContent* uiContent, PickerCallBack* pickerCallBack); 31 void OnRelease(int32_t releaseCode); 32 void OnResultForModal(int32_t resultCode, const OHOS::AAFwk::Want& result); 33 void OnReceive(const OHOS::AAFwk::WantParams& request); 34 void OnError(int32_t code, const std::string& name, const std::string& message); 35 void OnDestroy(); 36 void SetSessionId(int32_t sessionId); 37 38 private: 39 int32_t sessionId_ = 0; 40 Ace::UIContent* uiContent; 41 PickerCallBack* pickerCallBack_; 42 }; 43 } // namespace Media 44 } // namespace OHOS 45 46 #endif