Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_VIEW_HXX
20 : #define INCLUDED_SW_SOURCE_UIBASE_INC_VIEW_HXX
21 :
22 : #include <vcl/timer.hxx>
23 : #include <vcl/field.hxx>
24 : #include <vcl/floatwin.hxx>
25 : #include <svtools/htmlcfg.hxx>
26 : #include <sfx2/viewfac.hxx>
27 : #include <sfx2/viewsh.hxx>
28 : #include <sfx2/objsh.hxx>
29 : #include <editeng/svxenum.hxx>
30 : #include <sfx2/zoomitem.hxx>
31 : #include <svx/ruler.hxx>
32 : #include <svx/svxids.hrc>
33 : #include <svx/fmshell.hxx>
34 : #include <editeng/editstat.hxx>
35 : #include "swdllapi.h"
36 : #include <swtypes.hxx>
37 : #include <shellid.hxx>
38 : #include <IMark.hxx>
39 :
40 : class Button;
41 : class ImageButton;
42 : class SwTextFormatColl;
43 : class SwPageDesc;
44 : class SwFrameFormat;
45 : class SwCharFormat;
46 : class SwNumRule;
47 : class SwGlossaryHdl;
48 : class SwDrawBase;
49 : class SvxRuler;
50 : class SvxLRSpaceItem;
51 : class SwDocShell;
52 : class SwScrollbar;
53 : class SvBorder;
54 : class Ruler;
55 : class SvxSearchItem;
56 : class SearchAttrItemList;
57 : class SvxSearchDialog;
58 : class SdrView;
59 : class Dialog;
60 : class SdrObject;
61 : class SdrPageView;
62 : class SwHlpImageButton;
63 : class SwView;
64 : class SwEditWin;
65 : class SwWrtShell;
66 : class SwView_Impl;
67 : struct SwSearchOptions;
68 : class CommandEvent;
69 : class InsCaptionOpt;
70 : class SvGlobalName;
71 : class SvtAccessibilityOptions;
72 : class SwTransferable;
73 : class SwMailMergeConfigItem;
74 : class SwTextNode; // #i23726#
75 : class SwFormatClipboard;
76 : struct SwConversionArgs;
77 : class Graphic;
78 : class GraphicFilter;
79 : class SwPostItMgr;
80 : enum class SotExchangeDest;
81 :
82 : namespace com{ namespace sun { namespace star {
83 : namespace view{ class XSelectionSupplier; }
84 : }}}
85 : namespace sfx2 { class FileDialogHelper; }
86 :
87 : const long nLeftOfst = -370;
88 : const long nScrollX = 30;
89 : const long nScrollY = 30;
90 :
91 : #define MINZOOM 20
92 : #define MAXZOOM 600
93 :
94 : #define MAX_MARKS 5
95 :
96 : #define CHILDWIN_LABEL 1
97 : #define CHILDWIN_MAILMERGE 2
98 :
99 : enum ShellModes
100 : {
101 : SHELL_MODE_TEXT,
102 : SHELL_MODE_FRAME,
103 : SHELL_MODE_GRAPHIC,
104 : SHELL_MODE_OBJECT,
105 : SHELL_MODE_DRAW,
106 : SHELL_MODE_DRAW_CTRL,
107 : SHELL_MODE_DRAW_FORM,
108 : SHELL_MODE_DRAWTEXT,
109 : SHELL_MODE_BEZIER,
110 : SHELL_MODE_LIST_TEXT,
111 : SHELL_MODE_TABLE_TEXT,
112 : SHELL_MODE_TABLE_LIST_TEXT,
113 : SHELL_MODE_MEDIA,
114 : SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
115 : SHELL_MODE_FONTWORK,
116 : SHELL_MODE_POSTIT,
117 : SHELL_MODE_NAVIGATION
118 : };
119 :
120 : // apply a template
121 : struct SwApplyTemplate
122 : {
123 : union
124 : {
125 : SwTextFormatColl* pTextColl;
126 : SwPageDesc* pPageDesc;
127 : SwFrameFormat* pFrameFormat;
128 : SwCharFormat* pCharFormat;
129 : SwNumRule* pNumRule;
130 : } aColl;
131 :
132 : int eType;
133 : sal_uInt16 nColor;
134 : SwFormatClipboard* m_pFormatClipboard;
135 : bool bUndo;
136 :
137 0 : SwApplyTemplate() :
138 : eType(0),
139 : nColor(0),
140 : m_pFormatClipboard(0),
141 0 : bUndo(false)
142 : {
143 0 : aColl.pTextColl = 0;
144 0 : }
145 : };
146 :
147 : // view of a document
148 : class SW_DLLPUBLIC SwView: public SfxViewShell
149 : {
150 : friend class SwHHCWrapper;
151 : friend class SwHyphWrapper;
152 : friend class SwView_Impl;
153 : friend class SwClipboardChangeListener;
154 :
155 : // search & replace
156 : static VclPtr<SvxSearchDialog> m_pSrchDlg;
157 : static SvxSearchItem *m_pSrchItem;
158 :
159 : static sal_uInt16 m_nInsertCtrlState;
160 : static sal_uInt16 m_nWebInsertCtrlState;
161 : static sal_uInt16 m_nInsertObjectCtrlState;
162 : static sal_uInt16 m_nInsertFieldCtrlState;
163 : static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi)
164 : static sal_Int32 m_nActMark; // current jump mark for unknown mark
165 :
166 : static bool m_bExtra;
167 : static bool m_bFound;
168 : static bool m_bJustOpened;
169 :
170 : static SearchAttrItemList* m_pSrchList;
171 : static SearchAttrItemList* m_pReplList;
172 :
173 : SvxHtmlOptions m_aHTMLOpt;
174 : Timer m_aTimer; // for delayed ChgLnks during an action
175 : OUString m_sSwViewData,
176 : //and the new cursor position if the user double click in the PagePreview
177 : m_sNewCrsrPos;
178 : // to support keyboard the number of the page to go to can be set too
179 : sal_uInt16 m_nNewPage;
180 :
181 : sal_uInt16 m_nOldPageNum;
182 : OUString m_sOldSectionName;
183 :
184 : Point m_aTabColFromDocPos; // moving table colmns out of the document
185 : SwTextNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
186 :
187 : Size m_aDocSz; // current document size
188 : Rectangle m_aVisArea; // visible region
189 :
190 : VclPtr<SwEditWin> m_pEditWin;
191 : SwWrtShell *m_pWrtShell;
192 :
193 : SfxShell *m_pShell; // current SubShell at the dispatcher
194 : FmFormShell *m_pFormShell; // DB-FormShell
195 :
196 : SwView_Impl *m_pViewImpl; // Impl-data for UNO + Basic
197 :
198 : VclPtr<SwScrollbar> m_pHScrollbar, // MDI control elements
199 : m_pVScrollbar;
200 :
201 : bool m_bHScrollbarEnabled;
202 : bool m_bVScrollbarEnabled;
203 :
204 : VclPtr<vcl::Window> m_pScrollFill; // dummy window for filling the lower right edge
205 : // when both scrollbars are active
206 :
207 : VclPtr<SvxRuler> m_pHRuler,
208 : m_pVRuler;
209 : VclPtr<ImageButton> m_pTogglePageBtn;
210 :
211 : VclPtr<SwHlpImageButton> m_pPageUpBtn,
212 : m_pPageDownBtn;
213 :
214 : SwGlossaryHdl *m_pGlosHdl; // handle text block
215 : SwDrawBase *m_pDrawActual;
216 :
217 : const SwFrameFormat *m_pLastTableFormat;
218 :
219 : SwFormatClipboard *m_pFormatClipboard; //holds data for format paintbrush
220 :
221 : SwPostItMgr *m_pPostItMgr;
222 :
223 : int m_nSelectionType;
224 : VclPtr<FloatingWindow> m_pFieldPopup;
225 :
226 : static const int m_nMASTERENUMCOMMANDS = 6;
227 :
228 : OUString m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ];
229 :
230 : sal_uInt16 m_nPageCnt;
231 :
232 : // current draw mode
233 : sal_uInt16 m_nDrawSfxId;
234 : OUString m_sDrawCustom; //some drawing types are marked with strings!
235 : sal_uInt16 m_nFormSfxId;
236 : SotExchangeDest m_nLastPasteDestination;
237 :
238 : // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
239 : sal_uInt16 m_nLeftBorderDistance;
240 : sal_uInt16 m_nRightBorderDistance;
241 :
242 : bool m_bWheelScrollInProgress;
243 :
244 : bool m_bCenterCrsr : 1,
245 : m_bTopCrsr : 1,
246 : m_bAlwaysShowSel : 1,
247 : m_bTabColFromDoc : 1,
248 : m_bNumIndentFromDoc : 1, // #i23726#
249 : m_bTabRowFromDoc : 1,
250 : m_bSetTabColFromDoc : 1 ,
251 : m_bSetTabRowFromDoc : 1,
252 : m_bAttrChgNotified : 1,
253 : m_bAttrChgNotifiedWithRegistrations : 1,
254 : m_bVerbsActive : 1,
255 : m_bDrawRotate : 1,
256 : m_bDrawSelMode : 1,
257 : m_bShowAtResize : 1,
258 : m_bInOuterResizePixel : 1,
259 : m_bInInnerResizePixel : 1,
260 : m_bPasteState : 1,
261 : m_bPasteSpecialState : 1,
262 : m_bInMailMerge : 1,
263 : m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
264 : m_bOldShellWasPagePreview : 1,
265 : m_bIsPreviewDoubleClick : 1, // #i114045#
266 : m_bMakeSelectionVisible : 1, // transport the bookmark selection
267 : m_bAnnotationMode; ///< The real cursor position is inside an annotation.
268 :
269 : // methods for searching
270 : // set search context
271 : SAL_DLLPRIVATE bool SearchAndWrap(bool bApi = false);
272 : SAL_DLLPRIVATE bool SearchAll(sal_uInt16* pFound = 0);
273 : SAL_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
274 : SAL_DLLPRIVATE void Replace();
275 :
276 : bool IsDocumentBorder();
277 :
278 : SAL_DLLPRIVATE bool IsTextTool() const;
279 :
280 : // create control elements
281 : SAL_DLLPRIVATE void CreateBtns();
282 : DECL_DLLPRIVATE_LINK( BtnPage, Button * );
283 :
284 : DECL_DLLPRIVATE_LINK_TYPED( TimeoutHdl, Timer*, void );
285 : DECL_DLLPRIVATE_LINK( UpdatePercentHdl, GraphicFilter* );
286 :
287 : DECL_DLLPRIVATE_LINK( FieldPopupModeEndHdl, void* );
288 :
289 : inline long GetXScroll() const;
290 : inline long GetYScroll() const;
291 : SAL_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
292 : SAL_DLLPRIVATE void CalcPt( Point* pPt,const Rectangle& rRect,
293 : sal_uInt16 nRangeX = USHRT_MAX,
294 : sal_uInt16 nRangeY = USHRT_MAX);
295 :
296 : SAL_DLLPRIVATE bool GetPageScrollUpOffset(SwTwips& rOff) const;
297 : SAL_DLLPRIVATE bool GetPageScrollDownOffset(SwTwips& rOff) const;
298 :
299 : // scrollbar movements
300 : SAL_DLLPRIVATE long PageUp();
301 : SAL_DLLPRIVATE long PageDown();
302 : SAL_DLLPRIVATE bool PageUpCrsr(bool bSelect);
303 : SAL_DLLPRIVATE bool PageDownCrsr(bool bSelect);
304 : SAL_DLLPRIVATE long PhyPageUp();
305 : SAL_DLLPRIVATE long PhyPageDown();
306 :
307 : SAL_DLLPRIVATE int _CreateScrollbar( bool bHori );
308 : DECL_DLLPRIVATE_LINK( ScrollHdl, SwScrollbar * );
309 : DECL_DLLPRIVATE_LINK( EndScrollHdl, SwScrollbar * );
310 : SAL_DLLPRIVATE bool UpdateScrollbars();
311 : DECL_DLLPRIVATE_LINK( WindowChildEventListener, VclSimpleEvent* );
312 : SAL_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
313 :
314 : SAL_DLLPRIVATE void CreatePageButtons(bool bShow);
315 :
316 : // linguistics functions
317 : SAL_DLLPRIVATE void HyphenateDocument();
318 : SAL_DLLPRIVATE bool IsDrawTextHyphenate();
319 : SAL_DLLPRIVATE void HyphenateDrawText();
320 : SAL_DLLPRIVATE void StartThesaurus();
321 :
322 : // text conversion
323 : SAL_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive );
324 :
325 : // used for spell checking and text conversion
326 : SAL_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
327 : bool bEndDone, SwConversionArgs *pConvArgs = 0 );
328 : SAL_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
329 :
330 : SAL_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
331 : SAL_DLLPRIVATE bool CheckSpecialContent();
332 0 : SAL_DLLPRIVATE void SpellKontext(bool bOn = true)
333 0 : { m_bCenterCrsr = bOn; m_bAlwaysShowSel = bOn; }
334 :
335 : // for readonly switching
336 : SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
337 : SAL_DLLPRIVATE void _CheckReadonlyState();
338 : SAL_DLLPRIVATE void _CheckReadonlySelection();
339 :
340 : // method for rotating PageDesc
341 : SAL_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
342 :
343 : SAL_DLLPRIVATE void _SetZoom( const Size &rEditSz,
344 : SvxZoomType eZoomType,
345 : short nFactor = 100,
346 : bool bViewOnly = false);
347 : SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, bool bInner );
348 :
349 : SAL_DLLPRIVATE void ShowAtResize();
350 :
351 : SAL_DLLPRIVATE virtual void Move() SAL_OVERRIDE;
352 :
353 : SAL_DLLPRIVATE void DocumentStatsChanged();
354 :
355 : public: // #i123922# Needs to be called from a 2nd place now as a helper method
356 : SAL_DLLPRIVATE bool InsertGraphicDlg( SfxRequest& );
357 :
358 : protected:
359 :
360 14513 : SwView_Impl* GetViewImpl() {return m_pViewImpl;}
361 :
362 : void ImpSetVerb( int nSelType );
363 :
364 4 : int GetSelectionType() const { return m_nSelectionType; }
365 2 : void SetSelectionType(int nSet) { m_nSelectionType = nSet;}
366 :
367 : // for SwWebView
368 2 : void SetShell( SfxShell* pS ) { m_pShell = pS; }
369 2 : void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
370 :
371 : virtual void SelectShell();
372 :
373 : virtual void Activate(bool) SAL_OVERRIDE;
374 : virtual void Deactivate(bool) SAL_OVERRIDE;
375 : virtual void InnerResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
376 : virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE;
377 :
378 : void SetImageButtonColor(Color& rColor);
379 :
380 0 : const SwFrameFormat* GetLastTableFrameFormat() const {return m_pLastTableFormat;}
381 4 : void SetLastTableFrameFormat(const SwFrameFormat* pSet) {m_pLastTableFormat = pSet;}
382 :
383 : // form letter execution
384 : void GenerateFormLetter(bool bUseCurrentDocument);
385 :
386 : using SfxShell::GetDispatcher;
387 :
388 : public:
389 119 : SFX_DECL_VIEWFACTORY(SwView);
390 125 : SFX_DECL_INTERFACE(SW_VIEWSHELL)
391 : TYPEINFO_OVERRIDE();
392 :
393 : private:
394 : /// SfxInterface initializer.
395 : static void InitInterface_Impl();
396 :
397 : public:
398 : SfxDispatcher &GetDispatcher();
399 :
400 : void GotFocus() const;
401 : virtual SdrView* GetDrawView() const SAL_OVERRIDE;
402 : virtual bool HasUIFeature( sal_uInt32 nFeature ) SAL_OVERRIDE;
403 : virtual void ShowCursor( bool bOn = true ) SAL_OVERRIDE;
404 : virtual ErrCode DoVerb( long nVerb ) SAL_OVERRIDE;
405 :
406 : virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
407 0 : SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
408 : ShellModes GetShellMode();
409 :
410 : com::sun::star::view::XSelectionSupplier* GetUNOObject();
411 :
412 : OUString GetSelectionTextParam( bool bCompleteWords,
413 : bool bEraseTrail );
414 : virtual bool HasSelection( bool bText ) const SAL_OVERRIDE;
415 : virtual OUString GetSelectionText( bool bCompleteWords = false ) SAL_OVERRIDE;
416 : virtual bool PrepareClose( bool bUI = true ) SAL_OVERRIDE;
417 : virtual void MarginChanged() SAL_OVERRIDE;
418 :
419 : // replace word/selection with text from the thesaurus
420 : // (this code has special handling for "in word" character)
421 : void InsertThesaurusSynonym( const OUString &rSynonmText, const OUString &rLookUpText, bool bValidSelection );
422 : bool IsValidSelectionForThesaurus() const;
423 : OUString GetThesaurusLookUpText( bool bSelection ) const;
424 :
425 : // immediately switch shell -> for GetSelectionObject
426 : void StopShellTimer();
427 :
428 173238 : inline SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
429 40962 : inline SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell; }
430 :
431 169282 : inline SwEditWin &GetEditWin() { return *m_pEditWin; }
432 61662 : inline const SwEditWin &GetEditWin () const { return *m_pEditWin; }
433 :
434 : #if defined WNT || defined UNX
435 : void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
436 : #endif
437 :
438 : // hand the handler for text blocks to the shell; create if applicable
439 : SwGlossaryHdl* GetGlosHdl();
440 :
441 15951 : inline const Rectangle& GetVisArea() const { return m_aVisArea; }
442 :
443 : bool IsScroll(const Rectangle& rRect) const;
444 : void Scroll( const Rectangle& rRect,
445 : sal_uInt16 nRangeX = USHRT_MAX,
446 : sal_uInt16 nRangeY = USHRT_MAX);
447 :
448 : long SetVScrollMax(long lMax);
449 : long SetHScrollMax(long lMax);
450 :
451 : void SpellError(LanguageType eLang);
452 : bool ExecSpellPopup( const Point& rPt );
453 : void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
454 : bool ExecSmartTagPopup( const Point& rPt );
455 :
456 : DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
457 : bool ExecDrwTextSpellPopup(const Point& rPt);
458 :
459 0 : void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
460 2 : void SetTabColFromDoc( bool b ) { m_bTabColFromDoc = b; }
461 8644 : bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
462 0 : void SetTabRowFromDoc( bool b ) { m_bTabRowFromDoc = b; }
463 4314 : bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
464 :
465 : // -> #i23726#
466 2 : void SetNumRuleNodeFromDoc( SwTextNode * pNumRuleNode )
467 2 : { m_pNumRuleNodeFromDoc = pNumRuleNode; }
468 : void SetNumIndentFromDoc(bool b) { m_bNumIndentFromDoc = b; }
469 : bool IsNumIndentFromDoc() const { return NULL != m_pNumRuleNodeFromDoc; }
470 : // <- #i23726#
471 :
472 : void DocSzChgd( const Size& rNewSize );
473 408 : const Size& GetDocSz() const { return m_aDocSz; }
474 : void SetVisArea( const Rectangle&, bool bUpdateScrollbar = true);
475 : void SetVisArea( const Point&, bool bUpdateScrollbar = true);
476 : void CheckVisArea();
477 :
478 : void RecheckBrowseMode();
479 : static SvxSearchDialog* GetSearchDialog();
480 :
481 : static sal_uInt16 GetMoveType();
482 : static void SetMoveType(sal_uInt16 nSet);
483 : DECL_LINK( MoveNavigationHdl, bool* ); // #i75416#
484 : static void SetActMark(sal_Int32 nSet);
485 :
486 : bool HandleWheelCommands( const CommandEvent& );
487 :
488 : // insert frames
489 : void InsFrmMode(sal_uInt16 nCols);
490 :
491 : void SetZoom( SvxZoomType eZoomType, short nFactor = 100, bool bViewOnly = false);
492 : virtual void SetZoomFactor( const Fraction &rX, const Fraction & ) SAL_OVERRIDE;
493 :
494 : void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, bool bViewOnly = false );
495 :
496 : void ShowHScrollbar(bool bShow);
497 : bool IsHScrollbarVisible()const;
498 :
499 : void ShowVScrollbar(bool bShow);
500 : bool IsVScrollbarVisible()const;
501 :
502 : void EnableHScrollbar(bool bEnable);
503 : void EnableVScrollbar(bool bEnable);
504 :
505 : int CreateVRuler();
506 : int KillVRuler();
507 : int CreateTab();
508 : int KillTab();
509 :
510 0 : bool StatVRuler() const { return m_pVRuler->IsVisible(); }
511 : void ChangeVRulerMetric(FieldUnit eUnit);
512 : void GetVRulerMetric(FieldUnit& rToFill) const;
513 :
514 : bool StatTab() const { return m_pHRuler->IsVisible(); }
515 0 : SvxRuler& GetHRuler() { return *m_pHRuler; }
516 0 : SvxRuler& GetVRuler() { return *m_pVRuler; }
517 : void InvalidateRulerPos();
518 : void ChangeTabMetric(FieldUnit eUnit);
519 : void GetHRulerMetric(FieldUnit& rToFill) const;
520 :
521 : // Handler
522 : void Execute(SfxRequest&);
523 : void ExecPageMove(SfxRequest&);
524 : void ExecStyle(SfxRequest&);
525 : void ExecLingu(SfxRequest&);
526 : void ExecDataBase(SfxRequest&);
527 : void ExecDlg(SfxRequest&);
528 : void ExecDlgExt(SfxRequest&);
529 : void ExecDBDlg(SfxRequest &);
530 : void ExecColl(SfxRequest&);
531 : void ExecutePrint(SfxRequest&);
532 : void ExecDraw(SfxRequest&);
533 : void ExecTabWin(SfxRequest&);
534 : void ExecuteStatusLine(SfxRequest&);
535 : DECL_LINK( ExecRulerClick, Ruler * );
536 : void ExecSearch(SfxRequest&, bool bNoMessage = false);
537 : void ExecViewOptions(SfxRequest &);
538 :
539 : void StateViewOptions(SfxItemSet &);
540 : void StateSearch(SfxItemSet &);
541 : void GetState(SfxItemSet&);
542 : void StateStatusLine(SfxItemSet&);
543 : void UpdateWordCount(SfxShell*, sal_uInt16);
544 : void ExecFormatFootnote();
545 : void ExecNumberingOutline(SfxItemPool &);
546 :
547 : // functions for drawing
548 : void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
549 4613 : inline SwDrawBase* GetDrawFuncPtr() const { return m_pDrawActual; }
550 : void GetDrawState(SfxItemSet &rSet);
551 : void ExitDraw();
552 1 : inline bool IsDrawRotate() { return m_bDrawRotate; }
553 0 : inline void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
554 2 : inline bool IsDrawSelMode() { return m_bDrawSelMode; }
555 : void SetSelDrawSlot();
556 0 : inline void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
557 : void NoRotate(); // turn off rotate mode
558 : bool EnterDrawTextMode(const Point& aDocPos);
559 : /// Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position.
560 : bool EnterShapeDrawTextMode(SdrObject* pObject);
561 0 : void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear();}
562 19892 : bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
563 : bool IsFormMode() const;
564 : bool IsBezierEditMode();
565 : bool AreOnlyFormsSelected() const;
566 : bool HasDrwObj(SdrObject *pSdrObj) const;
567 : bool HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
568 : bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
569 : vcl::Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
570 :
571 : void StateTabWin(SfxItemSet&);
572 :
573 : // attributes have changed
574 : DECL_LINK( AttrChangedNotify, void* );
575 :
576 : // form control has been activated
577 : DECL_LINK( FormControlActivated, void* );
578 :
579 : // edit links
580 : void EditLinkDlg();
581 : void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
582 : void InsertCaption(const InsCaptionOpt *pOpt);
583 :
584 : // Async call by Core
585 : void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
586 :
587 : OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr);
588 :
589 : // hand over Shell
590 6718 : SfxShell *GetCurShell() { return m_pShell; }
591 : SwDocShell *GetDocShell();
592 : inline const SwDocShell *GetDocShell() const;
593 124 : inline virtual FmFormShell *GetFormShell() SAL_OVERRIDE { return m_pFormShell; }
594 0 : inline virtual const FmFormShell *GetFormShell() const SAL_OVERRIDE { return m_pFormShell; }
595 :
596 : // so that in the SubShells' DTors m_pShell can be reset if applicable
597 2757 : void ResetSubShell() { m_pShell = 0; }
598 :
599 : virtual void WriteUserData(OUString &, bool bBrowse = false) SAL_OVERRIDE;
600 : virtual void ReadUserData(const OUString &, bool bBrowse = false) SAL_OVERRIDE;
601 : virtual void ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, bool bBrowse ) SAL_OVERRIDE;
602 : virtual void WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, bool bBrowse ) SAL_OVERRIDE;
603 :
604 0 : void SetCrsrAtTop( bool bFlag, bool bCenter = false )
605 0 : { m_bTopCrsr = bFlag, m_bCenterCrsr = bCenter; }
606 0 : bool IsCrsrAtTop() const { return m_bTopCrsr; }
607 0 : bool IsCrsrAtCenter() const { return m_bCenterCrsr; }
608 :
609 : bool JumpToSwMark( const OUString& rMark );
610 :
611 : long InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName,
612 : const OUString& rFilterName, sal_Int16 nVersion = 0 );
613 :
614 : void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
615 : long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
616 : DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
617 :
618 : // status methods for clipboard.
619 : // Status changes now notified from the clipboard.
620 : bool IsPasteAllowed();
621 : bool IsPasteSpecialAllowed();
622 :
623 : // Enable mail merge - mail merge field dialog enabled
624 : void EnableMailMerge(bool bEnable = true);
625 : //apply Accessiblity options
626 : void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
627 :
628 : SwView(SfxViewFrame* pFrame, SfxViewShell*);
629 : virtual ~SwView();
630 :
631 : void NotifyDBChanged();
632 :
633 : SfxObjectShellLock CreateTmpSelectionDoc();
634 :
635 : void AddTransferable(SwTransferable& rTransferable);
636 :
637 : // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
638 : // or to support printing
639 : void SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem, sal_uInt16 nRestart, bool bIsSource);
640 : SwMailMergeConfigItem* GetMailMergeConfigItem();
641 : sal_uInt16 GetMailMergeRestartPage() const;
642 : bool IsMailMergeSourceView() const;
643 :
644 : void ExecFormatPaintbrush(SfxRequest &);
645 : void StateFormatPaintbrush(SfxItemSet &);
646 :
647 : //public fuer D&D
648 : int InsertGraphic( const OUString &rPath, const OUString &rFilter,
649 : bool bLink = true, GraphicFilter *pFlt = 0,
650 : Graphic* pPreviewGrf = 0,
651 : bool bRule = false );
652 :
653 : void ExecuteScan( SfxRequest& rReq );
654 :
655 218518 : SwPostItMgr* GetPostItMgr() { return m_pPostItMgr;}
656 : const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr;}
657 :
658 : // exhibition hack (MA,MBA)
659 : void SelectShellForDrop();
660 :
661 : void UpdateDocStats();
662 : /// Where is the real cursor: in the annotation or in the main document?
663 : void SetAnnotationMode(bool bMode);
664 :
665 : // methods for printing
666 : SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
667 : SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const SAL_OVERRIDE;
668 : SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window* pParent,
669 : const SfxItemSet& rSet) SAL_OVERRIDE;
670 : };
671 :
672 836 : inline long SwView::GetXScroll() const
673 : {
674 836 : return m_aVisArea.GetWidth() * nScrollX / 100L;
675 : }
676 :
677 836 : inline long SwView::GetYScroll() const
678 : {
679 836 : return m_aVisArea.GetHeight() * nScrollY / 100L;
680 : }
681 :
682 2647 : inline const SwDocShell *SwView::GetDocShell() const
683 : {
684 2647 : return const_cast<SwView*>(this)->GetDocShell();
685 : }
686 :
687 : VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent,
688 : const SfxItemSet &rOptions,
689 : bool bPreview);
690 :
691 : #endif
692 :
693 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|