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 24 25 #ifndef _SD_VECTDLG_HXX 26 #define _SD_VECTDLG_HXX 27 28 #include <vcl/button.hxx> 29 #include <vcl/group.hxx> 30 #include <vcl/fixed.hxx> 31 #include <vcl/field.hxx> 32 #include <vcl/dialog.hxx> 33 #include <vcl/gdimtf.hxx> 34 #include <svx/graphctl.hxx> 35 #include <svtools/prgsbar.hxx> 36 37 namespace sd { 38 class DrawDocShell; 39 } 40 41 /****************************************************************************** 42 |* 43 |* SdVectorizeDlg 44 |* 45 \******************************************************************************/ 46 47 class SdVectorizeDlg : public ModalDialog 48 { 49 ::sd::DrawDocShell * mpDocSh; 50 FixedLine aGrpSettings; 51 FixedText aFtLayers; 52 NumericField aNmLayers; 53 FixedText aFtReduce; 54 MetricField aMtReduce; 55 FixedText aFtFillHoles; 56 MetricField aMtFillHoles; 57 CheckBox aCbFillHoles; 58 59 FixedText aFtOriginal; 60 GraphCtrl aBmpWin; 61 62 FixedText aFtVectorized; 63 GraphCtrl aMtfWin; 64 65 FixedText aGrpPrgs; 66 ProgressBar aPrgs; 67 68 OKButton aBtnOK; 69 CancelButton aBtnCancel; 70 HelpButton aBtnHelp; 71 PushButton aBtnPreview; 72 73 Bitmap aBmp; 74 Bitmap aPreviewBmp; 75 GDIMetaFile aMtf; 76 77 void LoadSettings(); 78 void SaveSettings() const; 79 void InitPreviewBmp(); 80 void UpdatePreviewMtf(); 81 82 Rectangle GetRect( const Size& rDispSize, const Size& rBmpSize ) const; 83 Bitmap GetPreparedBitmap( Bitmap& rBmp, Fraction& rScale ); 84 void Calculate( Bitmap& rBmp, GDIMetaFile& rMtf ); 85 void AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf, 86 long nPosX, long nPosY, long nWidth, long nHeight ); 87 88 DECL_LINK( ProgressHdl, void* ); 89 DECL_LINK( ClickPreviewHdl, PushButton* ); 90 DECL_LINK( ClickOKHdl, OKButton* ); 91 DECL_LINK( ToggleHdl, CheckBox* ); 92 DECL_LINK( ModifyHdl, void* ); 93 94 public: 95 96 SdVectorizeDlg( Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell ); 97 ~SdVectorizeDlg(); 98 GetGDIMetaFile() const99 const GDIMetaFile& GetGDIMetaFile() const { return aMtf; } 100 }; 101 102 #endif 103 104