1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <sal/config.h>
23 #include <sal/log.hxx>
28 #include <editeng/outliner.hxx>
29 #include <o3tl/safeint.hxx>
30 #include <tools/link.hxx>
33 typedef struct _xmlTextWriter
* xmlTextWriterPtr
;
40 sal_Int32
GetParagraphCount() const
42 size_t nSize
= maEntries
.size();
43 if (nSize
> SAL_MAX_INT32
)
45 SAL_WARN( "editeng", "ParagraphList::GetParagraphCount - overflow " << nSize
);
51 Paragraph
* GetParagraph( sal_Int32 nPos
) const
53 return 0 <= nPos
&& o3tl::make_unsigned(nPos
) < maEntries
.size() ? maEntries
[nPos
].get() : nullptr;
56 sal_Int32
GetAbsPos( Paragraph
const * pParent
) const;
58 void Append( std::unique_ptr
<Paragraph
> pPara
);
59 void Insert( std::unique_ptr
<Paragraph
> pPara
, sal_Int32 nAbsPos
);
60 void Remove( sal_Int32 nPara
);
61 void MoveParagraphs( sal_Int32 nStart
, sal_Int32 nDest
, sal_Int32 nCount
);
63 Paragraph
* GetParent( Paragraph
const * pParagraph
) const;
64 bool HasChildren( Paragraph
const * pParagraph
) const;
65 bool HasHiddenChildren( Paragraph
const * pParagraph
) const;
66 bool HasVisibleChildren( Paragraph
const * pParagraph
) const;
67 sal_Int32
GetChildCount( Paragraph
const * pParagraph
) const;
69 void Expand( Paragraph
const * pParent
);
70 void Collapse( Paragraph
const * pParent
);
72 void SetVisibleStateChangedHdl( const Link
<Paragraph
&,void>& rLink
) { aVisibleStateChangedHdl
= rLink
; }
74 void dumpAsXml(xmlTextWriterPtr pWriter
) const;
78 Link
<Paragraph
&,void> aVisibleStateChangedHdl
;
79 std::vector
<std::unique_ptr
<Paragraph
>> maEntries
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */