/* -*- 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 .
*/
// The Paragraph's number is the absolute position within the text engine (from // 0 to N - 1), whereas the Paragraph's index is the position within the text // view/accessible parent (from 0 to M - 1). Paragraphs outside the currently // visible range have an index of -1. class Paragraph final
: public ParagraphBase, private ::comphelper::OCommonAccessibleText
{ public:
Paragraph(::rtl::Reference< Document > xDocument,
Paragraphs::size_type nNumber);
// Not thread-safe.
Paragraphs::size_type getNumber() const { return m_nNumber; }
// Not thread-safe. void numberChanged(bool bIncremented);
class Document final
: public cppu::ImplInheritanceHelper<VCLXAccessibleComponent, css::accessibility::XAccessible>, public ::SfxListener
{ public:
Document(vcl::Window* pWindow, ::TextEngine & rEngine, ::TextView & rView);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const *" instead of a // "::rtl::Reference< Paragraph > const &".
::sal_Int32 retrieveParagraphIndex(Paragraph const * pParagraph);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const *" instead of a // "::rtl::Reference< Paragraph > const &".
::sal_Int64 retrieveParagraphState(Paragraph const * pParagraph);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &".
css::awt::Rectangle
retrieveParagraphBounds(Paragraph const * pParagraph, bool bAbsolute);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &".
OUString retrieveParagraphText(Paragraph const * pParagraph);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". void retrieveParagraphSelection(Paragraph const * pParagraph,
::sal_Int32 * pBegin, ::sal_Int32 * pEnd);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const *" instead of a // "::rtl::Reference< Paragraph > const &".
::sal_Int32 retrieveParagraphCaretPosition(Paragraph const * pParagraph);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException.
css::awt::Rectangle
retrieveCharacterBounds(Paragraph const * pParagraph,
::sal_Int32 nIndex);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &".
::sal_Int32 retrieveCharacterIndex(Paragraph const * pParagraph,
css::awt::Point const & rPoint);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException.
css::uno::Sequence< css::beans::PropertyValue > retrieveCharacterAttributes(
Paragraph const * pParagraph, ::sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException.
css::uno::Sequence< css::beans::PropertyValue > retrieveRunAttributes(
Paragraph const * pParagraph, ::sal_Int32 Index, const css::uno::Sequence< OUString >& RequestedAttributes);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". void changeParagraphText(Paragraph const * pParagraph,
OUString const & rText);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException. void changeParagraphText(Paragraph const * pParagraph, ::sal_Int32 nBegin,
::sal_Int32 nEnd, bool bCut, bool bPaste,
OUString const & rText);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException. void copyParagraphText(Paragraph const * pParagraph,
::sal_Int32 nBegin, ::sal_Int32 nEnd);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException. void changeParagraphAttributes(
Paragraph const * pParagraph, ::sal_Int32 nBegin, ::sal_Int32 nEnd,
css::uno::Sequence< css::beans::PropertyValue > const &
rAttributeSet);
// To make it possible for this method to be (indirectly) called from // within Paragraph's constructor (i.e., when the Paragraph's ref count is // still zero), pass a "Paragraph const &" instead of a // "::rtl::Reference< Paragraph > const &". // Throws css::lang::IndexOutOfBoundsException. void changeParagraphSelection(Paragraph const * pParagraph,
::sal_Int32 nBegin, ::sal_Int32 nEnd);
// ??? Will be called with both the external (Solar) and internal mutex // locked: virtualvoid SAL_CALL disposing() override;
// ??? Will be called with the external (Solar) mutex locked. virtualvoid Notify(::SfxBroadcaster & rBC, ::SfxHint const & rHint) override;
// Assuming that this will only be called with the external (Solar) mutex // locked.
DECL_LINK(WindowEventHandler, VclWindowEvent&, void);
// Must be called with both the external (Solar) and internal mutex // locked: static ::rtl::Reference< Paragraph >
getParagraph(Paragraphs::iterator const & rIt);
// Must be called with both the external (Solar) and internal mutex // locked: // Throws css::uno::RuntimeException.
css::uno::Reference< css::accessibility::XAccessible >
getAccessibleChild(Paragraphs::iterator const & rIt);
// Must be called with both the external (Solar) and internal mutex // locked: void determineVisibleRange();
// Must be called with both the external (Solar) and internal mutex // locked: void notifyVisibleRangeChanges(
Paragraphs::iterator const & rOldVisibleBegin,
Paragraphs::iterator const & rOldVisibleEnd,
Paragraphs::iterator const & rInserted);
// Must be called with both the external (Solar) and internal mutex // locked: void changeParagraphText(::sal_uInt32 nNumber, ::sal_uInt16 nBegin, ::sal_uInt16 nEnd, bool bCut, bool bPaste,
OUString const & rText);
// m_nViewOffset is from the start of the document (0) to the start of the // current view, and m_nViewHeight is the height of the view:
::sal_Int32 m_nViewOffset;
::sal_Int32 m_nViewHeight;
// m_nVisibleBegin points to the first Paragraph that is (partially) // contained in the view, and m_nVisibleEnd points past the last Paragraph // that is (partially) contained. If no Paragraphs are (partially) in the // view, both m_nVisibleBegin and m_nVisibleEnd are set to // m_xParagraphs->size(). These values are only changed by // determineVisibleRange.
Paragraphs::size_type m_nVisibleBegin = 0;
Paragraphs::size_type m_nVisibleEnd = 0;
// m_nVisibleBeginOffset is from m_nViewOffset back to the start of the // Paragraph pointed to by m_aVisibleBegin (and always has a non-negative // value). If m_aVisibleBegin == m_xParagraphs->end(), // m_nVisibleBeginOffset is set to 0. These values are only changed by // determineVisibleRange.
::sal_Int32 m_nVisibleBeginOffset;
// If no selection has yet been set, all the following four variables are // set to -1. m_nSelectionLastPara/Pos is also the cursor position.
::sal_Int32 m_nSelectionFirstPara;
::sal_Int32 m_nSelectionFirstPos;
::sal_Int32 m_nSelectionLastPara;
::sal_Int32 m_nSelectionLastPos;
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.