LibreOffice Module xmloff (master)  1
XMLTextNumRuleInfo.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/container/XIndexReplace.hpp>
24 #include <sal/types.h>
25 
26 namespace com::sun::star {
27  namespace text { class XTextContent; }
28 }
29 
31 
39 {
40  // numbering rules instance and its name
41  css::uno::Reference < css::container::XIndexReplace > mxNumRules;
42  OUString msNumRulesName;
43 
44  // paragraph's list attributes
45  OUString msListId;
46  sal_Int16 mnListStartValue;
47  sal_Int16 mnListLevel;
50 
51  // numbering rules' attributes
53 
54  // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
56 
59 
60 public:
61 
63 
64  inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
65 
66  void Set( const css::uno::Reference < css::text::XTextContent > & rTextContent,
67  const bool bOutlineStyleAsNormalListStyle,
68  const XMLTextListAutoStylePool& rListAutoPool,
69  const bool bExportTextNumberElement );
70  inline void Reset();
71 
72  const OUString& GetNumRulesName() const
73  {
74  return msNumRulesName;
75  }
76  sal_Int16 GetListLevelStartValue() const
77  {
78  return mnListLevelStartValue;
79  }
80 
81  const OUString& GetListId() const
82  {
83  return msListId;
84  }
85 
86  sal_Int16 GetLevel() const
87  {
88  return mnListLevel;
89  }
90 
91  bool HasStartValue() const
92  {
93  return mnListStartValue != -1;
94  }
95  sal_uInt32 GetStartValue() const
96  {
97  return mnListStartValue;
98  }
99 
100  bool IsNumbered() const
101  {
102  return mbIsNumbered;
103  }
104  bool IsRestart() const
105  {
106  return mbIsRestart;
107  }
108 
109  bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
110 
112  {
114  }
115  const OUString& ListLabelString() const
116  {
117  return msListLabelString;
118  }
119 };
120 
122  const XMLTextNumRuleInfo& rInfo )
123 {
125  mxNumRules = rInfo.mxNumRules;
126  msListId = rInfo.msListId;
128  mnListLevel = rInfo.mnListLevel;
129  mbIsNumbered = rInfo.mbIsNumbered;
130  mbIsRestart = rInfo.mbIsRestart;
131  // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
135 
136  return *this;
137 }
138 
140 {
141  mxNumRules = nullptr;
142  msNumRulesName.clear();
143  msListId.clear();
144  mnListStartValue = -1;
145  mnListLevel = 0;
146  // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
150  msListLabelString.clear();
151 }
152 
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool BelongsToSameList(const XMLTextNumRuleInfo &rCmp) const
sal_uInt32 GetStartValue() const
bool IsContinueingPreviousSubTree() const
css::uno::Reference< css::container::XIndexReplace > mxNumRules
const OUString & GetListId() const
information about list and list style for a certain paragraph
exports com.sun.star. text
sal_Int16 GetLevel() const
const OUString & GetNumRulesName() const
XMLTextNumRuleInfo & operator=(const XMLTextNumRuleInfo &rInfo)
const OUString & ListLabelString() const
void Set(const css::uno::Reference< css::text::XTextContent > &rTextContent, const bool bOutlineStyleAsNormalListStyle, const XMLTextListAutoStylePool &rListAutoPool, const bool bExportTextNumberElement)
bool HasStartValue() const
sal_Int16 GetListLevelStartValue() const