Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/svx/source/dialog/contwnd.hxx
Line
Count
Source (jump to first uncovered line)
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 <tools/poly.hxx>
23
#include <svx/graphctl.hxx>
24
25
class ContourWindow final : public GraphCtrl
26
{
27
    tools::PolyPolygon         aPolyPoly;
28
    Color               aPipetteColor;
29
    tools::Rectangle           aWorkRect;
30
    Link<ContourWindow&,void>  aPipetteLink;
31
    Link<ContourWindow&,void>  aPipetteClickLink;
32
    Link<ContourWindow&,void>  aWorkplaceClickLink;
33
    bool                bPipetteMode;
34
    bool                bWorkplaceMode;
35
    bool                bClickValid;
36
37
    virtual bool        MouseButtonDown(const MouseEvent& rMEvt) override;
38
    virtual bool        MouseMove(const MouseEvent& rMEvt) override;
39
    virtual bool        MouseButtonUp(const MouseEvent& rMEvt) override;
40
    virtual void        SdrObjCreated( const SdrObject& rObj ) override;
41
    virtual void        InitSdrModel() override;
42
    virtual void        Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
43
    virtual void        SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
44
45
public:
46
47
    ContourWindow(weld::Dialog* pDialog);
48
49
    void                SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
50
    const tools::PolyPolygon&  GetPolyPolygon();
51
52
0
    void                SetPipetteMode( const bool bPipette ) { bPipetteMode = bPipette; }
53
0
    const Color&        GetPipetteColor() const { return aPipetteColor; }
54
55
0
    bool                IsClickValid() const { return bClickValid; }
56
    bool                IsContourChanged() const;
57
58
0
    void                SetWorkplaceMode( const bool bWorkplace ) { bWorkplaceMode = bWorkplace; }
59
0
    const tools::Rectangle&    GetWorkRect() const { return aWorkRect; }
60
61
0
    void                SetPipetteHdl( const Link<ContourWindow&,void>& rLink ) { aPipetteLink = rLink; }
62
0
    void                SetPipetteClickHdl( const Link<ContourWindow&,void>& rLink ) { aPipetteClickLink = rLink; }
63
0
    void                SetWorkplaceClickHdl( const Link<ContourWindow&,void>& rLink ) { aWorkplaceClickLink = rLink; }
64
};
65
66
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */