1 /*
2 * Copyright (c) 2025 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 #include "utils/document.h"
17
18 #include "impl_factory.h"
19 #include "static_factory.h"
20
21 namespace OHOS {
22 namespace Rosen {
23 namespace Drawing {
24
Document(std::shared_ptr<DocumentImpl> documentImpl)25 Document::Document(std::shared_ptr<DocumentImpl> documentImpl) noexcept : documentImplPtr_(documentImpl) {}
26
BeginPage(float width,float height)27 std::shared_ptr<Canvas> Document::BeginPage(float width, float height)
28 {
29 return documentImplPtr_->BeginPage(width, height);
30 }
31
EndPage()32 void Document::EndPage()
33 {
34 return documentImplPtr_->EndPage();
35 }
36
MakeMultiPictureDocument(FileWStream * fileStream,SerialProcs * procs,std::unique_ptr<SharingSerialContext> & serialContext)37 std::shared_ptr<Document> Document::MakeMultiPictureDocument(FileWStream* fileStream,
38 SerialProcs* procs, std::unique_ptr<SharingSerialContext>& serialContext)
39 {
40 return StaticFactory::MakeMultiPictureDocument(fileStream, procs, serialContext);
41 }
42
Close()43 void Document::Close()
44 {
45 return documentImplPtr_->Close();
46 }
47 } // namespace Drawing
48 } // namespace Rosen
49 } // namespace OHOS
50