1 /* 2 * Copyright (c) 2023-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_PIP_OPTION_H 17 #define OHOS_PIP_OPTION_H 18 #include <refbase.h> 19 #include <string> 20 #include "xcomponent_controller.h" 21 22 namespace OHOS { 23 namespace Rosen { 24 using namespace Ace; 25 class PipOption : virtual public RefBase { 26 public: 27 explicit PipOption(); 28 virtual ~PipOption() = default; 29 void SetContext(void* contextPtr); 30 void SetNavigationId(const std::string& navigationId); 31 void SetPipTemplate(uint32_t templateType); 32 void SetContentSize(uint32_t width, uint32_t height); 33 void SetXComponentController(std::shared_ptr<XComponentController> xComponentController); 34 void* GetContext() const; 35 std::string GetNavigationId() const; 36 uint32_t GetPipTemplate(); 37 void GetContentSize(uint32_t& width, uint32_t& height); 38 std::shared_ptr<XComponentController> GetXComponentController(); 39 private: 40 void* contextPtr_ = nullptr; 41 uint32_t templateType_ = 0; 42 std::string navigationId_ = ""; 43 uint32_t contentWidth_ = 0; 44 uint32_t contentHeight_ = 0; 45 std::shared_ptr<XComponentController> xComponentController_; 46 }; 47 } 48 } 49 #endif //OHOS_PIP_OPTION_H 50