Updated core
[LibreOffice.git] / svtools / source / filter / exportdialog.hxx
blob4df7cdc0f5a341e16266bb8b4012212adba22b88
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #ifndef INCLUDED_SVTOOLS_SOURCE_FILTER_EXPORTDIALOG_HXX
22 #define INCLUDED_SVTOOLS_SOURCE_FILTER_EXPORTDIALOG_HXX
24 #include <vcl/fltcall.hxx>
25 #include <vcl/dialog.hxx>
26 #include <vcl/button.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/field.hxx>
29 #include <vcl/layout.hxx>
30 #include <vcl/lstbox.hxx>
31 #include <vcl/msgbox.hxx>
32 #include <vcl/scrbar.hxx>
33 #include <com/sun/star/document/XExporter.hpp>
34 #include <com/sun/star/drawing/XShape.hpp>
35 #include <com/sun/star/drawing/XShapes.hpp>
36 #include <com/sun/star/drawing/XDrawPage.hpp>
38 /*************************************************************************
40 |* dialog to set filter options for pixel formats
42 \************************************************************************/
44 class FilterConfigItem;
45 class ExportDialog : public ModalDialog
47 private:
49 FltCallDialogParameter& mrFltCallPara;
51 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
52 mxContext;
53 const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
54 mxSourceDocument;
56 VclPtr<NumericField> mpMfSizeX;
57 VclPtr<ListBox> mpLbSizeX;
58 VclPtr<NumericField> mpMfSizeY;
59 VclPtr<FixedText> mpFtResolution;
60 VclPtr<NumericField> mpNfResolution;
61 VclPtr<ListBox> mpLbResolution;
63 VclPtr<VclContainer> mpColorDepth;
64 VclPtr<ListBox> mpLbColorDepth;
66 VclPtr<VclContainer> mpJPGQuality;
67 VclPtr<VclContainer> mpPNGCompression;
69 VclPtr<ScrollBar> mpSbCompression;
70 VclPtr<NumericField> mpNfCompression;
72 VclPtr<VclContainer> mpMode;
73 VclPtr<CheckBox> mpCbInterlaced;
75 VclPtr<VclContainer> mpBMPCompression;
76 VclPtr<CheckBox> mpCbRLEEncoding;
78 VclPtr<VclContainer> mpDrawingObjects;
79 VclPtr<CheckBox> mpCbSaveTransparency;
81 VclPtr<VclContainer> mpEncoding;
82 VclPtr<RadioButton> mpRbBinary;
83 VclPtr<RadioButton> mpRbText;
85 VclPtr<VclContainer> mpEPSGrid;
86 VclPtr<CheckBox> mpCbEPSPreviewTIFF;
87 VclPtr<CheckBox> mpCbEPSPreviewEPSI;
88 VclPtr<RadioButton> mpRbEPSLevel1;
89 VclPtr<RadioButton> mpRbEPSLevel2;
90 VclPtr<RadioButton> mpRbEPSColorFormat1;
91 VclPtr<RadioButton> mpRbEPSColorFormat2;
92 VclPtr<RadioButton> mpRbEPSCompressionLZW;
93 VclPtr<RadioButton> mpRbEPSCompressionNone;
95 VclPtr<VclContainer> mpInfo;
96 VclPtr<FixedText> mpFtEstimatedSize;
98 VclPtr<OKButton> mpBtnOK;
100 OUString msEstimatedSizePix1;
101 OUString msEstimatedSizePix2;
102 OUString msEstimatedSizeVec;
104 OUString ms1BitTreshold;
105 OUString ms1BitDithered;
106 OUString ms4BitGrayscale;
107 OUString ms4BitColorPalette;
108 OUString ms8BitGrayscale;
109 OUString ms8BitColorPalette;
110 OUString ms24BitColor;
112 Size maDialogSize;
114 FilterConfigItem* mpOptionsItem;
115 FilterConfigItem* mpFilterOptionsItem;
117 OUString maExt;
118 OUString maEstimatedSizeText;
119 sal_Int16 mnFormat;
120 sal_Int32 mnMaxFilesizeForRealtimePreview;
122 SvStream* mpTempStream;
123 Bitmap maBitmap;
125 com::sun::star::awt::Size
126 maOriginalSize; // the original graphic size in 1/100mm
127 com::sun::star::awt::Size
128 maSize; // for vector graphics it always contains the logical size in 1/100mm
130 bool mbIsPixelFormat;
131 bool mbExportSelection;
132 bool mbPreserveAspectRatio;
134 sal_Int32 mnInitialResolutionUnit;
136 // for pixel graphics it always contains the pixel count
137 com::sun::star::awt::Size
138 maResolution; // it always contains the number of pixels per meter
140 com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
141 mxShape;
142 com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >
143 mxShapes;
144 com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
145 mxPage;
148 DECL_LINK( UpdateHdl,void* p );
149 DECL_LINK( UpdateHdlMtfSizeX,void* p );
150 DECL_LINK( UpdateHdlMtfSizeY,void* p );
151 DECL_LINK( UpdateHdlNfResolution,void* p );
152 DECL_LINK( SbCompressionUpdateHdl,void* p );
153 DECL_LINK( NfCompressionUpdateHdlX,void* p );
155 DECL_LINK( OK, void* p );
157 void setupSizeControls();
158 void createFilterOptions();
159 void setupControls();
160 void updateControls();
162 void GetGraphicSource();
163 bool GetGraphicStream();
164 static Bitmap GetGraphicBitmap( SvStream& rStream );
165 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
166 GetFilterData( bool bUpdateConfig );
168 sal_uInt32 GetRawFileSize() const;
169 bool IsTempExportAvailable() const;
171 com::sun::star::awt::Size
172 GetOriginalSize();
174 sal_Int32 GetDefaultUnit();
176 public:
177 ExportDialog( FltCallDialogParameter& rPara,
178 const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
179 const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
180 bool bExportSelection, bool bIsExportVectorFormat );
181 virtual ~ExportDialog();
182 virtual void dispose() SAL_OVERRIDE;
187 #endif // INCLUDED_SVTOOLS_SOURCE_FILTER_EXPORTDIALOG_HXX
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */