xref: /aoo41x/main/svx/source/table/tablehandles.hxx (revision 1cd65da9)
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 #ifndef _SVX_TABLEHANDLES_HXX
25 #define _SVX_TABLEHANDLES_HXX
26 
27 #include <svx/sdr/overlay/overlayobject.hxx>
28 
29 #include <svx/svdhdl.hxx>
30 
31 // --------------------------------------------------------------------
32 
33 namespace sdr { namespace table {
34 
35 enum TableEdgeState { Empty, Invisible, Visible };
36 
37 struct TableEdge
38 {
39 	sal_Int32 mnStart;
40 	sal_Int32 mnEnd;
41 	TableEdgeState meState;
42 
TableEdgesdr::table::TableEdge43 	TableEdge() : mnStart(0), mnEnd(0), meState(Empty) {}
44 };
45 
46 typedef std::vector< TableEdge > TableEdgeVector;
47 
48 class TableEdgeHdl : public SdrHdl
49 {
50 public:
51 	TableEdgeHdl( const Point& rPnt, bool bHorizontal, sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nEdges );
52 
53 	sal_Int32 GetValidDragOffset( const SdrDragStat& rDrag ) const;
54 
55 	virtual Pointer GetPointer() const;
56 
57 	void SetEdge( sal_Int32 nEdge, sal_Int32 nStart, sal_Int32 nEnd, TableEdgeState nState );
58 
IsHorizontalEdge() const59 	bool IsHorizontalEdge() const { return mbHorizontal; }
60 
61     basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
62 	void getPolyPolygon(basegfx::B2DPolyPolygon& rVisible, basegfx::B2DPolyPolygon& rInvisible, const SdrDragStat* pDrag) const;
63 
64 protected:
65 	// create marker for this kind
66 	virtual void CreateB2dIAObject();
67 
68 private:
69 	bool mbHorizontal;
70 	sal_Int32 mnMin, mnMax;
71 	TableEdgeVector maEdges;
72 };
73 
74 class TableBorderHdl : public SdrHdl
75 {
76 public:
77 	TableBorderHdl(
78         const Rectangle& rRect,
79         bool bAnimate);
80 
81 	virtual Pointer GetPointer() const;
getAnimate() const82     bool getAnimate() const { return mbAnimate; }
83 
84 protected:
85 	// create marker for this kind
86 	virtual void CreateB2dIAObject();
87 
88 private:
89     Rectangle maRectangle;
90 
91     /// bitfield
92     bool            mbAnimate : 1;
93 };
94 
95 } // end of namespace table
96 } // end of namespace sdr
97 
98 #endif
99