LibreOffice Module svx (master) 1
compressgraphicdialog.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#ifndef INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
20#define INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX
21
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>
28
29class SdrGrafObj;
30class SfxBindings;
31class SvStream;
32
34{
35private:
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;
41
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;
54 std::unique_ptr<weld::Button> m_xBtnOkay;
55
61
63 sal_Int32 m_aNativeSize;
64
65 void Initialize();
66 void recallParameter();
67
68 DECL_DLLPRIVATE_LINK( SlideHdl, weld::Scale&, void );
69 DECL_DLLPRIVATE_LINK( NewInterpolationModifiedHdl, weld::ComboBox&, void );
70 DECL_DLLPRIVATE_LINK( NewQualityModifiedHdl, weld::Entry&, void );
71 DECL_DLLPRIVATE_LINK( NewCompressionModifiedHdl, weld::Entry&, void );
72 DECL_DLLPRIVATE_LINK( NewWidthModifiedHdl, weld::Entry&, void );
73 DECL_DLLPRIVATE_LINK( NewHeightModifiedHdl, weld::Entry&, void );
74 DECL_DLLPRIVATE_LINK( ResolutionModifiedHdl, weld::ComboBox&, void );
75 DECL_DLLPRIVATE_LINK( ToggleCompressionRB, weld::Toggleable&, void );
76 DECL_DLLPRIVATE_LINK( ToggleReduceResolutionRB, weld::Toggleable&, void );
77
78 DECL_DLLPRIVATE_LINK( CalculateClickHdl, weld::Button&, void );
79 DECL_DLLPRIVATE_LINK( OkayClickHdl, weld::Button&, void );
80
81 void Update();
82 void UpdateNewWidthMF();
83 void UpdateNewHeightMF();
84 void UpdateResolutionLB();
85
86 void Compress(SvStream& aStream);
87
88 double GetViewWidthInch() const;
89 double GetViewHeightInch() const;
90
91 BmpScaleFlag GetSelectedInterpolationType() const;
92
93public:
94 CompressGraphicsDialog( weld::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
95 CompressGraphicsDialog( weld::Window* pParent, Graphic aGraphic, Size aViewSize100mm, tools::Rectangle const & rCropRectangle, SfxBindings& rBindings );
96 virtual ~CompressGraphicsDialog() override;
97
98 SdrGrafObj* GetCompressedSdrGrafObj();
99 Graphic GetCompressedGraphic();
100
101 tools::Rectangle GetScaledCropRectangle() const;
102};
103
104#endif
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xBtnCalculate
std::unique_ptr< weld::Button > m_xBtnOkay
DECL_DLLPRIVATE_LINK(NewCompressionModifiedHdl, weld::Entry &, void)
DECL_DLLPRIVATE_LINK(NewQualityModifiedHdl, weld::Entry &, void)
std::unique_ptr< weld::Scale > m_xCompressionSlider
std::unique_ptr< weld::ComboBox > m_xResolutionLB
std::unique_ptr< weld::Label > m_xFixedText5
DECL_DLLPRIVATE_LINK(ToggleReduceResolutionRB, weld::Toggleable &, void)
std::unique_ptr< weld::Label > m_xFixedText6
std::unique_ptr< weld::SpinButton > m_xQualityMF
std::unique_ptr< weld::SpinButton > m_xMFNewHeight
std::unique_ptr< weld::RadioButton > m_xJpegCompRB
std::unique_ptr< weld::SpinButton > m_xCompressionMF
std::unique_ptr< weld::ComboBox > m_xInterpolationCombo
std::unique_ptr< weld::CheckButton > m_xReduceResolutionCB
DECL_DLLPRIVATE_LINK(NewWidthModifiedHdl, weld::Entry &, void)
DECL_DLLPRIVATE_LINK(NewInterpolationModifiedHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Label > m_xLabelGraphicType
DECL_DLLPRIVATE_LINK(ResolutionModifiedHdl, weld::ComboBox &, void)
DECL_DLLPRIVATE_LINK(ToggleCompressionRB, weld::Toggleable &, void)
std::unique_ptr< weld::Scale > m_xQualitySlider
DECL_DLLPRIVATE_LINK(SlideHdl, weld::Scale &, void)
DECL_DLLPRIVATE_LINK(OkayClickHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xFixedText3
std::unique_ptr< weld::RadioButton > m_xLosslessRB
DECL_DLLPRIVATE_LINK(CalculateClickHdl, weld::Button &, void)
std::unique_ptr< weld::SpinButton > m_xMFNewWidth
std::unique_ptr< weld::Label > m_xFixedText2
DECL_DLLPRIVATE_LINK(NewHeightModifiedHdl, weld::Entry &, void)
This class represents an embedded or linked bitmap graphic object.
Definition: svdograf.hxx:68
BmpScaleFlag
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
#define SAL_WARN_UNUSED