LibreOffice Module sd (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 <memory>
14#include <drawdoc.hxx>
16#include <svx/svdograf.hxx>
17
18namespace sd
19{
25{
26private:
28
29 sal_Int32 m_nLowDPILimit = 0;
30 sal_Int32 m_nHighDPILimit = 0;
31
32 sal_Int32 m_nDPIX = 0;
33 sal_Int32 m_nDPIY = 0;
34
35public:
36 GraphicSizeViolation(sal_Int32 nDPI, SdrGrafObj* pGraphicObject);
37 bool check();
38
39 const OUString& getGraphicName();
40
42
44
46
47 sal_Int32 getDPIX() { return m_nDPIX; }
48
49 sal_Int32 getDPIY() { return m_nDPIY; }
50};
51
57{
58private:
60 std::vector<std::unique_ptr<GraphicSizeViolation>> m_aGraphicSizeViolationList;
61
62public:
64 : m_pDocument(pDocument)
65 {
66 }
67
68 void check();
69
70 std::vector<std::unique_ptr<GraphicSizeViolation>>& getViolationList()
71 {
73 }
74};
75
78{
79private:
81 std::unique_ptr<GraphicSizeViolation> m_pViolation;
82
83public:
85 std::unique_ptr<GraphicSizeViolation>&& pViolation)
86 : m_pDocument(pDocument)
87 , m_pViolation(std::move(pViolation))
88 {
89 }
90
91 OUString getText() override;
92
93 bool canMarkObject() override { return true; }
94
95 void markObject() override;
96
97 bool hasProperties() override { return true; }
98
99 void runProperties() override;
100};
101
107{
108public:
110
111 OUString getTitle() override;
112};
113
114} // end of namespace sd
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The UI part of the GraphicSizeViolation used by GenericCheckDialog.
std::unique_ptr< GraphicSizeViolation > m_pViolation
GraphicSizeCheckGUIEntry(SdDrawDocument *pDocument, std::unique_ptr< GraphicSizeViolation > &&pViolation)
The UI part presenting the graphic size check results, which is used by GenericCheckDialog.
GraphicSizeCheckGUIResult(SdDrawDocument *m_pDocument)
Run the graphic size checks for all the graphic objects in the DOM and store a list of violations.
std::vector< std::unique_ptr< GraphicSizeViolation > > & getViolationList()
std::vector< std::unique_ptr< GraphicSizeViolation > > m_aGraphicSizeViolationList
SdDrawDocument * m_pDocument
GraphicSizeCheck(SdDrawDocument *pDocument)
Class responsible to check if a graphic object violates the size constraints and store the results.
GraphicSizeViolation(sal_Int32 nDPI, SdrGrafObj *pGraphicObject)
SdrGrafObj * getObject() const
const OUString & getGraphicName()