xref: /AOO41X/main/filter/source/graphicfilter/icgm/chart.hxx (revision 22e87013b212da8c80c93e291ad90de8f36964c2)
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_CHART_HXX_
25 #define CGM_CHART_HXX_
26 
27 #include <tools/list.hxx>
28 
29 /* FILE TYPE CONSTANTS: */
30 #define NOCHART         0       /* Undefined chart.         */
31 #define XYCHART         1       /* Standard XY chart.       */
32 #define PIECHART        21      /* Standard pie chart file. */
33 #define ORGCHART        26      /* Standard org chart file. */
34 #define TTLCHART        31      /* Title chart file.        */
35 #define BULCHART        32      /* Bullet chart file.       */
36 #define TABCHART        33      /* Table chart file.        */
37 #define DRWCHART        41      /* Chart with drawings only.*/
38 #define MLTCHART        42      /* Multiple chart file.     */
39 #define LASTCHART       45      /* The largest chart type.  */
40 #define SHWFILE         46      /* Slide show file.         */
41 #define SYMFILE         47      /* Symbol file.             */
42 /* the following were added although SPC doesn't have a #define */
43 /* for them...                                                  */
44 #define AUTOTTLCHT      95      /* Autobuild TTL CHT        */
45 #define AUTOBULCHT      96      /* Autobuild BUL CHT        */
46 #define AUTOTABCHT      97      /* Autobuild TAB CHT        */
47 
48 /* FNC 10/11/93: for the chart stream, ALLCHART was added.  */
49 /* It is used specifically by PPT in its Template to let    */
50 /* us know that the template applies to all charts, not to  */
51 /* one specific chart type.                                 */
52 #define ALLCHART       127      /* Applies to all chart types */
53 #define ALLCHART_TPL   255      /* Applies to all chart types */
54 
55 #define IOC_CHTTITLE        1       /* Title for any chart.                  */
56 #define IOC_CHTFOOTNOTE     2       /* ::com::sun::star::text::Footnote for any chart.               */
57 #define IOC_XYAXIS          3       /* Axis title for XY charts.             */
58 #define IOC_XYSERIESLEGEND  4       /* Series legend titles for XY charts.   */
59 #define IOC_PIETITLE        5       /* Title for pie charts.                 */
60 #define IOC_TABLEBODY       6       /* Table chart text element.             */
61 #define IOC_TITLEBODY       7       /* Title chart text element.             */
62 #define IOC_BULLETBODY      8       /* Bullet chart text element.            */
63 #define IOC_XYLEGENDTITLE   9       /* Legend title for XY charts.           */
64 #define IOC_PIELEGENDTITLE  10      /* Legend title for pie charts.          */
65 #define IOC_TABLEGENDTITLE  11      /* Legend title for table charts.        */
66 
67 typedef struct TextAttribute
68 {
69     sal_uInt16          nTextAttribCount;
70     sal_Int8            nTextColorIndex;
71     sal_Int8            nTextColorRed;
72     sal_Int8            nTextColorGreen;
73     sal_Int8            nTextColorBlue;
74     sal_Int8            nShadowColorIndex;
75     sal_Int8            nShadowColorRed;
76     sal_Int8            nShadowColorGreen;
77     sal_Int8            nShadowColorBlue;
78     float           nTextAttribSize;
79     sal_uInt16          nTextAttribBits;
80     sal_Int8            nTextFontType;      // font identifiers
81     sal_Int8            nTextCharPage;
82     sal_uInt16          nTextFontFamily;
83     sal_Int8            nTextFontMemberID;
84     sal_Int8            nTextFontVendorID;
85     TextAttribute*  pNextAttribute;     // zero or pointer to next TextAttribute
86 } TextAttribute;
87 
88 typedef struct TextEntry
89 {
90     sal_uInt16          nTypeOfText;
91     sal_uInt16          nRowOrLineNum;
92     sal_uInt16          nColumnNum;
93     sal_uInt16          nZoneSize;          // textzone attributes
94     sal_uInt16          nLineType;
95     sal_uInt16          nAttributes;
96     char*           pText;              // null terminated text
97     TextAttribute*  pAttribute;
98 } TextEntry;
99 
100 typedef struct ZoneOption
101 {
102     char            nOverTitle;
103     char            nOverBody;
104     char            nOverFoot;
105     char            nFStyle_Title;
106     char            nFStyle_Body;
107     char            nFStyle_Foot;
108     char            nFOutc_Title;
109     char            nFOutc_Body;
110     char            nFOutc_Foot;
111     char            nFFillc_Title;
112     char            nFFillc_Body;
113     char            nFFillc_Foot;
114 } ZoneOption;
115 
116 typedef struct BulletOption
117 {
118     char            nBType;
119     char            nBSize;
120     char            nBColor;
121     sal_Int16           nBStart;
122     double          nTMargin;
123     double          nBSpace;
124     char            nCPlace;
125 } BulletOption;
126 
127 typedef struct BulDef
128 {
129     char            btype;
130     char            bsize;
131     char            bcolor;
132     char            bnumber;
133 } BulDef;
134 
135 typedef struct BulletLines
136 {
137     BulDef          nBulDef[ 48 ];
138 } BulletLines;
139 
140 typedef struct IntSettings
141 {
142     sal_uInt16          nCountry;
143     sal_uInt16          nDateFormat;
144     sal_uInt16          nDateSep;
145     sal_uInt16          nTimeFormat;
146     sal_uInt16          nTimeSep;
147     sal_uInt16          nNumSeps;
148     sal_uInt16          nCurrencyFormat;
149     char            nCurrencySymbol[ 5 ];
150 } IntSettings;
151 
152 typedef struct PageOrientDim
153 {
154     char            nOrientation;
155     char            nDimension;
156     float           nPageX;
157     float           nPageY;
158 } PageOrientDim;
159 
160 typedef struct DataNode
161 {
162     sal_Int16           nBoxX1;
163     sal_Int16           nBoxY1;
164     sal_Int16           nBoxX2;
165     sal_Int16           nBoxY2;
166     sal_Int8            nZoneEnum;
167 } DataNode;
168 
169 typedef struct ChartZone
170 {
171     sal_Int16           nMinX;
172     sal_Int16           nMinY;
173     sal_Int16           nMaxX;
174     sal_Int16           nMaxY;
175     char            nUserDef;
176     char            nPad1;
177 } ChartZone;
178 
179 class CGM;
180 class CGMImpressOutAct;
181 class CGMChart
182 {
183     friend class CGM;
184     friend class CGMImpressOutAct;
185 
186     protected:
187         CGM*                    mpCGM;
188         sal_Int8                    mnCurrentFileType;
189         List                    maTextEntryList;
190         DataNode                mDataNode[ 7 ];
191         ChartZone               mChartZone;
192         PageOrientDim           mPageOrientDim;
193         BulletOption            mBulletOption;
194         BulletLines             mBulletLines;
195         ZoneOption              mZoneOption;
196         IntSettings             mIntSettings;
197 
198     public:
199                                 CGMChart( CGM& rCGM );
200                                 ~CGMChart();
201 
202         void                    DeleteTextEntry( TextEntry* );
203         void                    InsertTextEntry( TextEntry* );
204 
205         void                    ResetAnnotation();
206         sal_Bool                    IsAnnotation();
207 };
208 
209 #endif
210 
211