/* -*- 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 .
*/ #pragma once
namespace sw::overlay { class OverlayRangesOutline; } class MapMode;
/** * SwSelPaintRects is a base class of SwShellCursor, which stores the overlay for the * cursor/selection: a list of rectangles to be painted as an overlay. It is also capable of * painting other overlays as needed (text input, content control).
*/ class SwSelPaintRects : public SwRects
{ friendvoid InitCore(); friendvoid FinitCore();
virtualvoid FillRects() = 0; /// Fill rStart and rEnd with a rectangle that represents the start and end for selection handles. virtualvoid FillStartEnd(SwRect& rStart, SwRect& rEnd) const = 0;
// #i75172# in SwCursorShell::CreateCursor() the content of SwSelPaintRects is exchanged. To // make a complete swap access to m_pCursorOverlay is needed there void swapContent(SwSelPaintRects& rSwap);
const SwCursorShell* GetShell() const { return m_pCursorShell; } // check current MapMode of the shell and set possibly the static members. // Optional set the parameters pX, pY staticvoid Get1PixelInLogic( const SwViewShell& rSh,
tools::Long* pX = nullptr, tools::Long* pY = nullptr );
std::optional<OString> getLOKPayload(int nType, int nViewId) const;
};
/// Represents the current text cursor of one opened edit window. /// /// See SwShellTableCursor for a table cursor that extends this class. class SW_DLLPUBLIC SwShellCursor : publicvirtual SwCursor, public SwSelPaintRects
{ private: // Document positions of start/end characters of a SSelection.
Point m_MarkPt;
Point m_PointPt; const SwPosition* m_pInitialPoint; // For assignment of GetPoint() to m_PointPt.
using SwCursor::UpDown;
public:
SwShellCursor( const SwCursorShell& rCursorSh, const SwPosition &rPos );
SwShellCursor( const SwCursorShell& rCursorSh, const SwPosition &rPos, const Point& rPtPos, SwPaM* pRing ); // note: *intentionally* links the new shell cursor into the old one's Ring
SwShellCursor( SwShellCursor& ); virtual ~SwShellCursor() override;
virtualvoid FillRects() override; // For Table- and normal cursors. /// @see SwSelPaintRects::FillStartEnd(), override for text selections. virtualvoid FillStartEnd(SwRect& rStart, SwRect& rEnd) const override;
void Show(SfxViewShell const * pViewShell); // Update and display all selections. void Hide(); // Hide all selections. void Invalidate( const SwRect& rRect );
class SwShellTableCursor final : publicvirtual SwShellCursor, publicvirtual SwTableCursor
{ /// Left edge of the selection start (top left cell).
SwRect m_aStart; /// Right edge of the selection end (bottom right cell).
SwRect m_aEnd; // The Selection has the same order as the table boxes, i.e. // if something is deleted from the one array at a certain position // it has to be deleted from the other one as well!!
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.