1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22 #ifndef _SWVIEW_HXX
23 #define _SWVIEW_HXX
24
25 #include <vcl/timer.hxx>
26 #include <vcl/field.hxx>
27 #include <svtools/htmlcfg.hxx>
28 #include <sfx2/viewfac.hxx>
29 #include <sfx2/viewsh.hxx>
30 #include <sfx2/objsh.hxx>
31 #include <editeng/svxenum.hxx>
32 #include <svx/zoomitem.hxx>
33 #include <editeng/editstat.hxx>
34 #include "swdllapi.h"
35 #include <swtypes.hxx>
36 #include <shellid.hxx>
37 #include <layout/layout.hxx>
38 #include <IMark.hxx>
39
40 class SwBaseShell;
41 class Button;
42 class ImageButton;
43 class SwTxtFmtColl;
44 class SwPageDesc;
45 class SwFrmFmt;
46 class SwCharFmt;
47 class SwNumRule;
48 class SwViewOption;
49 class SwGlossaryHdl;
50 class SwDrawBase;
51 class SvxRuler;
52 class SvxLRSpaceItem;
53 class SwDocShell;
54 class SwScrollbar;
55 class SvxVCBrowser;
56 class SvBorder;
57 class Ruler;
58 class OutlinerView;
59 class SvxSearchItem;
60 class SearchAttrItemList;
61 class SvxSearchDialog;
62 class SdrView;
63 class Dialog;
64 class SdrObject;
65 class SdrPageView;
66 class SwNaviImageButton;
67 class SwHlpImageButton;
68 class Outliner;
69 class SwView;
70 class SwEditWin;
71 class SwWrtShell;
72 class SwView_Impl;
73 class XSelectionObject;
74 struct SwSearchOptions;
75 class FmFormShell;
76 class CommandEvent;
77 class InsCaptionOpt;
78 class SvGlobalName;
79 class SvtAccessibilityOptions;
80 class SwTransferable;
81 class SwMailMergeConfigItem;
82 class SwTxtNode; // #i23726#
83 class SwPrintData;
84 class SwFormatClipboard;
85 struct SwConversionArgs;
86 class Graphic;
87 class GraphicFilter;
88 class SwPostItMgr;
89 class SwFieldBookmark;
90
91 namespace com{ namespace sun { namespace star {
92 namespace view{ class XSelectionSupplier; }
93 }}}
94 namespace sfx2 { class FileDialogHelper; }
95
96 const long nLeftOfst = -370;
97 const long nScrollX = 30;
98 const long nScrollY = 30;
99
100 #define MINZOOM 20
101 #define MAXZOOM 600
102
103 #define MAX_MARKS 5
104
105 #define CHILDWIN_LABEL 1
106 #define CHILDWIN_MAILMERGE 2
107
108 enum ShellModes
109 {
110 SHELL_MODE_TEXT,
111 SHELL_MODE_FRAME,
112 SHELL_MODE_GRAPHIC,
113 SHELL_MODE_OBJECT,
114 SHELL_MODE_DRAW,
115 SHELL_MODE_DRAW_CTRL,
116 SHELL_MODE_DRAW_FORM,
117 SHELL_MODE_DRAWTEXT,
118 SHELL_MODE_BEZIER,
119 SHELL_MODE_LIST_TEXT,
120 SHELL_MODE_TABLE_TEXT,
121 SHELL_MODE_TABLE_LIST_TEXT,
122 SHELL_MODE_MEDIA,
123 SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
124 SHELL_MODE_FONTWORK,
125 SHELL_MODE_POSTIT
126 };
127
128 /*--------------------------------------------------------------------
129 Beschreibung: Anwendung einer Vorlage
130 --------------------------------------------------------------------*/
131
132 struct SwApplyTemplate
133 {
134 union
135 {
136 SwTxtFmtColl* pTxtColl;
137 SwPageDesc* pPageDesc;
138 SwFrmFmt* pFrmFmt;
139 SwCharFmt* pCharFmt;
140 SwNumRule* pNumRule;
141 } aColl;
142
143 int eType;
144 sal_uInt16 nColor;
145 SwFormatClipboard* pFormatClipboard;
146 sal_Bool bUndo;
147
SwApplyTemplateSwApplyTemplate148 SwApplyTemplate() :
149 eType(0),
150 nColor(0),
151 pFormatClipboard(0),
152 bUndo(sal_False)
153 {
154 aColl.pTxtColl = 0;
155 }
156 };
157
158
159 /*--------------------------------------------------------------------
160 Beschreibung: Sicht auf ein Dokument
161 --------------------------------------------------------------------*/
162
163 class SW_DLLPUBLIC SwView: public SfxViewShell
164 {
165 //Messehack (MA,MBA)
166 friend void lcl_SelectShellForDrop( SwView &rView );
167
168 friend class TestTemplateItem;
169 friend class SwHHCWrapper;
170 friend class SwHyphWrapper;
171 friend class SwView_Impl;
172 friend class SwClipboardChangeListener;
173
174 //suchen & ersetzen
175 static SvxSearchDialog *pSrchDlg;
176 static SvxSearchItem *pSrchItem;
177
178 static sal_uInt16 nInsertCtrlState;
179 static sal_uInt16 nWebInsertCtrlState;
180 static sal_uInt16 nInsertObjectCtrlState;
181 static sal_uInt16 nInsertFieldCtrlState;
182 static sal_uInt16 nMoveType; // fuer Buttons unter dem Scrollbar (viewmdi)
183 static sal_Int32 nActMark; // aktuelle Sprungmarke fuer unbenannte Merker
184
185 static sal_Bool bExtra;
186 static sal_Bool bFound;
187 static sal_Bool bJustOpened;
188
189 static SearchAttrItemList* pSrchList;
190 static SearchAttrItemList* pReplList;
191
192
193 SvxHtmlOptions aHTMLOpt;
194 Timer aTimer; //Für verzögerte ChgLnks waehrend
195 //einer Aktion
196 String aPageStr; //Statusanzeige, aktuelle Seite
197 String sSwViewData,
198 //and the new cursor position if the user double click in the PagePreView
199 sNewCrsrPos;
200 // to support keyboard the number of the page to go to can be set too
201 sal_uInt16 nNewPage;
202 sal_uInt16 nOldPageNum;
203 String nOldSectionName;
204 Point aTabColFromDocPos; //Verschieben von Tabellenspalten aus
205 //aus dem Dokument heraus.
206 SwTxtNode * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
207
208 Size aDocSz; // aktuelle Dokumentgroesse
209 Rectangle aVisArea; // sichtbarer Bereich
210
211 SwEditWin *pEditWin;
212 SwWrtShell *pWrtShell;
213
214 SfxShell *pShell; //aktuelle SubShell auf dem Dispatcher
215 FmFormShell *pFormShell; // DB-FormShell
216
217 SwView_Impl *pViewImpl; // Impl-Daten fuer UNO + Basic
218
219
220 SwScrollbar *pHScrollbar, // MDI Bedienelemente
221 *pVScrollbar;
222
223 Window *pScrollFill; // Dummy-Window zum Fuellen der rechten
224 // unteren Ecke, wenn beide Scrollbars
225 // aktiv sind
226
227 SvxRuler *pHRuler,
228 *pVRuler;
229 ImageButton *pTogglePageBtn;
230
231 SwHlpImageButton *pPageUpBtn,
232 *pPageDownBtn;
233
234 SwNaviImageButton *pNaviBtn;
235 SwGlossaryHdl *pGlosHdl; // Henkel Textbausteine
236 SwDrawBase *pDrawActual;
237
238 const SwFrmFmt *pLastTableFormat;
239
240 SwFormatClipboard *pFormatClipboard; //holds data for format paintbrush
241
242 SwPostItMgr *mpPostItMgr;
243
244 int nSelectionType;
245
246 static const int MASTERENUMCOMMANDS = 6;
247
248 String aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
249
250 sal_uInt16 nPageCnt;
251
252 // Aktueller Drawmode
253 sal_uInt16 nDrawSfxId;
254 String sDrawCustom; //some drawing types are marked with strings!
255 sal_uInt16 nFormSfxId;
256 sal_uInt16 nLastPasteDestination;
257
258 // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
259 sal_uInt16 nLeftBorderDistance;
260 sal_uInt16 nRightBorderDistance;
261
262 sal_Bool bCenterCrsr : 1,
263 bTopCrsr : 1,
264 bAllwaysShowSel : 1,
265 bTabColFromDoc : 1,
266 bNumIndentFromDoc : 1, // #i23726#
267 bTabRowFromDoc : 1,
268 bSetTabColFromDoc : 1 ,
269 bSetTabRowFromDoc : 1,
270 bAttrChgNotified : 1,
271 bAttrChgNotifiedWithRegistrations : 1,
272 bVerbsActive : 1,
273 bDrawRotate : 1,
274 bDrawSelMode : 1,
275 bShowAtResize : 1,
276 bInOuterResizePixel : 1,
277 bInInnerResizePixel : 1,
278 bPasteState : 1,
279 bPasteSpecialState : 1,
280 bInMailMerge : 1,
281 bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
282 bOldShellWasPagePreView : 1,
283 bIsPreviewDoubleClick : 1, // #i114045#
284 bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
285 ;
286
287 // Methoden fuers Suchen
288 // Suchkontext setzen
289 SW_DLLPRIVATE sal_Bool SearchAndWrap(sal_Bool bApi = sal_False);
290 SW_DLLPRIVATE sal_Bool SearchAll(sal_uInt16* pFound = 0);
291 SW_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
292 SW_DLLPRIVATE void Replace();
293
294 sal_Bool IsDocumentBorder();
295
296 SW_DLLPRIVATE sal_Bool IsTextTool() const;
297
298 // Bedienelemente verwalten anlegen
299 SW_DLLPRIVATE void CreateBtns();
300 SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
301
302 SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer * );
303 SW_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
304
305 SW_DLLPRIVATE DECL_LINK( HtmlOptionsHdl, void * );
306
307 inline long GetXScroll() const;
308 inline long GetYScroll() const;
309 SW_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
310 SW_DLLPRIVATE void CalcPt( Point* pPt,const Rectangle& rRect,
311 sal_uInt16 nRangeX = USHRT_MAX,
312 sal_uInt16 nRangeY = USHRT_MAX);
313
314 SW_DLLPRIVATE sal_Bool GetPageScrollUpOffset(SwTwips& rOff) const;
315 SW_DLLPRIVATE sal_Bool GetPageScrollDownOffset(SwTwips& rOff) const;
316
317 // Scrollbar Movements
318 SW_DLLPRIVATE long PageUp();
319 SW_DLLPRIVATE long PageDown();
320 SW_DLLPRIVATE long PageUpCrsr(sal_Bool bSelect);
321 SW_DLLPRIVATE long PageDownCrsr(sal_Bool bSelect);
322 SW_DLLPRIVATE long PhyPageUp();
323 SW_DLLPRIVATE long PhyPageDown();
324
325 SW_DLLPRIVATE int _CreateScrollbar( sal_Bool bHori );
326 SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
327 SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
328 SW_DLLPRIVATE sal_Bool UpdateScrollbars();
329 SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
330
331 SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow);
332
333 // Linguistik-Funktionen
334 SW_DLLPRIVATE void HyphenateDocument();
335 SW_DLLPRIVATE sal_Bool IsDrawTextHyphenate();
336 SW_DLLPRIVATE void HyphenateDrawText();
337 SW_DLLPRIVATE void StartThesaurus();
338
339 // text conversion
340 SW_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
341
342 // used for spell checking and text conversion
343 SW_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, sal_Bool bStartDone,
344 sal_Bool bEndDone, SwConversionArgs *pConvArgs = 0 );
345 SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
346
347 SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
348 SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
SpellKontext(sal_Bool bOn=sal_True)349 SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
350 { bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
351
352 // Methoden fuers Printing
353 SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
354 SfxTabPage* CreatePrintOptionsPage( Window* pParent,
355 const SfxItemSet& rSet);
356 // fuer Readonly-Umschaltung
357 SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
358 SW_DLLPRIVATE void _CheckReadonlyState();
359 SW_DLLPRIVATE void _CheckReadonlySelection();
360
361 // Methode fuer PageDesc drehen
362 SW_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
363
364 SW_DLLPRIVATE void _SetZoom( const Size &rEditSz,
365 SvxZoomType eZoomType,
366 short nFactor = 100,
367 sal_Bool bViewOnly = sal_False);
368 SW_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool bInner );
369
370 SW_DLLPRIVATE void ShowAtResize();
371
372 SW_DLLPRIVATE virtual void Move();
373
374 public: // #123922# Needs to be called from a 2nd place now as a helper method
375 SW_DLLPRIVATE sal_Bool InsertGraphicDlg( SfxRequest& );
376
377 protected:
378
GetViewImpl()379 SwView_Impl* GetViewImpl() {return pViewImpl;}
380
381 void ImpSetVerb( int nSelType );
382
GetSelectionType() const383 int GetSelectionType() const { return nSelectionType; }
SetSelectionType(int nSet)384 void SetSelectionType(int nSet) { nSelectionType = nSet;}
385
386 // fuer die SwWebView
SetShell(SfxShell * pS)387 void SetShell( SfxShell* pS ) { pShell = pS; }
SetFormShell(FmFormShell * pSh)388 void SetFormShell( FmFormShell* pSh ) { pFormShell = pSh; }
389
390 virtual void SelectShell();
391
392 virtual void Activate(sal_Bool);
393 virtual void Deactivate(sal_Bool);
394 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
395 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
396 virtual Size GetOptimalSizePixel() const;
397
398 void SetImageButtonColor(Color& rColor);
399
GetLastTblFrmFmt() const400 const SwFrmFmt* GetLastTblFrmFmt() const {return pLastTableFormat;}
SetLastTblFrmFmt(const SwFrmFmt * pSet)401 void SetLastTblFrmFmt(const SwFrmFmt* pSet) {pLastTableFormat = pSet;}
402
403 // form letter execution
404 void GenerateFormLetter(sal_Bool bUseCurrentDocument);
405
406 using SfxShell::GetDispatcher;
407
408 public:
409
410 SFX_DECL_VIEWFACTORY(SwView);
411 SFX_DECL_INTERFACE(SW_VIEWSHELL)
412 TYPEINFO();
413
414 SfxDispatcher &GetDispatcher();
415
416 void GotFocus() const;
417 virtual SdrView* GetDrawView() const;
418 virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
419 virtual void ShowCursor( FASTBOOL bOn = sal_True );
420 virtual ErrCode DoVerb( long nVerb );
421
422 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
423 sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false);
424 ShellModes GetShellMode();
425
426 com::sun::star::view::XSelectionSupplier* GetUNOObject();
427
428 String GetSelectionTextParam( sal_Bool bCompleteWords,
429 sal_Bool bEraseTrail );
430 virtual sal_Bool HasSelection( sal_Bool bText ) const;
431 virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
432 virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
433 virtual void MarginChanged();
434
435 // replace word/selection with text from the thesaurus
436 // (this code has special handling for "in word" character)
437 void InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
438 bool IsValidSelectionForThesaurus() const;
439 String GetThesaurusLookUpText( bool bSelection ) const;
440
441 // Shell sofort wechseln -> fuer GetSelectionObject
442 void StopShellTimer();
443
GetWrtShell() const444 inline SwWrtShell& GetWrtShell () const { return *pWrtShell; }
GetWrtShellPtr() const445 inline SwWrtShell* GetWrtShellPtr() const { return pWrtShell; }
446
GetEditWin()447 inline SwEditWin &GetEditWin() { return *pEditWin; }
GetEditWin() const448 inline const SwEditWin &GetEditWin () const { return *pEditWin; }
449
450 #if defined WNT || defined UNX
451 void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
452 #endif
453
454 //Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
455 SwGlossaryHdl* GetGlosHdl();
456
GetVisArea() const457 inline const Rectangle& GetVisArea() const { return aVisArea; }
458
459 sal_Bool IsScroll(const Rectangle& rRect) const;
460 void Scroll( const Rectangle& rRect,
461 sal_uInt16 nRangeX = USHRT_MAX,
462 sal_uInt16 nRangeY = USHRT_MAX);
463
464 long SetVScrollMax(long lMax);
465 long SetHScrollMax(long lMax);
466
467 DECL_LINK( SpellError, LanguageType * );
468 sal_Bool ExecSpellPopup( const Point& rPt );
469 sal_Bool ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
470 // SMARTTAGS
471 sal_Bool ExecSmartTagPopup( const Point& rPt );
472
473 DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
474 sal_Bool ExecDrwTxtSpellPopup(const Point& rPt);
475
SetTabColFromDocPos(const Point & rPt)476 void SetTabColFromDocPos( const Point &rPt ) { aTabColFromDocPos = rPt; }
SetTabColFromDoc(sal_Bool b)477 void SetTabColFromDoc( sal_Bool b ) { bTabColFromDoc = b; }
IsTabColFromDoc() const478 sal_Bool IsTabColFromDoc() const { return bTabColFromDoc; }
SetTabRowFromDoc(sal_Bool b)479 void SetTabRowFromDoc( sal_Bool b ) { bTabRowFromDoc = b; }
IsTabRowFromDoc() const480 sal_Bool IsTabRowFromDoc() const { return bTabRowFromDoc; }
481
482 // -> #i23726#
SetNumRuleNodeFromDoc(SwTxtNode * pNumRuleNode)483 void SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
484 { pNumRuleNodeFromDoc = pNumRuleNode; }
SetNumIndentFromDoc(sal_Bool b)485 void SetNumIndentFromDoc(sal_Bool b) { bNumIndentFromDoc = b; }
IsNumIndentFromDoc() const486 sal_Bool IsNumIndentFromDoc() const { return NULL != pNumRuleNodeFromDoc; }
487 // <- #i23726#
488
489 void DocSzChgd( const Size& rNewSize );
GetDocSz() const490 const Size& GetDocSz() const { return aDocSz; }
491 virtual void SetVisArea( const Rectangle&, sal_Bool bUpdateScrollbar = sal_True);
492 void SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
493 void CheckVisArea();
494
495 void RecheckBrowseMode();
496 static LAYOUT_NS Dialog* GetSearchDialog();
497
498 static sal_uInt16 GetMoveType();
499 static void SetMoveType(sal_uInt16 nSet);
500 DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
501 static void SetActMark(sal_Int32 nSet);
502
503 sal_Bool HandleWheelCommands( const CommandEvent& );
504
505 // Rahmen einfuegen
506 void InsFrmMode(sal_uInt16 nCols);
507
508 void SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
509 virtual void SetZoomFactor( const Fraction &rX, const Fraction & );
510
511 void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly = sal_False );
512
513 void ShowHScrollbar(sal_Bool bShow);
514 sal_Bool IsHScrollbarVisible()const;
515
516 void ShowVScrollbar(sal_Bool bShow);
517 sal_Bool IsVScrollbarVisible()const;
518
519 int CreateVRuler();
520 int KillVRuler();
521 int CreateTab();
522 int KillTab();
523
StatVRuler() const524 int StatVRuler() const { return ((Window*)pVRuler)->IsVisible(); }
525 void ChangeVRulerMetric(FieldUnit eUnit);
526 void GetVRulerMetric(FieldUnit& rToFill) const;
527
StatTab() const528 int StatTab() const { return ((Window*)pHRuler)->IsVisible(); }
GetHRuler()529 SvxRuler& GetHRuler() { return *pHRuler; }
GetVRuler()530 SvxRuler& GetVRuler() { return *pVRuler; }
531 void InvalidateRulerPos();
532 void ChangeTabMetric(FieldUnit eUnit);
533 void GetHRulerMetric(FieldUnit& rToFill) const;
534
535 // Handler
536 void Execute(SfxRequest&);
537 void ExecPageMove(SfxRequest&);
538 void ExecStyle(SfxRequest&);
539 void ExecLingu(SfxRequest&);
540 void ExecDataBase(SfxRequest&);
541 void ExecDlg(SfxRequest&);
542 void ExecDlgExt(SfxRequest&);
543 void ExecDBDlg(SfxRequest &);
544 void ExecColl(SfxRequest&);
545 void ExecutePrint(SfxRequest&);
546 void ExecDraw(SfxRequest&);
547 void ExecTabWin(SfxRequest&);
548 void ExecuteStatusLine(SfxRequest&);
549 DECL_LINK( ExecRulerClick, Ruler * );
550 void ExecSearch(SfxRequest&, sal_Bool bNoMessage = sal_False);
551 void ExecViewOptions(SfxRequest &);
552
553 void StateViewOptions(SfxItemSet &);
554 void StateSearch(SfxItemSet &);
555 void GetState(SfxItemSet&);
556 void StateStatusLine(SfxItemSet&);
557
558
559 // Funktionen fuer Drawing
560 void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
GetDrawFuncPtr() const561 inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const { return pDrawActual; }
562 void GetDrawState(SfxItemSet &rSet);
563 void ExitDraw();
IsDrawRotate()564 inline sal_Bool IsDrawRotate() { return bDrawRotate; }
FlipDrawRotate()565 inline void FlipDrawRotate() { bDrawRotate = !bDrawRotate; }
IsDrawSelMode()566 inline sal_Bool IsDrawSelMode() { return bDrawSelMode; }
567 void SetSelDrawSlot();
FlipDrawSelMode()568 inline void FlipDrawSelMode() { bDrawSelMode = !bDrawSelMode; }
569 void NoRotate(); // Rotate-Mode abschalten
570 sal_Bool EnterDrawTextMode(const Point& aDocPos);
LeaveDrawCreate()571 void LeaveDrawCreate() { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
IsDrawMode()572 sal_Bool IsDrawMode() { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
573 sal_Bool IsFormMode() const;
574 sal_Bool IsBezierEditMode();
575 sal_Bool AreOnlyFormsSelected() const;
576 sal_Bool HasDrwObj(SdrObject *pSdrObj) const;
577 sal_Bool HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
578 sal_Bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
579 Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
580
581 void StateTabWin(SfxItemSet&);
582
583 // Attribute haben sich geaendert
584 DECL_LINK( AttrChangedNotify, SwWrtShell * );
585
586 // form control has been activated
587 DECL_LINK( FormControlActivated, FmFormShell* );
588
589 // Links bearbeiten
590 void EditLinkDlg();
591 void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
592 void InsertCaption(const InsCaptionOpt *pOpt);
593
594 // Async Aufruf durch Core
595 void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
596
597 String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
598
599 // Shell rausreichen
GetCurShell()600 SfxShell *GetCurShell() { return pShell; }
601 SwDocShell *GetDocShell();
602 inline const SwDocShell *GetDocShell() const;
GetFormShell()603 inline FmFormShell *GetFormShell() { return pFormShell; }
GetFormShell() const604 inline const FmFormShell *GetFormShell() const { return pFormShell; }
605
606 //damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
ResetSubShell()607 void ResetSubShell() { pShell = 0; }
608
609 virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False );
610 virtual void ReadUserData(const String &, sal_Bool bBrowse = sal_False );
611 virtual void ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
612 virtual void WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
613
SetCrsrAtTop(sal_Bool bFlag,sal_Bool bCenter=sal_False)614 void SetCrsrAtTop( sal_Bool bFlag, sal_Bool bCenter = sal_False )
615 { bTopCrsr = bFlag, bCenterCrsr = bCenter; }
IsCrsrAtTop() const616 sal_Bool IsCrsrAtTop() const { return bTopCrsr; }
IsCrsrAtCenter() const617 sal_Bool IsCrsrAtCenter() const { return bCenterCrsr; }
618
619 sal_Bool JumpToSwMark( const String& rMark );
620
621 long InsertDoc( sal_uInt16 nSlotId, const String& rFileName,
622 const String& rFilterName, sal_Int16 nVersion = 0 );
623
624 void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
625 long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
626 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
627
628 // status methods for clipboard.
629 // Status changes now notified from the clipboard.
630 sal_Bool IsPasteAllowed();
631 sal_Bool IsPasteSpecialAllowed();
632
633 // Enable mail merge - mail merge field dialog enabled
634 void EnableMailMerge(sal_Bool bEnable = sal_True);
635 //apply Accessibility options
636 void ApplyAccessibilityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
637
638 SwView(SfxViewFrame* pFrame, SfxViewShell*);
639 ~SwView();
640
641 void NotifyDBChanged();
642
643 SfxObjectShellLock & GetTmpSelectionDoc();
644 SfxObjectShellLock & GetOrCreateTmpSelectionDoc();
645
646 void AddTransferable(SwTransferable& rTransferable);
647
648 // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
649 // or to support printing
650 void SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource);
651 SwMailMergeConfigItem* GetMailMergeConfigItem();
652 sal_uInt16 GetMailMergeRestartPage() const;
653 sal_Bool IsMailMergeSourceView() const;
654
655 void ExecFormatPaintbrush(SfxRequest &);
656 void StateFormatPaintbrush(SfxItemSet &);
657
658 //public fuer D&D
659 int InsertGraphic( const String &rPath, const String &rFilter,
660 sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
661 Graphic* pPreviewGrf = 0,
662 sal_Bool bRule = sal_False );
663
664 void ExecuteScan( SfxRequest& rReq );
665
GetPostItMgr()666 SwPostItMgr* GetPostItMgr() { return mpPostItMgr;}
GetPostItMgr() const667 const SwPostItMgr* GetPostItMgr() const { return mpPostItMgr;}
668 };
669
670 // ----------------- inline Methoden ----------------------
671
GetXScroll() const672 inline long SwView::GetXScroll() const
673 {
674 return aVisArea.GetWidth() * nScrollX / 100L;
675 }
676
GetYScroll() const677 inline long SwView::GetYScroll() const
678 {
679 return aVisArea.GetHeight() * nScrollY / 100L;
680 }
681
GetDocShell() const682 inline const SwDocShell *SwView::GetDocShell() const
683 {
684 return ((SwView*)this)->GetDocShell();
685 }
686
687 //***********************************************************
688
689 SfxTabPage* CreatePrintOptionsPage( Window *pParent,
690 const SfxItemSet &rOptions,
691 sal_Bool bPreview);
692
693 #endif
694
695 /* vim: set noet sw=4 ts=4: */
696