/* -*- 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
/** Screen behavior related to cursor movements */ enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, SC_FOLLOW_JUMP, SC_FOLLOW_JUMP_END };
/** Mouse mode to select areas */ enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL,
SC_REFTYPE_EMBED_LT, SC_REFTYPE_EMBED_RB };
/** States GetSimpleArea() returns for the underlying selection marks, so the
caller can react if the result is not of type SC_MARK_SIMPLE. */ enum ScMarkType
{
SC_MARK_NONE = 0, // Not returned by GetSimpleArea(), used internally. // Nothing marked always results in the // current cursor position being selected and a simple mark.
SC_MARK_SIMPLE = 1, // Simple rectangular area marked, no filtered rows.
SC_MARK_FILTERED = 2, // At least one mark contains filtered rows.
SC_MARK_SIMPLE_FILTERED = // Simple rectangular area marked containing filtered rows.
SC_MARK_SIMPLE |
SC_MARK_FILTERED, // 3
SC_MARK_MULTI = 4 // Multiple selection marks. /* TODO: if filtered multi-selection was implemented, this would be the value to use. */ #if 0
,
SC_MARK_MULTI_FILTERED = // Multiple selection marks containing filtered rows.
SC_MARK_MULTI |
SC_MARK_FILTERED // 6 #endif
};
enumclass ScPasteFlags
{
NONE = 0, // No flags specified
Mode = 1, // Enable paste-mode
Border = 2, // Show a border around the source cells
}; namespace o3tl { template<> struct typed_flags<ScPasteFlags> : is_typed_flags<ScPasteFlags, 0x03> {};
}
class ScDocFunc; class ScDBFunc; class ScTabViewShell; class ScDrawView; class ScEditEngineDefaulter; class EditView; class EditStatus; class Outliner; namespace vcl { class Window; } class SfxObjectShell; class SfxBindings; class SfxDispatcher; class ScPatternAttr; class ScExtDocOptions; class ScViewData; class ScGridWindow; class ScSizeDeviceProvider;
class ScPositionHelper
{ public: typedef SCCOLROW index_type; typedef std::pair<index_type, tools::Long> value_type;
static_assert(std::numeric_limits<index_type>::is_signed, "ScPositionCache: index type is not signed");
SCCOL nPosX[2]; ///< X position of the top left cell of the visible area.
SCROW nPosY[2]; ///< Y position of the top left cell of the visible area.
SCCOL nMaxTiledCol;
SCROW nMaxTiledRow;
bool bShowGrid; // per sheet show grid lines option. bool mbOldCursorValid; // "virtual" Cursor position when combined
ScViewDataTable(const ScDocument *pDoc = nullptr);
/** Sanitize the active split range value to not point into a grid window that would never be initialized due to non-matching split modes.
This is to be done when reading settings from file formats or configurations that could have arbitrary values. The caller is responsible for actually assigning the new value to eWhichActive because we want this function to be const to be able to call the check from anywhere.
*/
[[nodiscard]] ScSplitPos SanitizeWhichActive() const;
};
class ScViewData
{ private: double nPPTX, nPPTY; // Scaling factors
::std::vector<std::unique_ptr<ScViewDataTable>> maTabData;
ScDocShell& mrDocShell;
ScDocument& mrDoc;
ScMarkData maMarkData;
ScMarkData maHighlightData;
ScViewDataTable* pThisTab; // Data of the displayed sheet
ScTabViewShell* pView;
std::unique_ptr<EditView> pEditView[4]; // Belongs to the window
ScViewOptions maOptions;
EditView* pSpellingView;
SvxZoomType eDefZoomType; // default zoom and type for missing TabData
Fraction aDefZoomX;
Fraction aDefZoomY;
Fraction aDefPageZoomX; // zoom in page break preview mode
Fraction aDefPageZoomY;
ScRefType eRefType;
SCTAB nTabNo; // displayed sheet
SCTAB nRefTabNo; // sheet which contains RefInput
SCCOL nRefStartX;
SCROW nRefStartY;
SCTAB nRefStartZ;
SCCOL nRefEndX;
SCROW nRefEndY;
SCTAB nRefEndZ;
SCCOL nFillStartX; // Fill Cursor
SCROW nFillStartY;
SCCOL nFillEndX;
SCROW nFillEndY;
SCCOL nEditCol; // Related position
SCROW nEditRow;
SCCOL nEditStartCol;
SCCOL nEditEndCol; // End of Edit View
SCROW nEditEndRow;
SCCOL nTabStartCol; // for Enter after Tab
ScRange aDelRange; // for delete AutoFill
ScPasteFlags nPasteFlags;
ScSplitPos eEditActivePart; // the part that was active when edit mode was started
ScFillMode nFillMode;
SvxAdjust eEditAdjust; bool bEditActive[4] = {}; // Active? bool bActive:1; // Active Window ? bool bIsRefMode:1; // Reference input bool bDelMarkValid:1; // Only valid at SC_REFTYPE_FILL bool bPagebreak:1; // Page break preview mode bool bSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click bool bMoveArea:1; bool bEditHighlight:1;
bool bGrowing;
sal_Int16 nFormulaBarLines; // Visible lines in the formula bar
tools::Long m_nLOKPageUpDownOffset;
tools::Rectangle maLOKVisibleArea;///< The visible area in the LibreOfficeKit client.
void SetFormulaBarLines(sal_Int16 nLines)
{ // Formula bar must be between 1 and 25 lines (see SpreadsheetViewSettings.idl)
nLines = std::max(nLines, static_cast<sal_Int16>(1));
nLines = std::min(nLines, static_cast<sal_Int16>(25));
nFormulaBarLines = nLines;
}
sal_Int16 GetFormulaBarLines() const { return nFormulaBarLines; };
/** Disallow Paste on Ctrl+A all selected or another high amount of selected cells that is not the same size in one direction as the clipboard source. To prevent DOOM.
*/ bool SelectionForbidsPaste( ScDocument* pClipDoc = nullptr ); bool SelectionForbidsPaste( SCCOL nSrcCols, SCROW nSrcRows );
/** Disallow cell fill (Fill,Enter,...) on Ctrl+A all selected or another high amount of selected cells. We'd go DOOM.
*/ bool SelectionForbidsCellFill(); /// Determine DOOM condition, i.e. from selected range. staticbool SelectionFillDOOM( const ScRange& rRange );
/// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea. void ForcePageUpDownOffset(tools::Long nTwips) { m_nLOKPageUpDownOffset = nTwips; }
tools::Long GetPageUpDownOffset() const { return m_nLOKPageUpDownOffset; }
/// The visible area in the client (set by setClientVisibleArea). const tools::Rectangle& getLOKVisibleArea() const { return maLOKVisibleArea; } void setLOKVisibleArea(const tools::Rectangle& rArea) { maLOKVisibleArea = rArea; }
/** * Extend the output area for the edit engine view in a horizontal * direction as needed.
*/ void EditGrowX();
/** * Extend the output area for the edit engine view in a vertical direction * as needed. * * @param bInitial when true, then the call originates from a brand-new * edit engine instance.
*/ void EditGrowY( bool bInitial = false );
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.