1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vectdlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _SD_VECTDLG_HXX
33 #define _SD_VECTDLG_HXX
35 #include <vcl/imagebtn.hxx>
36 #include <vcl/group.hxx>
37 #include <vcl/fixed.hxx>
38 #include <vcl/field.hxx>
39 #include <vcl/dialog.hxx>
40 #include <vcl/gdimtf.hxx>
41 #include <svx/graphctl.hxx>
42 #include <svtools/prgsbar.hxx>
48 /******************************************************************************
52 \******************************************************************************/
54 class SdVectorizeDlg
: public ModalDialog
56 ::sd::DrawDocShell
* mpDocSh
;
57 FixedLine aGrpSettings
;
59 NumericField aNmLayers
;
61 MetricField aMtReduce
;
62 FixedText aFtFillHoles
;
63 MetricField aMtFillHoles
;
64 CheckBox aCbFillHoles
;
66 FixedText aFtOriginal
;
69 FixedText aFtVectorized
;
76 CancelButton aBtnCancel
;
78 PushButton aBtnPreview
;
85 void SaveSettings() const;
86 void InitPreviewBmp();
87 void UpdatePreviewMtf();
89 Rectangle
GetRect( const Size
& rDispSize
, const Size
& rBmpSize
) const;
90 Bitmap
GetPreparedBitmap( Bitmap
& rBmp
, Fraction
& rScale
);
91 void Calculate( Bitmap
& rBmp
, GDIMetaFile
& rMtf
);
92 void AddTile( BitmapReadAccess
* pRAcc
, GDIMetaFile
& rMtf
,
93 long nPosX
, long nPosY
, long nWidth
, long nHeight
);
95 DECL_LINK( ProgressHdl
, void* );
96 DECL_LINK( ClickPreviewHdl
, PushButton
* );
97 DECL_LINK( ClickOKHdl
, OKButton
* );
98 DECL_LINK( ToggleHdl
, CheckBox
* );
99 DECL_LINK( ModifyHdl
, void* );
103 SdVectorizeDlg( Window
* pParent
, const Bitmap
& rBmp
, ::sd::DrawDocShell
* pDocShell
);
106 const GDIMetaFile
& GetGDIMetaFile() const { return aMtf
; }