/* -*- 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/. */ #ifndef TOXTABSTOPTOKENHANDLER_HXX_ #define TOXTABSTOPTOKENHANDLER_HXX_ #include "swdllapi.h" #include "rtl/ustring.hxx" #include "editeng/tstpitem.hxx" struct SwFormToken; class SwPageDesc; class SwRootFrame; class SwTextNode; namespace sw { /** This class handles tab stop tokens in the pattern for tox entries. * * @internal * This is an interface class. It allows to mock the class in unit tests */ class ToxTabStopTokenHandler { public: virtual ~ToxTabStopTokenHandler() {} /** Return value of HandleTabStopToken */ struct HandledTabStopToken { OUString text; SvxTabStop tabStop; }; /** Handle a tab stop token. * * @returns A HandledTabStopToken. Make sure to append the text field to the text of the target node * and to provide the returned SvxTabStop to the attributes of the node. */ virtual HandledTabStopToken HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode, const SwRootFrame *currentLayout) const = 0; }; /** The default implementation of ToxTabStopTokenHandler */ class DefaultToxTabStopTokenHandler : public ToxTabStopTokenHandler { public: enum TabStopReferencePolicy {TABSTOPS_RELATIVE_TO_INDENT, TABSTOPS_RELATIVE_TO_PAGE}; /** * @param indexOfSectionNode * The index of the section node. It is needed to determine whether a page description was given by a node * before the tox section. * * @param defaultPageDescription * Which page description shall be used if we do not find one or the found page description was provided by * a node before the tox section * * @param tabPositionIsRelativeToParagraphIndent * Whether the tab position is relative to the paragraph indent. (toxForm.IsRelTabPos() is true or false.) * * @param tabstopReferencePolicy * How tab stops are positioned. (#i21237) The default behavior is to place tab stops relative to the page. */ DefaultToxTabStopTokenHandler(sal_uInt32 indexOfSectionNode, const SwPageDesc& defaultPageDescription, bool tabPositionIsRelativeToParagraphIndent, TabStopReferencePolicy referencePolicy); /** Handle a tab stop token. * * If the token contains tab alignment information, that is used to create the SvxTabStop. * Else, the information about the tab stop is taken from a page description. * Depending on the TabStopReferencePolicy provided in the constructor, the * method behaves differently when deriving the tab stop position. */ ToxTabStopTokenHandler::HandledTabStopToken HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode, const SwRootFrame *currentLayout) const override; private: /** Test whether the page layout can be obtained by a layout rectangle. * * Is used to determine how to find tab stop position. */ static bool CanUseLayoutRectangle(const SwTextNode& targetNode, const SwRootFrame *currentLayout); /** Calculate the page margin from the page description. * * This is the fallback method to determine the position of a tab stop. */ long CalculatePageMarginFromPageDescription(const SwTextNode& targetNode) const; sal_uInt32 mIndexOfSectionNode; const SwPageDesc& mDefaultPageDescription; bool mTabPositionIsRelativeToParagraphIndent; TabStopReferencePolicy mTabStopReferencePolicy; }; } #endif /* TOXTABSTOPTOKENHANDLER_HXX_ */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ alue='distro/collabora/cp-5.3'>distro/collabora/cp-5.3 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/.gitignore
AgeCommit message (Expand)Author
2023-04-28Add .cache (Qt Creator) and gdbtrace.log (gdb)Hossein
2023-02-12.gitignore: /.vscode*buldi
2022-07-01Add generated lo.xcent to .gitignoreStephan Bergmann
2022-05-13Add mold linker temp files to .gitignoreIlmari Lauhakangas
2022-03-30.gitignore: Add Qt Creator's '.qtc_clangd'Michael Weghorn
2022-02-14updated gitignore for Android buildsPranam Lashkari
2021-12-23Adapt .gitignoreStephan Bergmann
2021-12-01gbuild: serialize dynamic link for static buildsJan-Marek Glogowski
2021-05-31configure: Keep warnings file and cat build onesJan-Marek Glogowski
2021-05-05WASM: add initial support for Emscripten cross buildJan-Marek Glogowski
2021-02-24qtcreator: Create *.pro.shared files instead of *.pro.userMichael Weghorn
2020-12-30Drop some dubious .gitignore entriesStephan Bergmann
2020-08-17Move compilerplugins-related .gitignore content to compilerplugins/.gitignoreStephan Bergmann
2020-08-14add compilerplugin-generated files to .gitignoreNoel Grandin
2020-05-04Adapt to hardened_runtime.xcentStephan Bergmann
2019-06-08Add QtCreator-specific file to .gitignoreMuhammet Kara
2018-12-18No more need to generate lo.xcent from lo.xcent.inStephan Bergmann
2018-01-30Ignore Emacs lock filesStephan Bergmann
2017-12-24.gitignore vscode ide filesAshod Nakashian
2017-08-29Added VisualStudioCode/unified MSDEV VC.dbArmin Le Grand
2017-06-24gitignore: compile_commands.json is only top-levelMuhammet Kara
2017-06-22gitignore: compile_commands.jsonMuhammet Kara
2017-04-06Fix .gitignore after vs2015-ide-integration updateManfred Blume
2017-04-04add *.vcxproj* to .gitignoreBernhard Widl
2017-02-16ios, prepare for multiple targets.jan Iversen
2016-12-12Add rules to gitignoreJaskaran Singh
2016-11-01add Codelite files to .gitignoreNoel Grandin