xref: /aoo42x/main/svx/source/dialog/contimp.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2*3334a7e6SAndrew Rist  *
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
10*3334a7e6SAndrew Rist  *
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.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _CONTIMP_HXX_
24cdf0e10cSrcweir #define _CONTIMP_HXX_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _CONTDLG_HXX
27cdf0e10cSrcweir #include <svx/contdlg.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #include "contwnd.hxx"
30cdf0e10cSrcweir #include <vcl/toolbox.hxx>
31cdf0e10cSrcweir #include <vcl/status.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #define CONT_RESID(nId)  ResId( nId, DIALOG_MGR() )
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /*************************************************************************
36cdf0e10cSrcweir |*
37cdf0e10cSrcweir |*
38cdf0e10cSrcweir |*
39cdf0e10cSrcweir \************************************************************************/
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class SvxSuperContourDlg : public SvxContourDlg
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 	using SvxContourDlg::GetPolyPolygon;
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 	Graphic				aGraphic;
46cdf0e10cSrcweir 	Graphic				aUndoGraphic;
47cdf0e10cSrcweir 	Graphic				aRedoGraphic;
48cdf0e10cSrcweir 	Graphic				aUpdateGraphic;
49cdf0e10cSrcweir 	PolyPolygon			aUpdatePolyPoly;
50cdf0e10cSrcweir 	Timer				aUpdateTimer;
51cdf0e10cSrcweir 	Timer				aCreateTimer;
52cdf0e10cSrcweir 	Size				aLastSize;
53cdf0e10cSrcweir 	void*				pUpdateEditingObject;
54cdf0e10cSrcweir 	void*				pCheckObj;
55cdf0e10cSrcweir 	SvxContourDlgItem	aContourItem;
56cdf0e10cSrcweir 	ToolBox				aTbx1;
57cdf0e10cSrcweir 	MetricField			aMtfTolerance;
58cdf0e10cSrcweir 	ContourWindow		aContourWnd;
59cdf0e10cSrcweir 	StatusBar			aStbStatus;
60cdf0e10cSrcweir 	sal_uIntPtr				nGrfChanged;
61cdf0e10cSrcweir 	sal_Bool				bExecState;
62cdf0e10cSrcweir 	sal_Bool				bPipetteMode;
63cdf0e10cSrcweir 	sal_Bool				bWorkplaceMode;
64cdf0e10cSrcweir 	sal_Bool				bUpdateGraphicLinked;
65cdf0e10cSrcweir 	sal_Bool				bGraphicLinked;
66cdf0e10cSrcweir 	ImageList			maImageList;
67cdf0e10cSrcweir 	ImageList			maImageListH;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	virtual	void		Resize();
70cdf0e10cSrcweir 	virtual sal_Bool 		Close();
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	void				DoAutoCreate();
73cdf0e10cSrcweir 	void				ReducePoints( const long nTol = 8 );
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 						DECL_LINK( Tbx1ClickHdl, ToolBox* );
76cdf0e10cSrcweir 						DECL_LINK( MousePosHdl, ContourWindow* );
77cdf0e10cSrcweir 						DECL_LINK( GraphSizeHdl, ContourWindow* );
78cdf0e10cSrcweir 						DECL_LINK( UpdateHdl, Timer* );
79cdf0e10cSrcweir 						DECL_LINK( CreateHdl, Timer* );
80cdf0e10cSrcweir 						DECL_LINK( StateHdl, ContourWindow* );
81cdf0e10cSrcweir 						DECL_LINK( PipetteHdl, ContourWindow* );
82cdf0e10cSrcweir 						DECL_LINK( PipetteClickHdl, ContourWindow* );
83cdf0e10cSrcweir 						DECL_LINK( WorkplaceClickHdl, ContourWindow* );
84cdf0e10cSrcweir 						DECL_LINK( MiscHdl, void* );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir public:
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 						SvxSuperContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
89cdf0e10cSrcweir 											Window* pParent, const ResId& rResId );
90cdf0e10cSrcweir 						~SvxSuperContourDlg();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	void				SetExecState( sal_Bool bEnable );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	void				SetGraphic( const Graphic& rGraphic );
SetGraphicLinked(sal_Bool bLinked)95cdf0e10cSrcweir 	void				SetGraphicLinked( sal_Bool bLinked ) { bGraphicLinked = bLinked; }
GetGraphic() const96cdf0e10cSrcweir 	const Graphic&		GetGraphic() const { return aGraphic; }
IsGraphicChanged() const97cdf0e10cSrcweir 	sal_Bool				IsGraphicChanged() const { return nGrfChanged > 0UL; }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void				SetPolyPolygon( const PolyPolygon& rPolyPoly );
100cdf0e10cSrcweir 	PolyPolygon			GetPolyPolygon( sal_Bool bRescaleToGraphic = sal_True );
101cdf0e10cSrcweir 
SetEditingObject(void * pObj)102cdf0e10cSrcweir 	void				SetEditingObject( void* pObj ) { pCheckObj = pObj; }
GetEditingObject() const103cdf0e10cSrcweir 	const void*			GetEditingObject() const { return pCheckObj; }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	sal_Bool				IsUndoPossible() const;
106cdf0e10cSrcweir 	sal_Bool				IsRedoPossible() const;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	void				UpdateGraphic( const Graphic& rGraphic, sal_Bool bGraphicLinked,
109cdf0e10cSrcweir 								const PolyPolygon* pPolyPoly = NULL,
110cdf0e10cSrcweir 								void* pEditingObj = NULL );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	/** switches the toolbox images depending on the actuall high contrast display mode state */
113cdf0e10cSrcweir 	void				ApplyImageList();
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 	/** virtual method from Window is used to detect change in high contrast display mode
116cdf0e10cSrcweir 		to switch the toolbox images */
117cdf0e10cSrcweir 	virtual void		DataChanged( const DataChangedEvent& rDCEvt );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir };
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 
122cdf0e10cSrcweir #endif // _CONTIMP_HXX_
123cdf0e10cSrcweir 
124