Line data Source code
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_SW_SOURCE_CORE_ACCESS_ACCFRMOBJMAP_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRMOBJMAP_HXX
22 :
23 : #include <tools/gen.hxx>
24 : #include <svx/svdtypes.hxx>
25 : #include <accfrmobj.hxx>
26 : #include <map>
27 :
28 : class SwAccessibleMap;
29 : class SwRect;
30 : class SwFrm;
31 : class SdrObject;
32 :
33 : class SwAccessibleChildMapKey
34 : {
35 : public:
36 : enum LayerId { INVALID, HELL, TEXT, HEAVEN, CONTROLS, XWINDOW };
37 :
38 0 : SwAccessibleChildMapKey()
39 : : eLayerId( INVALID )
40 : , nOrdNum( 0 )
41 0 : , nPosNum( 0, 0 )
42 0 : {}
43 :
44 0 : SwAccessibleChildMapKey( LayerId eId, sal_uInt32 nOrd )
45 : : eLayerId( eId )
46 : , nOrdNum( nOrd )
47 0 : , nPosNum( 0, 0 )
48 0 : {}
49 :
50 : SwAccessibleChildMapKey( LayerId eId, sal_uInt32 nOrd, Point nPos )
51 : : eLayerId( eId )
52 : , nOrdNum( nOrd )
53 : , nPosNum( nPos )
54 : {}
55 :
56 0 : bool operator()( const SwAccessibleChildMapKey& r1,
57 : const SwAccessibleChildMapKey& r2 ) const
58 : {
59 0 : return (r1.eLayerId == r2.eLayerId) ?
60 0 : ( (r1.nPosNum == r2.nPosNum) ?(r1.nOrdNum < r2.nOrdNum) :
61 0 : (r1.nPosNum.getY() == r2.nPosNum.getY()? r1.nPosNum.getX() < r2.nPosNum.getX() :
62 0 : r1.nPosNum.getY() < r2.nPosNum.getY()) ) :
63 0 : (r1.eLayerId < r2.eLayerId);
64 : }
65 :
66 : /* MT: Need to get this position parameter stuff in dev300 somehow...
67 : //This methods are used to insert an object to the map, adding a position parameter.
68 : ::std::pair< iterator, bool > insert( sal_uInt32 nOrd, Point nPos,
69 : const SwFrmOrObj& rLower );
70 : ::std::pair< iterator, bool > insert( const SdrObject *pObj,
71 : const SwFrmOrObj& rLower,
72 : const SwDoc *pDoc,
73 : Point nPos);
74 : */
75 :
76 : private:
77 : LayerId eLayerId;
78 : sal_uInt32 nOrdNum;
79 : Point nPosNum;
80 : };
81 :
82 : typedef ::std::map < SwAccessibleChildMapKey, sw::access::SwAccessibleChild, SwAccessibleChildMapKey >
83 : _SwAccessibleChildMap;
84 :
85 0 : class SwAccessibleChildMap : public _SwAccessibleChildMap
86 : {
87 : const SdrLayerID nHellId;
88 : const SdrLayerID nControlsId;
89 :
90 : ::std::pair< iterator, bool > insert( const sal_uInt32 nPos,
91 : const SwAccessibleChildMapKey::LayerId eLayerId,
92 : const sw::access::SwAccessibleChild& rLower );
93 : ::std::pair< iterator, bool > insert( const SdrObject* pObj,
94 : const sw::access::SwAccessibleChild& rLower );
95 :
96 : public:
97 : SwAccessibleChildMap( const SwRect& rVisArea,
98 : const SwFrm& rFrm,
99 : SwAccessibleMap& rAccMap );
100 :
101 : static bool IsSortingRequired( const SwFrm& rFrm );
102 : };
103 :
104 : #endif
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|