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