lok: calc - send other views our selection in their co-ordinates.
[LibreOffice.git] / include / svx / compressgraphicdialog.hxx
blob9a0969f8f547d5b0e8e95997c47f51d2b9dc37c7
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 .
19 #ifndef INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
20 #define INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
22 #include <sal/types.h>
23 #include <svx/svxdllapi.h>
24 #include <tools/gen.hxx>
25 #include <tools/link.hxx>
26 #include <vcl/weld.hxx>
27 #include <vcl/graph.hxx>
29 class SdrGrafObj;
30 class SfxBindings;
31 class SvStream;
33 class SAL_WARN_UNUSED SVX_DLLPUBLIC CompressGraphicsDialog final : public weld::GenericDialogController
35 private:
36 std::unique_ptr<weld::Label> m_xLabelGraphicType;
37 std::unique_ptr<weld::Label> m_xFixedText2;
38 std::unique_ptr<weld::Label> m_xFixedText3;
39 std::unique_ptr<weld::Label> m_xFixedText5;
40 std::unique_ptr<weld::Label> m_xFixedText6;
42 std::unique_ptr<weld::CheckButton> m_xReduceResolutionCB;
43 std::unique_ptr<weld::SpinButton> m_xMFNewWidth;
44 std::unique_ptr<weld::SpinButton> m_xMFNewHeight;
45 std::unique_ptr<weld::ComboBox> m_xResolutionLB;
46 std::unique_ptr<weld::RadioButton> m_xLosslessRB;
47 std::unique_ptr<weld::RadioButton> m_xJpegCompRB;
48 std::unique_ptr<weld::SpinButton> m_xCompressionMF;
49 std::unique_ptr<weld::Scale> m_xCompressionSlider;
50 std::unique_ptr<weld::SpinButton> m_xQualityMF;
51 std::unique_ptr<weld::Scale> m_xQualitySlider;
52 std::unique_ptr<weld::Button> m_xBtnCalculate;
53 std::unique_ptr<weld::ComboBox> m_xInterpolationCombo;
55 SdrGrafObj* m_xGraphicObj;
56 Graphic const m_aGraphic;
57 Size const m_aViewSize100mm;
58 tools::Rectangle m_aCropRectangle;
59 SfxBindings& m_rBindings;
61 double m_dResolution;
63 void Initialize();
65 DECL_LINK( SlideHdl, weld::Scale&, void );
66 DECL_LINK( NewInterpolationModifiedHdl, weld::ComboBox&, void );
67 DECL_LINK( NewQualityModifiedHdl, weld::Entry&, void );
68 DECL_LINK( NewCompressionModifiedHdl, weld::Entry&, void );
69 DECL_LINK( NewWidthModifiedHdl, weld::Entry&, void );
70 DECL_LINK( NewHeightModifiedHdl, weld::Entry&, void );
71 DECL_LINK( ResolutionModifiedHdl, weld::ComboBox&, void );
72 DECL_LINK( ToggleCompressionRB, weld::ToggleButton&, void );
73 DECL_LINK( ToggleReduceResolutionRB, weld::ToggleButton&, void );
75 DECL_LINK( CalculateClickHdl, weld::Button&, void );
77 void Update();
78 void UpdateNewWidthMF();
79 void UpdateNewHeightMF();
80 void UpdateResolutionLB();
82 void Compress(SvStream& aStream);
84 double GetViewWidthInch() const;
85 double GetViewHeightInch() const;
87 BmpScaleFlag GetSelectedInterpolationType() const;
89 public:
90 CompressGraphicsDialog( weld::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
91 CompressGraphicsDialog( weld::Window* pParent, Graphic const & rGraphic, Size rViewSize100mm, tools::Rectangle const & rCropRectangle, SfxBindings& rBindings );
92 virtual ~CompressGraphicsDialog() override;
94 SdrGrafObj* GetCompressedSdrGrafObj();
95 Graphic GetCompressedGraphic();
97 tools::Rectangle GetScaledCropRectangle() const;
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */