xref: /AOO41X/main/svx/source/table/tablehandles.hxx (revision 3334a7e6acdae9820fa1a6f556bb10129a8de6b2)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew 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 
43cdf0e10cSrcweir 	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 
59cdf0e10cSrcweir 	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:
77cdf0e10cSrcweir 	TableBorderHdl( const Rectangle& rRect );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	virtual Pointer GetPointer() const;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir protected:
82cdf0e10cSrcweir 	// create marker for this kind
83cdf0e10cSrcweir 	virtual void CreateB2dIAObject();
84cdf0e10cSrcweir 
85cdf0e10cSrcweir private:
86cdf0e10cSrcweir 	Rectangle maRectangle;
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir } // end of namespace table
90cdf0e10cSrcweir } // end of namespace sdr
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #endif
93