• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_UIEXTENSION_CONTAINER_HANDLER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_UIEXTENSION_CONTAINER_HANDLER_H
18 
19 #include "base/memory/ace_type.h"
20 #include "frameworks/core/common/container_handler.h"
21 #include "frameworks/core/components_ng/pattern/pattern.h"
22 #include "interfaces/inner_api/ace/constants.h"
23 #include "want.h"
24 
25 namespace OHOS::Ace::NG {
26 
27 class UIExtensionContainerHandler : public ContainerHandler {
28     DECLARE_ACE_TYPE(UIExtensionContainerHandler, ContainerHandler);
29 
30 public:
31     UIExtensionContainerHandler() = default;
32     ~UIExtensionContainerHandler() override = default;
33 
34     static UIContentType FromStrToUIContentType(const std::string& str);
35     static std::string FromUIContentTypeToStr(UIContentType uIContentType);
36 
GetHostUIContentType()37     UIContentType GetHostUIContentType() const
38     {
39         return hostUIContentType_;
40     }
41 
SetHostUIContentType(UIContentType hostUIContentType)42     void SetHostUIContentType(UIContentType hostUIContentType)
43     {
44         hostUIContentType_ = hostUIContentType;
45     }
46 
47     void SetHostParams(const std::shared_ptr<OHOS::AAFwk::Want>& params);
48 
49 private:
50     void SetHostUIContentType(const std::shared_ptr<OHOS::AAFwk::Want>& params);
51 
52     UIContentType hostUIContentType_ = UIContentType::UNDEFINED;
53 };
54 
55 } // namespace OHOS::Ace
56 
57 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_UIEXTENSION_CONTAINER_HANDLER_H
58