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 _SWVIEW_HXX
29 : : #define _SWVIEW_HXX
30 : :
31 : : #include <vcl/timer.hxx>
32 : : #include <vcl/field.hxx>
33 : : #include <vcl/floatwin.hxx>
34 : : #include <svtools/htmlcfg.hxx>
35 : : #include <sfx2/viewfac.hxx>
36 : : #include <sfx2/viewsh.hxx>
37 : : #include <sfx2/objsh.hxx>
38 : : #include <editeng/svxenum.hxx>
39 : : #include <sfx2/zoomitem.hxx>
40 : : #include <svx/svxids.hrc>
41 : : #include <editeng/editstat.hxx>
42 : : #include "swdllapi.h"
43 : : #include <swtypes.hxx>
44 : : #include <shellid.hxx>
45 : : #include <IMark.hxx>
46 : :
47 : : class Button;
48 : : class ImageButton;
49 : : class SwTxtFmtColl;
50 : : class SwPageDesc;
51 : : class SwFrmFmt;
52 : : class SwCharFmt;
53 : : class SwNumRule;
54 : : class SwGlossaryHdl;
55 : : class SwDrawBase;
56 : : class SvxRuler;
57 : : class SvxLRSpaceItem;
58 : : class SwDocShell;
59 : : class SwScrollbar;
60 : : class SvBorder;
61 : : class Ruler;
62 : : class SvxSearchItem;
63 : : class SearchAttrItemList;
64 : : class SvxSearchDialog;
65 : : class SdrView;
66 : : class Dialog;
67 : : class SdrObject;
68 : : class SdrPageView;
69 : : class SwNaviImageButton;
70 : : class SwHlpImageButton;
71 : : class SwView;
72 : : class SwEditWin;
73 : : class SwWrtShell;
74 : : class SwView_Impl;
75 : : struct SwSearchOptions;
76 : : class FmFormShell;
77 : : class CommandEvent;
78 : : class InsCaptionOpt;
79 : : class SvGlobalName;
80 : : class SvtAccessibilityOptions;
81 : : class SwTransferable;
82 : : class SwMailMergeConfigItem;
83 : : class SwTxtNode; // #i23726#
84 : : class SwFormatClipboard;
85 : : struct SwConversionArgs;
86 : : class Graphic;
87 : : class GraphicFilter;
88 : : class SwPostItMgr;
89 : :
90 : : namespace com{ namespace sun { namespace star {
91 : : namespace view{ class XSelectionSupplier; }
92 : : }}}
93 : : namespace sfx2 { class FileDialogHelper; }
94 : :
95 : : const long nLeftOfst = -370;
96 : : const long nScrollX = 30;
97 : : const long nScrollY = 30;
98 : :
99 : : #define MINZOOM 20
100 : : #define MAXZOOM 600
101 : :
102 : : #define MAX_MARKS 5
103 : :
104 : : #define CHILDWIN_LABEL 1
105 : : #define CHILDWIN_MAILMERGE 2
106 : :
107 : : enum ShellModes
108 : : {
109 : : SHELL_MODE_TEXT,
110 : : SHELL_MODE_FRAME,
111 : : SHELL_MODE_GRAPHIC,
112 : : SHELL_MODE_OBJECT,
113 : : SHELL_MODE_DRAW,
114 : : SHELL_MODE_DRAW_CTRL,
115 : : SHELL_MODE_DRAW_FORM,
116 : : SHELL_MODE_DRAWTEXT,
117 : : SHELL_MODE_BEZIER,
118 : : SHELL_MODE_LIST_TEXT,
119 : : SHELL_MODE_TABLE_TEXT,
120 : : SHELL_MODE_TABLE_LIST_TEXT,
121 : : SHELL_MODE_MEDIA,
122 : : SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
123 : : SHELL_MODE_FONTWORK,
124 : : SHELL_MODE_POSTIT,
125 : : SHELL_MODE_NAVIGATION
126 : : };
127 : :
128 : : /*--------------------------------------------------------------------
129 : : Description: apply a template
130 : : --------------------------------------------------------------------*/
131 : : struct SwApplyTemplate
132 : : {
133 : : union
134 : : {
135 : : SwTxtFmtColl* pTxtColl;
136 : : SwPageDesc* pPageDesc;
137 : : SwFrmFmt* pFrmFmt;
138 : : SwCharFmt* pCharFmt;
139 : : SwNumRule* pNumRule;
140 : : } aColl;
141 : :
142 : : int eType;
143 : : sal_uInt16 nColor;
144 : : SwFormatClipboard* pFormatClipboard;
145 : : sal_Bool bUndo;
146 : :
147 : 0 : SwApplyTemplate() :
148 : : eType(0),
149 : : nColor(0),
150 : : pFormatClipboard(0),
151 : 0 : bUndo(sal_False)
152 : : {
153 : 0 : aColl.pTxtColl = 0;
154 : 0 : }
155 : : };
156 : :
157 : : /*--------------------------------------------------------------------
158 : : Description: view of a document
159 : : --------------------------------------------------------------------*/
160 : : class SW_DLLPUBLIC SwView: public SfxViewShell
161 : : {
162 : : // exhibition hack (MA,MBA)
163 : : friend void lcl_SelectShellForDrop( SwView &rView );
164 : :
165 : : friend class SwHHCWrapper;
166 : : friend class SwHyphWrapper;
167 : : friend class SwView_Impl;
168 : : friend class SwClipboardChangeListener;
169 : :
170 : : // search & replace
171 : : static SvxSearchDialog *pSrchDlg;
172 : : static SvxSearchItem *pSrchItem;
173 : :
174 : : static sal_uInt16 nInsertCtrlState;
175 : : static sal_uInt16 nWebInsertCtrlState;
176 : : static sal_uInt16 nInsertObjectCtrlState;
177 : : static sal_uInt16 nInsertFieldCtrlState;
178 : : static sal_uInt16 nMoveType; // for buttons below the scrollbar (viewmdi)
179 : : static sal_Int32 nActMark; // current jump mark for unknown mark
180 : :
181 : : static sal_Bool bExtra;
182 : : static sal_Bool bFound;
183 : : static sal_Bool bJustOpened;
184 : :
185 : : static SearchAttrItemList* pSrchList;
186 : : static SearchAttrItemList* pReplList;
187 : :
188 : :
189 : : SvxHtmlOptions aHTMLOpt;
190 : : Timer aTimer; // for delayed ChgLnks during an action
191 : : String aPageStr; // status view, current page
192 : : String sSwViewData,
193 : : //and the new cursor position if the user double click in the PagePreView
194 : : sNewCrsrPos;
195 : : // to support keyboard the number of the page to go to can be set too
196 : : sal_uInt16 nNewPage;
197 : :
198 : : Point aTabColFromDocPos; // moving table colmns out of the document
199 : : SwTxtNode * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
200 : :
201 : : Size aDocSz; // current document size
202 : : Rectangle aVisArea; // visible region
203 : :
204 : : SwEditWin *pEditWin;
205 : : SwWrtShell *pWrtShell;
206 : :
207 : : SfxShell *pShell; // current SubShell at the dispatcher
208 : : FmFormShell *pFormShell; // DB-FormShell
209 : :
210 : : SwView_Impl *pViewImpl; // Impl-data for UNO + Basic
211 : :
212 : :
213 : : SwScrollbar *pHScrollbar, // MDI control elements
214 : : *pVScrollbar;
215 : :
216 : : Window *pScrollFill; // dummy window for filling the lower right edge
217 : : // when both scrollbars are active
218 : :
219 : : SvxRuler *pHRuler,
220 : : *pVRuler;
221 : : ImageButton *pTogglePageBtn;
222 : :
223 : : SwHlpImageButton *pPageUpBtn,
224 : : *pPageDownBtn;
225 : :
226 : : SwNaviImageButton *pNaviBtn;
227 : : SwGlossaryHdl *pGlosHdl; // handle text block
228 : : SwDrawBase *pDrawActual;
229 : :
230 : : const SwFrmFmt *pLastTableFormat;
231 : :
232 : : SwFormatClipboard *pFormatClipboard; //holds data for format paintbrush
233 : :
234 : : SwPostItMgr *mpPostItMgr;
235 : :
236 : : int nSelectionType;
237 : : FloatingWindow *mpFieldPopup;
238 : :
239 : : static const int MASTERENUMCOMMANDS = 6;
240 : :
241 : : String aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
242 : :
243 : : sal_uInt16 nPageCnt;
244 : :
245 : : // current draw mode
246 : : sal_uInt16 nDrawSfxId;
247 : : String sDrawCustom; //some drawing types are marked with strings!
248 : : sal_uInt16 nFormSfxId;
249 : : sal_uInt16 nLastPasteDestination;
250 : :
251 : : // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
252 : : sal_uInt16 nLeftBorderDistance;
253 : : sal_uInt16 nRightBorderDistance;
254 : :
255 : : sal_Bool bCenterCrsr : 1,
256 : : bTopCrsr : 1,
257 : : bAllwaysShowSel : 1,
258 : : bTabColFromDoc : 1,
259 : : bNumIndentFromDoc : 1, // #i23726#
260 : : bTabRowFromDoc : 1,
261 : : bSetTabColFromDoc : 1 ,
262 : : bSetTabRowFromDoc : 1,
263 : : bAttrChgNotified : 1,
264 : : bAttrChgNotifiedWithRegistrations : 1,
265 : : bVerbsActive : 1,
266 : : bDrawRotate : 1,
267 : : bDrawSelMode : 1,
268 : : bShowAtResize : 1,
269 : : bInOuterResizePixel : 1,
270 : : bInInnerResizePixel : 1,
271 : : bPasteState : 1,
272 : : bPasteSpecialState : 1,
273 : : bInMailMerge : 1,
274 : : bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
275 : : bOldShellWasPagePreView : 1,
276 : : bIsPreviewDoubleClick : 1, // #i114045#
277 : : bMakeSelectionVisible : 1; // transport the bookmark selection
278 : :
279 : : // methods for searching
280 : : // set search context
281 : : SW_DLLPRIVATE sal_Bool SearchAndWrap(sal_Bool bApi = sal_False);
282 : : SW_DLLPRIVATE sal_Bool SearchAll(sal_uInt16* pFound = 0);
283 : : SW_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
284 : : SW_DLLPRIVATE void Replace();
285 : :
286 : : sal_Bool IsDocumentBorder();
287 : :
288 : : SW_DLLPRIVATE sal_Bool IsTextTool() const;
289 : :
290 : : // create control elements
291 : : SW_DLLPRIVATE void CreateBtns();
292 : : SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
293 : :
294 : : SW_DLLPRIVATE DECL_LINK( TimeoutHdl, void* );
295 : : SW_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
296 : :
297 : : SW_DLLPRIVATE DECL_LINK( FieldPopupModeEndHdl, void* );
298 : :
299 : : inline long GetXScroll() const;
300 : : inline long GetYScroll() const;
301 : : SW_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
302 : : SW_DLLPRIVATE void CalcPt( Point* pPt,const Rectangle& rRect,
303 : : sal_uInt16 nRangeX = USHRT_MAX,
304 : : sal_uInt16 nRangeY = USHRT_MAX);
305 : :
306 : : SW_DLLPRIVATE sal_Bool GetPageScrollUpOffset(SwTwips& rOff) const;
307 : : SW_DLLPRIVATE sal_Bool GetPageScrollDownOffset(SwTwips& rOff) const;
308 : :
309 : : // scrollbar movements
310 : : SW_DLLPRIVATE long PageUp();
311 : : SW_DLLPRIVATE long PageDown();
312 : : SW_DLLPRIVATE long PageUpCrsr(sal_Bool bSelect);
313 : : SW_DLLPRIVATE long PageDownCrsr(sal_Bool bSelect);
314 : : SW_DLLPRIVATE long PhyPageUp();
315 : : SW_DLLPRIVATE long PhyPageDown();
316 : :
317 : : SW_DLLPRIVATE int _CreateScrollbar( sal_Bool bHori );
318 : : SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
319 : : SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
320 : : SW_DLLPRIVATE sal_Bool UpdateScrollbars();
321 : : SW_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
322 : : SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
323 : :
324 : : SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow);
325 : :
326 : : // linguistics functions
327 : : SW_DLLPRIVATE void HyphenateDocument();
328 : : SW_DLLPRIVATE sal_Bool IsDrawTextHyphenate();
329 : : SW_DLLPRIVATE void HyphenateDrawText();
330 : : SW_DLLPRIVATE void StartThesaurus();
331 : :
332 : : // text conversion
333 : : SW_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
334 : :
335 : : // used for spell checking and text conversion
336 : : SW_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, sal_Bool bStartDone,
337 : : sal_Bool bEndDone, SwConversionArgs *pConvArgs = 0 );
338 : : SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
339 : :
340 : : SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
341 : : SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
342 : 0 : SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
343 : 0 : { bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
344 : :
345 : : // methods for printing
346 : : SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
347 : : SfxTabPage* CreatePrintOptionsPage( Window* pParent,
348 : : const SfxItemSet& rSet);
349 : : // for readonly switching
350 : : SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
351 : : SW_DLLPRIVATE void _CheckReadonlyState();
352 : : SW_DLLPRIVATE void _CheckReadonlySelection();
353 : :
354 : : // method for rotating PageDesc
355 : : SW_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
356 : :
357 : : SW_DLLPRIVATE void _SetZoom( const Size &rEditSz,
358 : : SvxZoomType eZoomType,
359 : : short nFactor = 100,
360 : : sal_Bool bViewOnly = sal_False);
361 : : SW_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool bInner );
362 : :
363 : : SW_DLLPRIVATE void ShowAtResize();
364 : :
365 : : SW_DLLPRIVATE virtual void Move();
366 : :
367 : : SW_DLLPRIVATE sal_Bool InsertGraphicDlg( SfxRequest& );
368 : :
369 : : protected:
370 : :
371 : 20913 : SwView_Impl* GetViewImpl() {return pViewImpl;}
372 : :
373 : : void ImpSetVerb( int nSelType );
374 : :
375 : 8 : int GetSelectionType() const { return nSelectionType; }
376 : 4 : void SetSelectionType(int nSet) { nSelectionType = nSet;}
377 : :
378 : : // for SwWebView
379 : 4 : void SetShell( SfxShell* pS ) { pShell = pS; }
380 : 4 : void SetFormShell( FmFormShell* pSh ) { pFormShell = pSh; }
381 : :
382 : : virtual void SelectShell();
383 : :
384 : : virtual void Activate(sal_Bool);
385 : : virtual void Deactivate(sal_Bool);
386 : : virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
387 : : virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
388 : : virtual Size GetOptimalSizePixel() const;
389 : :
390 : : void SetImageButtonColor(Color& rColor);
391 : :
392 : 0 : const SwFrmFmt* GetLastTblFrmFmt() const {return pLastTableFormat;}
393 : 8 : void SetLastTblFrmFmt(const SwFrmFmt* pSet) {pLastTableFormat = pSet;}
394 : :
395 : : // form letter execution
396 : : void GenerateFormLetter(sal_Bool bUseCurrentDocument);
397 : :
398 : : using SfxShell::GetDispatcher;
399 : :
400 : : public:
401 : :
402 : 136 : SFX_DECL_VIEWFACTORY(SwView);
403 : 146 : SFX_DECL_INTERFACE(SW_VIEWSHELL)
404 : : TYPEINFO();
405 : :
406 : : SfxDispatcher &GetDispatcher();
407 : :
408 : : void GotFocus() const;
409 : : virtual SdrView* GetDrawView() const;
410 : : virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
411 : : virtual void ShowCursor( bool bOn = sal_True );
412 : : virtual ErrCode DoVerb( long nVerb );
413 : :
414 : : virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
415 : : sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false);
416 : : ShellModes GetShellMode();
417 : :
418 : : com::sun::star::view::XSelectionSupplier* GetUNOObject();
419 : :
420 : : String GetSelectionTextParam( sal_Bool bCompleteWords,
421 : : sal_Bool bEraseTrail );
422 : : virtual sal_Bool HasSelection( sal_Bool bText ) const;
423 : : virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
424 : : virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
425 : : virtual void MarginChanged();
426 : :
427 : : // replace word/selection with text from the thesaurus
428 : : // (this code has special handling for "in word" character)
429 : : void InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
430 : : bool IsValidSelectionForThesaurus() const;
431 : : String GetThesaurusLookUpText( bool bSelection ) const;
432 : :
433 : : // immediately switch shell -> for GetSelectionObject
434 : : void StopShellTimer();
435 : :
436 : 108195 : inline SwWrtShell& GetWrtShell () const { return *pWrtShell; }
437 : 20400 : inline SwWrtShell* GetWrtShellPtr() const { return pWrtShell; }
438 : :
439 : 130518 : inline SwEditWin &GetEditWin() { return *pEditWin; }
440 : 13812 : inline const SwEditWin &GetEditWin () const { return *pEditWin; }
441 : :
442 : : #if defined WNT || defined UNX
443 : : void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
444 : : #endif
445 : :
446 : : // hand the handler for text blocks to the shell; create if applicable
447 : : SwGlossaryHdl* GetGlosHdl();
448 : :
449 : 15623 : inline const Rectangle& GetVisArea() const { return aVisArea; }
450 : :
451 : : sal_Bool IsScroll(const Rectangle& rRect) const;
452 : : void Scroll( const Rectangle& rRect,
453 : : sal_uInt16 nRangeX = USHRT_MAX,
454 : : sal_uInt16 nRangeY = USHRT_MAX);
455 : :
456 : : long SetVScrollMax(long lMax);
457 : : long SetHScrollMax(long lMax);
458 : :
459 : : void SpellError(LanguageType eLang);
460 : : sal_Bool ExecSpellPopup( const Point& rPt );
461 : : void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
462 : :
463 : : // SMARTTAGS
464 : : sal_Bool ExecSmartTagPopup( const Point& rPt );
465 : :
466 : : DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
467 : : sal_Bool ExecDrwTxtSpellPopup(const Point& rPt);
468 : :
469 : 0 : void SetTabColFromDocPos( const Point &rPt ) { aTabColFromDocPos = rPt; }
470 : 0 : void SetTabColFromDoc( sal_Bool b ) { bTabColFromDoc = b; }
471 : 6170 : sal_Bool IsTabColFromDoc() const { return bTabColFromDoc; }
472 : 0 : void SetTabRowFromDoc( sal_Bool b ) { bTabRowFromDoc = b; }
473 : 2723 : sal_Bool IsTabRowFromDoc() const { return bTabRowFromDoc; }
474 : :
475 : : // -> #i23726#
476 : 0 : void SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
477 : 0 : { pNumRuleNodeFromDoc = pNumRuleNode; }
478 : : void SetNumIndentFromDoc(sal_Bool b) { bNumIndentFromDoc = b; }
479 : : sal_Bool IsNumIndentFromDoc() const { return NULL != pNumRuleNodeFromDoc; }
480 : : // <- #i23726#
481 : :
482 : : void DocSzChgd( const Size& rNewSize );
483 : 638 : const Size& GetDocSz() const { return aDocSz; }
484 : : virtual void SetVisArea( const Rectangle&, sal_Bool bUpdateScrollbar = sal_True);
485 : : void SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
486 : : void CheckVisArea();
487 : :
488 : : void RecheckBrowseMode();
489 : : static Dialog* GetSearchDialog();
490 : :
491 : : static sal_uInt16 GetMoveType();
492 : : static void SetMoveType(sal_uInt16 nSet);
493 : : DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
494 : : static void SetActMark(sal_Int32 nSet);
495 : :
496 : : sal_Bool HandleWheelCommands( const CommandEvent& );
497 : :
498 : : // insert frames
499 : : void InsFrmMode(sal_uInt16 nCols);
500 : :
501 : : void SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
502 : : virtual void SetZoomFactor( const Fraction &rX, const Fraction & );
503 : :
504 : : void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly = sal_False );
505 : :
506 : : void ShowHScrollbar(sal_Bool bShow);
507 : : sal_Bool IsHScrollbarVisible()const;
508 : :
509 : : void ShowVScrollbar(sal_Bool bShow);
510 : : sal_Bool IsVScrollbarVisible()const;
511 : :
512 : : int CreateVLineal();
513 : : int KillVLineal();
514 : : int CreateTab();
515 : : int KillTab();
516 : :
517 : 0 : int StatVLineal() const { return ((Window*)pVRuler)->IsVisible(); }
518 : : void ChangeVLinealMetric(FieldUnit eUnit);
519 : : void GetVLinealMetric(FieldUnit& rToFill) const;
520 : :
521 : : int StatTab() const { return ((Window*)pHRuler)->IsVisible(); }
522 : 0 : SvxRuler& GetHLineal() { return *pHRuler; }
523 : 0 : SvxRuler& GetVLineal() { return *pVRuler; }
524 : : void InvalidateRulerPos();
525 : : void ChangeTabMetric(FieldUnit eUnit);
526 : : void GetHLinealMetric(FieldUnit& rToFill) const;
527 : :
528 : : // Handler
529 : : void Execute(SfxRequest&);
530 : : void ExecPageMove(SfxRequest&);
531 : : void ExecStyle(SfxRequest&);
532 : : void ExecLingu(SfxRequest&);
533 : : void ExecDataBase(SfxRequest&);
534 : : void ExecDlg(SfxRequest&);
535 : : void ExecDlgExt(SfxRequest&);
536 : : void ExecDBDlg(SfxRequest &);
537 : : void ExecColl(SfxRequest&);
538 : : void ExecutePrint(SfxRequest&);
539 : : void ExecDraw(SfxRequest&);
540 : : void ExecTabWin(SfxRequest&);
541 : : void ExecuteStatusLine(SfxRequest&);
542 : : DECL_LINK( ExecRulerClick, Ruler * );
543 : : void ExecSearch(SfxRequest&, sal_Bool bNoMessage = sal_False);
544 : : void ExecViewOptions(SfxRequest &);
545 : :
546 : : void StateViewOptions(SfxItemSet &);
547 : : void StateSearch(SfxItemSet &);
548 : : void GetState(SfxItemSet&);
549 : : void StateStatusLine(SfxItemSet&);
550 : :
551 : :
552 : : // functions for drawing
553 : : void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
554 : 799 : inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const { return pDrawActual; }
555 : : void GetDrawState(SfxItemSet &rSet);
556 : : void ExitDraw();
557 : 0 : inline sal_Bool IsDrawRotate() { return bDrawRotate; }
558 : 0 : inline void FlipDrawRotate() { bDrawRotate = !bDrawRotate; }
559 : 0 : inline sal_Bool IsDrawSelMode() { return bDrawSelMode; }
560 : : void SetSelDrawSlot();
561 : 0 : inline void FlipDrawSelMode() { bDrawSelMode = !bDrawSelMode; }
562 : : void NoRotate(); // turn off rotate mode
563 : : sal_Bool EnterDrawTextMode(const Point& aDocPos);
564 : 0 : void LeaveDrawCreate() { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
565 [ + - ][ - + ]: 24271 : sal_Bool IsDrawMode() { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
566 : : sal_Bool IsFormMode() const;
567 : : sal_Bool IsBezierEditMode();
568 : : sal_Bool AreOnlyFormsSelected() const;
569 : : sal_Bool HasDrwObj(SdrObject *pSdrObj) const;
570 : : sal_Bool HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
571 : : sal_Bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
572 : : Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
573 : :
574 : : void StateTabWin(SfxItemSet&);
575 : :
576 : : // attributes have changed
577 : : DECL_LINK( AttrChangedNotify, void* );
578 : :
579 : : // form control has been activated
580 : : DECL_LINK( FormControlActivated, void* );
581 : :
582 : : // edit links
583 : : void EditLinkDlg();
584 : : void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
585 : : void InsertCaption(const InsCaptionOpt *pOpt);
586 : :
587 : : // Async call by Core
588 : : void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
589 : :
590 : : String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
591 : :
592 : : // hand over Shell
593 : 2653 : SfxShell *GetCurShell() { return pShell; }
594 : : SwDocShell *GetDocShell();
595 : : inline const SwDocShell *GetDocShell() const;
596 : 962 : inline FmFormShell *GetFormShell() { return pFormShell; }
597 : 0 : inline const FmFormShell *GetFormShell() const { return pFormShell; }
598 : :
599 : : // so that in the SubShells' DTors pShell can be reset if applicable
600 : 1231 : void ResetSubShell() { pShell = 0; }
601 : :
602 : : virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False );
603 : : virtual void ReadUserData(const String &, sal_Bool bBrowse = sal_False );
604 : : virtual void ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
605 : : virtual void WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
606 : :
607 : 0 : void SetCrsrAtTop( sal_Bool bFlag, sal_Bool bCenter = sal_False )
608 : 0 : { bTopCrsr = bFlag, bCenterCrsr = bCenter; }
609 : 0 : sal_Bool IsCrsrAtTop() const { return bTopCrsr; }
610 : 0 : sal_Bool IsCrsrAtCenter() const { return bCenterCrsr; }
611 : :
612 : : sal_Bool JumpToSwMark( const String& rMark );
613 : :
614 : : long InsertDoc( sal_uInt16 nSlotId, const String& rFileName,
615 : : const String& rFilterName, sal_Int16 nVersion = 0 );
616 : :
617 : : void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
618 : : long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
619 : : DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
620 : :
621 : : // status methods for clipboard.
622 : : // Status changes now notified from the clipboard.
623 : : sal_Bool IsPasteAllowed();
624 : : sal_Bool IsPasteSpecialAllowed();
625 : :
626 : : // Enable mail merge - mail merge field dialog enabled
627 : : void EnableMailMerge(sal_Bool bEnable = sal_True);
628 : : //apply Accessiblity options
629 : : void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
630 : :
631 : : SwView(SfxViewFrame* pFrame, SfxViewShell*);
632 : : ~SwView();
633 : :
634 : : void NotifyDBChanged();
635 : :
636 : : SfxObjectShellLock CreateTmpSelectionDoc();
637 : :
638 : : void AddTransferable(SwTransferable& rTransferable);
639 : :
640 : : // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
641 : : // or to support printing
642 : : void SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource);
643 : : SwMailMergeConfigItem* GetMailMergeConfigItem();
644 : : sal_uInt16 GetMailMergeRestartPage() const;
645 : : sal_Bool IsMailMergeSourceView() const;
646 : :
647 : : void ExecFormatPaintbrush(SfxRequest &);
648 : : void StateFormatPaintbrush(SfxItemSet &);
649 : :
650 : : //public fuer D&D
651 : : int InsertGraphic( const String &rPath, const String &rFilter,
652 : : sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
653 : : Graphic* pPreviewGrf = 0,
654 : : sal_Bool bRule = sal_False );
655 : :
656 : : void ExecuteScan( SfxRequest& rReq );
657 : :
658 : 112077 : SwPostItMgr* GetPostItMgr() { return mpPostItMgr;}
659 : : const SwPostItMgr* GetPostItMgr() const { return mpPostItMgr;}
660 : : };
661 : :
662 : : // ----------------- inline Methoden ----------------------
663 : 1298 : inline long SwView::GetXScroll() const
664 : : {
665 : 1298 : return aVisArea.GetWidth() * nScrollX / 100L;
666 : : }
667 : :
668 : 1298 : inline long SwView::GetYScroll() const
669 : : {
670 : 1298 : return aVisArea.GetHeight() * nScrollY / 100L;
671 : : }
672 : :
673 : 5622 : inline const SwDocShell *SwView::GetDocShell() const
674 : : {
675 : 5622 : return ((SwView*)this)->GetDocShell();
676 : : }
677 : :
678 : : SfxTabPage* CreatePrintOptionsPage( Window *pParent,
679 : : const SfxItemSet &rOptions,
680 : : sal_Bool bPreview);
681 : :
682 : : #endif
683 : :
684 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|