merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / inc / vectdlg.hxx
blob4acc7b08bd42e3e5721d71224803fc5a8cd1d905
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vectdlg.hxx,v $
10 * $Revision: 1.6 $
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>
44 namespace sd {
45 class DrawDocShell;
48 /******************************************************************************
50 |* SdVectorizeDlg
52 \******************************************************************************/
54 class SdVectorizeDlg : public ModalDialog
56 ::sd::DrawDocShell * mpDocSh;
57 FixedLine aGrpSettings;
58 FixedText aFtLayers;
59 NumericField aNmLayers;
60 FixedText aFtReduce;
61 MetricField aMtReduce;
62 FixedText aFtFillHoles;
63 MetricField aMtFillHoles;
64 CheckBox aCbFillHoles;
66 FixedText aFtOriginal;
67 GraphCtrl aBmpWin;
69 FixedText aFtVectorized;
70 GraphCtrl aMtfWin;
72 FixedText aGrpPrgs;
73 ProgressBar aPrgs;
75 OKButton aBtnOK;
76 CancelButton aBtnCancel;
77 HelpButton aBtnHelp;
78 PushButton aBtnPreview;
80 Bitmap aBmp;
81 Bitmap aPreviewBmp;
82 GDIMetaFile aMtf;
84 void LoadSettings();
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* );
101 public:
103 SdVectorizeDlg( Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell );
104 ~SdVectorizeDlg();
106 const GDIMetaFile& GetGDIMetaFile() const { return aMtf; }
109 #endif