1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef CGM_BUNDLES_HXX_
25 #define CGM_BUNDLES_HXX_
26 
27 #include <sal/types.h>
28 #include "cgmtypes.hxx"
29 #include <tools/list.hxx>
30 #include <vcl/salbtype.hxx>
31 
32 // ---------------------------------------------------------------
33 
34 class CGM;
35 
36 class Bundle
37 {
38 
39 	long				mnBundleIndex;
40 	sal_uInt32			mnColor;
41 
42 public:
43 	void				SetColor( sal_uInt32 nColor ) ;
44 	sal_uInt32				GetColor() ;
GetIndex() const45 	long				GetIndex() const { return mnBundleIndex; } ;
SetIndex(long nBundleIndex)46 	void				SetIndex( long nBundleIndex ) { mnBundleIndex = nBundleIndex; } ;
47 
Bundle()48 						Bundle() {};
Clone()49 	virtual Bundle* 	Clone() { return new Bundle( *this ); };
50 	        Bundle& 	operator=( Bundle& rBundle );
51 
~Bundle()52 	virtual 			~Bundle() {} ;
53 };
54 
55 // ---------------------------------------------------------------
56 
57 class LineBundle : public Bundle
58 {
59 public:
60 
61 	LineType			eLineType;
62 	double				nLineWidth;
63 
LineBundle()64 						LineBundle() {};
Clone()65 	virtual Bundle* 	Clone() { return new LineBundle( *this ); };
66 	        LineBundle& operator=( LineBundle& rLineBundle );
~LineBundle()67 	virtual 			~LineBundle() {};
68 };
69 
70 // ---------------------------------------------------------------
71 
72 class MarkerBundle : public Bundle
73 {
74 public:
75 
76 	MarkerType			eMarkerType;
77 	double				nMarkerSize;
78 
MarkerBundle()79 						MarkerBundle() {};
Clone()80 	virtual Bundle* 	Clone() { return new MarkerBundle( *this ); } ;
81 	        MarkerBundle&	operator=( MarkerBundle& rMarkerBundle );
~MarkerBundle()82 	virtual 			~MarkerBundle() {};
83 };
84 
85 // ---------------------------------------------------------------
86 
87 class EdgeBundle : public Bundle
88 {
89 public:
90 
91 	EdgeType			eEdgeType;
92 	double				nEdgeWidth;
93 
EdgeBundle()94 						EdgeBundle() {};
Clone()95 	virtual Bundle* 	Clone() { return new EdgeBundle( *this ); } ;
96 	        EdgeBundle& operator=( EdgeBundle& rEdgeBundle );
~EdgeBundle()97 	virtual 			~EdgeBundle() {};
98 };
99 
100 // ---------------------------------------------------------------
101 
102 class TextBundle : public Bundle
103 {
104 public:
105 
106 	sal_uInt32				nTextFontIndex;
107 	TextPrecision		eTextPrecision;
108 	double				nCharacterExpansion;
109 	double				nCharacterSpacing;
110 
TextBundle()111 						TextBundle() {};
Clone()112 	virtual Bundle* 	Clone() { return new TextBundle( *this ); } ;
113 	        TextBundle& operator=( TextBundle& rTextBundle );
~TextBundle()114 	virtual 			~TextBundle() {};
115 };
116 
117 // ---------------------------------------------------------------
118 
119 class FillBundle : public Bundle
120 {
121 public:
122 
123 	FillInteriorStyle	eFillInteriorStyle;
124 	long				nFillPatternIndex;
125 	long				nFillHatchIndex;
126 
FillBundle()127 						FillBundle() {};
Clone()128 	virtual Bundle* 	Clone() { return new FillBundle( *this ); } ;
129 	        FillBundle& operator=( FillBundle& rFillBundle );
~FillBundle()130 	virtual 			~FillBundle() {};
131 };
132 
133 
134 // ---------------------------------------------------------------
135 
136 class FontEntry
137 {
138 public:
139 	sal_Int8*				pFontName;
140 	CharSetType 		eCharSetType;
141 	sal_Int8*				pCharSetValue;
142 	sal_uInt32				nFontType;			// bit 0 = 1 -> Italic,
143 											// bit 1 = 1 -> Bold
144 
145 						FontEntry();
Clone()146 	FontEntry*			Clone() { return new FontEntry( *this ); } ;
147 						~FontEntry();
148 };
149 
150 // ---------------------------------------------------------------
151 
152 class CGMFList
153 {
154 	sal_uInt32				nFontNameCount;
155 	sal_uInt32				nCharSetCount;
156 	List				aFontEntryList;
157 	void				ImplDeleteList();
158 public:
159 	sal_uInt32				nFontsAvailable;
160 	FontEntry*			GetFontEntry( sal_uInt32 );
161 	void				InsertName( sal_uInt8* pSource, sal_uInt32 nSize );
162 	void				InsertCharSet( CharSetType, sal_uInt8* pSource, sal_uInt32 nSize );
163 						CGMFList();
164 	CGMFList&			operator=( CGMFList& rFontList );
165 						~CGMFList();
166 };
167 
168 
169 #endif
170