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 25 #ifndef _WW8GRAF_HXX 26 #define _WW8GRAF_HXX 27 28 #include <vector> 29 #include <stack> 30 #include "writerhelper.hxx" 31 32 struct EscherShape 33 { 34 sal_uLong mnEscherShapeOrder; 35 sal_uLong mnNoInlines; 36 // --> OD 2004-12-13 #117915# - new member <mbInHeaderFooter> 37 bool mbInHeaderFooter; EscherShapeEscherShape38 EscherShape( sal_uLong nEscherShapeOrder, 39 bool _bInHeaderFooter ) 40 : mnEscherShapeOrder(nEscherShapeOrder), 41 mnNoInlines(0), 42 mbInHeaderFooter( _bInHeaderFooter ) 43 {} 44 // <-- 45 }; 46 47 class wwZOrderer 48 { 49 private: 50 // --> OD 2004-12-13 #117915# - consider that objects in page header/footer 51 // are always behind objects in page body. Thus, assure, that in vector 52 // <maEscherLayer> objects in page header|footer are inserted before 53 // objects in page body - see method <GetEscherObjectPos(..)>. 54 //No of objects in doc before starting (always 0 unless using file->insert 55 //and probably 0 then as well 56 std::vector<EscherShape> maEscherLayer; 57 // <-- 58 typedef std::vector<EscherShape>::iterator myeiter; 59 60 std::vector<short> maDrawHeight; 61 typedef std::vector<short>::iterator myditer; 62 63 std::stack<sal_uInt16> maIndexes; 64 65 sw::util::SetLayer maSetLayer; 66 67 sal_uLong mnNoInitialObjects; 68 sal_uLong mnInlines; 69 SdrPage* mpDrawPg; 70 const SvxMSDffShapeOrders *mpShapeOrders; 71 72 sal_uInt16 GetEscherObjectIdx(sal_uLong nSpId); 73 myeiter MapEscherIdxToIter(sal_uLong nIdx); 74 // --> OD 2004-12-13 #117915# - new parameter <_bInHeaderFooter>, indicating 75 // that object is in header or footer 76 sal_uLong GetEscherObjectPos( sal_uLong nSpId, 77 const bool _bInHeaderFooter ); 78 // <-- 79 sal_uLong GetDrawingObjectPos(short nWwHeight); 80 bool InsertObject(SdrObject *pObject, sal_uLong nPos); 81 public: 82 wwZOrderer(const sw::util::SetLayer &rSetLayer, SdrPage* pDrawPg, 83 const SvxMSDffShapeOrders *pShapeOrders); 84 void InsertTextLayerObject(SdrObject* pObject); 85 /* 86 cmc: We should have have separate ZOrder classes for 95- and 97+ and 87 instantiate the appropriate one at run time. 88 */ 89 void InsertDrawingObject(SdrObject* pObj, short nWwHeight); 90 // --> OD 2004-12-13 #117915# - new parameter <_bInHeaderFooter>, indicating 91 // that object is in header or footer 92 void InsertEscherObject( SdrObject* pObject, 93 sal_uLong nSpId, 94 const bool _bInHeaderFooter ); 95 // <-- 96 void InsideEscher(sal_uLong nIndex); 97 void OutsideEscher(); 98 }; 99 100 void WW8FSPAShadowToReal( WW8_FSPA_SHADOW* pFSPAS, WW8_FSPA* pPic ); 101 #endif 102 103 /* vi:set tabstop=4 shiftwidth=4 expandtab: */ 104