19#ifndef INCLUDED_SFX2_VIEWSH_HXX
20#define INCLUDED_SFX2_VIEWSH_HXX
27#include <com/sun/star/uno/Reference.h>
37#include <unordered_set>
38#include <unordered_map>
47 class DialogController;
63namespace rtl {
class OStringBuffer; }
64namespace vcl {
class PrinterController; }
92#define SFX_PRINTER_ALL (SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::OPTIONS | SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE)
94#define SFX_PRINTERROR_BUSY 1
97#define DEFAULT_MARGIN_WIDTH 8
98#define DEFAULT_MARGIN_HEIGHT 12
130#define SFX_DECL_VIEWFACTORY(Class) \
132 static SfxViewFactory *s_pFactory; \
134 static SfxViewShell *CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView); \
135 static void RegisterFactory( SfxInterfaceId nPrio ); \
136 static SfxViewFactory*Factory() { return s_pFactory; } \
137 static void InitFactory()
139#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
140 SfxViewFactory* Class::s_pFactory; \
141 SfxViewShell* Class::CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView) \
142 { return new Class(rFrame, pOldView); } \
143 void Class::RegisterFactory( SfxInterfaceId nPrio ) \
145 s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,AsciiViewName);\
148 void Class::InitFactory()
150#define SFX_VIEW_REGISTRATION(DocClass) \
151 DocClass::Factory().RegisterViewFactory( *Factory() )
155 return dynamic_cast<const T*
>(pShell) !=
nullptr;
170 std::unique_ptr<struct SfxViewShell_Impl>
pImpl;
194 virtual void Activate(
bool IsMDIActivate)
override;
195 virtual void Deactivate(
bool IsMDIActivate)
override;
197 virtual void InnerResizePixel(
const Point &rOfs,
const Size &rSize,
bool inplaceEditModeChange );
198 virtual void OuterResizePixel(
const Point &rOfs,
const Size &rSize );
199 virtual void SetZoomFactor(
const Fraction &rZoomX,
const Fraction &rZoomY );
209 bool bOnlyVisible =
true,
210 const std::function<
bool (
const SfxViewShell* )>& isViewShell =
nullptr );
220 static void InitInterface_Impl();
232 SfxInPlaceClient* FindIPClient(
const css::uno::Reference < css::embed::XEmbeddedObject >& xObj,
vcl::Window *pObjParentWin )
const;
234 virtual ErrCode DoVerb(sal_Int32 nVerb);
236 void OutplaceActivated(
bool bActive );
240 void JumpToMark(
const OUString& rMark );
251 virtual bool PrepareClose(
bool bUI =
true );
252 virtual OUString GetSelectionText(
bool bCompleteWords =
false,
bool bOnlyASample =
false );
253 virtual bool HasSelection(
bool bText =
true )
const;
254 virtual SdrView* GetDrawView()
const;
256 void AddSubShell(
SfxShell& rShell );
257 void RemoveSubShell(
SfxShell *pShell=
nullptr );
258 SfxShell* GetSubShell( sal_uInt16 );
264 virtual void notifyWindow(
vcl::LOKWindowId nLOKWindowId,
const OUString& rAction,
const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
267 virtual void ShowCursor(
bool bOn =
true );
275 const SvBorder& GetBorderPixel()
const;
276 void SetBorderPixel(
const SvBorder &rBorder );
277 void InvalidateBorder();
296 virtual SfxPrinter* GetPrinter(
bool bCreate =
false );
298 virtual bool HasPrintOptionsPage()
const;
300 Printer* GetActivePrinter()
const;
303 virtual void WriteUserData( OUString&,
bool bBrowse =
false );
304 virtual void ReadUserData(
const OUString&,
bool bBrowse =
false );
305 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& );
306 virtual void ReadUserDataSequence (
const css::uno::Sequence < css::beans::PropertyValue >& );
316 virtual css::uno::Reference< css::frame::XModel >
317 GetCurrentDocument()
const;
321 void SetCurrentDocument()
const;
325 virtual css::uno::Reference< css::view::XRenderable > GetRenderable();
328 virtual void MarginChanged();
329 const Size& GetMargin()
const;
330 void SetMargin(
const Size& );
331 void DisconnectAllClients();
336 css::uno::Reference<css::frame::XController>
GetController()
const;
339 const OUString& rMenuIdentifier,
341 css::ui::ContextMenuExecuteEvent aEvent);
343 const OUString& rMenuIdentifier,
344 css::ui::ContextMenuExecuteEvent aEvent);
346 void ExecPrint(
const css::uno::Sequence < css::beans::PropertyValue >&,
bool,
bool );
348 void StartPrint(
const css::uno::Sequence < css::beans::PropertyValue >&,
bool,
bool );
349 const std::shared_ptr< vcl::PrinterController >& GetPrinterController()
const;
351 void AddRemoveClipboardListener(
const css::uno::Reference < css::datatransfer::clipboard::XClipboardListener>&,
bool );
352 css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier()
const;
355 SAL_DLLPRIVATE
void AddContextMenuInterceptor_Impl(
const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
356 SAL_DLLPRIVATE
void RemoveContextMenuInterceptor_Impl(
const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
357 SAL_DLLPRIVATE
bool GlobalKeyInput_Impl(
const KeyEvent &rKeyEvent );
365 SAL_DLLPRIVATE
bool HandleNotifyEvent_Impl(
NotifyEvent const & rEvent );
366 SAL_DLLPRIVATE
bool HasKeyListeners_Impl()
const;
367 SAL_DLLPRIVATE
bool HasMouseClickListeners_Impl()
const;
372 SAL_DLLPRIVATE
void ExecPrint_Impl(
SfxRequest &);
373 SAL_DLLPRIVATE
void ExecMisc_Impl(
SfxRequest &);
374 SAL_DLLPRIVATE
void GetState_Impl(
SfxItemSet&);
376 SAL_DLLPRIVATE
void PushSubShells_Impl(
bool bPush=
true );
378 SAL_DLLPRIVATE
bool ExecKey_Impl(
const KeyEvent& aKey);
384 void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState);
392 virtual void flushPendingLOKInvalidateTiles();
397 virtual std::optional<OString> getLOKPayload(
int nType,
int nViewId)
const;
400 void setTiledSearching(
bool bTiledSearching);
402 virtual int getPart()
const;
404 virtual int getEditMode()
const;
423 void NotifyOtherViews(
int nType,
const OString& rKey,
const OString& rPayload)
override;
429 virtual void afterCallbackRegistered();
435 virtual OUString GetColorConfigName()
const;
438 void SetLOKLanguageTag(
const OUString& rBcp47LanguageTag);
442 void SetLOKAccessibilityState(
bool bEnabled);
447 return { maLOKIsTimezoneSet, maLOKTimezone };
455 maLOKIsTimezoneSet = isSet;
456 maLOKTimezone = rTimezone;
460 void SetLOKLocale(
const OUString& rBcp47LanguageTag);
476 bool isBlockedCommand(OUString command);
483 OUString getA11yFocusedParagraph()
const;
484 int getA11yCaretPosition()
const;
virtual vcl::Window * GetEditWindowForActiveOLEObj() const=0
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const=0
virtual void libreOfficeKitViewAddPendingInvalidateTiles()=0
virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const=0
virtual void libreOfficeKitViewUpdatedCallback(int nType) const=0
virtual ViewShellId GetViewShellId() const=0
virtual void NotifyOtherViews(int nType, const OString &rKey, const OString &rPayload)=0
virtual void NotifyOtherView(OutlinerViewShell *pOtherShell, int nType, const OString &rKey, const OString &rPayload)=0
virtual ViewShellDocId GetDocId() const=0
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString &pPayload, int nViewId) const=0
virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle *pRect, int nPart, int nMode) const=0
virtual void Notify(SfxBroadcaster &, const SfxHint &) override
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
virtual void Activate(bool bMDI)
Virtual method that is called when enabling the SfxShell instance, in order to give the Subclasses th...
virtual void Deactivate(bool bMDI)
Virtual method that is called when disabling the SfxShell instance, to give the Subclasses the opport...
virtual SfxObjectShell * GetObjectShell()
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
bool isLOKMobilePhone() const
Check if the lok client is running on a mobile device.
rtl::Reference< LOKDocumentFocusListener > mpLOKDocumentFocusListener
VclPtr< vcl::Window > pWindow
bool NewWindowAllowed() const
const LanguageTag & GetLOKLocale() const
Get the LibreOfficeKit locale of this view.
std::unique_ptr< struct SfxViewShell_Impl > pImpl
bool mbPrinterSettingsModified
bool isLOKTablet() const
Check if the lok client is running on a tablet.
SfxViewFrame & GetViewFrame() const
SAL_DLLPRIVATE void PopSubShells_Impl()
StylesHighlighterColorMap & GetStylesHighlighterCharColorMap()
StylesHighlighterColorMap CharStylesColorMap
void SetStoringHelper(std::shared_ptr< SfxStoringHelper > xHelper)
LOKDeviceFormFactor GetLOKDeviceFormFactor() const
Get the form factor of the device where the lok client is running.
bool mbLOKAccessibilityEnabled
bool TryContextMenuInterception(const rtl::Reference< VCLXPopupMenu > &rIn, const OUString &rMenuIdentifier, rtl::Reference< VCLXPopupMenu > &rOut, css::ui::ContextMenuExecuteEvent aEvent)
LanguageTag maLOKLanguageTag
const LanguageTag & GetLOKLanguageTag() const
Get the LibreOfficeKit language of this view.
std::unordered_set< OUString > mvLOKBlockedCommandList
LOKDeviceFormFactor maLOKDeviceFormFactor
StylesHighlighterColorMap & GetStylesHighlighterParaColorMap()
virtual const SfxShell * GetFormShell() const
static ViewShellDocId mnCurrentDocId
Used to set the DocId at construction time. See SetCurrentDocId.
virtual SfxShell * GetFormShell()
void SetNewWindowAllowed(bool bSet)
bool isLOKDesktop() const
Check if the lok client is running on a desktop machine.
vcl::Window * GetWindow() const
StylesHighlighterColorMap ParaStylesColorMap
std::pair< bool, OUString > GetLOKTimezone() const
Get the LibreOfficeKit timezone of this view. See @SetLOKTimezone.
std::shared_ptr< SfxStoringHelper > m_xHelper
Used for async export.
void SetLOKTimezone(bool isSet, const OUString &rTimezone)
Set the LibreOfficeKit timezone of this view.
virtual tools::Rectangle getLOKVisibleArea() const
virtual void notifyInvalidation(tools::Rectangle const *) const=0
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< LOKPayloadItem > &rPayload=std::vector< LOKPayloadItem >()) const=0
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual std::shared_ptr< SfxDialogController > GetController() override
struct _xmlTextWriter * xmlTextWriterPtr
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess.
COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char *blockedCommandList)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
constexpr auto SFX_INTERFACE_SFXVIEWSH
#define SFX_DECL_INTERFACE(nId)
#define SAL_WARN_UNUSED_RESULT
std::unique_ptr< SfxTabPage > CreatePrintOptionsPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rOptions, bool bPreview)
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)
bool checkSfxViewShell(const SfxViewShell *pShell)
std::unordered_map< OUString, std::pair< Color, int > > StylesHighlighterColorMap