xref: /aoo42x/main/svx/source/dialog/contimp.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _CONTIMP_HXX_
28*cdf0e10cSrcweir #define _CONTIMP_HXX_
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #ifndef _CONTDLG_HXX
31*cdf0e10cSrcweir #include <svx/contdlg.hxx>
32*cdf0e10cSrcweir #endif
33*cdf0e10cSrcweir #include "contwnd.hxx"
34*cdf0e10cSrcweir #include <vcl/toolbox.hxx>
35*cdf0e10cSrcweir #include <vcl/status.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #define CONT_RESID(nId)  ResId( nId, DIALOG_MGR() )
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir /*************************************************************************
40*cdf0e10cSrcweir |*
41*cdf0e10cSrcweir |*
42*cdf0e10cSrcweir |*
43*cdf0e10cSrcweir \************************************************************************/
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir class SvxSuperContourDlg : public SvxContourDlg
46*cdf0e10cSrcweir {
47*cdf0e10cSrcweir 	using SvxContourDlg::GetPolyPolygon;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 	Graphic				aGraphic;
50*cdf0e10cSrcweir 	Graphic				aUndoGraphic;
51*cdf0e10cSrcweir 	Graphic				aRedoGraphic;
52*cdf0e10cSrcweir 	Graphic				aUpdateGraphic;
53*cdf0e10cSrcweir 	PolyPolygon			aUpdatePolyPoly;
54*cdf0e10cSrcweir 	Timer				aUpdateTimer;
55*cdf0e10cSrcweir 	Timer				aCreateTimer;
56*cdf0e10cSrcweir 	Size				aLastSize;
57*cdf0e10cSrcweir 	void*				pUpdateEditingObject;
58*cdf0e10cSrcweir 	void*				pCheckObj;
59*cdf0e10cSrcweir 	SvxContourDlgItem	aContourItem;
60*cdf0e10cSrcweir 	ToolBox				aTbx1;
61*cdf0e10cSrcweir 	MetricField			aMtfTolerance;
62*cdf0e10cSrcweir 	ContourWindow		aContourWnd;
63*cdf0e10cSrcweir 	StatusBar			aStbStatus;
64*cdf0e10cSrcweir 	sal_uIntPtr				nGrfChanged;
65*cdf0e10cSrcweir 	sal_Bool				bExecState;
66*cdf0e10cSrcweir 	sal_Bool				bPipetteMode;
67*cdf0e10cSrcweir 	sal_Bool				bWorkplaceMode;
68*cdf0e10cSrcweir 	sal_Bool				bUpdateGraphicLinked;
69*cdf0e10cSrcweir 	sal_Bool				bGraphicLinked;
70*cdf0e10cSrcweir 	ImageList			maImageList;
71*cdf0e10cSrcweir 	ImageList			maImageListH;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	virtual	void		Resize();
74*cdf0e10cSrcweir 	virtual sal_Bool 		Close();
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	void				DoAutoCreate();
77*cdf0e10cSrcweir 	void				ReducePoints( const long nTol = 8 );
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 						DECL_LINK( Tbx1ClickHdl, ToolBox* );
80*cdf0e10cSrcweir 						DECL_LINK( MousePosHdl, ContourWindow* );
81*cdf0e10cSrcweir 						DECL_LINK( GraphSizeHdl, ContourWindow* );
82*cdf0e10cSrcweir 						DECL_LINK( UpdateHdl, Timer* );
83*cdf0e10cSrcweir 						DECL_LINK( CreateHdl, Timer* );
84*cdf0e10cSrcweir 						DECL_LINK( StateHdl, ContourWindow* );
85*cdf0e10cSrcweir 						DECL_LINK( PipetteHdl, ContourWindow* );
86*cdf0e10cSrcweir 						DECL_LINK( PipetteClickHdl, ContourWindow* );
87*cdf0e10cSrcweir 						DECL_LINK( WorkplaceClickHdl, ContourWindow* );
88*cdf0e10cSrcweir 						DECL_LINK( MiscHdl, void* );
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir public:
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 						SvxSuperContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
93*cdf0e10cSrcweir 											Window* pParent, const ResId& rResId );
94*cdf0e10cSrcweir 						~SvxSuperContourDlg();
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	void				SetExecState( sal_Bool bEnable );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	void				SetGraphic( const Graphic& rGraphic );
99*cdf0e10cSrcweir 	void				SetGraphicLinked( sal_Bool bLinked ) { bGraphicLinked = bLinked; }
100*cdf0e10cSrcweir 	const Graphic&		GetGraphic() const { return aGraphic; }
101*cdf0e10cSrcweir 	sal_Bool				IsGraphicChanged() const { return nGrfChanged > 0UL; }
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	void				SetPolyPolygon( const PolyPolygon& rPolyPoly );
104*cdf0e10cSrcweir 	PolyPolygon			GetPolyPolygon( sal_Bool bRescaleToGraphic = sal_True );
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 	void				SetEditingObject( void* pObj ) { pCheckObj = pObj; }
107*cdf0e10cSrcweir 	const void*			GetEditingObject() const { return pCheckObj; }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 	sal_Bool				IsUndoPossible() const;
110*cdf0e10cSrcweir 	sal_Bool				IsRedoPossible() const;
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 	void				UpdateGraphic( const Graphic& rGraphic, sal_Bool bGraphicLinked,
113*cdf0e10cSrcweir 								const PolyPolygon* pPolyPoly = NULL,
114*cdf0e10cSrcweir 								void* pEditingObj = NULL );
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 	/** switches the toolbox images depending on the actuall high contrast display mode state */
117*cdf0e10cSrcweir 	void				ApplyImageList();
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 	/** virtual method from Window is used to detect change in high contrast display mode
120*cdf0e10cSrcweir 		to switch the toolbox images */
121*cdf0e10cSrcweir 	virtual void		DataChanged( const DataChangedEvent& rDCEvt );
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir };
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir #endif // _CONTIMP_HXX_
127*cdf0e10cSrcweir 
128