1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
20 #define INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
22 #include <vcl/dialog.hxx>
23 #include <vcl/button.hxx>
24 #include <vcl/fixed.hxx>
25 #include <vcl/graph.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <vcl/field.hxx>
28 #include <vcl/slider.hxx>
29 #include <sfx2/bindings.hxx>
30 #include <svx/svxdllapi.h>
34 class SAL_WARN_UNUSED SVX_DLLPUBLIC CompressGraphicsDialog
: public ModalDialog
37 VclPtr
<FixedText
> m_pLabelGraphicType
;
38 VclPtr
<FixedText
> m_pFixedText2
;
39 VclPtr
<FixedText
> m_pFixedText3
;
40 VclPtr
<FixedText
> m_pFixedText5
;
41 VclPtr
<FixedText
> m_pFixedText6
;
43 VclPtr
<CheckBox
> m_pReduceResolutionCB
;
44 VclPtr
<NumericField
> m_pMFNewWidth
;
45 VclPtr
<NumericField
> m_pMFNewHeight
;
46 VclPtr
<ComboBox
> m_pResolutionLB
;
47 VclPtr
<RadioButton
> m_pLosslessRB
;
48 VclPtr
<RadioButton
> m_pJpegCompRB
;
49 VclPtr
<NumericField
> m_pCompressionMF
;
50 VclPtr
<Slider
> m_pCompressionSlider
;
51 VclPtr
<NumericField
> m_pQualityMF
;
52 VclPtr
<Slider
> m_pQualitySlider
;
53 VclPtr
<PushButton
> m_pBtnCalculate
;
54 VclPtr
<ListBox
> m_pInterpolationCombo
;
56 SdrGrafObj
* m_pGraphicObj
;
58 Size m_aViewSize100mm
;
59 Rectangle m_aCropRectangle
;
60 SfxBindings
& m_rBindings
;
66 DECL_LINK( EndSlideHdl
, Slider
*, void );
67 DECL_LINK( NewInterpolationModifiedHdl
, ListBox
&, void );
68 DECL_LINK( NewQualityModifiedHdl
, Edit
&, void );
69 DECL_LINK( NewCompressionModifiedHdl
, Edit
&, void );
70 DECL_LINK( NewWidthModifiedHdl
, Edit
&, void );
71 DECL_LINK( NewHeightModifiedHdl
, Edit
&, void );
72 DECL_LINK( ResolutionModifiedHdl
, Edit
&, void );
73 DECL_LINK( ToggleCompressionRB
, RadioButton
&, void );
74 DECL_LINK( ToggleReduceResolutionRB
, CheckBox
&, void );
76 DECL_LINK( CalculateClickHdl
, Button
*, void );
79 void UpdateNewWidthMF();
80 void UpdateNewHeightMF();
81 void UpdateResolutionLB();
83 void Compress(SvStream
& aStream
);
85 double GetViewWidthInch();
86 double GetViewHeightInch();
88 BmpScaleFlag
GetSelectedInterpolationType();
91 CompressGraphicsDialog( vcl::Window
* pParent
, SdrGrafObj
* pGraphicObj
, SfxBindings
& rBindings
);
92 CompressGraphicsDialog( vcl::Window
* pParent
, Graphic
& rGraphic
, Size rViewSize100mm
, Rectangle
& rCropRectangle
, SfxBindings
& rBindings
);
93 virtual ~CompressGraphicsDialog() override
;
94 virtual void dispose() override
;
96 SdrGrafObj
* GetCompressedSdrGrafObj();
97 Graphic
GetCompressedGraphic();
99 Rectangle
GetScaledCropRectangle();
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */