xref: /aoo4110/main/svx/source/dialog/contwnd.hxx (revision b1cdbd2c)
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 _CONTWND_HXX
25 #define _CONTWND_HXX
26 
27 #include <tools/poly.hxx>
28 #include <svx/graphctl.hxx>
29 
30 /*************************************************************************
31 |*
32 |*
33 |*
34 \************************************************************************/
35 
36 class ContourWindow : public GraphCtrl
37 {
38 	PolyPolygon			aPolyPoly;
39 	Color				aPipetteColor;
40 	Rectangle			aWorkRect;
41 	Link				aPipetteLink;
42 	Link				aPipetteClickLink;
43 	Link				aWorkplaceClickLink;
44 	sal_Bool				bPipetteMode;
45 	sal_Bool				bWorkplaceMode;
46 	sal_Bool				bClickValid;
47 
48 protected:
49 
50 	virtual void		MouseButtonDown(const MouseEvent& rMEvt);
51 	virtual void		MouseMove(const MouseEvent& rMEvt);
52 	virtual void		MouseButtonUp(const MouseEvent& rMEvt);
53 	virtual void		SdrObjCreated( const SdrObject& rObj );
54 	virtual	void		InitSdrModel();
55 	virtual	void		Paint( const Rectangle& rRect );
56 
57 	void				CreatePolyPolygon();
58 
59 public:
60 
61 						ContourWindow( Window* pParent, const ResId& rResId );
62 						~ContourWindow();
63 
64 	void				SetPolyPolygon( const PolyPolygon& rPolyPoly );
65 	const PolyPolygon&	GetPolyPolygon();
66 
SetPipetteMode(const sal_Bool bPipette)67 	void				SetPipetteMode( const sal_Bool bPipette ) { bPipetteMode = bPipette; }
IsPipetteMode() const68 	sal_Bool				IsPipetteMode() const { return bPipetteMode; }
GetPipetteColor() const69 	const Color&		GetPipetteColor() const { return aPipetteColor; }
70 
IsClickValid() const71 	sal_Bool				IsClickValid() const { return bClickValid; }
72 	sal_Bool				IsContourChanged() const;
73 
SetWorkplaceMode(const sal_Bool bWorkplace)74 	void				SetWorkplaceMode( const sal_Bool bWorkplace ) { bWorkplaceMode = bWorkplace; }
IsWorkplaceMode() const75 	sal_Bool				IsWorkplaceMode() const { return bWorkplaceMode; }
GetWorkRect() const76 	const Rectangle&	GetWorkRect() const { return aWorkRect; }
77 
SetPipetteHdl(const Link & rLink)78 	void				SetPipetteHdl( const Link& rLink ) { aPipetteLink = rLink; }
SetPipetteClickHdl(const Link & rLink)79 	void				SetPipetteClickHdl( const Link& rLink ) { aPipetteClickLink = rLink; }
80 
SetWorkplaceClickHdl(const Link & rLink)81 	void				SetWorkplaceClickHdl( const Link& rLink ) { aWorkplaceClickLink = rLink; }
82 };
83 
84 
85 #endif
86 
87