Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / dialog / contwnd.hxx
blob1bad623c05d64e5002b5be4f346e3a1afaf98a8f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
21 #define INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
23 #include <tools/poly.hxx>
24 #include <svx/graphctl.hxx>
26 class ContourWindow final : public GraphCtrl
28 tools::PolyPolygon aPolyPoly;
29 Color aPipetteColor;
30 tools::Rectangle aWorkRect;
31 Link<ContourWindow&,void> aPipetteLink;
32 Link<ContourWindow&,void> aPipetteClickLink;
33 Link<ContourWindow&,void> aWorkplaceClickLink;
34 bool bPipetteMode;
35 bool bWorkplaceMode;
36 bool bClickValid;
38 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
39 virtual bool MouseMove(const MouseEvent& rMEvt) override;
40 virtual bool MouseButtonUp(const MouseEvent& rMEvt) override;
41 virtual void SdrObjCreated( const SdrObject& rObj ) override;
42 virtual void InitSdrModel() override;
43 virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
44 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
46 public:
48 ContourWindow(weld::Dialog* pDialog);
50 void SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
51 const tools::PolyPolygon& GetPolyPolygon();
53 void SetPipetteMode( const bool bPipette ) { bPipetteMode = bPipette; }
54 const Color& GetPipetteColor() const { return aPipetteColor; }
56 bool IsClickValid() const { return bClickValid; }
57 bool IsContourChanged() const;
59 void SetWorkplaceMode( const bool bWorkplace ) { bWorkplaceMode = bWorkplace; }
60 const tools::Rectangle& GetWorkRect() const { return aWorkRect; }
62 void SetPipetteHdl( const Link<ContourWindow&,void>& rLink ) { aPipetteLink = rLink; }
63 void SetPipetteClickHdl( const Link<ContourWindow&,void>& rLink ) { aPipetteClickLink = rLink; }
64 void SetWorkplaceClickHdl( const Link<ContourWindow&,void>& rLink ) { aWorkplaceClickLink = rLink; }
68 #endif
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */