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
28class SwDoc;
29class SwNumRule;
30class SwNodes;
31
33{
34 SHOW,
35 HIDDEN,
37};
38
39class SwList
40{
41 public:
42 SwList( OUString sListId,
43 SwNumRule& rDefaultListStyle,
44 const SwNodes& rNodes );
45 ~SwList() COVERITY_NOEXCEPT_FALSE;
46
47 const OUString & GetListId() const { return msListId; }
48
49 const OUString & GetDefaultListStyleName() const { return msDefaultListStyleName; }
50
51 void SetDefaultListStyleName(OUString const&);
52
53 void InsertListItem(SwNodeNum& rNodeNum,
54 SwListRedlineType eRedlines,
55 const int nLevel,
56 const SwDoc& rDoc);
57 static void RemoveListItem(SwNodeNum& rNodeNum, const SwDoc& rDoc);
58
59 void InvalidateListTree();
60 void ValidateListTree(const SwDoc& rDoc);
61
62 void MarkListLevel( const int nListLevel,
63 const bool bValue );
64
65 bool IsListLevelMarked( const int nListLevel ) const;
66
67 bool HasNodes() const;
68
69 private:
70 SwList( const SwList& ) = delete;
71 SwList& operator=( const SwList& ) = delete;
72
73 void NotifyItemsOnListLevel( const int nLevel );
74
75 // unique identifier of the list
76 const OUString msListId;
77 // default list style for the list items, identified by the list style name
79
80 // list trees for certain document ranges
82 {
84 std::unique_ptr<SwNodeNum> pRoot;
93 std::unique_ptr<SwNodeNum> pRootRLHidden;
101 std::unique_ptr<SwNodeNum> pRootOrigText;
103 std::unique_ptr<SwPaM> pSection;
104 tListTreeForRange(std::unique_ptr<SwNodeNum> p1, std::unique_ptr<SwNodeNum> p2,
105 std::unique_ptr<SwNodeNum> p3, std::unique_ptr<SwPaM> p4)
106 : pRoot(std::move(p1)), pRootRLHidden(std::move(p2)),
107 pRootOrigText(std::move(p3)), pSection(std::move(p4)) {}
108 };
109 std::vector<tListTreeForRange> maListTrees;
110
112};
113#endif // INCLUDED_SW_INC_LIST_HXX
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Definition: list.hxx:40
void InsertListItem(SwNodeNum &rNodeNum, SwListRedlineType eRedlines, const int nLevel, const SwDoc &rDoc)
Definition: list.cxx:89
bool HasNodes() const
Definition: list.cxx:77
int mnMarkedListLevel
Definition: list.hxx:111
static void RemoveListItem(SwNodeNum &rNodeNum, const SwDoc &rDoc)
Definition: list.cxx:114
void InvalidateListTree()
Definition: list.cxx:119
void NotifyItemsOnListLevel(const int nLevel)
Definition: list.cxx:175
OUString msDefaultListStyleName
Definition: list.hxx:78
bool IsListLevelMarked(const int nListLevel) const
Definition: list.cxx:170
SwList & operator=(const SwList &)=delete
void ValidateListTree(const SwDoc &rDoc)
Definition: list.cxx:129
void MarkListLevel(const int nListLevel, const bool bValue)
Definition: list.cxx:139
std::vector< tListTreeForRange > maListTrees
Definition: list.hxx:109
const OUString & GetListId() const
Definition: list.hxx:47
SwList(OUString sListId, SwNumRule &rDefaultListStyle, const SwNodes &rNodes)
Definition: list.cxx:27
void SetDefaultListStyleName(OUString const &)
Definition: list.cxx:185
~SwList() COVERITY_NOEXCEPT_FALSE
Definition: list.cxx:67
const OUString msListId
Definition: list.hxx:76
SwList(const SwList &)=delete
const OUString & GetDefaultListStyleName() const
Definition: list.hxx:49
SwListRedlineType
Definition: list.hxx:33
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:93
std::unique_ptr< SwNodeNum > pRoot
tree always corresponds to document model
Definition: list.hxx:84
tListTreeForRange(std::unique_ptr< SwNodeNum > p1, std::unique_ptr< SwNodeNum > p2, std::unique_ptr< SwNodeNum > p3, std::unique_ptr< SwPaM > p4)
Definition: list.hxx:104
std::unique_ptr< SwPaM > pSection
top-level SwNodes section
Definition: list.hxx:103
std::unique_ptr< SwNodeNum > pRootOrigText
Tree that is missing those nodes that are merged or hidden by insert redlines; this is only used if t...
Definition: list.hxx:101