LibreOffice Module svx (master)
1
include
svx
svditer.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_SVX_SVDITER_HXX
21
#define INCLUDED_SVX_SVDITER_HXX
22
23
#include <vector>
24
25
#include <
svx/svxdllapi.h
>
26
27
class
SdrObjList
;
28
class
SdrObject
;
29
class
SdrPage
;
30
class
SdrMarkList
;
31
32
// SdrObjListIter methods:
33
// SdrIterMode::Flat : Flat over the list
34
// SdrIterMode::DeepWithGroups : With recursive descent parser, Next() also returns group objects
35
// SdrIterMode::DeepNoGroups : With recursive descent parser, Next() returns no group objects
36
enum class
SdrIterMode
{
Flat
,
DeepWithGroups
,
DeepNoGroups
};
37
38
class
SVXCORE_DLLPUBLIC
SdrObjListIter
39
{
40
std::vector< const SdrObject* >
maObjList
;
41
size_t
mnIndex
;
42
bool
mbReverse
;
43
bool
mbUseZOrder
;
44
45
void
ImpProcessObjectList(
const
SdrObjList
& rSdrObjList,
SdrIterMode
eMode);
46
void
ImpProcessMarkList(
const
SdrMarkList
& rMarkList,
SdrIterMode
eMode);
47
void
ImpProcessObj(
const
SdrObject
& rSdrObject,
SdrIterMode
eMode);
48
49
public
:
50
explicit
SdrObjListIter
(
const
SdrObjList
* pObjList,
SdrIterMode
eMode =
SdrIterMode::DeepNoGroups
,
bool
bReverse =
false
);
51
explicit
SdrObjListIter
(
const
SdrObjList
* pObjList,
bool
bUseZOrder,
SdrIterMode
eMode =
SdrIterMode::DeepNoGroups
,
bool
bReverse =
false
);
52
53
/* SJ: the following function can now be used with every
54
SdrObject and is no longer limited to group objects */
55
explicit
SdrObjListIter
(
const
SdrObject
& rSdrObject,
SdrIterMode
eMode =
SdrIterMode::DeepNoGroups
,
bool
bReverse =
false
);
56
explicit
SdrObjListIter
(
const
SdrPage
* pSdrPage,
SdrIterMode
eMode =
SdrIterMode::DeepNoGroups
,
bool
bReverse =
false
);
57
59
explicit
SdrObjListIter
(
const
SdrMarkList
& rMarkList,
SdrIterMode
eMode =
SdrIterMode::DeepNoGroups
);
60
61
void
Reset
() {
mnIndex
= (mbReverse ? maObjList.size() : 0L); }
62
bool
IsMore
()
const
{
return
(mbReverse ?
mnIndex
!= 0 : (
mnIndex
< maObjList.size())); }
63
SdrObject
*
Next
()
64
{
65
const
size_t
idx
(mbReverse ? --
mnIndex
:
mnIndex
++);
66
return
(
idx
< maObjList.size()) ?
const_cast<
SdrObject
*
>
(maObjList[
idx
]) :
nullptr
;
67
}
68
69
size_t
Count
()
const
{
return
maObjList.size(); }
70
};
71
72
#endif
// INCLUDED_SVX_SVDITER_HXX
73
74
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrMarkList
Definition:
svdmark.hxx:137
SdrObjListIter
Definition:
svditer.hxx:39
SdrObjListIter::mnIndex
size_t mnIndex
Definition:
svditer.hxx:41
SdrObjListIter::Count
size_t Count() const
Definition:
svditer.hxx:69
SdrObjListIter::Reset
void Reset()
Definition:
svditer.hxx:61
SdrObjListIter::mbReverse
bool mbReverse
Definition:
svditer.hxx:42
SdrObjListIter::Next
SdrObject * Next()
Definition:
svditer.hxx:63
SdrObjListIter::maObjList
std::vector< const SdrObject * > maObjList
Definition:
svditer.hxx:40
SdrObjListIter::IsMore
bool IsMore() const
Definition:
svditer.hxx:62
SdrObjListIter::mbUseZOrder
bool mbUseZOrder
Definition:
svditer.hxx:43
SdrObjList
Definition:
svdpage.hxx:62
SdrObject
Abstract DrawObject.
Definition:
svdobj.hxx:260
SdrPage
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition:
svdpage.hxx:379
idx
const sal_uInt16 idx[]
CapType::Flat
@ Flat
SdrIterMode
SdrIterMode
Definition:
svditer.hxx:36
SdrIterMode::DeepNoGroups
@ DeepNoGroups
SdrIterMode::DeepWithGroups
@ DeepWithGroups
mnIndex
sal_uInt32 mnIndex
svxdllapi.h
SVXCORE_DLLPUBLIC
#define SVXCORE_DLLPUBLIC
Definition:
svxdllapi.h:35
Generated on Sun Jul 30 2023 04:27:37 for LibreOffice Module svx (master) by
1.9.3