Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX
30 : : #define _SDR_OVERLAY_OVERLAYOBJECTLIST_HXX
31 : :
32 : : #include <svx/sdr/overlay/overlayobject.hxx>
33 : : #include <tools/gen.hxx>
34 : : #include "svx/svxdllapi.h"
35 : :
36 : : //////////////////////////////////////////////////////////////////////////////
37 : :
38 : : #define DEFAULT_VALUE_FOR_HITTEST_PIXEL (2L)
39 : :
40 : : //////////////////////////////////////////////////////////////////////////////
41 : :
42 : : namespace sdr
43 : : {
44 : : namespace overlay
45 : : {
46 : : class SVX_DLLPUBLIC OverlayObjectList
47 : : {
48 : : protected:
49 : : // the vector of OverlayObjects
50 : : OverlayObjectVector maVector;
51 : :
52 : : // default value for HiTestPixel
53 : : sal_uInt32 getDefaultValueForHitTestPixel() const { return 4L; }
54 : :
55 : : public:
56 : 2756 : OverlayObjectList() {}
57 : : ~OverlayObjectList();
58 : :
59 : : // clear list, this includes deletion of all contained objects
60 : : void clear();
61 : :
62 : : // append objects
63 [ + - ]: 2756 : void append(OverlayObject& rOverlayObject) { maVector.push_back(&rOverlayObject); }
64 : :
65 : : // access to objects
66 : : sal_uInt32 count() const { return maVector.size(); }
67 : : OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); }
68 : :
69 : : // Hittest with logical coordinates
70 : : bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const;
71 : :
72 : : // Hittest with pixel coordinates and pixel tolerance
73 : : bool isHitPixel(const Point& rDiscretePosition, sal_uInt32 fDiscreteTolerance = DEFAULT_VALUE_FOR_HITTEST_PIXEL) const;
74 : :
75 : : // calculate BaseRange of all included OverlayObjects and return
76 : : basegfx::B2DRange getBaseRange() const;
77 : : };
78 : : } // end of namespace overlay
79 : : } // end of namespace sdr
80 : :
81 : : //////////////////////////////////////////////////////////////////////////////
82 : :
83 : : #endif //_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX
84 : :
85 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|