merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / output.hxx
blobea2aadc1ae361f581e1436df6213f4a1ee9a45d9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: output.hxx,v $
10 * $Revision: 1.21 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_OUTPUT_HXX
32 #define SC_OUTPUT_HXX
34 #include "address.hxx"
35 #include <tools/list.hxx>
36 #include <tools/color.hxx>
37 #include <tools/fract.hxx>
38 #include <com/sun/star/embed/XEmbeddedObject.hpp>
40 class Rectangle;
41 class Font;
42 class OutputDevice;
43 class Window;
44 class EditEngine;
45 class ScDocument;
46 class ScBaseCell;
47 class ScPatternAttr;
48 class SvxMarginItem;
49 class SdrObject;
50 class SdrOle2Obj;
51 struct RowInfo;
52 struct ScTableInfo;
53 class ScTabViewShell;
54 class ScPageBreakData;
55 class FmFormView;
57 // #i74769# SdrPaintWindow predefine
58 class SdrPaintWindow;
60 // ---------------------------------------------------------------------------
62 #define SC_SCENARIO_HSPACE 60
63 #define SC_SCENARIO_VSPACE 50
65 // ---------------------------------------------------------------------------
67 #define SC_OBJECTS_NONE 0
68 #define SC_OBJECTS_DRAWING 1
69 #define SC_OBJECTS_OLE 2
70 #define SC_OBJECTS_CHARTS 4
71 #define SC_OBJECTS_ALL ( SC_OBJECTS_DRAWING | SC_OBJECTS_OLE | SC_OBJECTS_CHARTS )
73 enum ScOutputType { OUTTYPE_WINDOW, OUTTYPE_PRINTER };
75 class ScOutputData
77 friend class ScDrawStringsVars;
78 private:
79 OutputDevice* pDev; // Device
80 OutputDevice* pRefDevice; // printer if used for preview
81 OutputDevice* pFmtDevice; // reference for text formatting
82 ScTableInfo& mrTabInfo;
83 RowInfo* pRowInfo; // Info-Block
84 SCSIZE nArrCount; // belegte Zeilen im Info-Block
85 ScDocument* pDoc; // Dokument
86 SCTAB nTab; // Tabelle
87 long nScrX; // Ausgabe Startpos. (Pixel)
88 long nScrY;
89 long nScrW; // Ausgabe Groesse (Pixel)
90 long nScrH;
91 long nMirrorW; // Visible output width for mirroring (default: nScrW)
92 SCCOL nX1; // Start-/Endkoordinaten
93 SCROW nY1; // ( incl. versteckte )
94 SCCOL nX2;
95 SCROW nY2;
96 SCCOL nVisX1; // Start-/Endkoordinaten
97 SCROW nVisY1; // ( sichtbarer Bereich )
98 SCCOL nVisX2;
99 SCROW nVisY2;
100 ScOutputType eType; // Bildschirm/Drucker ...
101 double nPPTX; // Pixel per Twips
102 double nPPTY;
103 // USHORT nZoom; // Zoom-Faktor (Prozent) - fuer GetFont
104 Fraction aZoomX;
105 Fraction aZoomY;
107 SdrObject* pEditObj; // beim Painten auslassen
109 ScTabViewShell* pViewShell; // zum Connecten von sichtbaren Plug-Ins
111 // #114135#
112 FmFormView* pDrawView; // SdrView to paint to
114 BOOL bEditMode; // InPlace editierte Zelle - nicht ausgeben
115 SCCOL nEditCol;
116 SCROW nEditRow;
118 BOOL bMetaFile; // Ausgabe auf Metafile (nicht in Pixeln!)
119 BOOL bSingleGrid; // beim Gitter bChanged auswerten
121 BOOL bPagebreakMode; // Seitenumbruch-Vorschau
122 BOOL bSolidBackground; // weiss statt transparent
124 BOOL bUseStyleColor;
125 BOOL bForceAutoColor;
127 BOOL bSyntaxMode; // Syntax-Highlighting
128 Color* pValueColor;
129 Color* pTextColor;
130 Color* pFormulaColor;
132 Color aGridColor;
134 BOOL bShowNullValues;
135 BOOL bShowFormulas;
136 BOOL bShowSpellErrors; // Spell-Errors in EditObjekten anzeigen
137 BOOL bMarkClipped;
139 BOOL bSnapPixel;
141 BOOL bAnyRotated; // intern
142 BOOL bAnyClipped; // intern
143 BOOL bTabProtected;
144 BYTE nTabTextDirection; // EEHorizontalTextDirection values
145 BOOL bLayoutRTL;
147 // #i74769# use SdrPaintWindow direct, remember it during BeginDrawLayers/EndDrawLayers
148 SdrPaintWindow* mpTargetPaintWindow;
150 // private methods
152 BOOL GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
153 SCCOL& rOverX, SCROW& rOverY, BOOL bVisRowChanged );
154 BOOL IsEmptyCellText( RowInfo* pThisRowInfo, SCCOL nX, SCROW nY );
155 void GetVisibleCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell*& rpCell );
157 BOOL IsAvailable( SCCOL nX, SCROW nY );
158 void GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY,
159 SCCOL nCellX, SCROW nCellY, long nNeeded,
160 const ScPatternAttr& rPattern,
161 USHORT nHorJustify, BOOL bCellIsValue,
162 BOOL bBreak, BOOL bOverwrite,
163 Rectangle& rAlignRect, Rectangle& rClipRect,
164 BOOL& rLeftClip, BOOL& rRightClip );
166 void ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlignRect,
167 long nLeftM, long nTopM, long nRightM, long nBottomM,
168 BOOL bWidth, USHORT nOrient, long nAttrRotate, BOOL bPixelToLogic,
169 long& rEngineWidth, long& rEngineHeight, long& rNeededPixel,
170 BOOL& rLeftClip, BOOL& rRightClip );
172 void SetSyntaxColor( Font* pFont, ScBaseCell* pCell );
173 void SetEditSyntaxColor( EditEngine& rEngine, ScBaseCell* pCell );
175 double GetStretch();
177 void DrawRotatedFrame( const Color* pForceColor ); // pixel
179 public:
180 ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType,
181 ScTableInfo& rTabInfo, ScDocument* pNewDoc,
182 SCTAB nNewTab, long nNewScrX, long nNewScrY,
183 SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2,
184 double nPixelPerTwipsX, double nPixelPerTwipsY,
185 const Fraction* pZoomX = NULL,
186 const Fraction* pZoomY = NULL );
188 ~ScOutputData();
190 void SetContentDevice( OutputDevice* pContentDev );
192 void SetRefDevice( OutputDevice* pRDev ) { pRefDevice = pFmtDevice = pRDev; }
193 void SetFmtDevice( OutputDevice* pRDev ) { pFmtDevice = pRDev; }
194 void SetEditObject( SdrObject* pObj ) { pEditObj = pObj; }
195 void SetViewShell( ScTabViewShell* pSh ) { pViewShell = pSh; }
197 // #114135#
198 void SetDrawView( FmFormView* pNew ) { pDrawView = pNew; }
200 void SetSolidBackground( BOOL bSet ) { bSolidBackground = bSet; }
201 void SetUseStyleColor( BOOL bSet ) { bUseStyleColor = bSet; }
203 void SetEditCell( SCCOL nCol, SCROW nRow );
204 void SetSyntaxMode( BOOL bNewMode );
205 void SetMetaFileMode( BOOL bNewMode );
206 void SetSingleGrid( BOOL bNewMode );
207 void SetGridColor( const Color& rColor );
208 void SetMarkClipped( BOOL bSet );
209 void SetShowNullValues ( BOOL bSet = TRUE );
210 void SetShowFormulas ( BOOL bSet = TRUE );
211 void SetShowSpellErrors( BOOL bSet = TRUE );
212 void SetMirrorWidth( long nNew );
213 long GetScrW() const { return nScrW; }
214 long GetScrH() const { return nScrH; }
216 void SetSnapPixel( BOOL bSet = TRUE );
218 void DrawGrid( BOOL bGrid, BOOL bPage );
219 void DrawStrings( BOOL bPixelToLogic = FALSE );
220 void DrawDocumentBackground();
221 void DrawBackground();
222 void DrawShadow();
223 void DrawExtraShadow(BOOL bLeft, BOOL bTop, BOOL bRight, BOOL bBottom);
224 void DrawFrame();
226 // with logic MapMode set!
227 void DrawEdit(BOOL bPixelToLogic);
229 void FindRotated();
230 void DrawRotated(BOOL bPixelToLogic); // logisch
232 void DrawClear();
234 // #i72502# printer only command set
235 Point PrePrintDrawingLayer(long nLogStX, long nLogStY );
236 void PostPrintDrawingLayer(const Point& rMMOffset); // #i74768# need offset for FormLayer
237 void PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOffset);
239 // nur Bildschirm:
240 void DrawingSingle(const sal_uInt16 nLayer);
241 void DrawSelectiveObjects(const sal_uInt16 nLayer);
243 BOOL SetChangedClip(); // FALSE = nix
244 PolyPolygon GetChangedArea();
246 void FindChanged();
247 void SetPagebreakMode( ScPageBreakData* pPageData );
248 #ifdef OLD_SELECTION_PAINT
249 void DrawMark( Window* pWin );
250 #endif
251 void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
252 SCCOL nRefEndX, SCROW nRefEndY,
253 const Color& rColor, BOOL bHandle );
254 void DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
255 SCCOL nRefEndX, SCROW nRefEndY,
256 const Color& rColor, USHORT nType );
257 void DrawChangeTrack();
258 void DrawClipMarks();
260 void DrawNoteMarks();
261 void AddPDFNotes();
266 #endif