1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: output.hxx,v $
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 ************************************************************************/
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>
54 class ScPageBreakData
;
57 // #i74769# SdrPaintWindow predefine
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
};
77 friend class ScDrawStringsVars
;
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)
89 long nScrW
; // Ausgabe Groesse (Pixel)
91 long nMirrorW
; // Visible output width for mirroring (default: nScrW)
92 SCCOL nX1
; // Start-/Endkoordinaten
93 SCROW nY1
; // ( incl. versteckte )
96 SCCOL nVisX1
; // Start-/Endkoordinaten
97 SCROW nVisY1
; // ( sichtbarer Bereich )
100 ScOutputType eType
; // Bildschirm/Drucker ...
101 double nPPTX
; // Pixel per Twips
103 // USHORT nZoom; // Zoom-Faktor (Prozent) - fuer GetFont
107 SdrObject
* pEditObj
; // beim Painten auslassen
109 ScTabViewShell
* pViewShell
; // zum Connecten von sichtbaren Plug-Ins
112 FmFormView
* pDrawView
; // SdrView to paint to
114 BOOL bEditMode
; // InPlace editierte Zelle - nicht ausgeben
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
125 BOOL bForceAutoColor
;
127 BOOL bSyntaxMode
; // Syntax-Highlighting
130 Color
* pFormulaColor
;
134 BOOL bShowNullValues
;
136 BOOL bShowSpellErrors
; // Spell-Errors in EditObjekten anzeigen
141 BOOL bAnyRotated
; // intern
142 BOOL bAnyClipped
; // intern
144 BYTE nTabTextDirection
; // EEHorizontalTextDirection values
147 // #i74769# use SdrPaintWindow direct, remember it during BeginDrawLayers/EndDrawLayers
148 SdrPaintWindow
* mpTargetPaintWindow
;
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
);
177 void DrawRotatedFrame( const Color
* pForceColor
); // pixel
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
);
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
; }
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();
223 void DrawExtraShadow(BOOL bLeft
, BOOL bTop
, BOOL bRight
, BOOL bBottom
);
226 // with logic MapMode set!
227 void DrawEdit(BOOL bPixelToLogic
);
230 void DrawRotated(BOOL bPixelToLogic
); // logisch
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
);
240 void DrawingSingle(const sal_uInt16 nLayer
);
241 void DrawSelectiveObjects(const sal_uInt16 nLayer
);
243 BOOL
SetChangedClip(); // FALSE = nix
244 PolyPolygon
GetChangedArea();
247 void SetPagebreakMode( ScPageBreakData
* pPageData
);
248 #ifdef OLD_SELECTION_PAINT
249 void DrawMark( Window
* pWin
);
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();