1 /*
2  * Copyright (c) 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_RICH_EDITOR_DRAG_RICH_EDITOR_DRAG_PAINT_METHOD_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_RICH_EDITOR_DRAG_RICH_EDITOR_DRAG_PAINT_METHOD_H
18 
19 #include "base/memory/ace_type.h"
20 #include "base/memory/referenced.h"
21 #include "core/components_ng/pattern/text_drag/text_drag_paint_method.h"
22 #include "core/components_ng/pattern/rich_editor_drag/rich_editor_drag_content_modifier.h"
23 #include "core/components_ng/pattern/rich_editor_drag/rich_editor_drag_info.h"
24 
25 namespace OHOS::Ace::NG {
26 class ACE_EXPORT RichEditorDragPaintMethod : public TextDragPaintMethod {
27     DECLARE_ACE_TYPE(RichEditorDragPaintMethod, TextDragPaintMethod)
28 public:
29     RichEditorDragPaintMethod(const WeakPtr<Pattern>& pattern,
30         const RefPtr<TextDragOverlayModifier>& overlayMod, const RefPtr<RichEditorDragContentModifier>& contentMod,
31         const RichEditorDragInfo& info);
32 
33     ~RichEditorDragPaintMethod() override = default;
34 
35     RefPtr<Modifier> GetContentModifier(PaintWrapper* paintWrapper) override;
36     void UpdateContentModifier(PaintWrapper* paintWrapper) override;
37 
38 private:
39     RefPtr<RichEditorDragContentModifier> contentModifier_;
40     RichEditorDragInfo info_;
41     ACE_DISALLOW_COPY_AND_MOVE(RichEditorDragPaintMethod);
42 };
43 } // namespace OHOS::Ace::NG
44 
45 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_TEXT_DRAG_TEXT_DRAG_PAINT_METHOD_H
46