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