update credits
[LibreOffice.git] / editeng / source / outliner / paralist.hxx
blobd8abf686f5187c0a3e0301daae271fde6865420f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef _PARALIST_HXX
21 #define _PARALIST_HXX
23 #include <sal/config.h>
24 #include <sal/log.hxx>
26 #include <vector>
28 #include <tools/link.hxx>
30 class Paragraph;
32 class ParagraphList
34 public:
35 void Clear( sal_Bool bDestroyParagraphs );
37 sal_Int32 GetParagraphCount() const
39 size_t nSize = maEntries.size();
40 if (nSize > SAL_MAX_INT32)
42 SAL_WARN( "editeng", "ParagraphList::GetParagraphCount - overflow " << nSize);
43 return SAL_MAX_INT32;
45 return nSize;
48 Paragraph* GetParagraph( sal_Int32 nPos ) const
50 return 0 <= nPos && static_cast<size_t>(nPos) < maEntries.size() ? maEntries[nPos] : NULL;
53 sal_Int32 GetAbsPos( Paragraph* pParent ) const;
55 void Append( Paragraph *pPara);
56 void Insert( Paragraph* pPara, sal_Int32 nAbsPos);
57 void Remove( sal_Int32 nPara );
58 void MoveParagraphs( sal_Int32 nStart, sal_Int32 nDest, sal_Int32 nCount );
60 Paragraph* GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const;
61 sal_Bool HasChildren( Paragraph* pParagraph ) const;
62 sal_Bool HasHiddenChildren( Paragraph* pParagraph ) const;
63 sal_Bool HasVisibleChildren( Paragraph* pParagraph ) const;
64 sal_Int32 GetChildCount( Paragraph* pParagraph ) const;
66 void Expand( Paragraph* pParent );
67 void Collapse( Paragraph* pParent );
69 void SetVisibleStateChangedHdl( const Link& rLink ) { aVisibleStateChangedHdl = rLink; }
70 Link GetVisibleStateChangedHdl() const { return aVisibleStateChangedHdl; }
72 private:
74 Link aVisibleStateChangedHdl;
75 std::vector<Paragraph*> maEntries;
78 #endif
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */