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 .
19 #ifndef INCLUDED_SW_INC_EDGLBLDC_HXX
20 #define INCLUDED_SW_INC_EDGLBLDC_HXX
22 #include <o3tl/sorted_vector.hxx>
26 class SwTOXBaseSection
;
28 enum GlobalDocContentType
{
34 class SwGlblDocContent
36 GlobalDocContentType eType
;
39 const SwTOXBase
* pTOX
;
40 const SwSection
* pSect
;
44 SwGlblDocContent( sal_uLong nPos
);
45 SwGlblDocContent( const SwTOXBaseSection
* pTOX
);
46 SwGlblDocContent( const SwSection
* pSect
);
49 GlobalDocContentType
GetType() const { return eType
; }
50 const SwSection
* GetSection() const
51 { return GLBLDOC_SECTION
== eType
? PTR
.pSect
: 0; }
52 const SwTOXBase
* GetTOX() const
53 { return GLBLDOC_TOXBASE
== eType
? PTR
.pTOX
: 0; }
54 sal_uLong
GetDocPos() const { return nDocPos
; }
57 inline bool operator==( const SwGlblDocContent
& rCmp
) const
58 { return GetDocPos() == rCmp
.GetDocPos(); }
59 inline bool operator<( const SwGlblDocContent
& rCmp
) const
60 { return GetDocPos() < rCmp
.GetDocPos(); }
63 class SwGlblDocContents
: public o3tl::sorted_vector
<SwGlblDocContent
*, o3tl::less_ptr_to
<SwGlblDocContent
> > {
65 ~SwGlblDocContents() { DeleteAndDestroyAll(); }
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */