xref: /trunk/main/sd/source/ui/inc/vectdlg.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 
29 #ifndef _SD_VECTDLG_HXX
30 #define _SD_VECTDLG_HXX
31 
32 #include <vcl/button.hxx>
33 #include <vcl/group.hxx>
34 #include <vcl/fixed.hxx>
35 #include <vcl/field.hxx>
36 #include <vcl/dialog.hxx>
37 #include <vcl/gdimtf.hxx>
38 #include <svx/graphctl.hxx>
39 #include <svtools/prgsbar.hxx>
40 
41 namespace sd {
42 class DrawDocShell;
43 }
44 
45 /******************************************************************************
46 |*
47 |* SdVectorizeDlg
48 |*
49 \******************************************************************************/
50 
51 class SdVectorizeDlg : public ModalDialog
52 {
53     ::sd::DrawDocShell *    mpDocSh;
54     FixedLine           aGrpSettings;
55     FixedText           aFtLayers;
56     NumericField        aNmLayers;
57     FixedText           aFtReduce;
58     MetricField         aMtReduce;
59     FixedText           aFtFillHoles;
60     MetricField         aMtFillHoles;
61     CheckBox            aCbFillHoles;
62 
63     FixedText           aFtOriginal;
64     GraphCtrl           aBmpWin;
65 
66     FixedText           aFtVectorized;
67     GraphCtrl           aMtfWin;
68 
69     FixedText           aGrpPrgs;
70     ProgressBar         aPrgs;
71 
72     OKButton            aBtnOK;
73     CancelButton        aBtnCancel;
74     HelpButton          aBtnHelp;
75     PushButton          aBtnPreview;
76 
77     Bitmap              aBmp;
78     Bitmap              aPreviewBmp;
79     GDIMetaFile         aMtf;
80 
81     void                LoadSettings();
82     void                SaveSettings() const;
83     void                InitPreviewBmp();
84     void                UpdatePreviewMtf();
85 
86     Rectangle           GetRect( const Size& rDispSize, const Size& rBmpSize ) const;
87     Bitmap              GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale );
88     void                Calculate( Bitmap& rBmp, GDIMetaFile& rMtf );
89     void                AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf,
90                                  long nPosX, long nPosY, long nWidth, long nHeight );
91 
92                         DECL_LINK( ProgressHdl, void* );
93                         DECL_LINK( ClickPreviewHdl, PushButton* );
94                         DECL_LINK( ClickOKHdl, OKButton* );
95                         DECL_LINK( ToggleHdl, CheckBox* );
96                         DECL_LINK( ModifyHdl, void* );
97 
98 public:
99 
100                         SdVectorizeDlg( Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell );
101                         ~SdVectorizeDlg();
102 
103     const GDIMetaFile&  GetGDIMetaFile() const { return aMtf; }
104 };
105 
106 #endif
107 
108