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 ACCESSIBILITY_EXTENSION_H 17 #define ACCESSIBILITY_EXTENSION_H 18 19 #include "accessibility_extension_context.h" 20 #include "extension_base.h" 21 #include "runtime.h" 22 23 namespace OHOS { 24 namespace Accessibility { 25 class AccessibilityExtension : public AbilityRuntime::ExtensionBase<AccessibilityExtensionContext> { 26 public: 27 AccessibilityExtension() = default; 28 virtual ~AccessibilityExtension() = default; 29 30 /** 31 * @brief Init the extension. 32 * 33 * @param record the extension record. 34 * @param application the application info. 35 * @param handler the extension handler. 36 * @param token the remote token. 37 */ 38 virtual void Init(const std::shared_ptr<AbilityRuntime::AbilityLocalRecord> &record, 39 const std::shared_ptr<AbilityRuntime::OHOSApplication> &application, 40 std::shared_ptr<AbilityRuntime::AbilityHandler> &handler, 41 const sptr<IRemoteObject> &token) override; 42 43 /** 44 * @brief Create and init context. 45 * 46 * @param record the extension record. 47 * @param application the application info. 48 * @param handler the extension handler. 49 * @param token the remote token. 50 * @return The created context. 51 */ 52 virtual std::shared_ptr<AccessibilityExtensionContext> CreateAndInitContext( 53 const std::shared_ptr<AbilityRuntime::AbilityLocalRecord> &record, 54 const std::shared_ptr<AbilityRuntime::OHOSApplication> &application, 55 std::shared_ptr<AbilityRuntime::AbilityHandler> &handler, 56 const sptr<IRemoteObject> &token) override; 57 }; 58 } // namespace Accessibility 59 } // namespace OHOS 60 #endif // ACCESSIBILITY_EXTENSION_H