LibreOffice Module svtools (master) 1
exportdialog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#pragma once
22
24#include <vcl/weld.hxx>
25#include <tools/stream.hxx>
26#include <com/sun/star/lang/XComponent.hpp>
27#include <com/sun/star/drawing/XShape.hpp>
28#include <com/sun/star/drawing/XShapes.hpp>
29#include <com/sun/star/drawing/XDrawPage.hpp>
30#include <com/sun/star/uno/XComponentContext.hpp>
31
32#include <memory>
33
34/*************************************************************************
35|*
36|* dialog to set filter options for pixel formats
37|*
38\************************************************************************/
39
42{
43private:
44
46
47 const css::uno::Reference< css::uno::XComponentContext >
49 const css::uno::Reference< css::lang::XComponent >&
51 const css::uno::Reference< css::graphic::XGraphic >&
53
57
61 OUString ms24BitColor;
62
63 std::unique_ptr<FilterConfigItem> mpOptionsItem;
64 std::unique_ptr<FilterConfigItem> mpFilterOptionsItem;
65
66 OUString maExt;
67 sal_Int16 mnFormat;
69
70 std::unique_ptr<SvMemoryStream> mpTempStream;
71
72 css::awt::Size maOriginalSize; // the original graphic size in 1/100mm
73 css::awt::Size maSize; // for vector graphics it always contains the logical size in 1/100mm
74
77 bool mbGraphicsSource; // whether source document is graphics (Draw, Impress) or not (Calc, Writer)
78
80
81 // for pixel graphics it always contains the pixel count
82 css::awt::Size maResolution; // it always contains the number of pixels per meter
83
84 css::uno::Reference< css::drawing::XShape >
86 css::uno::Reference< css::drawing::XShapes >
88 css::uno::Reference< css::drawing::XDrawPage >
90
93
94 std::unique_ptr<weld::SpinButton> mxMfSizeX;
95 std::unique_ptr<weld::ComboBox> mxLbSizeX;
96 std::unique_ptr<weld::SpinButton> mxMfSizeY;
97 std::unique_ptr<weld::Label> mxFtResolution;
98 std::unique_ptr<weld::SpinButton> mxNfResolution;
99 std::unique_ptr<weld::ComboBox> mxLbResolution;
100
101 std::unique_ptr<weld::Widget> mxColorDepth;
102 std::unique_ptr<weld::ComboBox> mxLbColorDepth;
103
104 std::unique_ptr<weld::Widget> mxJPGWEBPQuality;
105 std::unique_ptr<weld::Widget> mxPNGCompression;
106
107 std::unique_ptr<weld::Scale> mxSbPngCompression;
108 std::unique_ptr<weld::SpinButton> mxNfPngCompression;
109
110 std::unique_ptr<weld::Scale> mxSbJpgWebpCompression;
111 std::unique_ptr<weld::SpinButton> mxNfJpgWebpCompression;
112
113 std::unique_ptr<weld::CheckButton> mxCbLossless;
114
115 std::unique_ptr<weld::Widget> mxMode;
116 std::unique_ptr<weld::CheckButton> mxCbInterlaced;
117
118 std::unique_ptr<weld::Widget> mxBMPCompression;
119 std::unique_ptr<weld::CheckButton> mxCbRLEEncoding;
120
121 std::unique_ptr<weld::Widget> mxDrawingObjects;
122 std::unique_ptr<weld::CheckButton> mxCbSaveTransparency;
123
124 std::unique_ptr<weld::Widget> mxEncoding;
125 std::unique_ptr<weld::RadioButton> mxRbBinary;
126 std::unique_ptr<weld::RadioButton> mxRbText;
127
128 std::unique_ptr<weld::Widget> mxEPSGrid;
129 std::unique_ptr<weld::RadioButton> mxModifyDimension;
130 std::unique_ptr<weld::RadioButton> mxModifyResolution;
131 std::unique_ptr<weld::CheckButton> mxCbEPSPreviewTIFF;
132 std::unique_ptr<weld::CheckButton> mxCbEPSPreviewEPSI;
133 std::unique_ptr<weld::RadioButton> mxRbEPSLevel1;
134 std::unique_ptr<weld::RadioButton> mxRbEPSLevel2;
135 std::unique_ptr<weld::RadioButton> mxRbEPSColorFormat1;
136 std::unique_ptr<weld::RadioButton> mxRbEPSColorFormat2;
137 std::unique_ptr<weld::RadioButton> mxRbEPSCompressionLZW;
138 std::unique_ptr<weld::RadioButton> mxRbEPSCompressionNone;
139
140
141 std::unique_ptr<weld::Widget> mxInfo;
142 std::unique_ptr<weld::Label> mxFtEstimatedSize;
143
144 std::unique_ptr<weld::Button> mxBtnOK;
145
146 DECL_LINK(UpdateHdl, weld::Toggleable&, void);
147 DECL_LINK(UpdateLock, weld::Toggleable&, void);
148 DECL_LINK(SelectListBoxHdl, weld::ComboBox&, void);
149 DECL_LINK(SelectHdl, weld::SpinButton&, void);
150 DECL_LINK(UpdateHdlMtfSizeX, weld::SpinButton&, void);
151 DECL_LINK(UpdateHdlMtfSizeY, weld::SpinButton&, void);
152 DECL_LINK(UpdateHdlNfResolution, weld::SpinButton&, void);
153 DECL_LINK(SbCompressionUpdateHdl, weld::Scale&, void);
154 DECL_LINK(UpdateHdlLossless, weld::Toggleable&, void);
155
157
158 void setupSizeControls();
159 void createFilterOptions();
160 void setupControls();
161 void updateControls();
162
163 void GetGraphicSource();
164 void GetGraphicStream();
165 css::uno::Sequence< css::beans::PropertyValue >
166 GetFilterData( bool bUpdateConfig );
167
168 sal_uInt32 GetRawFileSize() const;
169 bool IsTempExportAvailable() const;
170
171 css::awt::Size GetOriginalSize();
172
173 sal_Int32 GetDefaultUnit() const;
174
175public:
177 css::uno::Reference< css::uno::XComponentContext > xContext,
178 const css::uno::Reference< css::lang::XComponent >& rxSourceDocument,
179 bool bExportSelection, bool bIsExportVectorFormat, bool bGraphicsSource,
180 const css::uno::Reference< css::graphic::XGraphic >& rxGraphic);
181 virtual ~ExportDialog() override;
182};
183
184
185
186/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::RadioButton > mxRbEPSColorFormat1
std::unique_ptr< weld::Widget > mxJPGWEBPQuality
DECL_LINK(OK, weld::Button &, void)
virtual ~ExportDialog() override
css::awt::Size maSize
std::unique_ptr< weld::SpinButton > mxMfSizeY
std::unique_ptr< weld::CheckButton > mxCbRLEEncoding
weld::SpinButton * mpNfCompression
std::unique_ptr< weld::Scale > mxSbPngCompression
css::awt::Size maResolution
std::unique_ptr< weld::RadioButton > mxRbEPSLevel1
DECL_LINK(UpdateLock, weld::Toggleable &, void)
std::unique_ptr< weld::ComboBox > mxLbColorDepth
std::unique_ptr< weld::CheckButton > mxCbEPSPreviewEPSI
std::unique_ptr< weld::RadioButton > mxRbEPSColorFormat2
std::unique_ptr< weld::RadioButton > mxModifyDimension
std::unique_ptr< weld::RadioButton > mxRbBinary
std::unique_ptr< SvMemoryStream > mpTempStream
weld::Scale * mpSbCompression
OUString ms8BitGrayscale
std::unique_ptr< weld::RadioButton > mxRbEPSLevel2
std::unique_ptr< weld::RadioButton > mxRbText
std::unique_ptr< weld::Widget > mxColorDepth
std::unique_ptr< weld::SpinButton > mxNfJpgWebpCompression
DECL_LINK(UpdateHdlNfResolution, weld::SpinButton &, void)
DECL_LINK(UpdateHdlMtfSizeX, weld::SpinButton &, void)
OUString ms1BitThreshold
std::unique_ptr< weld::Widget > mxMode
DECL_LINK(SbCompressionUpdateHdl, weld::Scale &, void)
DECL_LINK(SelectListBoxHdl, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > mxLbResolution
css::uno::Sequence< css::beans::PropertyValue > GetFilterData(bool bUpdateConfig)
css::uno::Reference< css::drawing::XShapes > mxShapes
void setupSizeControls()
OUString msEstimatedSizePix1
std::unique_ptr< weld::CheckButton > mxCbInterlaced
std::unique_ptr< weld::RadioButton > mxRbEPSCompressionLZW
std::unique_ptr< weld::Widget > mxEPSGrid
std::unique_ptr< weld::CheckButton > mxCbSaveTransparency
OUString msEstimatedSizePix2
std::unique_ptr< weld::Widget > mxDrawingObjects
std::unique_ptr< weld::RadioButton > mxModifyResolution
std::unique_ptr< weld::Widget > mxBMPCompression
std::unique_ptr< weld::Widget > mxPNGCompression
std::unique_ptr< weld::SpinButton > mxNfResolution
std::unique_ptr< weld::Widget > mxEncoding
OUString msEstimatedSizeVec
sal_uInt32 GetRawFileSize() const
void updateControls()
ExportDialog(FltCallDialogParameter &rPara, css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::lang::XComponent > &rxSourceDocument, bool bExportSelection, bool bIsExportVectorFormat, bool bGraphicsSource, const css::uno::Reference< css::graphic::XGraphic > &rxGraphic)
void GetGraphicStream()
OUString maExt
std::unique_ptr< weld::Label > mxFtEstimatedSize
css::uno::Reference< css::drawing::XDrawPage > mxPage
DECL_LINK(UpdateHdlMtfSizeY, weld::SpinButton &, void)
css::uno::Reference< css::drawing::XShape > mxShape
std::unique_ptr< weld::Label > mxFtResolution
DECL_LINK(SelectHdl, weld::SpinButton &, void)
const css::uno::Reference< css::lang::XComponent > & mxSourceDocument
sal_Int32 GetDefaultUnit() const
std::unique_ptr< weld::SpinButton > mxNfPngCompression
bool mbIsPixelFormat
std::unique_ptr< weld::Widget > mxInfo
sal_Int16 mnFormat
css::awt::Size GetOriginalSize()
std::unique_ptr< weld::RadioButton > mxRbEPSCompressionNone
css::awt::Size maOriginalSize
void GetGraphicSource()
std::unique_ptr< weld::Scale > mxSbJpgWebpCompression
std::unique_ptr< weld::ComboBox > mxLbSizeX
std::unique_ptr< weld::Button > mxBtnOK
std::unique_ptr< weld::CheckButton > mxCbLossless
OUString ms8BitColorPalette
DECL_LINK(UpdateHdlLossless, weld::Toggleable &, void)
sal_Int32 mnInitialResolutionUnit
const css::uno::Reference< css::uno::XComponentContext > mxContext
const css::uno::Reference< css::graphic::XGraphic > & mxGraphic
bool mbGraphicsSource
void createFilterOptions()
bool mbExportSelection
void setupControls()
std::unique_ptr< FilterConfigItem > mpOptionsItem
DECL_LINK(UpdateHdl, weld::Toggleable &, void)
std::unique_ptr< weld::SpinButton > mxMfSizeX
FltCallDialogParameter & mrFltCallPara
OUString ms24BitColor
std::unique_ptr< FilterConfigItem > mpFilterOptionsItem
sal_Int32 mnMaxFilesizeForRealtimePreview
std::unique_ptr< weld::CheckButton > mxCbEPSPreviewTIFF
bool IsTempExportAvailable() const