xref: /aoo41x/main/sd/source/ui/inc/vectdlg.hxx (revision 67e470da)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*c45d927aSAndrew Rist  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*c45d927aSAndrew Rist  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19*c45d927aSAndrew Rist  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _SD_VECTDLG_HXX
26cdf0e10cSrcweir #define _SD_VECTDLG_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <vcl/button.hxx>
29cdf0e10cSrcweir #include <vcl/group.hxx>
30cdf0e10cSrcweir #include <vcl/fixed.hxx>
31cdf0e10cSrcweir #include <vcl/field.hxx>
32cdf0e10cSrcweir #include <vcl/dialog.hxx>
33cdf0e10cSrcweir #include <vcl/gdimtf.hxx>
34cdf0e10cSrcweir #include <svx/graphctl.hxx>
35cdf0e10cSrcweir #include <svtools/prgsbar.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace sd {
38cdf0e10cSrcweir class DrawDocShell;
39cdf0e10cSrcweir }
40cdf0e10cSrcweir 
41cdf0e10cSrcweir /******************************************************************************
42cdf0e10cSrcweir |*
43cdf0e10cSrcweir |* SdVectorizeDlg
44cdf0e10cSrcweir |*
45cdf0e10cSrcweir \******************************************************************************/
46cdf0e10cSrcweir 
47cdf0e10cSrcweir class SdVectorizeDlg : public ModalDialog
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	::sd::DrawDocShell *	mpDocSh;
50cdf0e10cSrcweir 	FixedLine			aGrpSettings;
51cdf0e10cSrcweir 	FixedText			aFtLayers;
52cdf0e10cSrcweir 	NumericField		aNmLayers;
53cdf0e10cSrcweir 	FixedText			aFtReduce;
54cdf0e10cSrcweir 	MetricField			aMtReduce;
55cdf0e10cSrcweir 	FixedText			aFtFillHoles;
56cdf0e10cSrcweir 	MetricField			aMtFillHoles;
57cdf0e10cSrcweir 	CheckBox			aCbFillHoles;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	FixedText			aFtOriginal;
60cdf0e10cSrcweir 	GraphCtrl			aBmpWin;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 	FixedText			aFtVectorized;
63cdf0e10cSrcweir 	GraphCtrl			aMtfWin;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	FixedText			aGrpPrgs;
66cdf0e10cSrcweir 	ProgressBar			aPrgs;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	OKButton			aBtnOK;
69cdf0e10cSrcweir 	CancelButton		aBtnCancel;
70cdf0e10cSrcweir 	HelpButton			aBtnHelp;
71cdf0e10cSrcweir 	PushButton			aBtnPreview;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	Bitmap				aBmp;
74cdf0e10cSrcweir 	Bitmap				aPreviewBmp;
75cdf0e10cSrcweir 	GDIMetaFile			aMtf;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	void				LoadSettings();
78cdf0e10cSrcweir 	void				SaveSettings() const;
79cdf0e10cSrcweir 	void				InitPreviewBmp();
80cdf0e10cSrcweir 	void				UpdatePreviewMtf();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	Rectangle			GetRect( const Size& rDispSize, const Size& rBmpSize ) const;
83cdf0e10cSrcweir 	Bitmap				GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale );
84cdf0e10cSrcweir 	void				Calculate( Bitmap& rBmp, GDIMetaFile& rMtf );
85cdf0e10cSrcweir 	void				AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
86cdf0e10cSrcweir 								 long nPosX, long nPosY, long nWidth, long nHeight );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 						DECL_LINK( ProgressHdl, void* );
89cdf0e10cSrcweir 						DECL_LINK( ClickPreviewHdl, PushButton* );
90cdf0e10cSrcweir 						DECL_LINK( ClickOKHdl, OKButton* );
91cdf0e10cSrcweir 						DECL_LINK( ToggleHdl, CheckBox* );
92cdf0e10cSrcweir 						DECL_LINK( ModifyHdl, void* );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir public:
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 						SdVectorizeDlg( Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell );
97cdf0e10cSrcweir 						~SdVectorizeDlg();
98cdf0e10cSrcweir 
GetGDIMetaFile() const99cdf0e10cSrcweir 	const GDIMetaFile&	GetGDIMetaFile() const { return aMtf; }
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #endif
103cdf0e10cSrcweir 
104