Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / dialog / contimp.hxx
blob2bf5aca4d1e8fa7822fbb12e64c8a2ee420d882c
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 .
19 #ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
20 #define INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
22 #include <sfx2/ctrlitem.hxx>
23 #include "contwnd.hxx"
24 #include <vcl/idle.hxx>
26 class SvxSuperContourDlg;
28 class SvxContourDlgItem : public SfxControllerItem
30 SvxSuperContourDlg& rDlg;
32 protected:
34 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
36 public:
38 SvxContourDlgItem( SvxSuperContourDlg& rDlg, SfxBindings& rBindings );
41 class ContourWindow;
43 class StatusColor : public weld::CustomWidgetController
45 private:
46 ContourWindow& m_rWnd;
47 public:
48 StatusColor(ContourWindow& rWnd)
49 : m_rWnd(rWnd)
52 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
53 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
55 weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
56 Size aSize(pDrawingArea->get_approximate_digit_width() * 3,
57 pDrawingArea->get_text_height());
58 pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
59 SetOutputSizePixel(aSize);
63 class SvxSuperContourDlg
65 Graphic aGraphic;
66 Graphic aUndoGraphic;
67 Graphic aRedoGraphic;
68 Graphic aUpdateGraphic;
69 tools::PolyPolygon aUpdatePolyPoly;
70 Idle aUpdateIdle;
71 Idle aCreateIdle;
72 SfxBindings* mpBindings;
73 void* pUpdateEditingObject;
74 void* pCheckObj;
75 SvxContourDlgItem aContourItem;
76 sal_Int32 mnGrfChanged;
77 bool bExecState;
78 bool bUpdateGraphicLinked;
79 bool bGraphicLinked;
81 weld::Dialog& m_rDialog;
82 std::unique_ptr<ContourWindow> m_xContourWnd;
83 std::unique_ptr<StatusColor> m_xStbStatusColor;
84 std::unique_ptr<weld::Toolbar> m_xTbx1;
85 std::unique_ptr<weld::MetricSpinButton> m_xMtfTolerance;
86 std::unique_ptr<weld::Label> m_xStbStatus2;
87 std::unique_ptr<weld::Label> m_xStbStatus3;
88 std::unique_ptr<weld::Button> m_xCancelBtn;
89 std::unique_ptr<weld::CustomWeld> m_xStbStatusColorWeld;
90 std::unique_ptr<weld::CustomWeld> m_xContourWndWeld;
92 DECL_LINK( Tbx1ClickHdl, const OUString&, void );
93 DECL_LINK( MousePosHdl, GraphCtrl*, void );
94 DECL_LINK( GraphSizeHdl, GraphCtrl*, void );
95 DECL_LINK( UpdateHdl, Timer *, void );
96 DECL_LINK( CreateHdl, Timer *, void );
97 DECL_LINK( StateHdl, GraphCtrl*, void );
98 DECL_LINK( PipetteHdl, ContourWindow&, void );
99 DECL_LINK( PipetteClickHdl, ContourWindow&, void );
100 DECL_LINK( WorkplaceClickHdl, ContourWindow&, void );
101 DECL_LINK( CancelHdl, weld::Button&, void );
103 void SetActiveTool(std::u16string_view rId);
104 void SetActivePoly(std::u16string_view rId);
106 SfxBindings& GetBindings() { return *mpBindings; }
108 public:
110 SvxSuperContourDlg(weld::Builder& rBuilder, weld::Dialog& rDialog, SfxBindings* pBindings);
111 ~SvxSuperContourDlg();
113 void SetExecState( bool bEnable );
115 void SetGraphic( const Graphic& rGraphic );
116 const Graphic& GetGraphic() const { return aGraphic; }
117 bool IsGraphicChanged() const { return mnGrfChanged > 0; }
119 void SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
120 tools::PolyPolygon GetPolyPolygon();
122 const void* GetEditingObject() const { return pCheckObj; }
124 void UpdateGraphic( const Graphic& rGraphic, bool bGraphicLinked,
125 const tools::PolyPolygon* pPolyPoly,
126 void* pEditingObj );
130 #endif // INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */