LibreOffice Module sw (master)  1
ToxTabStopTokenHandler.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 
11 #ifndef TOXTABSTOPTOKENHANDLER_HXX_
12 #define TOXTABSTOPTOKENHANDLER_HXX_
13 
14 #include <rtl/ustring.hxx>
15 
16 #include <editeng/tstpitem.hxx>
17 #include "nodeoffset.hxx"
18 
19 struct SwFormToken;
20 class SwPageDesc;
21 class SwRootFrame;
22 class SwTextNode;
23 
24 namespace sw {
25 
32 {
33 public:
35 
38  OUString text;
40  };
41 
47  virtual HandledTabStopToken
48  HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode,
49  const SwRootFrame *currentLayout) const = 0;
50 };
51 
54 {
55 public:
56 
58 
74  DefaultToxTabStopTokenHandler(SwNodeOffset indexOfSectionNode, const SwPageDesc& defaultPageDescription,
75  bool tabPositionIsRelativeToParagraphIndent,
76  TabStopReferencePolicy referencePolicy);
77 
86  HandleTabStopToken(const SwFormToken& aToken, const SwTextNode& targetNode,
87  const SwRootFrame *currentLayout) const override;
88 
89 private:
94  static bool
95  CanUseLayoutRectangle(const SwTextNode& targetNode, const SwRootFrame *currentLayout);
96 
102  CalculatePageMarginFromPageDescription(const SwTextNode& targetNode) const;
103 
108 };
109 
110 }
111 
112 #endif /* TOXTABSTOPTOKENHANDLER_HXX_ */
113 
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ToxTabStopTokenHandler::HandledTabStopToken HandleTabStopToken(const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const override
Handle a tab stop token.
long Long
Dialog to specify the properties of date form field.
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
static bool CanUseLayoutRectangle(const SwTextNode &targetNode, const SwRootFrame *currentLayout)
Test whether the page layout can be obtained by a layout rectangle.
This class handles tab stop tokens in the pattern for tox entries.
The default implementation of ToxTabStopTokenHandler.
virtual HandledTabStopToken HandleTabStopToken(const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const =0
Handle a tab stop token.
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
DefaultToxTabStopTokenHandler(SwNodeOffset indexOfSectionNode, const SwPageDesc &defaultPageDescription, bool tabPositionIsRelativeToParagraphIndent, TabStopReferencePolicy referencePolicy)
tools::Long CalculatePageMarginFromPageDescription(const SwTextNode &targetNode) const
Calculate the page margin from the page description.