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 FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_CANVAS_PATH_H 17 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_CANVAS_PATH_H 18 19 #include "base/memory/referenced.h" 20 #include "bridge/declarative_frontend/engine/bindings_defines.h" 21 22 namespace OHOS::Ace::Framework { 23 24 class JSCanvasPath : public Referenced { 25 public: 26 JSCanvasPath(); 27 ~JSCanvasPath() override = default; 28 void JsPath2DSetTransform(const JSCallbackInfo& args); 29 void JsPath2DMoveTo(const JSCallbackInfo& args); 30 void JsPath2DLineTo(const JSCallbackInfo& args); 31 void JsPath2DArc(const JSCallbackInfo& args); 32 void JsPath2DArcTo(const JSCallbackInfo& args); 33 void JsPath2DQuadraticCurveTo(const JSCallbackInfo& args); 34 void JsPath2DBezierCurveTo(const JSCallbackInfo& args); 35 void JsPath2DEllipse(const JSCallbackInfo& args); 36 void JsPath2DRect(const JSCallbackInfo& args); 37 void JsPath2DClosePath(const JSCallbackInfo& args); GetCanvasPath2d()38 RefPtr<CanvasPath2D> GetCanvasPath2d() const 39 { 40 return path2d_; 41 } SetCanvasPath2d(RefPtr<CanvasPath2D> path2d)42 void SetCanvasPath2d(RefPtr<CanvasPath2D> path2d) 43 { 44 path2d_ = path2d; 45 } 46 47 ACE_DISALLOW_COPY_AND_MOVE(JSCanvasPath); 48 protected: 49 RefPtr<CanvasPath2D> path2d_; 50 }; 51 52 } // namespace OHOS::Ace::Framework 53 54 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_CANVAS_PATH_H