Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FESH_HXX
29 : : #define _FESH_HXX
30 : :
31 : : #include <com/sun/star/text/RelOrientation.hpp>
32 : : #include <com/sun/star/embed/XClassifiedObject.hpp>
33 : : #include <com/sun/star/embed/XEmbeddedObject.hpp>
34 : :
35 : : #include <svx/svdobj.hxx>
36 : : #include "swdllapi.h"
37 : : #include <editsh.hxx>
38 : : #include <flyenum.hxx>
39 : :
40 : : #include <svx/svdtypes.hxx>
41 : :
42 : : #include <svtools/embedhlp.hxx>
43 : :
44 : : #include <vector>
45 : :
46 : : namespace editeng { class SvxBorderLine; }
47 : :
48 : : class SwFlyFrm;
49 : : class SwTabCols;
50 : : class SvxBrushItem;
51 : : class SvxFrameDirectionItem;
52 : : class SwTableAutoFmt;
53 : : class SwFrm;
54 : : class SwFmtFrmSize;
55 : : class SwFmtRowSplit;
56 : : class SdrObject;
57 : : class Color;
58 : : class Outliner;
59 : : class SotDataObject;
60 : : class SwFrmFmt;
61 : : struct SwSortOptions;
62 : : class SdrMarkList;
63 : :
64 : : namespace svx
65 : : {
66 : : class ISdrObjectFilter;
67 : : }
68 : :
69 : :
70 : : // return values for GetFrmType() und GetSelFrmType().
71 : : //! values can be combined via logival or
72 : : #define FRMTYPE_NONE (sal_uInt16) 0
73 : : #define FRMTYPE_PAGE (sal_uInt16) 1
74 : : #define FRMTYPE_HEADER (sal_uInt16) 2
75 : : #define FRMTYPE_FOOTER (sal_uInt16) 4
76 : : #define FRMTYPE_BODY (sal_uInt16) 8
77 : : #define FRMTYPE_COLUMN (sal_uInt16) 16
78 : : #define FRMTYPE_TABLE (sal_uInt16) 32
79 : : #define FRMTYPE_FLY_FREE (sal_uInt16) 64
80 : : #define FRMTYPE_FLY_ATCNT (sal_uInt16) 128
81 : : #define FRMTYPE_FLY_INCNT (sal_uInt16) 256
82 : : #define FRMTYPE_FOOTNOTE (sal_uInt16) 512
83 : : #define FRMTYPE_FTNPAGE (sal_uInt16) 1024
84 : : #define FRMTYPE_FLY_ANY (sal_uInt16) 2048
85 : : #define FRMTYPE_DRAWOBJ (sal_uInt16) 4096
86 : : #define FRMTYPE_COLSECT (sal_uInt16) 8192
87 : : #define FRMTYPE_COLSECTOUTTAB (sal_uInt16) 16384
88 : :
89 : : //! values can be combined via logival or
90 : : #define GOTOOBJ_DRAW_CONTROL (sal_uInt16) 1
91 : : #define GOTOOBJ_DRAW_SIMPLE (sal_uInt16) 2
92 : : #define GOTOOBJ_DRAW_ANY (sal_uInt16) 3
93 : : #define GOTOOBJ_FLY_FRM (sal_uInt16) 4
94 : : #define GOTOOBJ_FLY_GRF (sal_uInt16) 8
95 : : #define GOTOOBJ_FLY_OLE (sal_uInt16) 16
96 : : #define GOTOOBJ_FLY_ANY (sal_uInt16) 28
97 : : #define GOTOOBJ_GOTO_ANY (sal_uInt16) 31
98 : :
99 : : //! values can be combined via logival or
100 : : #define FLYPROTECT_CONTENT (sal_uInt16) 1
101 : : #define FLYPROTECT_SIZE (sal_uInt16) 2
102 : : #define FLYPROTECT_POS (sal_uInt16) 4
103 : : #define FLYPROTECT_PARENT (sal_uInt16) 8 // Check only parents.
104 : : #define FLYPROTECT_FIXED (sal_uInt16) 16 // Only protection that cannot be withdrawn
105 : : // e.g. by OLE-server; also relevant for dialog.
106 : :
107 : : // For figuring out contents by position (D&D)
108 : : enum ObjCntType
109 : : {
110 : : OBJCNT_NONE,
111 : : OBJCNT_FLY,
112 : : OBJCNT_GRF,
113 : : OBJCNT_OLE,
114 : : OBJCNT_SIMPLE,
115 : : OBJCNT_CONTROL,
116 : : OBJCNT_URLBUTTON,
117 : :
118 : : OBJCNT_GROUPOBJ,
119 : : OBJCNT_DONTCARE // Not determinable - different objects are selected.
120 : : };
121 : :
122 : : //For GetAnyCurRect
123 : : enum CurRectType
124 : : {
125 : : RECT_PAGE, // Rect of current page.
126 : : RECT_PAGE_CALC, // ... page will be formated if required.
127 : : RECT_PAGE_PRT, // Rect of current PrtArea of page.
128 : : RECT_FRM, // Rect of current frame.
129 : : RECT_FLY_EMBEDDED, // Rect of current FlyFrm.
130 : : RECT_FLY_PRT_EMBEDDED, // Rect of PrtArea of FlyFrm
131 : : RECT_SECTION, // Rect of current section.
132 : : RECT_OUTTABSECTION, // Rect of current section but outside of table.
133 : : RECT_SECTION_PRT, // Rect of current PrtArea of section.
134 : : RECT_OUTTABSECTION_PRT, // Rect of current PrtArea of section but outside table.
135 : : RECT_HEADERFOOTER, // Rect of current header/footer
136 : : RECT_HEADERFOOTER_PRT, // Rect of PrtArea of current headers/footers
137 : :
138 : : RECT_PAGES_AREA //Rect covering the pages area
139 : : };
140 : :
141 : : struct SwGetCurColNumPara
142 : : {
143 : : const SwFrmFmt* pFrmFmt;
144 : : const SwRect* pPrtRect, *pFrmRect;
145 : 0 : SwGetCurColNumPara() : pFrmFmt( 0 ), pPrtRect( 0 ), pFrmRect( 0 ) {}
146 : : };
147 : :
148 : : #define SW_PASTESDR_INSERT 1
149 : : #define SW_PASTESDR_REPLACE 2
150 : : #define SW_PASTESDR_SETATTR 3
151 : :
152 : : #define SW_ADD_SELECT 1
153 : : #define SW_ENTER_GROUP 2
154 : : #define SW_LEAVE_FRAME 4
155 : :
156 : : #define SW_MOVE_UP 0
157 : : #define SW_MOVE_DOWN 1
158 : : #define SW_MOVE_LEFT 2
159 : : #define SW_MOVE_RIGHT 3
160 : :
161 : : #define SW_TABCOL_NONE 0
162 : : #define SW_TABCOL_HORI 1
163 : : #define SW_TABCOL_VERT 2
164 : : #define SW_TABROW_HORI 3
165 : : #define SW_TABROW_VERT 4
166 : :
167 : : #define SW_TABSEL_HORI 5
168 : : #define SW_TABSEL_HORI_RTL 6
169 : : #define SW_TABROWSEL_HORI 7
170 : : #define SW_TABROWSEL_HORI_RTL 8
171 : : #define SW_TABCOLSEL_HORI 9
172 : : #define SW_TABSEL_VERT 10
173 : : #define SW_TABROWSEL_VERT 11
174 : : #define SW_TABCOLSEL_VERT 12
175 : :
176 : : class SdrDropMarkerOverlay;
177 : :
178 : : class SW_DLLPUBLIC SwFEShell : public SwEditShell
179 : : {
180 : : SdrDropMarkerOverlay *pChainFrom, *pChainTo;
181 : : sal_Bool bCheckForOLEInCaption;
182 : :
183 : : SW_DLLPRIVATE SwFlyFrm *FindFlyFrm() const;
184 : : SW_DLLPRIVATE SwFlyFrm *FindFlyFrm( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ) const;
185 : :
186 : : // Terminate actions for all shells and call ChangeLink.
187 : : SW_DLLPRIVATE void EndAllActionAndCall();
188 : :
189 : : SW_DLLPRIVATE void ScrollTo( const Point &rPt );
190 : :
191 : : SW_DLLPRIVATE void ChangeOpaque( SdrLayerID nLayerId );
192 : :
193 : : // Used for mouse operations on a table:
194 : : // Returns a cell frame that is 'close' to rPt.
195 : : SW_DLLPRIVATE const SwFrm *GetBox( const Point &rPt, bool* pbRow = 0, bool* pbCol = 0 ) const;
196 : :
197 : : // 0 == not in any column.
198 : : SW_DLLPRIVATE sal_uInt16 _GetCurColNum( const SwFrm *pFrm,
199 : : SwGetCurColNumPara* pPara ) const;
200 : :
201 : : SW_DLLPRIVATE void _GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const;
202 : : SW_DLLPRIVATE void _GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const;
203 : :
204 : : SW_DLLPRIVATE sal_Bool ImpEndCreate();
205 : :
206 : : SW_DLLPRIVATE ObjCntType GetObjCntType( const SdrObject& rObj ) const;
207 : :
208 : : // Methods for copying of draw objects.
209 : : SW_DLLPRIVATE sal_Bool CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
210 : : const Point& rInsPt, sal_Bool bIsMove,
211 : : sal_Bool bSelectInsert );
212 : :
213 : : // Get list of marked SdrObjects;
214 : : // helper method for GetSelFrmType, IsSelContainsControl.
215 : : SW_DLLPRIVATE const SdrMarkList* _GetMarkList() const;
216 : :
217 : : SW_DLLPRIVATE sal_Bool CheckHeadline( bool bRepeat ) const;
218 : :
219 : : using SwEditShell::Copy;
220 : :
221 : : public:
222 : :
223 : : using SwEditShell::Insert;
224 : :
225 : : TYPEINFO();
226 : : SwFEShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 );
227 : : SwFEShell( SwEditShell& rShell, Window *pWin );
228 : : virtual ~SwFEShell();
229 : :
230 : : // Copy and Paste methods for internal clipboard.
231 : : sal_Bool Copy( SwDoc* pClpDoc, const String* pNewClpTxt = 0 );
232 : : sal_Bool Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames = sal_False);
233 : :
234 : : //Paste some pages into another doc - used in mailmerge.
235 : : sal_Bool PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
236 : :
237 : : // Copy-Method for Drag&Drop
238 : : sal_Bool Copy( SwFEShell*, const Point& rSttPt, const Point& rInsPt,
239 : : sal_Bool bIsMove = sal_False, sal_Bool bSelectInsert = sal_True );
240 : :
241 : : void SelectFlyFrm( SwFlyFrm& rFrm, sal_Bool bNew = sal_False );
242 : :
243 : : // Is selected frame within another frame?
244 : : const SwFrmFmt* IsFlyInFly();
245 : :
246 : :
247 : : // If an object as been given, exactly this object is selected
248 : : // (instead of searching over position).
249 : : sal_Bool SelectObj( const Point& rSelPt, sal_uInt8 nFlag = 0, SdrObject *pObj = 0 );
250 : : void DelSelectedObj();
251 : :
252 : : // Move selection upwards or downwards (Z-Order).
253 : : // TRUE = to top or bottom.
254 : : // FALSE = run past one other.
255 : : void SelectionToTop ( sal_Bool bTop = sal_True );
256 : : void SelectionToBottom( sal_Bool bBottom = sal_True );
257 : :
258 : : short GetLayerId() const; // 1 Heaven, 0 Hell, -1 Ambiguous.
259 : : void SelectionToHeaven(); // Above document.
260 : : void SelectionToHell(); // Below document.
261 : :
262 : : // The following two methods return enum SdrHdlKind.
263 : : // Declared as int in order to spare including SVDRAW.HXX.
264 : : bool IsObjSelectable( const Point& rPt );
265 : : int IsInsideSelectedObj( const Point& rPt ); //!! returns enum values
266 : :
267 : : // Test if there is a draw object at that position and if it should be selected.
268 : : // The 'should' is aimed at Writer text fly frames which may be in front of
269 : : // the draw object.
270 : : sal_Bool ShouldObjectBeSelected(const Point& rPt);
271 : :
272 : : sal_Bool MoveAnchor( sal_uInt16 nDir );
273 : :
274 : : // Returns if Upper of frame at current position is section frame
275 : : // Currently only used by the rules. To be replaced by something more
276 : : // sophisticated one day.
277 : : bool IsDirectlyInSection() const;
278 : :
279 : : // For return valies see above FrmType.
280 : : // pPt: Cursr or DocPos respectively; bStopAtFly: Stop at flys or continue over anchor.
281 : : // Although (0,TRUE) is kind of a standard, the parameters are not defaulted here
282 : : // in order to force more conscious use especially of bStopAtFly.
283 : : sal_uInt16 GetFrmType( const Point *pPt, sal_Bool bStopAtFly ) const;
284 : : sal_uInt16 GetSelFrmType() const; //Selektion (Drawing)
285 : :
286 : : /** check whether selected frame contains a control;
287 : : * companion method to GetSelFrmType, used for preventing
288 : : * drag&drop of controls into header */
289 : : bool IsSelContainsControl() const;
290 : :
291 : : ObjCntType GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const;
292 : : ObjCntType GetObjCntTypeOfSelection( SdrObject** ppObj = 0 ) const;
293 : :
294 : : // For adjustment of PosAttr when anchor changes.
295 : : SwRect GetObjRect() const;
296 : :
297 : : // For moving flys with keyboard.
298 : : SwRect GetFlyRect() const;
299 : : // i#17567 - adjustments to allow negative vertical positions for fly frames anchored
300 : : // to paragraph or to character.
301 : : // i#18732 - adjustments for new option 'FollowTextFlow'
302 : : // i#22341 - adjustments for new vertical alignment at top of line
303 : : void CalcBoundRect( SwRect& _orRect,
304 : : const RndStdIds _nAnchorId,
305 : : const sal_Int16 _eHoriRelOrient = com::sun::star::text::RelOrientation::FRAME,
306 : : const sal_Int16 _eVertRelOrient = com::sun::star::text::RelOrientation::FRAME,
307 : : const SwPosition* _pToCharCntntPos = NULL,
308 : : const bool _bFollowTextFlow = false,
309 : : bool _bMirror = false,
310 : : Point* _opRef = NULL,
311 : : Size* _opPercent = NULL ) const;
312 : :
313 : : // Set size of draw objects.
314 : : void SetObjRect( const SwRect& rRect );
315 : :
316 : : long BeginDrag( const Point *pPt, sal_Bool bProp );
317 : : long Drag ( const Point *pPt, sal_Bool bProp );
318 : : long EndDrag ( const Point *pPt, sal_Bool bProp );
319 : : void BreakDrag();
320 : :
321 : : //Methods for status line.
322 : : Point GetAnchorObjDiff() const;
323 : : Point GetObjAbsPos() const;
324 : : Size GetObjSize() const;
325 : :
326 : : // SS for envelopes: get all page-bound objects and set them to new page.
327 : : void GetPageObjs( std::vector<SwFrmFmt*>& rFillArr );
328 : : void SetPageObjsNewPage( std::vector<SwFrmFmt*>& rFillArr, int nOffset = 1 );
329 : :
330 : : // Show current selection (frame / draw object as required).
331 : : virtual void MakeSelVisible();
332 : :
333 : : // Return FrmFmt of object that may be under Point.
334 : : // Object does not become selected!
335 : : const SwFrmFmt* GetFmtFromObj( const Point& rPt, SwRect** pRectToFill = 0 ) const;
336 : :
337 : : // Returns a format too, if the point is over the text of any fly.
338 : : const SwFrmFmt* GetFmtFromAnyObj( const Point& rPt ) const;
339 : :
340 : : // Which Protection is set at selected object?
341 : : //!! returns several flags in sal_uInt8
342 : : sal_uInt8 IsSelObjProtected( sal_uInt16 /*FLYPROTECT_...*/ eType ) const;
343 : :
344 : : // Deliver graphic in rName besides graphic name. If graphic is
345 : : // linked give name with path. rbLink is TRUE if graphic is linked.
346 : : const Graphic *GetGrfAtPos( const Point &rDocPos,
347 : : String &rName, sal_Bool &rbLink ) const;
348 : :
349 : : const String GetObjTitle() const;
350 : : void SetObjTitle( const String& rTitle );
351 : : const String GetObjDescription() const;
352 : : void SetObjDescription( const String& rDescription );
353 : :
354 : :
355 : : sal_Bool IsFrmSelected() const;
356 : : sal_Bool GetFlyFrmAttr( SfxItemSet &rSet ) const;
357 : : sal_Bool SetFlyFrmAttr( SfxItemSet &rSet );
358 : : sal_Bool ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet = 0 );
359 : : const SwFrmFmt *NewFlyFrm( const SfxItemSet &rSet, sal_Bool bAnchValid = sal_False,
360 : : SwFrmFmt *pParent = 0 );
361 : : void SetFlyPos( const Point &rAbsPos);
362 : : Point FindAnchorPos( const Point &rAbsPos, sal_Bool bMoveIt = sal_False );
363 : :
364 : : // Determines whether a frame or its environment is vertically formatted and right-to-left.
365 : : // also determines, if frame or its environmane is in mongolianlayout (vertical left-to-right)
366 : : // - add output parameter <bVertL2R>
367 : : sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const;
368 : :
369 : : SwFrmFmt* GetCurFrmFmt() const; //If frame then frame style, else 0.
370 : : void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 ); //If frame then set frame style.
371 : 146 : const SwFlyFrm *GetCurrFlyFrm() const { return FindFlyFrm(); }
372 : :
373 : : // Find/delete fly containing the cursor.
374 : : SwFrmFmt* WizzardGetFly();
375 : :
376 : : // Independent selecting of flys.
377 : 0 : sal_Bool GotoNextFly( sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_FLY_ANY )
378 : 0 : { return GotoObj( sal_True, eType ); }
379 : 0 : sal_Bool GotoPrevFly( sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_FLY_ANY)
380 : 0 : { return GotoObj( sal_False, eType); }
381 : :
382 : : // Iterate over flys - for Basic-collections.
383 : : sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL ) const;
384 : : const SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL) const;
385 : :
386 : : // If a fly is selected, it draws cursor into the first CntntFrm.
387 : : const SwFrmFmt* SelFlyGrabCrsr();
388 : :
389 : : //Get FlyFrameFormat; fuer UI Macro Anbindung an Flys
390 : : const SwFrmFmt* GetFlyFrmFmt() const;
391 : : SwFrmFmt* GetFlyFrmFmt();
392 : :
393 : : // OLE. Server requires new size. Desired values are adjusted as frame attributes.
394 : : // If the values are not allowed, the formating clips and determines scaling.
395 : : // See CalcAndSetScale().
396 : : // The return value is the applied size.
397 : : Size RequestObjectResize( const SwRect &rRect, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
398 : :
399 : : //The layout has been changed, so the active object has to be moved after that
400 : : virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
401 : :
402 : : // Client for OleObject has to be up-to-date regarding scaling.
403 : : // Implemented in WrtShell.
404 : : // If a pointer is passed on a size, this is the object's current core-size.
405 : : // Else the size is provided via GetCurFlyRect().
406 : : virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
407 : : const SwRect *pFlyPrtRect = 0,
408 : : const SwRect *pFlyFrmRect = 0,
409 : : const bool bNoTxtFrmPrtAreaChanged = false ) = 0;
410 : :
411 : : // Connect objects with ActivateWhenVisible at Paint.
412 : : // Called by notxtfrm::Paint, implemented in wrtsh.
413 : : virtual void ConnectObj( svt::EmbeddedObjectRef&,
414 : : const SwRect &rPrt,
415 : : const SwRect &rFrm ) = 0;
416 : :
417 : : // Set visible range on object, if it is not yet visible.
418 : : void MakeObjVisible( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ) const;
419 : :
420 : : // Check resize of OLE-Object.
421 : 2 : sal_Bool IsCheckForOLEInCaption() const { return bCheckForOLEInCaption; }
422 : 0 : void SetCheckForOLEInCaption( sal_Bool bFlag ) { bCheckForOLEInCaption = bFlag; }
423 : :
424 : : // Set name at selected FlyFrame.
425 : : void SetFlyName( const String& rName );
426 : : const String& GetFlyName() const;
427 : :
428 : : // get reference to OLE object (if there is one) for selected FlyFrame
429 : : const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef() const;
430 : :
431 : : // Created unique name for frame.
432 : : String GetUniqueGrfName() const;
433 : : String GetUniqueOLEName() const;
434 : : String GetUniqueFrameName() const;
435 : :
436 : : // Jump to named Fly (graphic/OLE).
437 : : sal_Bool GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL,
438 : : sal_Bool bSelFrame = sal_True );
439 : :
440 : : // Position is a graphic with URL?
441 : : const SwFrmFmt* IsURLGrfAtPos( const Point& rPt, String* pURL = 0,
442 : : String *pTargetFrameName = 0,
443 : : String *pURLDescription = 0 ) const;
444 : :
445 : : // For Chain always connect Fly specified by format with that hit by point.
446 : : // rRect contains rect of Fly (for its highlight).
447 : : int Chainable( SwRect &rRect, const SwFrmFmt &rSource, const Point &rPt ) const;
448 : : int Chain( SwFrmFmt &rSource, const Point &rPt );
449 : : int Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest );
450 : : void Unchain( SwFrmFmt &rFmt );
451 : : void HideChainMarker();
452 : : void SetChainMarker();
453 : :
454 : : Size GetGraphicDefaultSize() const;
455 : :
456 : : // Temporary work around for bug.
457 : : void CheckUnboundObjects();
458 : :
459 : : // Attention: Ambiguities if multiple selections.
460 : : sal_Bool GetObjAttr( SfxItemSet &rSet ) const;
461 : : sal_Bool SetObjAttr( const SfxItemSet &rSet );
462 : :
463 : : const SdrObject* GetBestObject( sal_Bool bNext, sal_uInt16 eType = GOTOOBJ_DRAW_ANY, sal_Bool bFlat = sal_True, const ::svx::ISdrObjectFilter* pFilter = NULL );
464 : : sal_Bool GotoObj( sal_Bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType = GOTOOBJ_DRAW_ANY);
465 : :
466 : : // Set DragMode (e.g. Rotae), but do nothing when frame is selected.
467 : : void SetDragMode( sal_uInt16 eSdrDragMode );
468 : :
469 : : sal_uInt16 IsObjSelected() const; // Returns object count, but doesn't count the objects in groups.
470 : : sal_Bool IsObjSelected( const SdrObject& rObj ) const;
471 : :
472 : : void EndTextEdit(); // Deletes object if required.
473 : :
474 : : // Anchor type of selected object, -1 if ambiguous or in case of frame selection.
475 : : // Else FLY_AT_PAGE or FLY_AT_PARA resp. from frmatr.hxx.
476 : : short GetAnchorId() const;
477 : :
478 : : // Process of creating draw objects. At the beginning object type is passed.
479 : : // At the end a Cmd can be passed. Here, SDRCREATE_RESTRAINTEND for end
480 : : // or SDRCREATE_NEXTPOINT for a polygon may be relevant.
481 : : // After RESTRAINTEND the object is created and selected.
482 : : // BreakCreate interrupts the process. In this case no object is selected.
483 : : sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos );
484 : : sal_Bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor, const Point &);
485 : : void MoveCreate ( const Point &rPos );
486 : : sal_Bool EndCreate ( sal_uInt16 eSdrCreateCmd );
487 : : void BreakCreate();
488 : : sal_Bool IsDrawCreate() const;
489 : : void CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, sal_uInt16 nSlotId);
490 : :
491 : : // Functions for Rubberbox, ti select Draw-Objects
492 : : sal_Bool BeginMark( const Point &rPos );
493 : : void MoveMark ( const Point &rPos );
494 : : sal_Bool EndMark ();
495 : : void BreakMark();
496 : :
497 : : // Create and destroy group, don't when frame is selected.
498 : : sal_Bool IsGroupSelected(); // Can be a mixed selection!
499 : : void GroupSelection(); // Afterwards the group is selected.
500 : : void UnGroupSelection(); // The individual objects are selected, but
501 : : // it is possible that there are groups included.
502 : :
503 : : bool IsGroupAllowed() const;
504 : :
505 : : void MirrorSelection( sal_Bool bHorizontal ); //Vertical if FALSE.
506 : :
507 : : // frmatr.hxx. Here no enum because of dependencies.
508 : : // bool value only for internal use! Anchor is newly set according
509 : : // to current document position. Anchor is not re-set.
510 : : void ChgAnchor( int eAnchorId, sal_Bool bSameOnly = sal_False,
511 : : sal_Bool bPosCorr = sal_True );
512 : :
513 : : sal_Bool SetDrawingAttr( SfxItemSet &rSet );
514 : :
515 : : // Get selected DrawObj as graphics (MetaFile/Bitmap).
516 : : // Return value indicates if it was converted.
517 : : sal_Bool GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const;
518 : :
519 : : void Paste( SvStream& rStm, sal_uInt16 nAction, const Point* pPt = 0 );
520 : : sal_Bool Paste( const Graphic &rGrf );
521 : : sal_Bool Paste( SotDataObject& rObj, const Point& rPt );
522 : :
523 : : sal_Bool IsAlignPossible() const;
524 : : void SetCalcFieldValueHdl(Outliner* pOutliner);
525 : :
526 : : void Insert(const String& rGrfName,
527 : : const String& rFltName,
528 : : const Graphic* pGraphic = 0,
529 : : const SfxItemSet* pFlyAttrSet = 0,
530 : : const SfxItemSet* pGrfAttrSet = 0,
531 : : SwFrmFmt* = 0 );
532 : :
533 : : // Insertion of a drawing object which have to be already inserted in the DrawModel.
534 : : void InsertDrawObj( SdrObject& rDrawObj,
535 : : const Point& rInsertPosition );
536 : :
537 : : sal_Bool ReplaceSdrObj( const String& rGrfName, const String& rFltName,
538 : : const Graphic* pGrf = 0 );
539 : :
540 : : // --> #i972#
541 : : // for starmath formulas anchored 'as char' it alignes it baseline to baseline
542 : : // changing the previous vertical orientation
543 : : void AlignFormulaToBaseline( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, SwFlyFrm * pFly = 0 );
544 : :
545 : : // aligns all formulas with anchor 'as char' to baseline
546 : : void AlignAllFormulasToBaseline();
547 : :
548 : :
549 : :
550 : : // Provide information about content situated closes to given Point.
551 : : Point GetCntntPos( const Point& rPoint, sal_Bool bNext ) const;
552 : :
553 : : // Convert document position into position relative to the current page.
554 : : Point GetRelativePagePosition(const Point& rDocPos);
555 : :
556 : : // Hide or show layout-selection and pass call to CrsrSh.
557 : : void ShLooseFcs();
558 : : void ShGetFcs( sal_Bool bUpdate = sal_True );
559 : :
560 : : // PageDescriptor-interface
561 : : void ChgCurPageDesc( const SwPageDesc& );
562 : : sal_uInt16 GetCurPageDesc( const sal_Bool bCalcFrm = sal_True ) const;
563 : : sal_uInt16 GetMousePageDesc( const Point &rPt ) const;
564 : : sal_uInt16 GetPageDescCnt() const;
565 : : SwPageDesc* FindPageDescByName( const String& rName,
566 : : sal_Bool bGetFromPool = sal_False,
567 : : sal_uInt16* pPos = 0 );
568 : :
569 : : const SwPageDesc& GetPageDesc( sal_uInt16 i ) const;
570 : : void ChgPageDesc( sal_uInt16 i, const SwPageDesc& );
571 : : // if inside all selection only one PageDesc, return this.
572 : : // Otherwise return 0 pointer
573 : : const SwPageDesc* GetSelectedPageDescs() const;
574 : :
575 : : const SwRect& GetAnyCurRect( CurRectType eType,
576 : : const Point* pPt = 0,
577 : : const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& =
578 : : ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >() ) const;
579 : :
580 : :
581 : : // Page number of the page containing Point, O if no page.
582 : : sal_uInt16 GetPageNumber( const Point &rPoint ) const;
583 : : sal_Bool GetPageNumber( long nYPos, sal_Bool bAtCrsrPos, sal_uInt16& rPhyNum, sal_uInt16& rVirtNum, String &rDisplay ) const;
584 : :
585 : : SwFlyFrmFmt* InsertObject( const svt::EmbeddedObjectRef&,
586 : : const SfxItemSet* pFlyAttrSet = 0,
587 : : const SfxItemSet* pGrfAttrSet = 0,
588 : : SwFrmFmt* = 0 );
589 : : sal_Bool FinishOLEObj(); //Shutdown server.
590 : :
591 : : void GetTblAttr( SfxItemSet & ) const;
592 : : void SetTblAttr( const SfxItemSet & );
593 : :
594 : : sal_Bool HasWholeTabSelection() const;
595 : :
596 : : // Is content of a table cell or at least a table cell completely selected?
597 : : sal_Bool HasBoxSelection() const;
598 : :
599 : : sal_Bool InsertRow( sal_uInt16 nCnt, sal_Bool bBehind );
600 : : sal_Bool InsertCol( sal_uInt16 nCnt, sal_Bool bBehind ); // 0 == at the end.
601 : : sal_Bool DeleteCol();
602 : : sal_Bool DeleteRow();
603 : :
604 : : sal_Bool DeleteTblSel(); // Current selection, may be whole table.
605 : :
606 : : sal_uInt16 MergeTab(); // Merge selected parts of table.
607 : : // Return error via enum.
608 : :
609 : : // Split cell vertically or horizontally.
610 : : sal_Bool SplitTab( sal_Bool nVert = sal_True, sal_uInt16 nCnt = 1, sal_Bool bSameHeight = sal_False );
611 : : sal_Bool Sort(const SwSortOptions&); //Sortieren.
612 : :
613 : : void SetRowHeight( const SwFmtFrmSize &rSz );
614 : :
615 : : // Pointer must be detroyed by caller != 0.
616 : : void GetRowHeight( SwFmtFrmSize *&rpSz ) const;
617 : :
618 : : void SetRowSplit( const SwFmtRowSplit &rSz );
619 : : void GetRowSplit( SwFmtRowSplit *&rpSz ) const;
620 : :
621 : : void SetBoxAlign( sal_uInt16 nOrient );
622 : : sal_uInt16 GetBoxAlign() const; // USHRT_MAX if ambiguous.
623 : :
624 : : // Adjustment of Rowheights. Determine via bTstOnly if more than one row is selected.
625 : : sal_Bool BalanceRowHeight( sal_Bool bTstOnly );
626 : :
627 : : void SetTabBorders( const SfxItemSet& rSet );
628 : : void GetTabBorders( SfxItemSet& rSet) const;
629 : : void SetTabLineStyle(const Color* pColor, sal_Bool bSetLine = sal_False, const editeng::SvxBorderLine* pBorderLine = NULL);
630 : :
631 : : void SetTabBackground( const SvxBrushItem &rNew );
632 : : void GetTabBackground( SvxBrushItem &rToFill ) const;
633 : :
634 : : void SetBoxBackground( const SvxBrushItem &rNew );
635 : : sal_Bool GetBoxBackground( SvxBrushItem &rToFill ) const; //FALSE ambiguous.
636 : :
637 : : void SetBoxDirection( const SvxFrameDirectionItem& rNew );
638 : : sal_Bool GetBoxDirection( SvxFrameDirectionItem& rToFill ) const; //FALSE ambiguous.
639 : :
640 : : void SetRowBackground( const SvxBrushItem &rNew );
641 : : sal_Bool GetRowBackground( SvxBrushItem &rToFill ) const; //FALSE ambiguous.
642 : :
643 : : sal_uInt8 WhichMouseTabCol( const Point &rPt ) const;
644 : : void GetTabCols( SwTabCols &rToFill ) const; // Info about columns and margins.
645 : : void SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly = sal_True );
646 : : void GetMouseTabCols( SwTabCols &rToFill, const Point &rPt ) const;
647 : : void SetMouseTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly,
648 : : const Point &rPt );
649 : :
650 : : // pEnd will be used during MouseMove
651 : : bool SelTblRowCol( const Point& rPt, const Point* pEnd = 0, bool bRowDrag = false );
652 : :
653 : : void GetTabRows( SwTabCols &rToFill ) const;
654 : : void SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly );
655 : : void GetMouseTabRows( SwTabCols &rToFill, const Point &rPt ) const;
656 : : void SetMouseTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const Point &rPt );
657 : :
658 : : void ProtectCells(); // If a table selection exists it is destroyed in case
659 : : // cursor is not allowed in readonly.
660 : : void UnProtectCells(); // Refers to table selection.
661 : : void UnProtectTbls(); // Unprotect all tables in selection.
662 : : sal_Bool HasTblAnyProtection( const String* pTblName = 0,
663 : : sal_Bool* pFullTblProtection = 0 );
664 : : sal_Bool CanUnProtectCells() const;
665 : :
666 : : sal_uInt16 GetRowsToRepeat() const;
667 : : void SetRowsToRepeat( sal_uInt16 nNumOfRows );
668 : : sal_uInt16 GetVirtPageNum( const sal_Bool bCalcFrm = sal_True );
669 : :
670 : : //Returns the number of table rows currently selected
671 : : //if the selection start at the top of the table.
672 : : sal_uInt16 GetRowSelectionFromTop() const;
673 : :
674 : 9 : sal_Bool IsInRepeatedHeadline() const { return CheckHeadline( true ); }
675 : 0 : sal_Bool IsInHeadline() const { return CheckHeadline( false ); }
676 : :
677 : : // Adjusts cell widths in such a way, that their content
678 : : // does not need to be wrapped (if possible).
679 : : // bBalance provides for adjustment of selected columns.
680 : : void AdjustCellWidth( sal_Bool bBalance = sal_False );
681 : :
682 : : // Not allowed if only empty cells are selected.
683 : : sal_Bool IsAdjustCellWidthAllowed( sal_Bool bBalance = sal_False ) const;
684 : :
685 : : // Adjustment of cell-widths; determine via bTstOnly if more than one cell is selected.
686 : : sal_Bool BalanceCellWidth( sal_Bool bTstOnly );
687 : :
688 : : // AutoFormat for table/ table selection.
689 : : sal_Bool SetTableAutoFmt( const SwTableAutoFmt& rNew );
690 : :
691 : : sal_Bool GetTableAutoFmt( SwTableAutoFmt& rGet );
692 : :
693 : : sal_Bool SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff = 283 );
694 : :
695 : : sal_Bool GetAutoSum( String& rFml ) const;
696 : :
697 : : // Phy: real page count.
698 : : // Virt: consider offset that may have been set by user.
699 : : sal_uInt16 GetPhyPageNum();
700 : :
701 : : void SetNewPageOffset( sal_uInt16 nOffset );
702 : : void SetPageOffset( sal_uInt16 nOffset ); //Changes last page offset.
703 : : sal_uInt16 GetPageOffset() const; //Returns last page offset.
704 : :
705 : : void InsertLabel( const SwLabelType eType, const String &rTxt, const String& rSeparator,
706 : : const String& rNumberSeparator,
707 : : const sal_Bool bBefore, const sal_uInt16 nId,
708 : : const String& rCharacterStyle,
709 : : const sal_Bool bCpyBrd = sal_True );
710 : :
711 : : // The ruler needs some information too.
712 : : sal_uInt16 GetCurColNum( SwGetCurColNumPara* pPara = 0 ) const; //0 == not in any column.
713 : : sal_uInt16 GetCurMouseColNum( const Point &rPt,
714 : : SwGetCurColNumPara* pPara = 0 ) const;
715 : : sal_uInt16 GetCurTabColNum() const; //0 == not in any table.
716 : : sal_uInt16 GetCurMouseTabColNum( const Point &rPt ) const;
717 : : sal_uInt16 GetCurOutColNum( SwGetCurColNumPara* pPara = 0 ) const; // Current outer column.
718 : :
719 : : sal_Bool IsTableRightToLeft() const;
720 : : sal_Bool IsMouseTableRightToLeft( const Point &rPt ) const;
721 : : sal_Bool IsTableVertical() const;
722 : :
723 : : sal_Bool IsLastCellInRow() const;
724 : :
725 : : // Width of current range for column-dialog.
726 : : long GetSectionWidth( SwFmt& rFmt ) const;
727 : :
728 : : void GetConnectableFrmFmts
729 : : (SwFrmFmt & rFmt, const String & rReference, sal_Bool bSuccessors,
730 : : ::std::vector< String > & aPrevPageVec,
731 : : ::std::vector< String > & aThisPageVec,
732 : : ::std::vector< String > & aNextPageVec,
733 : : ::std::vector< String > & aRestVec);
734 : :
735 : : /** SwFEShell::GetShapeBackgrd
736 : :
737 : : method determines background color of the page the selected drawing
738 : : object is on and returns this color.
739 : : If no color is found, because no drawing object is selected or ...,
740 : : color COL_BLACK (default color on constructing object of class Color)
741 : : is returned.
742 : :
743 : : @author OD
744 : :
745 : : @returns an object of class Color
746 : : */
747 : : const Color GetShapeBackgrd() const;
748 : :
749 : : /** Is default horizontal text direction for selected drawing object right-to-left
750 : :
751 : : Because drawing objects only painted for each page only, the default
752 : : horizontal text direction of a drawing object is given by the corresponding
753 : : page property.
754 : :
755 : : @author OD
756 : :
757 : : @returns boolean, indicating, if the horizontal text direction of the
758 : : page, the selected drawing object is on, is right-to-left.
759 : : */
760 : : bool IsShapeDefaultHoriTextDirR2L() const;
761 : :
762 : : void ParkCursorInTab();
763 : :
764 : : SwTxtNode * GetNumRuleNodeAtPos(const Point &rPot);
765 : : sal_Bool IsNumLabel( const Point &rPt, int nMaxOffset = -1 );
766 : :
767 : : bool IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
768 : : const Point& _rDocPos ) const;
769 : :
770 : : virtual void ToggleHeaderFooterEdit( );
771 : : };
772 : :
773 : : #endif
774 : :
775 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|