Line data Source code
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 : #ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_OUTACT_HXX
21 : #define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_OUTACT_HXX
22 :
23 : #include <com/sun/star/awt/Gradient.hpp>
24 : #include <com/sun/star/drawing/XDrawPages.hpp>
25 : #include <com/sun/star/drawing/XDrawPage.hpp>
26 : #include <com/sun/star/drawing/XShape.hpp>
27 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 : #include <com/sun/star/beans/XPropertySet.hpp>
29 :
30 :
31 : #define CGM_OUTACT_MAX_GROUP_LEVEL 64
32 :
33 : #include "cgm.hxx"
34 : #include <chart.hxx>
35 : #include <tools/poly.hxx>
36 :
37 : typedef struct NodeFrameSet
38 : {
39 : Point nTopLeft;
40 : Point nBottomRight;
41 : ::com::sun::star::awt::Size nSize;
42 : } NodeFrameSet;
43 :
44 : class CGM;
45 : class CGMBitmapDescriptor;
46 : class CGMOutAct
47 : {
48 : protected:
49 : sal_uInt16 mnCurrentPage; // defaulted to zero
50 :
51 : sal_uInt32 mnGroupActCount; // grouping
52 : sal_uInt32 mnGroupLevel;
53 : sal_uInt32* mpGroupLevel;
54 :
55 : sal_uInt16 mnIndex; // figure
56 : sal_uInt8* mpFlags;
57 : Point* mpPoints;
58 : tools::PolyPolygon maPolyPolygon;
59 : css::awt::Gradient* mpGradient;
60 :
61 : CGM* mpCGM;
62 :
63 : public:
64 : CGMOutAct( CGM& rCGM );
65 : virtual ~CGMOutAct();
66 14 : void FirstOutPut() { mpCGM->mbFirstOutPut = false; } ;
67 0 : virtual void InsertPage() { mnCurrentPage++; } ;
68 0 : virtual void BeginGroup() {} ;
69 0 : virtual void EndGroup() {};
70 0 : virtual void EndGrouping() {} ;
71 : void BeginFigure() ;
72 : void CloseRegion() ;
73 : void NewRegion() ;
74 : void EndFigure() ;
75 : void RegPolyLine( Polygon&, bool bReverse = false ) ;
76 : void SetGradientOffset( long nHorzOfs, long nVertOfs, sal_uInt32 nType );
77 : void SetGradientAngle( long nAngle );
78 : void SetGradientDescriptor( sal_uInt32 nColorFrom, sal_uInt32 nColorTo );
79 : void SetGradientStyle( sal_uInt32 nStyle, double fRatio );
80 0 : virtual void DrawRectangle( FloatRect& ) {} ;
81 0 : virtual void DrawEllipse( FloatPoint&, FloatPoint&, double& ) {} ;
82 0 : virtual void DrawEllipticalArc( FloatPoint&, FloatPoint&, double&,
83 0 : sal_uInt32, double&, double&) {} ;
84 0 : virtual void DrawBitmap( CGMBitmapDescriptor* ) {} ;
85 0 : virtual void DrawPolygon( Polygon& ) {} ;
86 0 : virtual void DrawPolyLine( Polygon& ) {} ;
87 0 : virtual void DrawPolybezier( Polygon& ) {} ;
88 0 : virtual void DrawPolyPolygon( tools::PolyPolygon& ) {} ;
89 0 : virtual void DrawText( ::com::sun::star::awt::Point&, ::com::sun::star::awt::Size&, char*, sal_uInt32, FinalFlag ) {} ;
90 0 : virtual void AppendText( char*, sal_uInt32, FinalFlag ) {} ;
91 0 : virtual sal_uInt32 DrawText( TextEntry*, NodeFrameSet&, sal_uInt32 ) { return 0; } ;
92 0 : virtual void DrawChart(){} ;
93 : };
94 :
95 : class CGMImpressOutAct : public CGMOutAct
96 : {
97 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > maXDrawPages;
98 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > maXDrawPage;
99 :
100 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > maXMultiServiceFactory;
101 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > maXShape;
102 : bool ImplCreateShape( const OUString& rType );
103 :
104 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > maXPropSet;
105 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > maXShapes;
106 :
107 : sal_uInt32 nFinalTextCount;
108 :
109 : bool ImplInitPage();
110 : void ImplSetOrientation( FloatPoint& RefPoint, double& Orientation ) ;
111 : void ImplSetLineBundle() ;
112 : void ImplSetFillBundle() ;
113 : void ImplSetTextBundle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & ) ;
114 : public:
115 : CGMImpressOutAct( CGM&, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & ) ;
116 4 : virtual ~CGMImpressOutAct() {} ;
117 : virtual void InsertPage() SAL_OVERRIDE ;
118 : virtual void BeginGroup() SAL_OVERRIDE ;
119 : virtual void EndGroup() SAL_OVERRIDE ;
120 : virtual void EndGrouping() SAL_OVERRIDE ;
121 : virtual void DrawRectangle( FloatRect& ) SAL_OVERRIDE ;
122 : virtual void DrawEllipse( FloatPoint& center, FloatPoint&, double& Orientation ) SAL_OVERRIDE ;
123 : virtual void DrawEllipticalArc( FloatPoint& center, FloatPoint& size, double& orientation,
124 : sal_uInt32 etype, double& startangle, double& endangle ) SAL_OVERRIDE ;
125 : virtual void DrawBitmap( CGMBitmapDescriptor* ) SAL_OVERRIDE ;
126 : virtual void DrawPolygon( Polygon& ) SAL_OVERRIDE ;
127 : virtual void DrawPolyLine( Polygon& ) SAL_OVERRIDE ;
128 : virtual void DrawPolybezier( Polygon& ) SAL_OVERRIDE ;
129 : virtual void DrawPolyPolygon( tools::PolyPolygon& ) SAL_OVERRIDE ;
130 : virtual void DrawText( ::com::sun::star::awt::Point& TextRectPos, ::com::sun::star::awt::Size& TextRectSize, char* String, sal_uInt32 StringSize, FinalFlag ) SAL_OVERRIDE ;
131 : virtual void AppendText( char* String, sal_uInt32 StringSize, FinalFlag ) SAL_OVERRIDE ;
132 : virtual sal_uInt32 DrawText( TextEntry*, NodeFrameSet&, sal_uInt32 ) SAL_OVERRIDE ;
133 : virtual void DrawChart() SAL_OVERRIDE;
134 : };
135 :
136 :
137 : #endif
138 :
139 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|