xref: /trunk/main/sw/inc/fesh.hxx (revision 52f1c2ee)
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 #ifndef _FESH_HXX
24 #define _FESH_HXX
25 
26 #include <com/sun/star/text/RelOrientation.hpp>
27 #include <com/sun/star/embed/XClassifiedObject.hpp>
28 #include <com/sun/star/embed/XEmbeddedObject.hpp>
29 
30 #include <svx/svdobj.hxx>
31 #include "swdllapi.h"
32 #include <editsh.hxx>
33 #include <flyenum.hxx>
34 
35 // OD 25.06.2003 #108784#
36 #include <svx/svdtypes.hxx>
37 
38 #include <svtools/embedhlp.hxx>
39 
40 #ifndef INCLUDED_VECTOR
41 #include <vector>
42 #define INCLUDED_VECTOR
43 #endif
44 
45 
46 class SwFlyFrm;
47 class SwTabCols;
48 class SvxBrushItem;
49 class SvxFrameDirectionItem;
50 class SwTableAutoFmt;
51 class SwFrm;
52 class SwFmtFrmSize;
53 class SwFmtRowSplit;
54 class SvxBorderLine;
55 class SdrObject;
56 class Color;
57 class Outliner;
58 class SotDataObject;
59 class SwFrmFmt;
60 struct SwSortOptions;
61 class SdrMarkList;
62 
63 namespace svx
64 {
65     class ISdrObjectFilter;
66 }
67 
68 
69 // return values for GetFrmType() und GetSelFrmType().
70 //! values can be combined via logival or
71 #define FRMTYPE_NONE			(sal_uInt16)     0
72 #define FRMTYPE_PAGE			(sal_uInt16)     1
73 #define FRMTYPE_HEADER			(sal_uInt16)     2
74 #define FRMTYPE_FOOTER			(sal_uInt16)     4
75 #define FRMTYPE_BODY			(sal_uInt16)     8
76 #define FRMTYPE_COLUMN			(sal_uInt16)    16
77 #define FRMTYPE_TABLE			(sal_uInt16)    32
78 #define FRMTYPE_FLY_FREE		(sal_uInt16)    64
79 #define FRMTYPE_FLY_ATCNT		(sal_uInt16)   128
80 #define FRMTYPE_FLY_INCNT		(sal_uInt16)   256
81 #define FRMTYPE_FOOTNOTE		(sal_uInt16)   512
82 #define FRMTYPE_FTNPAGE			(sal_uInt16)  1024
83 #define FRMTYPE_FLY_ANY			(sal_uInt16)  2048
84 #define FRMTYPE_DRAWOBJ			(sal_uInt16)  4096
85 #define FRMTYPE_COLSECT			(sal_uInt16)  8192
86 #define FRMTYPE_COLSECTOUTTAB 	(sal_uInt16) 16384
87 
88 #define FRMTYPE_ANYCOLSECT ( FRMTYPE_COLSECT | FRMTYPE_COLSECTOUTTAB )
89 
90 //! values can be combined via logival or
91 #define GOTOOBJ_DRAW_CONTROL 	(sal_uInt16)  1
92 #define GOTOOBJ_DRAW_SIMPLE 	(sal_uInt16)  2
93 #define GOTOOBJ_DRAW_ANY 		(sal_uInt16)  3
94 #define GOTOOBJ_FLY_FRM 		(sal_uInt16)  4
95 #define GOTOOBJ_FLY_GRF 		(sal_uInt16)  8
96 #define GOTOOBJ_FLY_OLE 		(sal_uInt16) 16
97 #define GOTOOBJ_FLY_ANY 		(sal_uInt16) 28
98 #define GOTOOBJ_GOTO_ANY 		(sal_uInt16) 31
99 
100 //! values can be combined via logival or
101 #define FLYPROTECT_CONTENT		(sal_uInt16)  1		// kann verodert werden!
102 #define FLYPROTECT_SIZE			(sal_uInt16)  2
103 #define FLYPROTECT_POS			(sal_uInt16)  4
104 #define FLYPROTECT_PARENT 		(sal_uInt16)  8 	// nur Parents untersuchen
105 #define FLYPROTECT_FIXED		(sal_uInt16) 16		// nur nicht aufhebbarer Schutz
106 												// z.B. durch OLE-Server, gilt auch
107 												// fuer Dialog
108 
109 
110 enum ObjCntType		//Fuer das Ermitteln des Cntnts per Positon (D&D)
111 {
112 	OBJCNT_NONE,
113 	OBJCNT_FLY,
114 	OBJCNT_GRF,
115 	OBJCNT_OLE,
116 	OBJCNT_SIMPLE,
117 	OBJCNT_CONTROL,
118 	OBJCNT_URLBUTTON,
119 
120 	OBJCNT_GROUPOBJ,
121 	OBJCNT_DONTCARE		// nicht bestimmbar - unterschiedliche Objecte selektiert
122 };
123 
124 //fuer GetAnyCurRect
125 enum CurRectType
126 {
127 	RECT_PAGE,					//Rect der aktuellen Seite.
128 	RECT_PAGE_CALC,				//... Seite wird ggf. Formatiert
129 	RECT_PAGE_PRT,              //Rect der aktuellen PrtArea der Seite
130 	RECT_FRM,                   //Rect des aktuellen Rahmen
131 	RECT_FLY_EMBEDDED,          //Rect des aktuellen FlyFrm
132 	RECT_FLY_PRT_EMBEDDED,      //Rect der PrtArea des FlyFrm
133 	RECT_SECTION,				//Rect des aktuellen Bereichs
134 	RECT_OUTTABSECTION,			//Rect des aktuellen Bereichs,
135 								// aber ausserhalb der Tabelle
136 	RECT_SECTION_PRT,  			//Rect der aktuellen PrtArea des Bereichs
137 	RECT_OUTTABSECTION_PRT, 	//Rect der aktuellen PrtArea des Bereichs,
138 								// aber ausserhalb der Tabelle
139 	RECT_HEADERFOOTER,     		//Rect des aktuellen Headers/Footer
140     RECT_HEADERFOOTER_PRT,      //Rect der PrtArea des aktuellen Headers/Footers
141 
142     RECT_PAGES_AREA             //Rect covering the pages area
143 };
144 
145 struct SwGetCurColNumPara
146 {
147 	const SwFrmFmt* pFrmFmt;
148 	const SwRect* pPrtRect, *pFrmRect;
SwGetCurColNumParaSwGetCurColNumPara149 	SwGetCurColNumPara() : pFrmFmt( 0 ), pPrtRect( 0 ), pFrmRect( 0 ) {}
150 };
151 
152 #define SW_PASTESDR_INSERT		1
153 #define SW_PASTESDR_REPLACE		2
154 #define SW_PASTESDR_SETATTR		3
155 
156 #define SW_ADD_SELECT   1
157 #define SW_ENTER_GROUP  2
158 #define SW_LEAVE_FRAME  4
159 
160 #define SW_MOVE_UP      0
161 #define SW_MOVE_DOWN    1
162 #define SW_MOVE_LEFT    2
163 #define SW_MOVE_RIGHT   3
164 
165 #define SW_TABCOL_NONE          0
166 #define SW_TABCOL_HORI          1
167 #define SW_TABCOL_VERT          2
168 #define SW_TABROW_HORI          3
169 #define SW_TABROW_VERT          4
170 // --> FME 2004-07-30 #i32329# Enhanced table selection
171 #define SW_TABSEL_HORI          5
172 #define SW_TABSEL_HORI_RTL      6
173 #define SW_TABROWSEL_HORI       7
174 #define SW_TABROWSEL_HORI_RTL   8
175 #define SW_TABCOLSEL_HORI       9
176 #define SW_TABSEL_VERT          10
177 #define SW_TABROWSEL_VERT       11
178 #define SW_TABCOLSEL_VERT       12
179 // <--
180 
181 class SdrDropMarkerOverlay;
182 
183 class SW_DLLPUBLIC SwFEShell : public SwEditShell
184 {
185 	SdrDropMarkerOverlay *pChainFrom, *pChainTo;
186 	sal_Bool bCheckForOLEInCaption;
187 
188 	SW_DLLPRIVATE SwFlyFrm *FindFlyFrm() const;
189     SW_DLLPRIVATE SwFlyFrm *FindFlyFrm( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&  ) const;
190 
191 	//Actions fuer alle Shells beenden und ChangeLink rufen.
192 	SW_DLLPRIVATE void EndAllActionAndCall();
193 
194 	SW_DLLPRIVATE void ScrollTo( const Point &rPt );
195 
196     // OD 25.06.2003 #108784# - correct type of 1st parameter
197     SW_DLLPRIVATE void ChangeOpaque( SdrLayerID nLayerId );
198 
199     // Used for mouse operations on a table:
200     // Returns a cell frame that is 'close' to rPt.
201     SW_DLLPRIVATE const SwFrm *GetBox( const Point &rPt, bool* pbRow = 0, bool* pbCol = 0 ) const;
202 
203 	//0 == in keiner Spalte
204 	SW_DLLPRIVATE sal_uInt16 _GetCurColNum( const SwFrm *pFrm,
205 						  SwGetCurColNumPara* pPara ) const;
206 
207     SW_DLLPRIVATE void _GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const;
208     SW_DLLPRIVATE void _GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const;
209 
210 	SW_DLLPRIVATE sal_Bool ImpEndCreate();
211 
212 	SW_DLLPRIVATE ObjCntType GetObjCntType( const SdrObject& rObj ) const;
213 
214 	// Methoden fuers kopieren von DrawObjecten
215 	SW_DLLPRIVATE sal_Bool CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
216 								const Point& rInsPt, sal_Bool bIsMove,
217 								sal_Bool bSelectInsert );
218 
219     // get list of marked SdrObjects;
220     // helper method for GetSelFrmType, IsSelContainsControl
221     SW_DLLPRIVATE const SdrMarkList* _GetMarkList() const;
222 
223     SW_DLLPRIVATE sal_Bool CheckHeadline( bool bRepeat ) const;
224 
225     using SwEditShell::Copy;
226 
227 public:
228 
229     using SwEditShell::Insert;
230 
231 	TYPEINFO();
232     SwFEShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
233 	SwFEShell( SwEditShell& rShell, Window *pWin );
234 	virtual ~SwFEShell();
235 
236 	// Copy und Paste Methoden fuer das interne Clipboard
237 	sal_Bool Copy( SwDoc* pClpDoc, const String* pNewClpTxt = 0 );
238     sal_Bool Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames = sal_False);
239     //paste some pages into another doc - used in mailmerge
240     sal_Bool PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
241 	// Copy-Methode fuer Drag&Drop
242 	sal_Bool Copy( SwFEShell*, const Point& rSttPt, const Point& rInsPt,
243 				sal_Bool bIsMove = sal_False, sal_Bool bSelectInsert = sal_True );
244 
245 	void SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew = sal_False );
246 
247 	// befindet sich der selektierte Rahmen innerhalb eines anderen?
248 	const SwFrmFmt* IsFlyInFly();
249 
250 //SS fuer DrawObjekte und Rahmen-----------------------------
251 
252 	//Wenn ein Objekt angegeben wurde, so wird genau diese Markiert (anstatt
253 	//ueber die Position zu suchen.
254     sal_Bool SelectObj( const Point& rSelPt, sal_uInt8 nFlag = 0, SdrObject *pObj = 0 );
255 	void DelSelectedObj();
256 
257 	//Selektion nach oben unten bewegen (Z-Order).
258 	//sal_True	== ganz nach oben/unten
259 	//sal_False == einen ueberholen
260 	void SelectionToTop   ( sal_Bool bTop = sal_True );
261 	void SelectionToBottom( sal_Bool bBottom = sal_True );
262 
263 	short GetLayerId() const;	//1 Heaven, 0 Hell, -1 Uneindeutig
264 	void  SelectionToHeaven();	//Ueber dem Dokument
265 	void  SelectionToHell();	//Unter dem Dokument
266 
267 	// folgende zwei Methoden returnen den enum SdrHdlKind, um sich ein
268 	// includen von SVDRAW.HXX zu ersparen als int deklariert.
269     bool IsObjSelectable( const Point& rPt );
270     int IsInsideSelectedObj( const Point& rPt );    //!! returns enum values
271 
272 	// #107513#
273 	// Test if there is a draw object at that position and if it should be selected.
274 	// The 'should' is aimed at Writer text fly frames which may be in front of
275 	// the draw object.
276 	sal_Bool ShouldObjectBeSelected(const Point& rPt);
277 
278     sal_Bool MoveAnchor( sal_uInt16 nDir );
279 
280     // Returns if Upper of frame at current position is section frame
281     // Currently only used by the rules. To be replaced by something more
282     // sophisticated one day.
283     bool IsDirectlyInSection() const;
284 
285 	//Returnwerte siehe oben FrmType.
286 	//pPt: Crsr bzw. DocPos; bStopAtFly: Bei Flys anhalten oder ueber den Anchor weitergehen
287 	// Obgleich (0,sal_True) eine Art Standard ist, sind die Parameter nicht defaultet, damit
288 	// bei jeder Benutzung insbesondere das bStopAtFly bewusst genutzt wird.
289 	sal_uInt16 GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const;
290 	sal_uInt16 GetSelFrmType() const;				//Selektion (Drawing)
291 
292     /** #108784# check whether selected frame contains a control;
293      * companion method to GetSelFrmType, used for preventing
294      * drag&drop of controls into header */
295     bool IsSelContainsControl() const;
296 
297 	ObjCntType GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const;
298 	ObjCntType GetObjCntTypeOfSelection( SdrObject** ppObj = 0 ) const;
299 
300 	//Zum Anpassen der PosAttr bei Ankerwechseln.
301 	SwRect  GetObjRect() const;
302 	//Zum Verschieben von Flys mit der Tastatur
303 	SwRect  GetFlyRect() const;
304     // OD 18.09.2003 #i17567#, #108749#, #110354# - adjustments to allow
305     //          negative vertical positions for fly frames anchored
306     //          to paragraph or to character.
307     // OD 02.10.2003 #i18732# - adjustments for new option 'FollowTextFlow'
308     // OD 12.11.2003 #i22341# - adjustments for new vertical alignment at top of line
309     void CalcBoundRect( SwRect& _orRect,
310                         const RndStdIds _nAnchorId,
311                         const sal_Int16 _eHoriRelOrient = com::sun::star::text::RelOrientation::FRAME,
312                         const sal_Int16 _eVertRelOrient = com::sun::star::text::RelOrientation::FRAME,
313                         const SwPosition* _pToCharCntntPos = NULL,
314                         const bool _bFollowTextFlow = false,
315                         bool _bMirror = false,
316                         Point* _opRef = NULL,
317                         Size* _opPercent = NULL ) const;
318 
319 	// Groesse von Drawobjekten setzen
320 	void SetObjRect( const SwRect& rRect );
321 
322 	long BeginDrag( const Point *pPt, sal_Bool bProp );
323 	long Drag	  ( const Point *pPt, sal_Bool bProp );
324 	long EndDrag  ( const Point *pPt, sal_Bool bProp );
325 	void BreakDrag();
326 
327 	//Methoden fuer die Statuszeile.
328 	Point GetAnchorObjDiff() const;	//Abstand zum Anker
329 	Point GetObjAbsPos()	 const; //Absolute Position
330 	Size  GetObjSize()	     const;	//Groesse, ggf. die umschliessende
331 
332 	//SS fuer die BriefUmschlaege: hole alle Seitengebundenen Objekte
333 	//und setze diese auf eine neue Seite.
334 	void GetPageObjs( SvPtrarr& rFillArr );
335 	void SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset = 1 );
336 
337 	// zeige die aktuelle Selektion an ( ggfs. den Rahmen/DrawObject)
338 	virtual void MakeSelVisible();
339 
340 	// returne das FrmFmt von dem evt. unter dem Point stehenden Object.
341 	// Das Object wird nicht selektiert!
342 	const SwFrmFmt* GetFmtFromObj( const Point& rPt, SwRect** pRectToFill = 0 ) const;
343 	// returns a format too, if the point is over the text of any fly
344 	const SwFrmFmt* GetFmtFromAnyObj( const Point& rPt ) const;
345 
346 	//Welcher Schutz ist am selektierten Objekt gesetzt?
347     //!! returns several flags in sal_uInt8
348 	sal_uInt8 IsSelObjProtected( sal_uInt16 /*FLYPROTECT_...*/ eType ) const;
349 
350 	//Liefert neben der Grafik in rName bei gelinkten Grafiken den Namen mit
351 	//Pfad und sonst den Grafiknamen. rbLink ist TRU bei gelinkten Grafiken.
352 	const Graphic *GetGrfAtPos( const Point &rDocPos,
353 								String &rName, sal_Bool &rbLink ) const;
354 
355     // --> OD 2009-07-13 #i73249#
356     const String GetObjTitle() const;
357     void SetObjTitle( const String& rTitle );
358     const String GetObjDescription() const;
359     void SetObjDescription( const String& rDescription );
360     // <--
361 
362 //SS fuer Rahmen --------------------------------------------
363 
364 	sal_Bool IsFrmSelected() const;
365 	sal_Bool GetFlyFrmAttr( SfxItemSet &rSet ) const;
366 	sal_Bool SetFlyFrmAttr( SfxItemSet &rSet );
367 	sal_Bool ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet = 0 );
368 	const SwFrmFmt *NewFlyFrm( const SfxItemSet &rSet, sal_Bool bAnchValid = sal_False,
369 						 SwFrmFmt *pParent = 0 );
370 	void SetFlyPos( const Point &rAbsPos);
371 	Point FindAnchorPos( const Point &rAbsPos, sal_Bool bMoveIt = sal_False );
372     // determines whether a frame or its environment is vertically formatted and right-to-left
373     // --> OD 2009-08-31 #mongolianlayout#
374     // also determines, if frame or its environmane is in mongolianlayout (vertical left-to-right)
375     // - add output parameter <bVertL2R>
376     sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const;
377 
378 	SwFrmFmt* GetCurFrmFmt() const;	//Wenn Rahmen, dann Rahmenvorlage, sonst 0
379 	void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 );	//Wenn Rahmen, dann Rahmenvorlage setzen
GetCurrFlyFrm() const380 	const SwFlyFrm *GetCurrFlyFrm() const { return FindFlyFrm(); }
381 
382 	// finde/loeschen den Fly, in dem der Cursor steht
383 	SwFrmFmt* WizzardGetFly();
384 
385 	//Selebstaendiges selektieren von Flys
GotoNextFly(sal_uInt16 eType=GOTOOBJ_FLY_ANY)386     sal_Bool GotoNextFly( sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_FLY_ANY )
387                                 { return GotoObj( sal_True, eType ); }
GotoPrevFly(sal_uInt16 eType=GOTOOBJ_FLY_ANY)388     sal_Bool GotoPrevFly( sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_FLY_ANY)
389                                 { return GotoObj( sal_False, eType); }
390 
391 	//iterieren ueber Flys - fuer Basic-Collections
392 	sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL ) const;
393 	const SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL) const;
394 
395 	//Wenn ein fly selectiert ist, zieht er den Crsr in den ersten CntntFrm
396 	const SwFrmFmt* SelFlyGrabCrsr();
397 
398 	//Get FlyFrameFormat; fuer UI Macro Anbindung an Flys
399 	const SwFrmFmt* GetFlyFrmFmt() const;
400 	      SwFrmFmt* GetFlyFrmFmt();
401 
402 	//OLE, Server fordert neue Groesse an, die gewuenschten Werte werden
403 	//als Rahmenattribute eingestellt. Wenn die Werte nicht erlaubt sind,
404 	//so wird von der Formatierung geclippt und eine Scalierung eingestellt.
405 	//siehe CalcAndSetScale().
406 	// The return value is the applied size.
407     Size RequestObjectResize( const SwRect &rRect, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
408 
409     //The layout has been changed, so the active object has to be moved after that
410     virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
411 
412 	//Der Client fuer das OleObject muss bezueglich der Scalierung auf dem
413 	//neuesten Stand gehalten werden. Impl in der WrtShell.
414 	//Wird ein Pointer auf eine Size uebergeben, so ist diese die aktuelle
415 	//Core-Groesse des Objectes. Anderfalls wird die Groesse per GetCurFlyRect()
416 	//besorgt.
417     virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
418 								  const SwRect *pFlyPrtRect = 0,
419                                   const SwRect *pFlyFrmRect = 0,
420                                   const bool bNoTxtFrmPrtAreaChanged = false ) = 0;
421 
422 	//Objekte mit ActivateWhenVisible werden beim Paint Connected.
423 	//gerufen von notxtfrm::Paint, impl in wrtsh
424     virtual void ConnectObj( svt::EmbeddedObjectRef&,
425                              const SwRect &rPrt,
426 							 const SwRect &rFrm ) = 0;
427 
428 	//Sichbaren Bereich auf das Object setzen, wenn es noch nicht sichtbar ist.
429     void MakeObjVisible( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ) const;
430 
431 	// check resize of OLE-Object
IsCheckForOLEInCaption() const432 	sal_Bool IsCheckForOLEInCaption() const 		{ return bCheckForOLEInCaption; }
SetCheckForOLEInCaption(sal_Bool bFlag)433 	void SetCheckForOLEInCaption( sal_Bool bFlag )	{ bCheckForOLEInCaption = bFlag; }
434 
435 	// setze am selektierten FlyFrame einen Namen
436 	void SetFlyName( const String& rName );
437 	const String& GetFlyName() const;
438 
439     // get reference to OLE object (if there is one) for selected FlyFrame
440     const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef() const;
441 
442 	// erezeuge eindeutige Namen fuer Rahmen
443 	String GetUniqueGrfName() const;
444 	String GetUniqueOLEName() const;
445 	String GetUniqueFrameName() const;
446 
447 	// springe zum benannten Rahmen (Grafik/OLE)
448 	sal_Bool GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL,
449 					sal_Bool bSelFrame = sal_True );
450 	// steht an der Position eine Grafik mit einer URL ?
451 	const SwFrmFmt* IsURLGrfAtPos( const Point& rPt, String* pURL = 0,
452 									String *pTargetFrameName = 0,
453 									String *pURLDescription = 0 ) const;
454 
455 	//Fuer das Chain wird immer der durch das Format spezifizierte Fly
456 	//mit dem durch den Point getroffenen verbunden.
457 	//In rRect wird das Rect des Flys geliefert (fuer Highlight desselben)
458 	int Chainable( SwRect &rRect, const SwFrmFmt &rSource, const Point &rPt ) const;
459 	int Chain( SwFrmFmt &rSource, const Point &rPt );
460     int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
461     void Unchain( SwFrmFmt &rFmt );
462 	void HideChainMarker();
463 	void SetChainMarker();
464 
465 	Size GetGraphicDefaultSize() const;
466 
467 //SS fuer DrawObjekte ---------------------
468 
469 	//Temporaer um Bug zu umgehen.
470 	void CheckUnboundObjects();
471 
472 	//Achtung: Uneindeutikeiten bei Mehrfachselektionen.
473 	sal_Bool GetObjAttr( SfxItemSet &rSet ) const;
474 	sal_Bool SetObjAttr( const SfxItemSet &rSet );
475 
476     const SdrObject* GetBestObject( sal_Bool bNext, sal_uInt16 eType = GOTOOBJ_DRAW_ANY, sal_Bool bFlat = sal_True, const ::svx::ISdrObjectFilter* pFilter = NULL );
477     sal_Bool GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_DRAW_ANY);
478 
479 	//Setzen vom DragMode (z.B. Rotate), tut nix bei Rahmenselektion.
480 	void SetDragMode( sal_uInt16 eSdrDragMode );
481 
482 	sal_uInt16 IsObjSelected() const;	//Liefert gleich die Anzahl der Objekte,
483 									//zaehlt aber nicht die Objekte in Gruppen.
484 	sal_Bool IsObjSelected( const SdrObject& rObj ) const;
485 	sal_Bool IsObjSameLevelWithMarked(const SdrObject* pObj) const;
GetMarkList() const486     const SdrMarkList* GetMarkList() const{ return _GetMarkList(); };
487 
488 	void EndTextEdit();				//Loescht ggf. das Objekt.
489 
490 	//Ankertyp des selektierten Objektes, -1 bei Uneindeutigkeit oder
491     //Rahmenselektion; FLY_AT_PAGE bzw. FLY_AT_PARA aus frmatr.hxx sonst.
492 	short GetAnchorId() const;
493 
494 	//Erzeugen von DrawObjekten, beim Begin wird der Objekttyp mitgegeben.
495 	//Beim End kann ein Cmd mitgegeben werden, hier ist ggf.
496 	//SDRCREATE_RESTRAINTEND fuer Ende oder SDRCREATE_NEXTPOINT fuer ein
497 	//Polygon relevant. Nach dem RESTRAINTEND ist das Objekt erzeugt und
498 	//selektiert.
499 	//Mit BreakCreate wird der Vorgang abgebrochen, dann ist kein Objekt
500 	//mehr selektiert.
501     sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos );
502 	sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor, const Point &);
503 	void MoveCreate ( const Point &rPos );
504 	sal_Bool EndCreate	( sal_uInt16 eSdrCreateCmd );
505 	void BreakCreate();
506 	sal_Bool IsDrawCreate() const;
507     void CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, sal_uInt16 nSlotId);
508 
509 	// Funktionen f�r Rubberbox, um Draw-Objekte zu selektieren
510 	sal_Bool BeginMark( const Point &rPos );
511 	void MoveMark ( const Point &rPos );
512 	sal_Bool EndMark  ();
513 	void BreakMark();
514 
515 	//Gruppe erzeugen, aufloesen, nix bei Rahmenselektion.
516 	sal_Bool IsGroupSelected();		//Kann auch eine Mischselektion sein!
517 	void GroupSelection();		//Hinterher ist die Gruppe selektiert.
518 	void UnGroupSelection();	//Die Einzelobjekte sind Selektiert
519 								//Es koennen noch immer Gruppen dabei sein.
520 
521     // OD 27.06.2003 #108784# - change return type.
522     bool IsGroupAllowed() const;
523 
524 	void MirrorSelection( sal_Bool bHorizontal );	//Bei sal_False Vertikal
525 
526 	//frmatr.hxx. Hier kein enum wg. Abhaengigkeiten
527 	//Der sal_Bool ist nur fuer internen Gebrauch! Anker wird nur - anhand der
528 	//aktuellen Dokumentposition - neu gesetzt aber nicht umgesetzt.
529 	void ChgAnchor( int eAnchorId, sal_Bool bSameOnly = sal_False,
530 								   sal_Bool bPosCorr = sal_True );
531 
532     sal_Bool SetDrawingAttr( SfxItemSet &rSet );
533 
534     // hole die selectierten DrawObj als Grafik (MetaFile/Bitmap)
535 	// Return-Wert besagt ob konvertiert wurde!!
536 	sal_Bool GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const;
537 
538 	void Paste( SvStream& rStm, sal_uInt16 nAction, const Point* pPt = 0 );
539 	bool Paste( const Graphic &rGrf, const String& rURL );
540 	sal_Bool Paste( SotDataObject& rObj, const Point& rPt );
541 
542 	sal_Bool IsAlignPossible() const;
543 	void SetCalcFieldValueHdl(Outliner* pOutliner);
544 
545 	void Insert(const String& rGrfName,
546 				const String& rFltName,
547 				const Graphic* pGraphic = 0,
548 				const SfxItemSet* pFlyAttrSet = 0,
549 				const SfxItemSet* pGrfAttrSet = 0,
550 				SwFrmFmt* = 0 );
551 
552     // Insertion of a drawing object which have to be already inserted in the DrawModel
553     void InsertDrawObj( SdrObject& rDrawObj,
554                         const Point& rInsertPosition );
555 
556 	sal_Bool ReplaceSdrObj( const String& rGrfName, const String& rFltName,
557 						const Graphic* pGrf = 0 );
558 
559 	// --> #i972#
560     // for starmath formulas anchored 'as char' it alignes it baseline to baseline
561     // changing the previous vertical orientation
562     void AlignFormulaToBaseline( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, SwFlyFrm * pFly = 0 );
563 
564     // aligns all formulas with anchor 'as char' to baseline
565     void AlignAllFormulasToBaseline();
566     // <--
567 
568 //------------------------------------------
569 
570 	//Auskunft ueber naechstliegenden Inhalt zum uebergebenen Point
571 	Point GetCntntPos( const Point& rPoint, sal_Bool bNext ) const;
572 
573     //convert document position into position relative to the current page
574     Point GetRelativePagePosition(const Point& rDocPos);
575 
576     //Layout-Selektion Hiden/Zeigen und aufruf an die CrsrSh weiterreichen.
577 	void ShLooseFcs();
578 	void ShGetFcs( sal_Bool bUpdate = sal_True );
579 
580 	//PageDescriptor-Schnittstelle
581 	void   ChgCurPageDesc( const SwPageDesc& );
582 	sal_uInt16 GetCurPageDesc( const sal_Bool bCalcFrm = sal_True ) const;
583     sal_uInt16 GetMousePageDesc( const Point &rPt ) const;
584     sal_uInt16 GetPageDescCnt() const;
585 	SwPageDesc* FindPageDescByName( const String& rName,
586 									sal_Bool bGetFromPool = sal_False,
587 									sal_uInt16* pPos = 0 );
588 
589 	const SwPageDesc& GetPageDesc( sal_uInt16 i ) const;
590 	void  ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
591 	// if inside all selection only one PageDesc, return this.
592 	// Otherwise return 0 pointer
593 	const SwPageDesc* GetSelectedPageDescs() const;
594 
595 	const SwRect& GetAnyCurRect( CurRectType eType,
596 								 const Point* pPt = 0,
597                                  const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& =
598                                  ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >() ) const;
599 
600 	//Seitennummer der Seite in der der Point liegt, 0 wenn keine
601 	//getroffen ist.
602 	sal_uInt16 GetPageNumber( const Point &rPoint ) const;
603 	sal_Bool GetPageNumber( long nYPos, sal_Bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay ) const;
604 
605     SwFlyFrmFmt* InsertObject( const svt::EmbeddedObjectRef&,
606 				const SfxItemSet* pFlyAttrSet = 0,
607 				const SfxItemSet* pGrfAttrSet = 0,
608 				SwFrmFmt* = 0 );
609 	sal_Bool 	FinishOLEObj();								// Server wird beendet
610 
611 	//Attribute der Tabelle besorgen/setzen.
612 	void GetTblAttr( SfxItemSet & ) const;
613 	void SetTblAttr( const SfxItemSet & );
614 
615 	//Tabelle vollstaendig selektiert?
616 	sal_Bool HasWholeTabSelection() const;
617 	//Ist der Inhalt einer Tabellenzelle oder mindestens eine Tabellenzelle
618 	//vollstaendig selektiert ist
619 	sal_Bool HasBoxSelection() const;
620 
621 	sal_Bool InsertRow( sal_uInt16 nCnt, sal_Bool bBehind );
622 	sal_Bool InsertCol( sal_uInt16 nCnt, sal_Bool bBehind );  // 0 == am Ende
623 	sal_Bool DeleteCol();
624 	sal_Bool DeleteRow();
625 
626 	sal_Bool DeleteTblSel();		//Aktuelle Selektion, ggf. die ganze Tabelle.
627 
628 	sal_uInt16 MergeTab();			//Merged selektierte Tabellenteile zusammen
629 								//Fehler ueber enum zurueck
630     // Zelle Vertikal oder Horizontal splitten.
631     sal_Bool SplitTab( sal_Bool nVert = sal_True, sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
632 	sal_Bool Sort(const SwSortOptions&);	//Sortieren.
633 
634 	void SetRowHeight( const SwFmtFrmSize &rSz );
635 	//Der Pointer muss vom Aufrufer zerstoert werden wenn != 0
636 	void GetRowHeight( SwFmtFrmSize *&rpSz ) const;
637 
638     void SetRowSplit( const SwFmtRowSplit &rSz );
639     void GetRowSplit( SwFmtRowSplit *&rpSz ) const;
640 
641 	void   SetBoxAlign( sal_uInt16 nOrient );
642 	sal_uInt16 GetBoxAlign() const;			//USHRT_MAX fuer uneindeutig!
643 
644 	//Ausgleichen der Zeilenhoehen. Mit bTstOnly festellen ob mehr als eine
645 	//Zeile markiert ist.
646 	sal_Bool BalanceRowHeight( sal_Bool bTstOnly );
647 
648 	void SetTabBorders( const SfxItemSet& rSet );
649 	void GetTabBorders( 	  SfxItemSet& rSet) const;
650 	void SetTabLineStyle(const Color* pColor, sal_Bool bSetLine = sal_False, const SvxBorderLine* pBorderLine = NULL);
651 
652 	void SetTabBackground( const SvxBrushItem &rNew );
653 	void GetTabBackground( SvxBrushItem &rToFill ) const;
654 
655 	void SetBoxBackground( const SvxBrushItem &rNew );
656 	sal_Bool GetBoxBackground( SvxBrushItem &rToFill ) const; //sal_False uneindeutig
657 
658     void SetBoxDirection( const SvxFrameDirectionItem& rNew );
659     sal_Bool GetBoxDirection( SvxFrameDirectionItem& rToFill ) const; //sal_False uneindeutig
660 
661     void SetRowBackground( const SvxBrushItem &rNew );
662 	sal_Bool GetRowBackground( SvxBrushItem &rToFill ) const; //sal_False uneindeutig
663 
664     sal_uInt8 WhichMouseTabCol( const Point &rPt ) const;
665     void GetTabCols( SwTabCols &rToFill ) const; //Spalten- und Randinfo.
666     void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly = sal_True );
667     void GetMouseTabCols( SwTabCols &rToFill, const Point &rPt ) const;
668 	void SetMouseTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
669                           const Point &rPt );
670 
671     // --> FME 2004-07-30 #i20126# Enhanced table selection
672     // pEnd will be used during MouseMove
673     bool SelTblRowCol( const Point& rPt, const Point* pEnd = 0, bool bRowDrag = false );
674     // <--
675 
676     // #i24134# adjustment of table rows via Ruler
677     void GetTabRows( SwTabCols &rToFill ) const;
678     void SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly );
679     void GetMouseTabRows( SwTabCols &rToFill, const Point &rPt ) const;
680     void SetMouseTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const Point &rPt );
681 
682     void ProtectCells();    //Falls eine Tabselektion besteht, wird sie ver-
683 							// nichtet, wenn der Cursor nicht in Readonly darf
684 	void UnProtectCells();	// auf die Tabellenselektin
685 	void UnProtectTbls();	//bei allen Tabellen in der Selektion den Schutz aufheben
686 	sal_Bool HasTblAnyProtection( const String* pTblName = 0,
687 								sal_Bool* pFullTblProtection = 0 );
688 	sal_Bool CanUnProtectCells() const;
689 
690     sal_uInt16 GetRowsToRepeat() const;
691     void SetRowsToRepeat( sal_uInt16 nNumOfRows );
692     sal_uInt16 GetVirtPageNum( const sal_Bool bCalcFrm = sal_True );
693     //returns the number of table rows currently selected
694     //if the selection start at the top of the table
695     sal_uInt16    GetRowSelectionFromTop() const;
696 
IsInRepeatedHeadline() const697     sal_Bool IsInRepeatedHeadline() const { return CheckHeadline( true ); }
IsInHeadline() const698     sal_Bool IsInHeadline() const { return CheckHeadline( false ); }
699 
700 	//Stellt die Breiten der Zellen so ein, dass der Inhalt moeglichst
701 	//nicht umgebrochen werden muss.
702 	//bBalance sorgt fuer einen Ausgleich der markierten Spalten.
703 	void AdjustCellWidth( sal_Bool bBalance = sal_False );
704 	//Nicht erlaubt, wenn nur  leere Zellen selektiert sind.
705 	sal_Bool IsAdjustCellWidthAllowed( sal_Bool bBalance = sal_False ) const;
706 
707 	//Ausgleich der Zellenbreiten, mit bTstOnly feststellen, ob mehr als
708 	//eine Zelle markiert ist.
709 	sal_Bool BalanceCellWidth( sal_Bool bTstOnly );
710 
711 		// AutoFormat fuer die Tabelle/TabellenSelection
712 	sal_Bool SetTableAutoFmt( const SwTableAutoFmt& rNew );
713 		// Erfrage wie attributiert ist
714 	sal_Bool GetTableAutoFmt( SwTableAutoFmt& rGet );
715 		// aender eine  Zellenbreite/-Hoehe/Spaltenbreite/Zeilenhoehe
716 	sal_Bool SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff = 283 );
717 		// Autosumme
718 	sal_Bool GetAutoSum( String& rFml ) const;
719 
720 	//Phy:	Tatsaechliche Seitenanzahl.
721 	//Virt: Vom User evtl. gesetzten Offset mit einbeziehen.
722 	sal_uInt16	GetPhyPageNum();
723 
724 	// Setzt an der aktuellen Postion einen neuen Page Offset
725 	void SetNewPageOffset( sal_uInt16 nOffset );
726 	void SetPageOffset( sal_uInt16 nOffset );	//Aendert den letzten Page Offset
727 	sal_uInt16 GetPageOffset() const;			//Liefert den letzten Page Offset
728 
729 	//SS fuer Beschriftungen
730     void InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
731                       const String& rNumberSeparator,
732 					  const sal_Bool bBefore, const sal_uInt16 nId,
733                       const String& rCharacterStyle,
734                       const sal_Bool bCpyBrd = sal_True );
735 
736 	//Das Lineal will auch noch etwas von uns wissen.
737 	sal_uInt16 GetCurColNum( SwGetCurColNumPara* pPara = 0 ) const;	//0 == in keiner Spalte
738 	sal_uInt16 GetCurMouseColNum( const Point &rPt,
739 							SwGetCurColNumPara* pPara = 0 ) const;
740 	sal_uInt16 GetCurTabColNum() const;		//0 == in keiner Tabelle
741 	sal_uInt16 GetCurMouseTabColNum( const Point &rPt ) const;
742 	sal_uInt16 GetCurOutColNum( SwGetCurColNumPara* pPara = 0 ) const;	// aktuelle aeussere Spalte
743 
744     sal_Bool IsTableRightToLeft() const;
745     sal_Bool IsMouseTableRightToLeft( const Point &rPt ) const;
746     sal_Bool IsTableVertical() const;
747 
748     sal_Bool IsLastCellInRow() const;
749     // Die Breite des aktuellen Bereichs fuer Spaltendialog
750 	long GetSectionWidth( SwFmt& rFmt ) const;
751 
752     void GetConnectableFrmFmts
753     (SwFrmFmt & rFmt, const String & rReference, sal_Bool bSuccessors,
754      ::std::vector< String > & aPrevPageVec,
755      ::std::vector< String > & aThisPageVec,
756      ::std::vector< String > & aNextPageVec,
757      ::std::vector< String > & aRestVec);
758 
759     /** SwFEShell::GetShapeBackgrd
760 
761         OD 02.09.2002 for #102450#:
762         method determines background color of the page the selected drawing
763         object is on and returns this color.
764         If no color is found, because no drawing object is selected or ...,
765         color COL_BLACK (default color on constructing object of class Color)
766         is returned.
767 
768         @author OD
769 
770         @returns an object of class Color
771     */
772     const Color GetShapeBackgrd() const;
773 
774     /** Is default horizontal text direction for selected drawing object right-to-left
775 
776         OD 09.12.2002 #103045#
777         Because drawing objects only painted for each page only, the default
778         horizontal text direction of a drawing object is given by the corresponding
779         page property.
780 
781         @author OD
782 
783         @returns boolean, indicating, if the horizontal text direction of the
784         page, the selected drawing object is on, is right-to-left.
785     */
786     bool IsShapeDefaultHoriTextDirR2L() const;
787 
788     void ParkCursorInTab();
789 
790     // -> #i23726#
791     SwTxtNode * GetNumRuleNodeAtPos(const Point &rPot);
792     sal_Bool IsNumLabel( const Point &rPt, int nMaxOffset = -1 );
793     // <- #i23726#
794     // --> OD 2005-02-21 #i42921#
795     bool IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
796                                    const Point& _rDocPos ) const;
797     // <--
798 
799 };
800 
801 #endif
802