LibreOffice Module cui (master) 1
grfpage.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#pragma once
21
22#include <vcl/customweld.hxx>
23#include <vcl/graph.hxx>
24#include <sfx2/tabdlg.hxx>
25
27{
32
33public:
35
36 virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
37 virtual void Resize() override;
38 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
39
40 void SetTop( tools::Long nVal ) { m_aTopLeft.setX(nVal); }
41 void SetBottom( tools::Long nVal ) { m_aBottomRight.setX(nVal); }
42 void SetLeft( tools::Long nVal ) { m_aTopLeft.setY(nVal); }
43 void SetRight( tools::Long nVal) { m_aBottomRight.setY(nVal); }
44 void SetFrameSize( const Size& rSz );
45 void SetGraphic( const Graphic& rGrf ) { m_aGrf = rGrf; }
46};
47
49{
50 friend class VclPtr<SvxGrfCropPage>;
51
59 sal_Int32 m_aPreferredDPI;
60
62
63 std::unique_ptr<weld::Widget> m_xCropFrame;
64 std::unique_ptr<weld::RadioButton> m_xZoomConstRB;
65 std::unique_ptr<weld::RadioButton> m_xSizeConstRB;
66 std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
67 std::unique_ptr<weld::MetricSpinButton> m_xRightMF;
68 std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
69 std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
70
71 std::unique_ptr<weld::Widget> m_xScaleFrame;
72 std::unique_ptr<weld::MetricSpinButton> m_xWidthZoomMF;
73 std::unique_ptr<weld::MetricSpinButton> m_xHeightZoomMF;
74
75 std::unique_ptr<weld::Widget> m_xSizeFrame;
76 std::unique_ptr<weld::MetricSpinButton> m_xWidthMF;
77 std::unique_ptr<weld::MetricSpinButton> m_xHeightMF;
78
79 std::unique_ptr<weld::Widget> m_xOrigSizeGrid;
80 std::unique_ptr<weld::Label> m_xOrigSizeFT;
81 std::unique_ptr<weld::Button> m_xOrigSizePB;
82
83 // Example
84 std::unique_ptr<weld::CustomWeld> m_xExampleWN;
85
88 DECL_LINK(CropModifyHdl, weld::MetricSpinButton&, void);
89 DECL_LINK(OrigSizeHdl, weld::Button&, void);
90
91 void CalcZoom();
92 void CalcMinMaxBorder();
93 void GraphicHasChanged(bool bFound);
94 virtual void ActivatePage(const SfxItemSet& rSet) override;
95
96 Size GetGrfOrigSize(const Graphic& rGraphic);
97public:
98 SvxGrfCropPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet);
99 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet );
100 virtual ~SvxGrfCropPage() override;
101
102 virtual bool FillItemSet( SfxItemSet *rSet ) override;
103 virtual void Reset( const SfxItemSet *rSet ) override;
104 virtual DeactivateRC DeactivatePage( SfxItemSet *pSet ) override;
105};
106
107/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setX(tools::Long nX)
void setY(tools::Long nY)
Size m_aFrameSize
Definition: grfpage.hxx:29
void SetBottom(tools::Long nVal)
Definition: grfpage.hxx:41
Point m_aBottomRight
Definition: grfpage.hxx:30
void SetLeft(tools::Long nVal)
Definition: grfpage.hxx:42
void SetTop(tools::Long nVal)
Definition: grfpage.hxx:40
void SetFrameSize(const Size &rSz)
Definition: grfpage.cxx:784
virtual void Resize() override
Definition: grfpage.cxx:779
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
Definition: grfpage.cxx:722
Point m_aTopLeft
Definition: grfpage.hxx:30
void SetGraphic(const Graphic &rGrf)
Definition: grfpage.hxx:45
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: grfpage.cxx:709
void SetRight(tools::Long nVal)
Definition: grfpage.hxx:43
Graphic m_aGrf
Definition: grfpage.hxx:31
MapMode m_aMapMode
Definition: grfpage.hxx:28
std::unique_ptr< weld::Widget > m_xCropFrame
Definition: grfpage.hxx:63
std::unique_ptr< weld::MetricSpinButton > m_xWidthMF
Definition: grfpage.hxx:76
tools::Long m_nOldHeight
Definition: grfpage.hxx:57
Size m_aPageSize
Definition: grfpage.hxx:55
std::unique_ptr< weld::Widget > m_xSizeFrame
Definition: grfpage.hxx:75
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
Definition: grfpage.hxx:67
void CalcMinMaxBorder()
Definition: grfpage.cxx:560
DECL_LINK(OrigSizeHdl, weld::Button &, void)
std::unique_ptr< weld::RadioButton > m_xSizeConstRB
Definition: grfpage.hxx:65
virtual void Reset(const SfxItemSet *rSet) override
Definition: grfpage.cxx:119
std::unique_ptr< weld::MetricSpinButton > m_xWidthZoomMF
Definition: grfpage.hxx:72
std::unique_ptr< weld::CustomWeld > m_xExampleWN
Definition: grfpage.hxx:84
DECL_LINK(SizeHdl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::RadioButton > m_xZoomConstRB
Definition: grfpage.hxx:64
std::unique_ptr< weld::Widget > m_xScaleFrame
Definition: grfpage.hxx:71
Size m_aOrigSize
Definition: grfpage.hxx:53
std::unique_ptr< weld::Widget > m_xOrigSizeGrid
Definition: grfpage.hxx:79
sal_Int32 m_aPreferredDPI
Definition: grfpage.hxx:59
bool m_bSetOrigSize
Definition: grfpage.hxx:58
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: grfpage.hxx:68
std::unique_ptr< weld::Label > m_xOrigSizeFT
Definition: grfpage.hxx:80
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: grfpage.cxx:220
std::unique_ptr< weld::MetricSpinButton > m_xHeightMF
Definition: grfpage.hxx:77
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: grfpage.cxx:347
OUString m_aGraphicName
Definition: grfpage.hxx:52
std::unique_ptr< weld::MetricSpinButton > m_xHeightZoomMF
Definition: grfpage.hxx:73
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
Definition: grfpage.hxx:66
void CalcZoom()
Definition: grfpage.cxx:531
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: grfpage.cxx:114
Size m_aOrigPixelSize
Definition: grfpage.hxx:54
std::unique_ptr< weld::Button > m_xOrigSizePB
Definition: grfpage.hxx:81
SvxCropExample m_aExampleWN
Definition: grfpage.hxx:61
DECL_LINK(ZoomHdl, weld::MetricSpinButton &, void)
DECL_LINK(CropModifyHdl, weld::MetricSpinButton &, void)
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: grfpage.cxx:284
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: grfpage.hxx:69
void GraphicHasChanged(bool bFound)
Definition: grfpage.cxx:589
virtual ~SvxGrfCropPage() override
Definition: grfpage.cxx:109
Size GetGrfOrigSize(const Graphic &rGraphic)
Definition: grfpage.cxx:675
tools::Long m_nOldWidth
Definition: grfpage.hxx:56
SvxGrfCropPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: grfpage.cxx:56
long Long
DeactivateRC