• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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_BASE_SUBWINDOW_SUBWINDOW_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_SUBWINDOW_SUBWINDOW_H
18 
19 #include "base/memory/ace_type.h"
20 #include "core/pipeline/base/component.h"
21 
22 namespace OHOS::Ace {
23 
24 class ACE_EXPORT Subwindow : public AceType {
25     DECLARE_ACE_TYPE(Subwindow, AceType)
26 
27 public:
28     static RefPtr<Subwindow> CreateSubwindow(int32_t instanceId);
29 
30     virtual void InitContainer() = 0;
31     virtual void ShowMenu(const RefPtr<Component>& newComponent) = 0;
32     virtual void CloseMenu() = 0;
ClearMenu()33     virtual void ClearMenu() {};
34 
GetSubwindowId()35     int32_t GetSubwindowId()
36     {
37         return subwindowId_;
38     }
39 
SetSubwindowId(int32_t id)40     void SetSubwindowId(int32_t id)
41     {
42         subwindowId_ = id;
43     }
44 
45 private:
46     int32_t subwindowId_;
47 };
48 
49 } // namespace OHOS::Ace
50 
51 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_SUBWINDOW_SUBWINDOW_H