LibreOffice Module sw (master) 1
GraphicSizeCheck.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 */
10
11#pragma once
12
13#include <doc.hxx>
15
16namespace sw
17{
23{
24private:
26
27 sal_Int32 m_nLowDPILimit = 0;
28 sal_Int32 m_nHighDPILimit = 0;
29
30 sal_Int32 m_nDPIX = 0;
31 sal_Int32 m_nDPIY = 0;
32
33public:
34 GraphicSizeViolation(sal_Int32 nDPI, const SwGrfNode* pGraphicNode);
35 bool check();
36
37 const OUString& getGraphicName();
38
40
42
43 sal_Int32 getDPIX() { return m_nDPIX; }
44
45 sal_Int32 getDPIY() { return m_nDPIY; }
46};
47
53{
54private:
56 std::vector<std::unique_ptr<GraphicSizeViolation>> m_aGraphicSizeViolationList;
57
58public:
60 : m_pDocument(pDocument)
61 {
62 }
63
64 void check();
65
66 std::vector<std::unique_ptr<GraphicSizeViolation>>& getViolationList()
67 {
69 }
70};
71
74{
75private:
77 std::unique_ptr<GraphicSizeViolation> m_pViolation;
78
79public:
80 GraphicSizeCheckGUIEntry(SwDoc* pDocument, std::unique_ptr<GraphicSizeViolation>&& pViolation)
81 : m_pDocument(pDocument)
82 , m_pViolation(std::move(pViolation))
83 {
84 }
85
86 OUString getText() override;
87
88 bool canMarkObject() override { return true; }
89
90 void markObject() override;
91
92 bool hasProperties() override { return true; }
93
94 void runProperties() override;
95};
96
102{
103public:
105
106 OUString getTitle() override;
107};
108
109} // end sw namespace
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
The UI part of the GraphicSizeViolation used by GenericCheckDialog.
GraphicSizeCheckGUIEntry(SwDoc *pDocument, std::unique_ptr< GraphicSizeViolation > &&pViolation)
std::unique_ptr< GraphicSizeViolation > m_pViolation
The UI part presenting the graphic size check results, which is used by GenericCheckDialog.
GraphicSizeCheckGUIResult(SwDoc *pDocument)
Run the graphic size checks for all the graphic objects in the DOM and store a list of violations.
GraphicSizeCheck(SwDoc *pDocument)
std::vector< std::unique_ptr< GraphicSizeViolation > > & getViolationList()
std::vector< std::unique_ptr< GraphicSizeViolation > > m_aGraphicSizeViolationList
Class responsible to check if a graphic object violates the size constraints and store the results.
const OUString & getGraphicName()
GraphicSizeViolation(sal_Int32 nDPI, const SwGrfNode *pGraphicNode)
const SwGrfNode * m_pGraphicNode
Dialog to specify the properties of date form field.