• 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 WINDOW_EXTENSION_STUB_IMPL_H
17 #define WINDOW_EXTENSION_STUB_IMPL_H
18 
19 #include <string>
20 
21 #include "window.h"
22 #include "window_extension_stub.h"
23 #include "window_extension_client_interface.h"
24 #include "wm_common.h"
25 
26 namespace OHOS {
27 namespace Rosen {
28 class WindowExtensionStubImpl : public WindowExtensionStub {
29 public:
30     WindowExtensionStubImpl(const std::string& windowName);
31     ~WindowExtensionStubImpl();
32 
33     virtual void SetBounds(const Rect& rect) override;
34     virtual void Hide() override;
35     virtual void Show() override;
36     virtual void RequestFocus() override;
37     virtual void GetExtensionWindow(sptr<IWindowExtensionClient>& token) override;
38 
39     sptr<Window> CreateWindow(
40         const Rect& rect, uint32_t parentWindowId, const std::shared_ptr<AbilityRuntime::Context>& context);
41     void DestroyWindow();
42     sptr<Window> GetWindow() const;
43 private:
44     sptr<IDispatchInputEventListener> dispatchInputEventListener_;
45     sptr<Window> window_;
46     std::string windowName_;
47     sptr<IWindowExtensionClient> token_;
48 };
49 } // namespace Rosen
50 } // namespace OHOS
51 #endif // WINDOW_EXTENSION_STUB_IMPL_H