xref: /aoo42x/main/sw/source/filter/ww8/ww8graf.hxx (revision 86e1cf34)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
25 
26 #ifndef _WW8GRAF_HXX
27 #define _WW8GRAF_HXX
28 
29 #include <vector>
30 #include <stack>
31 #include "writerhelper.hxx"
32 
33 struct EscherShape
34 {
35     sal_uLong mnEscherShapeOrder;
36     sal_uLong mnNoInlines;
37     // --> OD 2004-12-13 #117915# - new member <mbInHeaderFooter>
38     bool mbInHeaderFooter;
EscherShapeEscherShape39     EscherShape( sal_uLong nEscherShapeOrder,
40                  bool _bInHeaderFooter )
41         : mnEscherShapeOrder(nEscherShapeOrder),
42           mnNoInlines(0),
43           mbInHeaderFooter( _bInHeaderFooter )
44     {}
45     // <--
46 };
47 
48 class wwZOrderer
49 {
50 private:
51     // --> OD 2004-12-13 #117915# - consider that objects in page header/footer
52     // are always behind objects in page body. Thus, assure, that in vector
53     // <maEscherLayer> objects in page header|footer are inserted before
54     // objects in page body - see method <GetEscherObjectPos(..)>.
55     //No of objects in doc before starting (always 0 unless using file->insert
56     //and probably 0 then as well
57     std::vector<EscherShape> maEscherLayer;
58     // <--
59     typedef std::vector<EscherShape>::iterator myeiter;
60 
61     std::vector<short> maDrawHeight;
62     typedef std::vector<short>::iterator myditer;
63 
64     std::stack<sal_uInt16> maIndexes;
65 
66     sw::util::SetLayer maSetLayer;
67 
68     sal_uLong mnNoInitialObjects;
69     sal_uLong mnInlines;
70     SdrPage* mpDrawPg;
71     const SvxMSDffShapeOrders *mpShapeOrders;
72 
73     sal_uInt16 GetEscherObjectIdx(sal_uLong nSpId);
74     myeiter MapEscherIdxToIter(sal_uLong nIdx);
75     // --> OD 2004-12-13 #117915# - new parameter <_bInHeaderFooter>, indicating
76     // that object is in header or footer
77     sal_uLong GetEscherObjectPos( sal_uLong nSpId,
78                               const bool _bInHeaderFooter );
79     // <--
80     sal_uLong GetDrawingObjectPos(short nWwHeight);
81     bool InsertObject(SdrObject *pObject, sal_uLong nPos);
82 public:
83     wwZOrderer(const sw::util::SetLayer &rSetLayer, SdrPage* pDrawPg,
84         const SvxMSDffShapeOrders *pShapeOrders);
85     void InsertTextLayerObject(SdrObject* pObject);
86     /*
87      cmc: We should have have separate ZOrder classes for 95- and 97+ and
88      instantiate the appropriate one at run time.
89      */
90     void InsertDrawingObject(SdrObject* pObj, short nWwHeight);
91     // --> OD 2004-12-13 #117915# - new parameter <_bInHeaderFooter>, indicating
92     // that object is in header or footer
93     void InsertEscherObject( SdrObject* pObject,
94                              sal_uLong nSpId,
95                              const bool _bInHeaderFooter );
96     // <--
97     void InsideEscher(sal_uLong nIndex);
98     void OutsideEscher();
99 };
100 
101 void WW8FSPAShadowToReal( WW8_FSPA_SHADOW* pFSPAS, WW8_FSPA* pPic );
102 #endif
103 
104 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
105