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 16 #ifndef OHOS_ROSEN_WINDOW_EXTENSION_SESSION_IMPL_H 17 #define OHOS_ROSEN_WINDOW_EXTENSION_SESSION_IMPL_H 18 19 #include "window_session_impl.h" 20 21 namespace OHOS { 22 namespace Rosen { 23 class WindowExtensionSessionImpl : public WindowSessionImpl { 24 public: 25 explicit WindowExtensionSessionImpl(const sptr<WindowOption>& option); 26 ~WindowExtensionSessionImpl(); 27 28 WMError Create(const std::shared_ptr<AbilityRuntime::Context>& context, 29 const sptr<Rosen::ISession>& iSession) override; 30 WMError MoveTo(int32_t x, int32_t y) override; 31 WMError Resize(uint32_t width, uint32_t height) override; 32 WMError TransferAbilityResult(uint32_t resultCode, const AAFwk::Want& want) override; 33 WMError TransferExtensionData(const AAFwk::WantParams& wantParams) override; 34 WSError NotifyTransferComponentData(const AAFwk::WantParams& wantParams) override; 35 void RegisterTransferComponentDataListener(const NotifyTransferComponentDataFunc& func) override; 36 WMError SetPrivacyMode(bool isPrivacyMode) override; 37 WMError SetUIContent(const std::string& contentInfo, NativeEngine* engine, 38 NativeValue* storage, bool isdistributed, AppExecFwk::Ability* ability) override; 39 40 void NotifyFocusActiveEvent(bool isFocusActive) override; 41 void NotifyFocusStateEvent(bool focusState) override; 42 43 protected: 44 NotifyTransferComponentDataFunc notifyTransferComponentDataFunc_; 45 46 private: 47 std::optional<std::atomic<bool>> focusState_ = std::nullopt; 48 }; 49 } // namespace Rosen 50 } // namespace OHOS 51 52 #endif // OHOS_ROSEN_WINDOW_EXTENSION_SESSION_IMPL_H 53