/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #ifndef INCLUDED_SFX2_VIEWSH_HXX #define INCLUDED_SFX2_VIEWSH_HXX
class SfxTabPage; class SfxBaseController; class Fraction; namespace weld { class Container; class DialogController; class Window;
} class KeyEvent; class SvBorder; class SdrView; class SfxModule; class SfxViewFrame; class Printer; class SfxPrinter; class NotifyEvent; class SfxInPlaceClient; class SfxLokCallbackInterface; class LOKDocumentFocusListener; class SfxStoringHelper; class VCLXPopupMenu; namespace rtl { class OStringBuffer; } namespace vcl { class PrinterController; }
namespace com::sun::star::beans { struct PropertyValue; } namespace com::sun::star::datatransfer::clipboard { class XClipboardListener; } namespace com::sun::star::datatransfer::clipboard { class XClipboardNotifier; } namespace com::sun::star::embed { class XEmbeddedObject; } namespace com::sun::star::frame { class XController; } namespace com::sun::star::frame { class XModel; } namespace com::sun::star::ui { class XContextMenuInterceptor; } namespace com::sun::star::ui { struct ContextMenuExecuteEvent; } namespace com::sun::star::view { class XRenderable; } namespace com::sun::star::security { class XCertificate; } namespace svtools { enum ColorConfigEntry : int; } namespace svl::crypto { class CertificateOrName; }
The SfxViewShell flags control the behavior of SfxViewShell for the duration of its lifetime. They are defined in the constructor of <SfxViewShell>.
*/
/** * One SfxViewShell more or less represents one edit window for a document, there can be multiple * ones for a single opened document (SfxObjectShell).
*/ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener, public OutlinerViewShell, public vcl::ILibreOfficeKitNotifier
{ friendclass SfxViewFrame; friendclass SfxBaseController; friendclass SfxPrinterController;
LOKDocumentFocusListener& GetLOKDocumentFocusListener(); const LOKDocumentFocusListener& GetLOKDocumentFocusListener() const; bool lokReadOnlyView = false; // When true, this is a LOK readonly view. bool allowChangeComments = false; // When true, user can edit comments in readonly view mode.
/** * Initialize is called after the frame has been loaded and the controller * has been set. By the time this is called the document has been fully * imported. * @param bOnlyASample used by some dialogs to avoid constructing monster strings e.g. in calc
*/ virtualbool PrepareClose( bool bUI = true ); virtual OUString GetSelectionText( bool bCompleteWords = false, bool bOnlyASample = false ); virtualbool HasSelection( bool bText = true ) const; virtual SdrView* GetDrawView() const;
This method returns a reference to the <SfxViewFrame> Instance in which this SfxViewShell is displayed. This is the instance that was passed on in the constructor. It is guaranteed that the returned reference is a valid SfxViewFrame instance.
/** retrieves the document which shall be considered the "current document" when the frame is active
The default implementation simply returns the XModel of the associated SfxObjectShell. You will rarely need to overwrite this behavior.
*/ virtual css::uno::Reference< css::frame::XModel >
GetCurrentDocument() const;
/** forwards the current document, as returned by ->GetCurrentDocument, to SfxObjectShell::SetWorkingDocument
*/ void SetCurrentDocument() const;
/** get an XRenderable instance that can render this document
*/ virtual css::uno::Reference< css::view::XRenderable > GetRenderable();
/// Set up a more efficient internal callback instead of LibreOfficeKitCallback. void setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback);
SfxLokCallbackInterface* getLibreOfficeKitViewCallback() const; /// dump view state for diagnostics void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState); /// Invokes the registered callback, if there are any. virtualvoid libreOfficeKitViewCallback(int nType, const OString& pPayload) const override; virtualvoid libreOfficeKitViewCallbackWithViewId(int nType, const OString& pPayload, int nViewId) const override; virtualvoid libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart, int nMode) const override; virtualvoid libreOfficeKitViewUpdatedCallback(int nType) const override; virtualvoid libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) const override; // Performs any pending calls to libreOfficeKitViewInvalidateTilesCallback() as necessary. virtualvoid flushPendingLOKInvalidateTiles(); virtualvoid libreOfficeKitViewAddPendingInvalidateTiles() override; // Returns current payload for nType, after libreOfficeKitViewUpdatedCallback() or // libreOfficeKitViewUpdatedCallbackPerViewId() were called. If no payload should // be generated, the ignore flag should be set. virtual std::optional<OString> getLOKPayload(int nType, int nViewId) const;
/// Set if we are doing tiled searching. void setTiledSearching(bool bTiledSearching); /// See lok::Document::getPart(). virtualint getPart() const; /// See lok::Document::getMode(). virtualint getEditMode() const; virtualvoid dumpAsXml(xmlTextWriterPtr pWriter) const; /// See OutlinerViewShell::GetViewShellId().
ViewShellId GetViewShellId() const override;
/// Set the current DocId, which is used by Mobile LOKit to /// load multiple documents and yet identify the views of each. /// There are events that are fired while creating a new view, /// and if we don't have a DocId, we can't know which other views /// within the same document (if any) should get those events. /// By setting this static value, we are able to set the DocId /// of each SfxViewShell at construction time. staticvoid SetCurrentDocId(ViewShellDocId nId); /// Get the DocId used by Mobile LOKit to load multiple documents.
ViewShellDocId GetDocId() const override;
/// ILibreOfficeKitNotifier. Emits a LOK_CALLBACK_INVALIDATE_TILES. virtualvoid notifyInvalidation(tools::Rectangle const *) const override; /// See OutlinerViewShell::NotifyOtherViews(). void NotifyOtherViews(int nType, const OString& rKey, const OString& rPayload) override; /// See OutlinerViewShell::NotifyOtherView(). void NotifyOtherView(OutlinerViewShell* pOtherShell, int nType, const OString& rKey, const OString& rPayload) override; /// Ask this view to send its cursor position to pViewShell. virtualvoid NotifyCursor(SfxViewShell* /*pViewShell*/) const; /// Where a new view can perform some update/initialization soon after the callback has been registered. virtualvoid afterCallbackRegistered(); /// See OutlinerViewShell::GetEditWindowForActiveOLEObj(). virtual vcl::Window* GetEditWindowForActiveOLEObj() const override; /// Get a color config color from this view virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const;
/// Set the LibreOfficeKit language of this view. void SetLOKLanguageTag(const OUString& rBcp47LanguageTag); /// Get the LibreOfficeKit language of this view. const LanguageTag& GetLOKLanguageTag() const { return maLOKLanguageTag; } /// Enable/Disable LibreOfficeKit AT support for this view. void SetLOKAccessibilityState(bool bEnabled); /// Get LibreOfficeKit AT support state for this view. bool GetLOKAccessibilityState() const { return mbLOKAccessibilityEnabled; }
/// Get the LibreOfficeKit timezone of this view. See @SetLOKTimezone.
std::pair<bool, OUString> GetLOKTimezone() const
{ return { maLOKIsTimezoneSet, maLOKTimezone };
}
/// Set the LibreOfficeKit timezone of this view. /// @isSet true to use @rTimezone, even if it's empty. Otherwise, no timezone. /// @rTimezone the value to set (which could be empty). void SetLOKTimezone(bool isSet, const OUString& rTimezone)
{
maLOKIsTimezoneSet = isSet;
maLOKTimezone = rTimezone;
}
/// Set the LibreOfficeKit locale of this view. void SetLOKLocale(const OUString& rBcp47LanguageTag); /// Get the LibreOfficeKit locale of this view. const LanguageTag& GetLOKLocale() const { return maLOKLocale; } /// Get the form factor of the device where the lok client is running.
LOKDeviceFormFactor GetLOKDeviceFormFactor() const { return maLOKDeviceFormFactor; } /// Check if the lok client is running on a desktop machine. bool isLOKDesktop() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::DESKTOP; } /// Check if the lok client is running on a tablet. bool isLOKTablet() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::TABLET; } /// Check if the lok client is running on a mobile device. bool isLOKMobilePhone() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::MOBILE; }
// These are used for visual signing: SetSignPDFCertificate() is called when the signature // line is inserted, and GetSignPDFCertificate() is used by the signing code to get the already // selected certificate. void SetSignPDFCertificate(const svl::crypto::CertificateOrName& rCertificateOrName);
svl::crypto::CertificateOrName GetSignPDFCertificate() const;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.