1 /* 2 * Copyright (c) 2024 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_ABILITY_RUNTIME_MODAL_SYSTEM_DIALOG_UI_EXTENSION_H 17 #define OHOS_ABILITY_RUNTIME_MODAL_SYSTEM_DIALOG_UI_EXTENSION_H 18 19 #include "ability_connect_callback_stub.h" 20 #include "iremote_broker.h" 21 #include "iremote_object.h" 22 #include "iremote_proxy.h" 23 24 namespace OHOS { 25 namespace AbilityRuntime { 26 class ModalSystemDialogUIExtension { 27 public: 28 ModalSystemDialogUIExtension() = default; 29 virtual ~ModalSystemDialogUIExtension() = default; 30 bool CreateModalUIExtension(const std::string &commandStr); 31 32 private: 33 class DialogConnection : public OHOS::AAFwk::AbilityConnectionStub { 34 public: DialogConnection(const std::string & commandStr)35 DialogConnection(const std::string &commandStr) : commandStr_(commandStr) {} 36 virtual ~DialogConnection() = default; 37 38 void OnAbilityConnectDone( 39 const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, int resultCode) override; 40 void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override; 41 42 private: 43 std::string commandStr_; 44 }; 45 }; 46 } // namespace AbilityRuntime 47 } // namespace OHOS 48 #endif // OHOS_ABILITY_RUNTIME_MODAL_SYSTEM_DIALOG_UI_EXTENSION_H