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_SCENE_SESSION_RPOXY_H 17 #define OHOS_ROSEN_WINDOW_SCENE_SESSION_RPOXY_H 18 19 #include <iremote_proxy.h> 20 #include <message_parcel.h> 21 #include "interfaces/include/ws_common.h" 22 #include "session/host/include/zidl/session_interface.h" 23 24 namespace OHOS::Rosen { 25 class SessionProxy : public IRemoteProxy<ISession> { 26 public: SessionProxy(const sptr<IRemoteObject> & impl)27 explicit SessionProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<ISession>(impl) {}; ~SessionProxy()28 ~SessionProxy() {}; 29 30 WSError Foreground(sptr<WindowSessionProperty> property) override; 31 WSError Background() override; 32 WSError Disconnect() override; 33 WSError Connect(const sptr<ISessionStage>& sessionStage, const sptr<IWindowEventChannel>& eventChannel, 34 const std::shared_ptr<RSSurfaceNode>& surfaceNode, SystemSessionConfig& systemConfig, 35 sptr<WindowSessionProperty> property = nullptr, sptr<IRemoteObject> token = nullptr) override; 36 WSError UpdateActiveStatus(bool isActive) override; 37 WSError PendingSessionActivation(const sptr<AAFwk::SessionInfo> abilitySessionInfo) override; 38 bool WriteAbilitySessionInfoBasic(MessageParcel& data, const sptr<AAFwk::SessionInfo> abilitySessionInfo); 39 WSError TerminateSession(const sptr<AAFwk::SessionInfo> abilitySessionInfo) override; 40 WSError NotifySessionException(const sptr<AAFwk::SessionInfo> abilitySessionInfo) override; 41 WSError OnSessionEvent(SessionEvent event) override; 42 WSError RaiseToAppTop() override; 43 WSError UpdateSessionRect(const WSRect& rect, const SizeChangeReason& reason) override; 44 WSError CreateAndConnectSpecificSession(const sptr<ISessionStage>& sessionStage, 45 const sptr<IWindowEventChannel>& eventChannel, const std::shared_ptr<RSSurfaceNode>& surfaceNode, 46 sptr<WindowSessionProperty> property, int32_t& persistentId, sptr<ISession>& session, 47 sptr<IRemoteObject> token = nullptr) override; 48 WSError DestroyAndDisconnectSpecificSession(const int32_t& persistentId) override; 49 WSError OnNeedAvoid(bool status) override; 50 AvoidArea GetAvoidAreaByType(AvoidAreaType type) override; 51 WSError RequestSessionBack() override; 52 WSError MarkProcessed(int32_t eventId) override; 53 WSError SetGlobalMaximizeMode(MaximizeMode mode) override; 54 WSError GetGlobalMaximizeMode(MaximizeMode& mode) override; 55 WSError UpdateWindowSessionProperty(sptr<WindowSessionProperty> property) override; 56 WSError SetAspectRatio(float ratio) override; 57 WSError UpdateWindowSceneAfterCustomAnimation(bool isAdd) override; 58 WSError RaiseAboveTarget(int32_t subWindowId) override; 59 60 WSError TransferAbilityResult(uint32_t resultCode, const AAFwk::Want& want) override; 61 WSError TransferExtensionData(const AAFwk::WantParams& wantParams) override; 62 void NotifyRemoteReady() override; 63 void NotifyExtensionDied() override; 64 WSError UpdateWindowAnimationFlag(bool needDefaultAnimationFlag) override; 65 private: 66 static inline BrokerDelegator<SessionProxy> delegator_; 67 }; 68 } // namespace OHOS::Rosen 69 #endif // OHOS_ROSEN_WINDOW_SCENE_SESSION_RPOXY_H 70