20#include <config_features.h>
21#include <config_wasm_strip.h>
28#include <officecfg/Office/Common.hxx>
42#include <com/sun/star/linguistic2/XLinguProperties.hpp>
43#include <osl/diagnose.h>
57#define ShellClass_SwView
58#define ShellClass_Text
59#define ShellClass_TextDrawText
86 GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR,
true);
88 GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
90 GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
91 GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
92 GetStaticInterface()->RegisterChildWindow(SwSpellDialogChildWindow::GetChildWindowId());
94 GetStaticInterface()->RegisterChildWindow(SID_HYPERLINK_DIALOG);
96#if HAVE_FEATURE_AVMEDIA
97 GetStaticInterface()->RegisterChildWindow(::avmedia::MediaPlayer::GetChildWindowId());
101 GetStaticInterface()->RegisterChildWindow(
FN_SYNC_LABELS,
false, SfxShellFeature::SwChildWindowLabel);
103 GetStaticInterface()->RegisterObjectBar(
SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server,
104 ToolbarId::Tools_Toolbox);
120#if ENABLE_WASM_STRIP_ACCESSIBILITY
176 static sal_uInt16
const aInva[] =
180 SID_RULER_BORDERS, SID_RULER_PAGE_POS,
186 SID_TOGGLE_RESOLVED_NOTES,
209 if(
GetWrtShell().GetViewOptions()->getBrowseMode() && SvxZoomType::PERCENT != (
eType =
245 case SID_BROWSER_MODE:
270 case SID_TOGGLE_NOTES:
281 case SID_TOGGLE_RESOLVED_NOTES:
310 case SID_GRID_VISIBLE:
314 case SID_HELPLINES_MOVE:
331 case SID_AUTOSPELL_CHECK:
334 case SID_ACCESSIBILITY_CHECK_ONLINE:
337 aBool.
SetValue(bOnlineAccessibilityCheck);
379 std::optional<SwViewOption> pOpt( *
GetWrtShell().GetViewOptions() );
384 bool bBrowseModeChanged =
false;
387 sal_uInt16 nSlot = rReq.
GetSlot();
390 if( pArgs && SfxItemState::SET == pArgs->
GetItemState( nSlot ,
false, &pAttr ))
403 bFlag = !pOpt->IsGraphic();
404 pOpt->SetGraphic( bFlag );
409 bFlag = !pOpt->IsFieldShadings() ;
415 bFlag = !pOpt->IsDocBoundaries();
421 bFlag = !pOpt->IsSectionBoundaries();
425 case SID_GRID_VISIBLE:
427 bFlag = !pOpt->IsGridVisible();
429 pOpt->SetGridVisible( bFlag );
434 bFlag = !pOpt->IsSnap();
436 pOpt->SetSnap( bFlag );
439 case SID_HELPLINES_MOVE:
441 bFlag = !pOpt->IsCrossHair();
443 pOpt->SetCrossHair( bFlag );
446 case SID_BROWSER_MODE:
447 bBrowseModeChanged = !pOpt->getBrowseMode();
448 pOpt->setBrowseMode(
true );
452 bBrowseModeChanged = pOpt->getBrowseMode();
453 pOpt->setBrowseMode(
false );
456 case SID_TOGGLE_NOTES:
458 bFlag = !pOpt->IsPostIts();
461 pOpt->SetPostIts( bFlag );
462 if (pOpt->IsPostIts())
466 case SID_TOGGLE_RESOLVED_NOTES:
468 bFlag = pOpt->IsResolvedPostIts();
473 pOpt->SetResolvedPostIts( !bFlag );
479 bFlag = !pOpt->IsShowHiddenPara();
481 pOpt->SetShowHiddenPara( bFlag );
486 bFlag = !pOpt->IsHideWhitespaceMode();
488 pOpt->SetHideWhitespaceMode(bFlag);
493 bFlag = pOpt->IsHideWhitespaceMode();
495 pOpt->SetHideWhitespaceMode(!bFlag);
501 bFlag = !pOpt->IsSmoothScroll();
503 pOpt->SetSmoothScroll( bFlag );
508 bFlag = !pOpt->IsViewVRuler();
510 pOpt->SetViewVRuler( bFlag );
515 bFlag = !pOpt->IsViewVScrollBar();
517 pOpt->SetViewVScrollBar( bFlag );
522 bFlag = !pOpt->IsViewHScrollBar();
524 pOpt->SetViewHScrollBar( bFlag );
529 bFlag = !pOpt->IsViewAnyRuler();
531 pOpt->SetViewAnyRuler( bFlag );
536 bFlag = !pOpt->IsTableBoundaries();
542 bFlag = !pOpt->IsFieldName() ;
544 pOpt->SetFieldName( bFlag );
562 bFlag = !pOpt->IsViewMetaChars();
567 case SID_AUTOSPELL_CHECK:
570 if (pArgs && pArgs->
HasItem(FN_PARAM_1, &pItem))
574 bFlag = !pOpt->IsOnlineSpell();
578 pOpt->SetOnlineSpell(bSet);
584 xLngProp->setIsSpellAuto( bSet );
594 bool bIsAutoGrammar =
false;
597 if (pDoc && bIsAutoGrammar)
603 case SID_ACCESSIBILITY_CHECK_ONLINE:
605 if (pArgs && pArgs->
HasItem(FN_PARAM_1, &pItem))
612 bSet = !bOnlineCheck;
615 officecfg::Office::Common::Accessibility::OnlineAccessibilityCheck::set(bSet, batch);
619 SwDoc* pDocument = pDocSh? pDocSh->
GetDoc() :
nullptr;
628 bFlag = !pOpt->IsShadowCursor();
632 pOpt->SetShadowCursor(bSet);
637 bFlag = !pOpt->IsShowInlineTooltips();
639 pOpt->SetShowInlineTooltips( bFlag );
644 bFlag = !pOpt->IsUseHeaderFooterMenu();
646 pOpt->SetUseHeaderFooterMenu( bFlag );
652 bFlag = !pOpt->IsShowOutlineContentVisibilityButton();
659 pOpt->SetShowOutlineContentVisibilityButton(bFlag);
675 bFlag = !pOpt->IsShowChangesInMargin();
677 pOpt->SetShowChangesInMargin( bFlag );
681 OSL_FAIL(
"wrong request method");
686 bool bWebView =
dynamic_cast<const SwWebView*
>(
this) !=
nullptr;
693 if( bBrowseModeChanged )
710 if ( nSlot == SID_AUTOSPELL_CHECK )
716 if( bBrowseModeChanged && !bFlag )
void Invalidate(sal_uInt16 nId)
void SetValue(bool const bTheValue)
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
void SetWhich(sal_uInt16 nId)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void AppendItem(const SfxPoolItem &)
void Done(bool bRemove=false)
virtual void Invalidate(sal_uInt16 nId=0)
SfxBindings & GetBindings()
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
bool SetProperty(std::u16string_view rPropertyName, const css::uno::Any &rValue)
virtual VclPtr< SfxAbstractTabDialog > CreateSwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rSh)=0
virtual VclPtr< SfxAbstractTabDialog > CreateOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)=0
static SwAbstractDialogFactory * Create()
void EndAction(const bool bIdleEnd=false)
void ToggleLayoutMode(SwView *pView)
SwDoc * GetDoc()
returns Doc. But be careful!
bool StartGrammarChecking(bool bSkipStart=false)
std::unique_ptr< sw::OnlineAccessibilityCheck > const & getOnlineAccessibilityCheck() const
bool IsModified() const
Changes in document?
static void CheckSpellChanges(bool bOnlineSpelling, bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags)
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
void ShowHideResolvedNotes(bool visible)
bool IsViewHRuler(bool bDirect=false) const
bool IsHideWhitespaceMode() const
bool IsParagraph(bool bHard=false) const
bool IsSectionBoundaries() const
void SetLineBreak(bool b)
bool IsShadowCursor() const
bool IsSmoothScroll() const
bool IsShowBookmarks(bool const bHard=false) const
bool IsBlank(bool bHard=false) const
bool IsShowOutlineContentVisibilityButton() const
bool IsGridVisible() const
void SetShowHiddenChar(bool b)
void SetHardBlank(bool b)
bool IsShowHiddenPara() const
void SetParagraph(bool b)
bool IsViewAnyRuler() const
void SetShowBookmarks(bool const b)
bool getBrowseMode() const
bool IsShowHiddenChar(bool bHard=false) const
bool IsViewVRuler(bool bDirect=false) const
bool IsTableBoundaries() const
bool CanHideWhitespace() const
The rules that allow for hiding whitespace.
bool IsViewMetaChars() const
bool IsResolvedPostIts() const
bool IsLineBreak(bool bHard=false) const
bool IsTab(bool bHard=false) const
bool IsOnlineSpell() const
bool IsDocBoundaries() const
bool IsUseHeaderFooterMenu() const
void SetAppearanceFlag(ViewOptFlags nFlag, bool bSet, bool bSaveInConfig=false)
bool IsShowInlineTooltips() const
bool IsShowChangesInMargin() const
bool IsFieldShadings() const
void SetViewMetaChars(bool b)
bool IsViewLocked() const
const SwViewOption * GetViewOptions() const
SwWrtShell & GetWrtShell() const
std::unique_ptr< SwView_Impl > m_pViewImpl
std::unique_ptr< SwWrtShell > m_pWrtShell
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
bool IsHScrollbarVisible() const
SwPostItMgr * GetPostItMgr()
css::view::XSelectionSupplier * GetUNOObject()
void ExecNumberingOutline(SfxItemPool &)
bool IsVScrollbarVisible() const
void ExecViewOptions(SfxRequest &)
bool m_bIsHighlightCharDF
ShellMode GetShellMode() const
SwDocShell * GetDocShell()
void ExecFormatFootnote()
void StateViewOptions(SfxItemSet &)
void ApplyAccessibilityOptions()
SAL_DLLPRIVATE void CalcVisArea(const Size &rPixelSz)
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
Used by the UI to modify the document model.
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
void MakeAllFoldedOutlineContentVisible(bool bMakeVisible=true)
static std::shared_ptr< ConfigurationChanges > create()
#define FN_VIEW_SHOW_WHITESPACE
#define FN_VIEW_SMOOTH_SCROLL
#define FN_SHOW_CHANGES_IN_MARGIN
#define FN_HIGHLIGHT_CHAR_DF
#define FN_VIEW_SECTION_BOUNDARIES
#define FN_USE_HEADERFOOTERMENU
#define FN_VIEW_HIDDEN_PARA
#define FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON
#define FN_VIEW_META_CHARS
#define FN_WORDCOUNT_DIALOG
#define FN_VIEW_FIELDNAME
#define FN_INSERT_FIELD_DATA_ONLY
#define FN_VIEW_HIDE_WHITESPACE
#define FN_REDLINE_ACCEPT
#define FN_SHOW_INLINETOOLTIPS
#define FN_VIEW_TABLEGRID
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
constexpr OUStringLiteral UPN_IS_GRAMMAR_AUTO
constexpr OUStringLiteral UPN_IS_SPELL_AUTO
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
#define SFX_OBJECTBAR_TOOLS
#define SFX_IMPL_INTERFACE(Class, SuperClass)
uno::Reference< linguistic2::XLinguProperties > GetLinguPropertySet()
static void lcl_SetViewMarks(SwViewOption &rVOpt, bool bOn)
static bool lcl_IsViewMarks(const SwViewOption &rVOpt)
SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default")
static void lcl_SetViewMetaChars(SwViewOption &rVOpt, bool bOn)
#define SFX_VIEW_REGISTRATION(DocClass)