/src/libreoffice/include/sfx2/viewsh.hxx
Line | Count | Source |
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_SFX2_VIEWSH_HXX |
20 | | #define INCLUDED_SFX2_VIEWSH_HXX |
21 | | |
22 | | #include <sal/config.h> |
23 | | #include <memory> |
24 | | #include <optional> |
25 | | #include <sfx2/dllapi.h> |
26 | | #include <sal/types.h> |
27 | | #include <svl/lstner.hxx> |
28 | | #include <sfx2/shell.hxx> |
29 | | #include <i18nlangtag/languagetag.hxx> |
30 | | #include <vcl/IDialogRenderable.hxx> |
31 | | #include <comphelper/errcode.hxx> |
32 | | #include <o3tl/typed_flags_set.hxx> |
33 | | #include <vcl/vclptr.hxx> |
34 | | #include <editeng/outliner.hxx> |
35 | | #include <functional> |
36 | | #include <unordered_set> |
37 | | #include <unordered_map> |
38 | | |
39 | | class SfxTabPage; |
40 | | class SfxBaseController; |
41 | | namespace weld { |
42 | | class Container; |
43 | | class DialogController; |
44 | | class Window; |
45 | | } |
46 | | class KeyEvent; |
47 | | class SvBorder; |
48 | | class SdrView; |
49 | | class SfxModule; |
50 | | class SfxViewFrame; |
51 | | class Printer; |
52 | | class SfxPrinter; |
53 | | class NotifyEvent; |
54 | | class SfxInPlaceClient; |
55 | | class SfxLokCallbackInterface; |
56 | | class LOKDocumentFocusListener; |
57 | | class SfxStoringHelper; |
58 | | class VCLXPopupMenu; |
59 | | class CalendarWrapper; |
60 | | namespace rtl { class OStringBuffer; } |
61 | | namespace vcl { class PrinterController; } |
62 | | |
63 | | namespace com::sun::star::beans { struct PropertyValue; } |
64 | | namespace com::sun::star::datatransfer::clipboard { class XClipboardListener; } |
65 | | namespace com::sun::star::datatransfer::clipboard { class XClipboardNotifier; } |
66 | | namespace com::sun::star::embed { class XEmbeddedObject; } |
67 | | namespace com::sun::star::frame { class XController; } |
68 | | namespace com::sun::star::frame { class XModel; } |
69 | | namespace com::sun::star::ui { class XContextMenuInterceptor; } |
70 | | namespace com::sun::star::ui { struct ContextMenuExecuteEvent; } |
71 | | namespace com::sun::star::view { class XRenderable; } |
72 | | namespace com::sun::star::security { class XCertificate; } |
73 | | namespace svtools { enum ColorConfigEntry : int; } |
74 | | namespace svl::crypto { class CertificateOrName; } |
75 | | |
76 | | enum class SfxPrinterChangeFlags |
77 | | { |
78 | | NONE = 0, |
79 | | PRINTER = 1, // without JOB SETUP => Temporary |
80 | | JOBSETUP = 2, |
81 | | OPTIONS = 4, |
82 | | CHG_ORIENTATION = 8, |
83 | | CHG_SIZE = 16 |
84 | | }; |
85 | | namespace o3tl |
86 | | { |
87 | | template<> struct typed_flags<SfxPrinterChangeFlags> : is_typed_flags<SfxPrinterChangeFlags, 31> {}; |
88 | | } |
89 | | #define SFX_PRINTER_ALL (SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::OPTIONS | SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE) |
90 | | |
91 | 0 | #define SFX_PRINTERROR_BUSY 1 |
92 | | |
93 | | // "Verified" using www.apple.com and Netscape 3.01 |
94 | 4.01k | #define DEFAULT_MARGIN_WIDTH 8 |
95 | 4.01k | #define DEFAULT_MARGIN_HEIGHT 12 |
96 | | |
97 | | |
98 | | // @[SfxViewShell-Flags] |
99 | | |
100 | | enum class SfxViewShellFlags |
101 | | { |
102 | | NONE = 0x0000, |
103 | | HAS_PRINTOPTIONS = 0x0010, /* Options-Button and Options-Dialog in PrintDialog */ |
104 | | NO_NEWWINDOW = 0x0100, /* Allow N View */ |
105 | | }; |
106 | | namespace o3tl |
107 | | { |
108 | | template<> struct typed_flags<SfxViewShellFlags> : is_typed_flags<SfxViewShellFlags, 0x0110> {}; |
109 | | } |
110 | | |
111 | | class SfxViewFactory; |
112 | | #define SFX_DECL_VIEWFACTORY(Class) \ |
113 | | private: \ |
114 | | static std::unique_ptr<SfxViewFactory> s_pFactory; \ |
115 | | public: \ |
116 | | static SfxViewShell *CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView); \ |
117 | | static void RegisterFactory( SfxInterfaceId nPrio ); \ |
118 | 56 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ScTabViewShell::Factory() Line | Count | Source | 118 | 11 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
ScPreviewShell::Factory() Line | Count | Source | 118 | 11 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
Line | Count | Source | 118 | 1 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
Line | Count | Source | 118 | 18 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
Unexecuted instantiation: SwPagePreview::Factory() Unexecuted instantiation: SwSrcView::Factory() Unexecuted instantiation: SwWebView::Factory() Unexecuted instantiation: sd::OutlineViewShell::Factory() Unexecuted instantiation: sd::GraphicViewShell::Factory() Unexecuted instantiation: sd::NotesPanelViewShell::Factory() Unexecuted instantiation: sd::GraphicViewShellBase::Factory() sd::PresentationViewShellBase::Factory() Line | Count | Source | 118 | 5 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
sd::OutlineViewShellBase::Factory() Line | Count | Source | 118 | 5 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
sd::SlideSorterViewShellBase::Factory() Line | Count | Source | 118 | 5 | static SfxViewFactory*Factory() { return s_pFactory.get(); } \ |
|
119 | | static void InitFactory() |
120 | | |
121 | | #define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ |
122 | | std::unique_ptr<SfxViewFactory> Class::s_pFactory; \ |
123 | | SfxViewShell* Class::CreateInstance(SfxViewFrame& rFrame, SfxViewShell *pOldView) \ |
124 | 4.01k | { return new Class(rFrame, pOldView); } \Unexecuted instantiation: ScPreviewShell::CreateInstance(SfxViewFrame&, SfxViewShell*) Unexecuted instantiation: ScTabViewShell::CreateInstance(SfxViewFrame&, SfxViewShell*) Unexecuted instantiation: SmViewShell::CreateInstance(SfxViewFrame&, SfxViewShell*) Unexecuted instantiation: SwPagePreview::CreateInstance(SfxViewFrame&, SfxViewShell*) Unexecuted instantiation: SwSrcView::CreateInstance(SfxViewFrame&, SfxViewShell*) SwView::CreateInstance(SfxViewFrame&, SfxViewShell*) Line | Count | Source | 124 | 4.01k | { return new Class(rFrame, pOldView); } \ |
Unexecuted instantiation: SwWebView::CreateInstance(SfxViewFrame&, SfxViewShell*) |
125 | | void Class::RegisterFactory( SfxInterfaceId nPrio ) \ |
126 | 32 | { \ |
127 | 32 | assert(!s_pFactory && "initialising this twice will leak memory"); \ |
128 | 32 | s_pFactory = std::make_unique<SfxViewFactory>(&CreateInstance,nPrio,AsciiViewName); \ |
129 | 32 | InitFactory(); \ |
130 | 32 | } \ |
131 | | void Class::InitFactory() |
132 | | |
133 | | #define SFX_VIEW_REGISTRATION(DocClass) \ |
134 | 56 | DocClass::Factory().RegisterViewFactory( *Factory() ) |
135 | | |
136 | | template<class T> bool checkSfxViewShell(const SfxViewShell& pShell) |
137 | 0 | { |
138 | 0 | return dynamic_cast<const T*>(&pShell) != nullptr; |
139 | 0 | } Unexecuted instantiation: bool checkSfxViewShell<ScTabViewShell>(SfxViewShell const&) Unexecuted instantiation: bool checkSfxViewShell<SwView>(SfxViewShell const&) |
140 | | |
141 | | typedef std::unordered_map<OUString, std::pair<Color, int>> StylesSpotlightColorMap; |
142 | | |
143 | | /** |
144 | | * One SfxViewShell more or less represents one edit window for a document, there can be multiple |
145 | | * ones for a single opened document (SfxObjectShell). |
146 | | */ |
147 | | class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener, public OutlinerViewShell, public vcl::ILibreOfficeKitNotifier |
148 | | { |
149 | | friend class SfxViewFrame; |
150 | | friend class SfxBaseController; |
151 | | friend class SfxPrinterController; |
152 | | |
153 | | std::unique_ptr<struct SfxViewShell_Impl> pImpl; |
154 | | SfxViewFrame& rFrame; |
155 | | VclPtr<vcl::Window> pWindow; |
156 | | bool bNoNewWindow; |
157 | | bool mbPrinterSettingsModified; |
158 | | LanguageTag maLOKLanguageTag; |
159 | | LanguageTag maLOKLocale; |
160 | | std::unique_ptr<CalendarWrapper> mpCalendar; |
161 | | bool mbLOKAccessibilityEnabled; |
162 | | rtl::Reference<LOKDocumentFocusListener> mpLOKDocumentFocusListener; |
163 | | std::unordered_set<OUString> mvLOKBlockedCommandList; |
164 | | OUString maLOKTimezone; |
165 | | bool maLOKIsTimezoneSet; |
166 | | bool mbLOKColorPreviewEnabled; |
167 | | |
168 | | /// Used for async export |
169 | | std::shared_ptr<SfxStoringHelper> m_xHelper; |
170 | | |
171 | | StylesSpotlightColorMap ParaStylesSpotlightColorMap; |
172 | | StylesSpotlightColorMap CharStylesSpotlightColorMap; |
173 | | |
174 | | protected: |
175 | | virtual void Activate(bool IsMDIActivate) override; |
176 | | virtual void Deactivate(bool IsMDIActivate) override; |
177 | | |
178 | | virtual void InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ); |
179 | | virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ); |
180 | | virtual void SetZoomFactor( double fZoomX, double fZoomY ); |
181 | | |
182 | | virtual void Move(); |
183 | | |
184 | | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
185 | | |
186 | | public: |
187 | | // Iteration |
188 | | SAL_RET_MAYBENULL static SfxViewShell* GetFirst( bool bOnlyVisible = true, const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); |
189 | | SAL_RET_MAYBENULL static SfxViewShell* GetNext( const SfxViewShell& rPrev, |
190 | | bool bOnlyVisible = true, |
191 | | const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); |
192 | | SAL_RET_MAYBENULL static SfxViewShell* Current(); |
193 | | SAL_WARN_UNUSED_RESULT static bool IsCurrentLokViewReadOnly(); |
194 | | |
195 | | SAL_RET_MAYBENULL static SfxViewShell* Get( const css::uno::Reference< css::frame::XController>& i_rController ); |
196 | | |
197 | | // Initialize Constructors/Destructors |
198 | | SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH) |
199 | | |
200 | | private: |
201 | | /// SfxInterface initializer. |
202 | | static void InitInterface_Impl(); |
203 | | |
204 | | LOKDocumentFocusListener& GetLOKDocumentFocusListener(); |
205 | | const LOKDocumentFocusListener& GetLOKDocumentFocusListener() const; |
206 | | bool lokReadOnlyView : 1 = false; // When true, this is a LOK readonly view |
207 | | |
208 | | public: |
209 | | |
210 | | SfxViewShell( SfxViewFrame& rFrame, SfxViewShellFlags nFlags ); |
211 | | virtual ~SfxViewShell() override; |
212 | | |
213 | | /// Informs the view shell that it'll be deleted before the main loop processes the next user |
214 | | /// input. |
215 | 0 | virtual void SetDying() {} |
216 | | |
217 | | SfxInPlaceClient* GetIPClient() const; |
218 | | SfxInPlaceClient* GetUIActiveClient() const; |
219 | | SfxInPlaceClient* FindIPClient( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj, vcl::Window *pObjParentWin ) const; |
220 | | |
221 | | virtual ErrCode DoVerb(sal_Int32 nVerb); |
222 | | |
223 | | void OutplaceActivated( bool bActive ); |
224 | | virtual void UIActivating( SfxInPlaceClient* pClient ); |
225 | | virtual void UIDeactivated( SfxInPlaceClient* pClient ); |
226 | | |
227 | | void JumpToMark( const OUString& rMark ); |
228 | | void VisAreaChanged(); |
229 | | |
230 | 0 | void SetLokReadOnlyView(bool readOnlyView) { lokReadOnlyView = readOnlyView; }; |
231 | 0 | bool IsLokReadOnlyView() const { return lokReadOnlyView; }; |
232 | | |
233 | | // Misc |
234 | | |
235 | | /** |
236 | | * Initialize is called after the frame has been loaded and the controller |
237 | | * has been set. By the time this is called the document has been fully |
238 | | * imported. |
239 | | * @param bOnlyASample used by some dialogs to avoid constructing monster strings e.g. in calc |
240 | | */ |
241 | | virtual bool PrepareClose( bool bUI = true ); |
242 | | virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ); |
243 | | virtual bool HasSelection( bool bText = true ) const; |
244 | | virtual SdrView* GetDrawView() const; |
245 | | |
246 | | void AddSubShell( SfxShell& rShell ); |
247 | | void RemoveSubShell( SfxShell *pShell=nullptr ); |
248 | | SfxShell* GetSubShell( sal_uInt16 ); |
249 | | |
250 | 0 | virtual SfxShell* GetFormShell() { return nullptr; }; |
251 | 0 | virtual const SfxShell* GetFormShell() const { return nullptr; }; |
252 | | |
253 | | // ILibreOfficeKitNotifier |
254 | | virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) const override; |
255 | | virtual OString dumpNotifyState() const override; |
256 | | |
257 | | // Focus, KeyInput, Cursor |
258 | | virtual void ShowCursor( bool bOn = true ); |
259 | | virtual bool KeyInput( const KeyEvent &rKeyEvent ); |
260 | | bool Escape(); |
261 | | |
262 | | // Viewing Interface |
263 | 15.9k | vcl::Window* GetWindow() const { return pWindow; } |
264 | | weld::Window* GetFrameWeld() const; |
265 | | void SetWindow( vcl::Window *pViewPort ); |
266 | | const SvBorder& GetBorderPixel() const; |
267 | | void SetBorderPixel( const SvBorder &rBorder ); |
268 | | void InvalidateBorder(); |
269 | | |
270 | | /* [Description] |
271 | | |
272 | | This method returns a reference to the <SfxViewFrame> Instance in which |
273 | | this SfxViewShell is displayed. This is the instance that was passed |
274 | | on in the constructor. It is guaranteed that the returned reference |
275 | | is a valid SfxViewFrame instance. |
276 | | |
277 | | [Cross-reference] |
278 | | |
279 | | <SfxShell::GetFrame()const> |
280 | | */ |
281 | | SfxViewFrame& GetViewFrame() const |
282 | 417k | { |
283 | 417k | return rFrame; |
284 | 417k | } |
285 | | |
286 | | // Printing Interface |
287 | | virtual SfxPrinter* GetPrinter( bool bCreate = false ); |
288 | | virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); |
289 | | virtual bool HasPrintOptionsPage() const; |
290 | | virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rOptions); |
291 | | Printer* GetActivePrinter() const; |
292 | | |
293 | | // Working set |
294 | | virtual void WriteUserData( OUString&, bool bBrowse = false ); |
295 | | virtual void ReadUserData( const OUString&, bool bBrowse = false ); |
296 | | virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ); |
297 | | virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ); |
298 | | virtual void QueryObjAreaPixel( tools::Rectangle& rRect ) const; |
299 | | |
300 | | virtual SfxObjectShell* GetObjectShell() override; |
301 | | |
302 | | /** retrieves the document which shall be considered the "current document" when the frame is active |
303 | | |
304 | | The default implementation simply returns the XModel of the associated SfxObjectShell. You will rarely |
305 | | need to overwrite this behavior. |
306 | | */ |
307 | | virtual css::uno::Reference< css::frame::XModel > |
308 | | GetCurrentDocument() const; |
309 | | |
310 | | /** forwards the current document, as returned by ->GetCurrentDocument, to SfxObjectShell::SetWorkingDocument |
311 | | */ |
312 | | void SetCurrentDocument() const; |
313 | | |
314 | | /** get an XRenderable instance that can render this document |
315 | | */ |
316 | | virtual css::uno::Reference< css::view::XRenderable > GetRenderable(); |
317 | | |
318 | | |
319 | | virtual void MarginChanged(); |
320 | | const Size& GetMargin() const; |
321 | | void SetMargin( const Size& ); |
322 | | void DisconnectAllClients(); |
323 | 0 | bool NewWindowAllowed() const { return !bNoNewWindow; } |
324 | 4.12k | void SetNewWindowAllowed( bool bSet ) { bNoNewWindow = !bSet; } |
325 | | |
326 | | void SetController( SfxBaseController* pController ); |
327 | | css::uno::Reference<css::frame::XController> GetController() const; |
328 | | |
329 | | bool TryContextMenuInterception(const rtl::Reference<VCLXPopupMenu>& rIn, |
330 | | const OUString& rMenuIdentifier, |
331 | | rtl::Reference<VCLXPopupMenu>& rOut, |
332 | | css::ui::ContextMenuExecuteEvent aEvent); |
333 | | bool TryContextMenuInterception(const rtl::Reference<VCLXPopupMenu>&, |
334 | | const OUString& rMenuIdentifier, |
335 | | css::ui::ContextMenuExecuteEvent aEvent); |
336 | | |
337 | | void ExecPrint( const css::uno::Sequence < css::beans::PropertyValue >&, bool, bool ); |
338 | | // Like ExecPrint(), but only sets up for printing. Use Printer::ExecutePrintJob() and Printer::FinishPrintJob() afterwards. |
339 | | void StartPrint( const css::uno::Sequence < css::beans::PropertyValue >&, bool, bool ); |
340 | | const std::shared_ptr< vcl::PrinterController >& GetPrinterController() const; |
341 | | |
342 | | void AddRemoveClipboardListener( const css::uno::Reference < css::datatransfer::clipboard::XClipboardListener>&, bool ); |
343 | | css::uno::Reference< css::datatransfer::clipboard::XClipboardNotifier > GetClipboardNotifier() const; |
344 | | |
345 | | SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const; |
346 | | SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor ); |
347 | | SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl( const css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor ); |
348 | | SAL_DLLPRIVATE bool GlobalKeyInput_Impl( const KeyEvent &rKeyEvent ); |
349 | | |
350 | | SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient ); |
351 | | SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient const *pIPClient ); |
352 | | SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient const *pIP ); |
353 | | |
354 | | SAL_DLLPRIVATE void SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter ); |
355 | | |
356 | | SAL_DLLPRIVATE bool HandleNotifyEvent_Impl( NotifyEvent const & rEvent ); |
357 | | SAL_DLLPRIVATE bool HasKeyListeners_Impl() const; |
358 | | SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const; |
359 | | |
360 | | SAL_DLLPRIVATE SfxBaseController* GetBaseController_Impl() const; |
361 | | |
362 | | // Shell Interface |
363 | | SAL_DLLPRIVATE void ExecPrint_Impl(SfxRequest &); |
364 | | SAL_DLLPRIVATE void ExecMisc_Impl(SfxRequest &); |
365 | | SAL_DLLPRIVATE void GetState_Impl(SfxItemSet&); |
366 | | SAL_DLLPRIVATE void CheckIPClient_Impl(SfxInPlaceClient const *, const tools::Rectangle&); |
367 | | SAL_DLLPRIVATE void PushSubShells_Impl( bool bPush=true ); |
368 | 4.01k | SAL_DLLPRIVATE void PopSubShells_Impl() { PushSubShells_Impl( false ); } |
369 | | SAL_DLLPRIVATE bool ExecKey_Impl(const KeyEvent& aKey); |
370 | | |
371 | | /// Set up a more efficient internal callback instead of LibreOfficeKitCallback. |
372 | | void setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback); |
373 | | SfxLokCallbackInterface* getLibreOfficeKitViewCallback() const; |
374 | | /// dump view state for diagnostics |
375 | | void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState); |
376 | | /// Invokes the registered callback, if there are any. |
377 | | virtual void libreOfficeKitViewCallback(int nType, const OString& pPayload) const override; |
378 | | virtual void libreOfficeKitViewCallbackWithViewId(int nType, const OString& pPayload, int nViewId) const override; |
379 | | virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart, int nMode) const override; |
380 | | virtual void libreOfficeKitViewUpdatedCallback(int nType) const override; |
381 | | virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const override; |
382 | | // Performs any pending calls to libreOfficeKitViewInvalidateTilesCallback() as necessary. |
383 | | virtual void flushPendingLOKInvalidateTiles(); |
384 | | virtual void libreOfficeKitViewAddPendingInvalidateTiles() override; |
385 | | // Returns current payload for nType, after libreOfficeKitViewUpdatedCallback() or |
386 | | // libreOfficeKitViewUpdatedCallbackPerViewId() were called. If no payload should |
387 | | // be generated, the ignore flag should be set. |
388 | | virtual std::optional<OString> getLOKPayload(int nType, int nViewId) const; |
389 | | |
390 | | /// Set if we are doing tiled searching. |
391 | | void setTiledSearching(bool bTiledSearching); |
392 | | /// See lok::Document::getPart(). |
393 | | virtual int getPart() const; |
394 | | /// See lok::Document::getMode(). |
395 | | virtual int getEditMode() const; |
396 | | virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; |
397 | | /// See OutlinerViewShell::GetViewShellId(). |
398 | | ViewShellId GetViewShellId() const override; |
399 | | |
400 | | /// Get the DocId used by Mobile LOKit to load multiple documents. |
401 | | ViewShellDocId GetDocId() const override; |
402 | | |
403 | | /// ILibreOfficeKitNotifier. Emits a LOK_CALLBACK_INVALIDATE_TILES. |
404 | | virtual void notifyInvalidation(tools::Rectangle const *) const override; |
405 | | /// ILibreOfficeKitNotifier. |
406 | | virtual void notifyCursorInvalidation(tools::Rectangle const *, bool bControlEvent, int windowID) const override; |
407 | | |
408 | | /// See OutlinerViewShell::NotifyOtherViews(). |
409 | | void NotifyOtherViews(int nType, const OString& rKey, const OString& rPayload) override; |
410 | | /// See OutlinerViewShell::NotifyOtherView(). |
411 | | void NotifyOtherView(OutlinerViewShell* pOtherShell, int nType, const OString& rKey, const OString& rPayload) override; |
412 | | /// Ask this view to send its cursor position to pViewShell. |
413 | | virtual void NotifyCursor(SfxViewShell* /*pViewShell*/) const; |
414 | | /// Where a new view can perform some update/initialization soon after the callback has been registered. |
415 | | virtual void afterCallbackRegistered(); |
416 | | /// See OutlinerViewShell::GetEditWindowForActiveOLEObj(). |
417 | | virtual vcl::Window* GetEditWindowForActiveOLEObj() const override; |
418 | | /// Get a color config color from this view |
419 | | virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const; |
420 | | |
421 | | /// Set the LibreOfficeKit language of this view. |
422 | | void SetLOKLanguageTag(const OUString& rBcp47LanguageTag); |
423 | | /// Get the LibreOfficeKit language of this view. |
424 | 0 | const LanguageTag& GetLOKLanguageTag() const { return maLOKLanguageTag; } |
425 | | /// Enable/Disable LibreOfficeKit AT support for this view. |
426 | | void SetLOKAccessibilityState(bool bEnabled); |
427 | | /// Get LibreOfficeKit AT support state for this view. |
428 | 0 | bool GetLOKAccessibilityState() const { return mbLOKAccessibilityEnabled; } |
429 | | /// Set LibreOfficeKit color preview state for this view. |
430 | | void SetLOKColorPreviewState(bool bEnabled); |
431 | | /// Return LibreOfficeKit color preview state for this view. |
432 | 0 | bool IsLOKColorPreviewEnabled() const { return mbLOKColorPreviewEnabled; } |
433 | | |
434 | | /// Get the LibreOfficeKit timezone of this view. See @SetLOKTimezone. |
435 | | std::pair<bool, OUString> GetLOKTimezone() const |
436 | 0 | { |
437 | 0 | return { maLOKIsTimezoneSet, maLOKTimezone }; |
438 | 0 | } |
439 | | |
440 | | /// Set the LibreOfficeKit timezone of this view. |
441 | | /// @isSet true to use @rTimezone, even if it's empty. Otherwise, no timezone. |
442 | | /// @rTimezone the value to set (which could be empty). |
443 | | void SetLOKTimezone(bool isSet, const OUString& rTimezone) |
444 | 0 | { |
445 | 0 | maLOKIsTimezoneSet = isSet; |
446 | 0 | maLOKTimezone = rTimezone; |
447 | 0 | } |
448 | | |
449 | | /// Set the LibreOfficeKit locale of this view. |
450 | | void SetLOKLocale(const OUString& rBcp47LanguageTag); |
451 | | /// Get the LibreOfficeKit locale of this view. |
452 | 0 | const LanguageTag& GetLOKLocale() const { return maLOKLocale; } |
453 | | /// Set the LibreOfficeKit locale and language of this view. |
454 | | void SetLOKLanguageAndLocale(const OUString& rBcp47LanguageTag); |
455 | | /// Get the LibreOfficeKit calendar of this view. |
456 | | CalendarWrapper& GetLOKCalendar(); |
457 | | |
458 | 0 | virtual tools::Rectangle getLOKVisibleArea() const { return tools::Rectangle(); } |
459 | | |
460 | | // Blocked Command view settings |
461 | | void setBlockedCommandList(const char* blockedCommandList); |
462 | | bool isBlockedCommand(const OUString & command) const; |
463 | | |
464 | 0 | void SetStoringHelper(const std::shared_ptr<SfxStoringHelper>& xHelper) { m_xHelper = xHelper; } |
465 | | |
466 | 0 | StylesSpotlightColorMap& GetStylesSpotlightParaColorMap() { return ParaStylesSpotlightColorMap; } |
467 | 0 | StylesSpotlightColorMap& GetStylesSpotlightCharColorMap() { return CharStylesSpotlightColorMap; } |
468 | | |
469 | | OUString getA11yFocusedParagraph() const; |
470 | | int getA11yCaretPosition() const; |
471 | | void SetSigningCertificate(const svl::crypto::CertificateOrName& rCertificateOrName); |
472 | | const svl::crypto::CertificateOrName & GetSigningCertificate() const; |
473 | | |
474 | | // These are used for visual signing: SetSignPDFCertificate() is called when the signature |
475 | | // line is inserted, and GetSignPDFCertificate() is used by the signing code to get the already |
476 | | // selected certificate. |
477 | | void SetSignPDFCertificate(const svl::crypto::CertificateOrName& rCertificateOrName); |
478 | | svl::crypto::CertificateOrName GetSignPDFCertificate() const; |
479 | | }; |
480 | | |
481 | | #endif // INCLUDED_SFX2_VIEWSH_HXX |
482 | | |
483 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |