• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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_WINDOW_ACE_DRAG_WINDOW_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_WINDOW_ACE_DRAG_WINDOW_H
18 
19 #include "base/image/pixel_map.h"
20 #include "base/memory/ace_type.h"
21 
22 namespace OHOS::Ace {
23 class ACE_EXPORT DragWindow : public AceType {
24     DECLARE_ACE_TYPE(DragWindow, AceType);
25 
26 public:
27     static RefPtr<DragWindow> CreateDragWindow(const std::string& windowName, int32_t x, int32_t y, uint32_t width,
28         uint32_t height);
29     virtual void MoveTo(int32_t x, int32_t y) const = 0;
30     virtual void Destory() const = 0;
31     virtual void DrawPixelMap(const RefPtr<PixelMap>& pixelmap) = 0;
SetOffset(int32_t offsetX,int32_t offsetY)32     void SetOffset(int32_t offsetX, int32_t offsetY)
33     {
34         offsetX_ = offsetX;
35         offsetY_ = offsetY;
36     }
37 
SetSize(int32_t width,int32_t height)38     void SetSize(int32_t width, int32_t height)
39     {
40         width_ = width;
41         height_ = height;
42     }
43 
44 protected:
45     int32_t width_ = 0;
46     int32_t height_ = 0;
47     int32_t offsetX_ = 0;
48     int32_t offsetY_ = 0;
49 };
50 } // namespace OHOS::Ace
51 
52 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_WINDOW_ACE_DRAG_WINDOW_H
53