LibreOffice Module filter (master) 1
bundles.hxx
Go to the documentation of this file.
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 <sal/types.h>
23#include "cgmtypes.hxx"
24#include <vector>
25#include <memory>
26
27
28class Bundle
29{
30
32 sal_uInt32 mnColor;
33
34public:
35 void SetColor( sal_uInt32 nColor ) ;
36 sal_uInt32 GetColor() const { return mnColor;}
37 tools::Long GetIndex() const { return mnBundleIndex; } ;
38 void SetIndex( tools::Long nBundleIndex ) { mnBundleIndex = nBundleIndex; } ;
39
41 : mnBundleIndex( 0 )
42 , mnColor( 0 )
43 {};
44
45 virtual std::unique_ptr<Bundle> Clone() { return std::make_unique<Bundle>( *this ); };
46
47 virtual ~Bundle() {} ;
48
49 Bundle(Bundle const &) = default;
50 Bundle(Bundle &&) = default;
51 Bundle & operator =(Bundle const &) = default;
52 Bundle & operator =(Bundle &&) = default;
53};
54
55
56class LineBundle : public Bundle
57{
58public:
59
61 double nLineWidth;
62
65 , nLineWidth(0)
66 {}
67
68 virtual std::unique_ptr<Bundle> Clone() override { return std::make_unique<LineBundle>( *this ); }
69};
70
71
72class MarkerBundle : public Bundle
73{
74public:
75
78
81 , nMarkerSize( 0.0 )
82 {};
83
84 virtual std::unique_ptr<Bundle> Clone() override { return std::make_unique<MarkerBundle>( *this ); } ;
85};
86
87
88class EdgeBundle : public Bundle
89{
90public:
91
93 double nEdgeWidth;
94
97 , nEdgeWidth(0)
98 {}
99 virtual std::unique_ptr<Bundle> Clone() override { return std::make_unique<EdgeBundle>( *this ); }
100};
101
102
103class TextBundle : public Bundle
104{
105public:
106
107 sal_uInt32 nTextFontIndex;
111
113 : nTextFontIndex( 0 )
115 , nCharacterExpansion( 0.0 )
116 , nCharacterSpacing( 0.0 )
117 {};
118
119 virtual std::unique_ptr<Bundle> Clone() override { return std::make_unique<TextBundle>( *this ); } ;
120};
121
122
123class FillBundle : public Bundle
124{
125public:
126
130
134 , nFillHatchIndex(0)
135 {}
136 virtual std::unique_ptr<Bundle> Clone() override { return std::make_unique<FillBundle>( *this ); }
137};
138
139
141{
142 std::vector<sal_Int8> aFontName;
143 std::vector<sal_Int8> aCharSetValue;
144 sal_uInt32 nFontType; // bit 0 = 1 -> Italic,
145 // bit 1 = 1 -> Bold
147 : nFontType(0)
148 {
149 }
150};
151
153{
154 sal_uInt32 nFontNameCount;
155 sal_uInt32 nCharSetCount;
156 std::vector<FontEntry> aFontEntryList;
157
158public:
159 CGMFList();
160
161 FontEntry* GetFontEntry( sal_uInt32 );
162 void InsertName( sal_uInt8 const * pSource, sal_uInt32 nSize );
163 void InsertCharSet( sal_uInt8 const * pSource, sal_uInt32 nSize );
164};
165
166/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TextPrecision
Definition: cgmtypes.hxx:101
@ TPR_UNDEFINED
Definition: cgmtypes.hxx:101
EdgeType
Definition: cgmtypes.hxx:115
@ ET_NONE
Definition: cgmtypes.hxx:116
FillInteriorStyle
Definition: cgmtypes.hxx:123
@ FIS_HOLLOW
Definition: cgmtypes.hxx:123
MarkerType
Definition: cgmtypes.hxx:119
@ MT_POINT
Definition: cgmtypes.hxx:119
@ LT_SOLID
Definition: cgmtypes.hxx:108
virtual ~Bundle()
Definition: bundles.hxx:47
Bundle(Bundle const &)=default
Bundle(Bundle &&)=default
virtual std::unique_ptr< Bundle > Clone()
Definition: bundles.hxx:45
sal_uInt32 mnColor
Definition: bundles.hxx:32
Bundle & operator=(Bundle const &)=default
tools::Long GetIndex() const
Definition: bundles.hxx:37
void SetIndex(tools::Long nBundleIndex)
Definition: bundles.hxx:38
Bundle()
Definition: bundles.hxx:40
tools::Long mnBundleIndex
Definition: bundles.hxx:31
void SetColor(sal_uInt32 nColor)
Definition: bundles.cxx:25
sal_uInt32 GetColor() const
Definition: bundles.hxx:36
void InsertCharSet(sal_uInt8 const *pSource, sal_uInt32 nSize)
Definition: bundles.cxx:121
CGMFList()
Definition: bundles.cxx:30
sal_uInt32 nFontNameCount
Definition: bundles.hxx:154
FontEntry * GetFontEntry(sal_uInt32)
Definition: bundles.cxx:36
sal_uInt32 nCharSetCount
Definition: bundles.hxx:155
std::vector< FontEntry > aFontEntryList
Definition: bundles.hxx:156
void InsertName(sal_uInt8 const *pSource, sal_uInt32 nSize)
Definition: bundles.cxx:61
EdgeBundle()
Definition: bundles.hxx:95
EdgeType eEdgeType
Definition: bundles.hxx:92
double nEdgeWidth
Definition: bundles.hxx:93
virtual std::unique_ptr< Bundle > Clone() override
Definition: bundles.hxx:99
FillInteriorStyle eFillInteriorStyle
Definition: bundles.hxx:127
tools::Long nFillPatternIndex
Definition: bundles.hxx:128
virtual std::unique_ptr< Bundle > Clone() override
Definition: bundles.hxx:136
tools::Long nFillHatchIndex
Definition: bundles.hxx:129
double nLineWidth
Definition: bundles.hxx:61
virtual std::unique_ptr< Bundle > Clone() override
Definition: bundles.hxx:68
LineType eLineType
Definition: bundles.hxx:60
LineBundle()
Definition: bundles.hxx:63
MarkerType eMarkerType
Definition: bundles.hxx:76
virtual std::unique_ptr< Bundle > Clone() override
Definition: bundles.hxx:84
double nMarkerSize
Definition: bundles.hxx:77
double nCharacterExpansion
Definition: bundles.hxx:109
double nCharacterSpacing
Definition: bundles.hxx:110
sal_uInt32 nTextFontIndex
Definition: bundles.hxx:107
TextPrecision eTextPrecision
Definition: bundles.hxx:108
virtual std::unique_ptr< Bundle > Clone() override
Definition: bundles.hxx:119
long Long
LineType
std::vector< sal_Int8 > aFontName
Definition: bundles.hxx:142
std::vector< sal_Int8 > aCharSetValue
Definition: bundles.hxx:143
sal_uInt32 nFontType
Definition: bundles.hxx:144
unsigned char sal_uInt8