13334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 53334a7e6SAndrew Rist * distributed with this work for additional information 63334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 83334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 93334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 133334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 143334a7e6SAndrew Rist * software distributed under the License is distributed on an 153334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 173334a7e6SAndrew Rist * specific language governing permissions and limitations 183334a7e6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVX_TABLEHANDLES_HXX 25cdf0e10cSrcweir #define _SVX_TABLEHANDLES_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svx/sdr/overlay/overlayobject.hxx> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <svx/svdhdl.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir // -------------------------------------------------------------------- 32cdf0e10cSrcweir 33cdf0e10cSrcweir namespace sdr { namespace table { 34cdf0e10cSrcweir 35cdf0e10cSrcweir enum TableEdgeState { Empty, Invisible, Visible }; 36cdf0e10cSrcweir 37cdf0e10cSrcweir struct TableEdge 38cdf0e10cSrcweir { 39cdf0e10cSrcweir sal_Int32 mnStart; 40cdf0e10cSrcweir sal_Int32 mnEnd; 41cdf0e10cSrcweir TableEdgeState meState; 42cdf0e10cSrcweir TableEdgesdr::table::TableEdge43cdf0e10cSrcweir TableEdge() : mnStart(0), mnEnd(0), meState(Empty) {} 44cdf0e10cSrcweir }; 45cdf0e10cSrcweir 46cdf0e10cSrcweir typedef std::vector< TableEdge > TableEdgeVector; 47cdf0e10cSrcweir 48cdf0e10cSrcweir class TableEdgeHdl : public SdrHdl 49cdf0e10cSrcweir { 50cdf0e10cSrcweir public: 51cdf0e10cSrcweir TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges ); 52cdf0e10cSrcweir 53cdf0e10cSrcweir sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const; 54cdf0e10cSrcweir 55cdf0e10cSrcweir virtual Pointer GetPointer() const; 56cdf0e10cSrcweir 57cdf0e10cSrcweir void SetEdge( sal_Int32 nEdge, sal_Int32 nStart, sal_Int32 nEnd, TableEdgeState nState ); 58cdf0e10cSrcweir IsHorizontalEdge() const59cdf0e10cSrcweir bool IsHorizontalEdge() const { return mbHorizontal; } 60cdf0e10cSrcweir 61cdf0e10cSrcweir basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const; 62cdf0e10cSrcweir void getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const; 63cdf0e10cSrcweir 64cdf0e10cSrcweir protected: 65cdf0e10cSrcweir // create marker for this kind 66cdf0e10cSrcweir virtual void CreateB2dIAObject(); 67cdf0e10cSrcweir 68cdf0e10cSrcweir private: 69cdf0e10cSrcweir bool mbHorizontal; 70cdf0e10cSrcweir sal_Int32 mnMin, mnMax; 71cdf0e10cSrcweir TableEdgeVector maEdges; 72cdf0e10cSrcweir }; 73cdf0e10cSrcweir 74cdf0e10cSrcweir class TableBorderHdl : public SdrHdl 75cdf0e10cSrcweir { 76cdf0e10cSrcweir public: 77*1cd65da9SArmin Le Grand TableBorderHdl( 78*1cd65da9SArmin Le Grand const Rectangle& rRect, 79*1cd65da9SArmin Le Grand bool bAnimate); 80cdf0e10cSrcweir 81cdf0e10cSrcweir virtual Pointer GetPointer() const; getAnimate() const82*1cd65da9SArmin Le Grand bool getAnimate() const { return mbAnimate; } 83cdf0e10cSrcweir 84cdf0e10cSrcweir protected: 85cdf0e10cSrcweir // create marker for this kind 86cdf0e10cSrcweir virtual void CreateB2dIAObject(); 87cdf0e10cSrcweir 88cdf0e10cSrcweir private: 89cdf0e10cSrcweir Rectangle maRectangle; 90*1cd65da9SArmin Le Grand 91*1cd65da9SArmin Le Grand /// bitfield 92*1cd65da9SArmin Le Grand bool mbAnimate : 1; 93cdf0e10cSrcweir }; 94cdf0e10cSrcweir 95cdf0e10cSrcweir } // end of namespace table 96cdf0e10cSrcweir } // end of namespace sdr 97cdf0e10cSrcweir 98cdf0e10cSrcweir #endif 99