LibreOffice Module sw (master)  1
list.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 #ifndef INCLUDED_SW_INC_LIST_HXX
21 #define INCLUDED_SW_INC_LIST_HXX
22 
23 #include <rtl/ustring.hxx>
24 #include "SwNodeNum.hxx"
25 #include "pam.hxx"
26 #include <memory>
27 
28 class SwDoc;
29 class SwNumRule;
30 class SwNodes;
31 
32 class SwList
33 {
34  public:
35  SwList( const OUString& sListId,
36  SwNumRule& rDefaultListStyle,
37  const SwNodes& rNodes );
38  ~SwList() COVERITY_NOEXCEPT_FALSE;
39 
40  const OUString & GetListId() const { return msListId; }
41 
42  const OUString & GetDefaultListStyleName() const { return msDefaultListStyleName; }
43 
44  void SetDefaultListStyleName(OUString const&);
45 
46  void InsertListItem(SwNodeNum& rNodeNum,
47  bool isHiddenRedlines,
48  const int nLevel,
49  const SwDoc& rDoc);
50  static void RemoveListItem(SwNodeNum& rNodeNum, const SwDoc& rDoc);
51 
52  void InvalidateListTree();
53  void ValidateListTree(const SwDoc& rDoc);
54 
55  void MarkListLevel( const int nListLevel,
56  const bool bValue );
57 
58  bool IsListLevelMarked( const int nListLevel ) const;
59 
60  bool HasNodes() const;
61 
62  private:
63  SwList( const SwList& ) = delete;
64  SwList& operator=( const SwList& ) = delete;
65 
66  void NotifyItemsOnListLevel( const int nLevel );
67 
68  // unique identifier of the list
69  const OUString msListId;
70  // default list style for the list items, identified by the list style name
72 
73  // list trees for certain document ranges
75  {
77  std::unique_ptr<SwNodeNum> pRoot;
86  std::unique_ptr<SwNodeNum> pRootRLHidden;
88  std::unique_ptr<SwPaM> pSection;
89  tListTreeForRange(std::unique_ptr<SwNodeNum> p1, std::unique_ptr<SwNodeNum> p2, std::unique_ptr<SwPaM> p3)
90  : pRoot(std::move(p1)), pRootRLHidden(std::move(p2)), pSection(std::move(p3)) {}
91  };
92  std::vector<tListTreeForRange> maListTrees;
93 
95 };
96 #endif // INCLUDED_SW_INC_LIST_HXX
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString msDefaultListStyleName
Definition: list.hxx:71
SwList(const OUString &sListId, SwNumRule &rDefaultListStyle, const SwNodes &rNodes)
Definition: list.cxx:26
Definition: list.hxx:32
Definition: doc.hxx:187
~SwList() COVERITY_NOEXCEPT_FALSE
Definition: list.cxx:55
void NotifyItemsOnListLevel(const int nLevel)
Definition: list.cxx:159
tListTreeForRange(std::unique_ptr< SwNodeNum > p1, std::unique_ptr< SwNodeNum > p2, std::unique_ptr< SwPaM > p3)
Definition: list.hxx:89
void SetDefaultListStyleName(OUString const &)
Definition: list.cxx:168
std::unique_ptr< SwNodeNum > pRootRLHidden
Tree that is missing those nodes that are merged or hidden by delete redlines; this is only used if t...
Definition: list.hxx:86
std::unique_ptr< SwNodeNum > pRoot
tree always corresponds to document model
Definition: list.hxx:77
const OUString & GetListId() const
Definition: list.hxx:40
void MarkListLevel(const int nListLevel, const bool bValue)
Definition: list.cxx:123
const OUString msListId
Definition: list.hxx:69
std::vector< tListTreeForRange > maListTrees
Definition: list.hxx:92
bool IsListLevelMarked(const int nListLevel) const
Definition: list.cxx:154
void InvalidateListTree()
Definition: list.cxx:105
void ValidateListTree(const SwDoc &rDoc)
Definition: list.cxx:114
SwList & operator=(const SwList &)=delete
void InsertListItem(SwNodeNum &rNodeNum, bool isHiddenRedlines, const int nLevel, const SwDoc &rDoc)
Definition: list.cxx:76
bool HasNodes() const
Definition: list.cxx:64
std::unique_ptr< SwPaM > pSection
top-level SwNodes section
Definition: list.hxx:88
int mnMarkedListLevel
Definition: list.hxx:94
const OUString & GetDefaultListStyleName() const
Definition: list.hxx:42
static void RemoveListItem(SwNodeNum &rNodeNum, const SwDoc &rDoc)
Definition: list.cxx:100