/src/libreoffice/xmloff/inc/xexptran.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include <rtl/ustring.hxx> |
23 | | #include <com/sun/star/drawing/HomogenMatrix.hpp> |
24 | | |
25 | | #include <memory> |
26 | | #include <vector> |
27 | | |
28 | | struct ImpSdXMLExpTransObj2DBase; |
29 | | struct ImpSdXMLExpTransObj3DBase; |
30 | | class SvXMLUnitConverter; |
31 | | |
32 | | namespace basegfx |
33 | | { |
34 | | class B2DTuple; |
35 | | class B2DHomMatrix; |
36 | | class B3DHomMatrix; |
37 | | } |
38 | | |
39 | | class SdXMLImExTransform2D |
40 | | { |
41 | | // NOTE: This uses shared_ptr, because with unique_ptr the code |
42 | | // fails to compile because of incomplete type. |
43 | | std::vector< std::shared_ptr< ImpSdXMLExpTransObj2DBase > > maList; |
44 | | OUString msString; |
45 | | |
46 | | public: |
47 | 12.0k | SdXMLImExTransform2D() {} |
48 | | |
49 | | void AddRotate(double fNew); |
50 | | void AddTranslate(const ::basegfx::B2DTuple& rNew); |
51 | | void AddSkewX(double fNew); |
52 | | |
53 | 11.1k | bool NeedsAction() const { return !maList.empty(); } |
54 | | void GetFullTransform(::basegfx::B2DHomMatrix& rFullTrans); |
55 | | const OUString& GetExportString(const SvXMLUnitConverter& rConv); |
56 | | void SetString(const OUString& rNew, const SvXMLUnitConverter& rConv); |
57 | | }; |
58 | | |
59 | | class SdXMLImExTransform3D |
60 | | { |
61 | | // NOTE: This uses shared_ptr, because with unique_ptr the code |
62 | | // fails to compile because of incomplete type. |
63 | | std::vector< std::shared_ptr< ImpSdXMLExpTransObj3DBase > > maList; |
64 | | OUString msString; |
65 | | |
66 | | public: |
67 | 0 | SdXMLImExTransform3D() {} |
68 | | SdXMLImExTransform3D(const OUString& rNew, const SvXMLUnitConverter& rConv); |
69 | | |
70 | | void AddMatrix(const ::basegfx::B3DHomMatrix& rNew); |
71 | | |
72 | | void AddHomogenMatrix(const css::drawing::HomogenMatrix& xHomMat); |
73 | 0 | bool NeedsAction() const { return !maList.empty(); } |
74 | | void GetFullTransform(::basegfx::B3DHomMatrix& rFullTrans); |
75 | | bool GetFullHomogenTransform(css::drawing::HomogenMatrix& xHomMat); |
76 | | const OUString& GetExportString(const SvXMLUnitConverter& rConv); |
77 | | void SetString(const OUString& rNew, const SvXMLUnitConverter& rConv); |
78 | | }; |
79 | | |
80 | | class SdXMLImExViewBox |
81 | | { |
82 | | OUString msString; |
83 | | double mfX; |
84 | | double mfY; |
85 | | double mfW; |
86 | | double mfH; |
87 | | |
88 | | public: |
89 | | SdXMLImExViewBox(double fX, double fY, double fW, double fH); |
90 | | SdXMLImExViewBox(OUString aNew, const SvXMLUnitConverter& rConv); |
91 | | |
92 | 940 | double GetX() const { return mfX; } |
93 | 940 | double GetY() const { return mfY; } |
94 | 553 | double GetWidth() const { return mfW; } |
95 | 553 | double GetHeight() const { return mfH; } |
96 | | const OUString& GetExportString(); |
97 | | }; |
98 | | |
99 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |