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 #ifndef _FLYPOS_HXX 24 #define _FLYPOS_HXX 25 26 #include <swdllapi.h> 27 #include <boost/shared_ptr.hpp> 28 #include <set> 29 30 class SwFrmFmt; 31 class SwNodeIndex; 32 33 // Struktur zum Erfragen der akt. freifliegenden Rahmen am Dokument. 34 class SW_DLLPUBLIC SwPosFlyFrm 35 { 36 const SwFrmFmt* pFrmFmt; // das FlyFrmFmt 37 SwNodeIndex* pNdIdx; // es reicht ein Index auf den Node 38 sal_uInt32 nOrdNum; 39 public: 40 SwPosFlyFrm( const SwNodeIndex& , const SwFrmFmt*, sal_uInt16 nArrPos ); 41 virtual ~SwPosFlyFrm(); // virtual fuer die Writer (DLL !!) 42 GetFmt() const43 const SwFrmFmt& GetFmt() const { return *pFrmFmt; } GetNdIndex() const44 const SwNodeIndex& GetNdIndex() const { return *pNdIdx; } GetOrdNum() const45 sal_uInt32 GetOrdNum() const { return nOrdNum; } 46 }; 47 48 // define needed classes to safely handle an array of allocated SwPosFlyFrm(s). 49 // SwPosFlyFrms can be handled by value (as return value), only refcounts to 50 // contained SwPosFlyFrm* will be copied. When releasing the last SwPosFlyFrmPtr 51 // instance the allocated instance will be freed. The array is sorted by 52 // GetNdIndex by using a ::std::set container. 53 typedef ::boost::shared_ptr< SwPosFlyFrm > SwPosFlyFrmPtr; 54 struct SwPosFlyFrmCmp { bool operator()(const SwPosFlyFrmPtr& rA, const SwPosFlyFrmPtr& rB) const; }; 55 typedef ::std::set< SwPosFlyFrmPtr, SwPosFlyFrmCmp > SwPosFlyFrms; 56 57 #endif // _FLYPOS_HXX 58