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; }
91#define SFX_PRINTER_ALL (SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::OPTIONS | SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE)
93#define SFX_PRINTERROR_BUSY 1
96#define DEFAULT_MARGIN_WIDTH 8
97#define DEFAULT_MARGIN_HEIGHT 12
129#define SFX_DECL_VIEWFACTORY(Class) \
131 static SfxViewFactory *s_pFactory; \
133 static SfxViewShell *CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView); \
134 static void RegisterFactory( SfxInterfaceId nPrio ); \
135 static SfxViewFactory*Factory() { return s_pFactory; } \
136 static void InitFactory()
138#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \
139 SfxViewFactory* Class::s_pFactory; \
140 SfxViewShell* Class::CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView) \
141 { return new Class(rFrame, pOldView); } \
142 void Class::RegisterFactory( SfxInterfaceId nPrio ) \
144 s_pFactory = new SfxViewFactory(&CreateInstance,nPrio,AsciiViewName);\
147 void Class::InitFactory()
149#define SFX_VIEW_REGISTRATION(DocClass) \
150 DocClass::Factory().RegisterViewFactory( *Factory() )
154 return dynamic_cast<const T*
>(pShell) !=
nullptr;
169 std::unique_ptr<struct SfxViewShell_Impl>
pImpl;
193 virtual void Activate(
bool IsMDIActivate)
override;
194 virtual void Deactivate(
bool IsMDIActivate)
override;
196 virtual void InnerResizePixel(
const Point &rOfs,
const Size &rSize,
bool inplaceEditModeChange );
197 virtual void OuterResizePixel(
const Point &rOfs,
const Size &rSize );
198 virtual void SetZoomFactor(
const Fraction &rZoomX,
const Fraction &rZoomY );
208 bool bOnlyVisible =
true,
209 const std::function<
bool (
const SfxViewShell* )>& isViewShell =
nullptr );
219 static void InitInterface_Impl();
231 SfxInPlaceClient* FindIPClient(
const css::uno::Reference < css::embed::XEmbeddedObject >& xObj,
vcl::Window *pObjParentWin )
const;
233 virtual ErrCode DoVerb(sal_Int32 nVerb);
235 void OutplaceActivated(
bool bActive );
239 void JumpToMark(
const OUString& rMark );
250 virtual bool PrepareClose(
bool bUI =
true );
251 virtual OUString GetSelectionText(
bool bCompleteWords =
false,
bool bOnlyASample =
false );
252 virtual bool HasSelection(
bool bText =
true )
const;
253 virtual SdrView* GetDrawView()
const;
255 void AddSubShell(
SfxShell& rShell );
256 void RemoveSubShell(
SfxShell *pShell=
nullptr );
257 SfxShell* GetSubShell( sal_uInt16 );
263 virtual void notifyWindow(
vcl::LOKWindowId nLOKWindowId,
const OUString& rAction,
const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>())
const override;
266 virtual void ShowCursor(
bool bOn =
true );
274 const SvBorder& GetBorderPixel()
const;
275 void SetBorderPixel(
const SvBorder &rBorder );
276 void InvalidateBorder();
295 virtual SfxPrinter* GetPrinter(
bool bCreate =
false );
297 virtual bool HasPrintOptionsPage()
const;
299 Printer* GetActivePrinter()
const;
302 virtual void WriteUserData( OUString&,
bool bBrowse =
false );
303 virtual void ReadUserData(
const OUString&,
bool bBrowse =
false );
304 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& );
305 virtual void ReadUserDataSequence (
const css::uno::Sequence < css::beans::PropertyValue >& );
315 virtual css::uno::Reference< css::frame::XModel >
316 GetCurrentDocument()
const;
320 void SetCurrentDocument()
const;
324 virtual css::uno::Reference< css::view::XRenderable > GetRenderable();
327 virtual void MarginChanged();
328 const Size& GetMargin()
const;
329 void SetMargin(
const Size& );
330 void DisconnectAllClients();
335 css::uno::Reference<css::frame::XController>
GetController()
const;
338 const OUString& rMenuIdentifier,
340 css::ui::ContextMenuExecuteEvent aEvent);
342 const OUString& rMenuIdentifier,
343 css::ui::ContextMenuExecuteEvent aEvent);
345 void ExecPrint(
const css::uno::Sequence < css::beans::PropertyValue >&,
bool,
bool );
347 void StartPrint(
const css::uno::Sequence < css::beans::PropertyValue >&,
bool,
bool );
348 const std::shared_ptr< vcl::PrinterController >& GetPrinterController()
const;
350 void AddRemoveClipboardListener(
const css::uno::Reference < css::datatransfer::clipboard::XClipboardListener>&,
bool );
351 css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier()
const;
354 SAL_DLLPRIVATE
void AddContextMenuInterceptor_Impl(
const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
355 SAL_DLLPRIVATE
void RemoveContextMenuInterceptor_Impl(
const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
356 SAL_DLLPRIVATE
bool GlobalKeyInput_Impl(
const KeyEvent &rKeyEvent );
364 SAL_DLLPRIVATE
bool HandleNotifyEvent_Impl(
NotifyEvent const & rEvent );
365 SAL_DLLPRIVATE
bool HasKeyListeners_Impl()
const;
366 SAL_DLLPRIVATE
bool HasMouseClickListeners_Impl()
const;
371 SAL_DLLPRIVATE
void ExecPrint_Impl(
SfxRequest &);
372 SAL_DLLPRIVATE
void ExecMisc_Impl(
SfxRequest &);
373 SAL_DLLPRIVATE
void GetState_Impl(
SfxItemSet&);
375 SAL_DLLPRIVATE
void PushSubShells_Impl(
bool bPush=
true );
377 SAL_DLLPRIVATE
bool ExecKey_Impl(
const KeyEvent& aKey);
383 void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState);
391 virtual void flushPendingLOKInvalidateTiles();
396 virtual std::optional<OString> getLOKPayload(
int nType,
int nViewId)
const;
399 void setTiledSearching(
bool bTiledSearching);
401 virtual int getPart()
const;
403 virtual int getEditMode()
const;
422 void NotifyOtherViews(
int nType,
const OString& rKey,
const OString& rPayload)
override;
428 virtual void afterCallbackRegistered();
433 void SetLOKLanguageTag(
const OUString& rBcp47LanguageTag);
437 void SetLOKAccessibilityState(
bool bEnabled);
442 return { maLOKIsTimezoneSet, maLOKTimezone };
450 maLOKIsTimezoneSet = isSet;
451 maLOKTimezone = rTimezone;
455 void SetLOKLocale(
const OUString& rBcp47LanguageTag);
471 bool isBlockedCommand(OUString command);
478 OUString getA11yFocusedParagraph()
const;
479 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)
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