/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OHOS_ROSEN_WINDOW_NODE_H #define OHOS_ROSEN_WINDOW_NODE_H #include #include #include #include "window_interface.h" #include "window_manager_hilog.h" namespace OHOS { namespace Rosen { class WindowNode : public RefBase { public: WindowNode(const sptr& property, const sptr& window, std::shared_ptr surfaceNode) : surfaceNode_(surfaceNode), property_(property), windowToken_(window) { callingPid_ = IPCSkeleton::GetCallingPid(); callingUid_ = IPCSkeleton::GetCallingUid(); } WindowNode() : property_(new WindowProperty()) { callingPid_ = IPCSkeleton::GetCallingPid(); callingUid_ = IPCSkeleton::GetCallingUid(); } ~WindowNode() = default; void SetDisplayId(int32_t displayId); void SetLayoutRect(const Rect& rect); void SetWindowProperty(const sptr& property); void SetSystemBarProperty(WindowType type, const SystemBarProperty& property); const sptr& GetWindowToken() const; uint32_t GetWindowId() const; int32_t GetDisplayId() const; const Rect& GetLayoutRect() const; WindowType GetWindowType() const; WindowMode GetWindowMode() const; uint32_t GetWindowFlags() const; const sptr& GetWindowProperty() const; int32_t GetCallingPid() const; int32_t GetCallingUid() const; const std::unordered_map& GetSystemBarProperty() const; sptr parent_; std::vector> children_; std::shared_ptr surfaceNode_; sptr abilityToken_ = nullptr; int32_t priority_ { 0 }; bool requestedVisibility_ { false }; bool currentVisibility_ { false }; private: sptr property_; sptr windowToken_; Rect layoutRect_ { 0, 0, 0, 0 }; int32_t callingPid_; int32_t callingUid_; }; } } #endif // OHOS_ROSEN_WINDOW_NODE_H