Branch data 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 : : #ifndef _ACCFRMOBJMAP_HXX
20 : : #define _ACCFRMOBJMAP_HXX
21 : :
22 : : #include <accfrmobj.hxx>
23 : :
24 : : #include <svx/svdtypes.hxx>
25 : :
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 : 4 : inline SwAccessibleChildMapKey()
39 : : : eLayerId( INVALID )
40 : 4 : , nOrdNum( 0 )
41 : 4 : {}
42 : :
43 : 8 : inline SwAccessibleChildMapKey( LayerId eId, sal_uInt32 nOrd )
44 : : : eLayerId( eId )
45 : 8 : , nOrdNum( nOrd )
46 : 8 : {}
47 : :
48 : 12 : inline bool operator()( const SwAccessibleChildMapKey& r1,
49 : : const SwAccessibleChildMapKey& r2 ) const
50 : : {
51 : : return (r1.eLayerId == r2.eLayerId)
52 : : ? (r1.nOrdNum < r2.nOrdNum)
53 [ - + ]: 12 : : (r1.eLayerId < r2.eLayerId);
54 : : }
55 : :
56 : : private:
57 : :
58 : : LayerId eLayerId;
59 : : sal_uInt32 nOrdNum;
60 : :
61 : : };
62 : :
63 : : typedef ::std::map < SwAccessibleChildMapKey, sw::access::SwAccessibleChild, SwAccessibleChildMapKey >
64 : : _SwAccessibleChildMap;
65 : :
66 : 4 : class SwAccessibleChildMap : public _SwAccessibleChildMap
67 : : {
68 : : const SdrLayerID nHellId;
69 : : const SdrLayerID nControlsId;
70 : :
71 : : ::std::pair< iterator, bool > insert( const sal_uInt32 nPos,
72 : : const SwAccessibleChildMapKey::LayerId eLayerId,
73 : : const sw::access::SwAccessibleChild& rLower );
74 : : ::std::pair< iterator, bool > insert( const SdrObject* pObj,
75 : : const sw::access::SwAccessibleChild& rLower );
76 : :
77 : : public:
78 : :
79 : : SwAccessibleChildMap( const SwRect& rVisArea,
80 : : const SwFrm& rFrm,
81 : : SwAccessibleMap& rAccMap );
82 : :
83 : : static sal_Bool IsSortingRequired( const SwFrm& rFrm );
84 : : };
85 : :
86 : : #endif
87 : :
88 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|