LibreOffice Module svx (master)  1
contimp.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  * 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 #ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
20 #define INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
21 
22 #include <sfx2/ctrlitem.hxx>
23 #include "contwnd.hxx"
24 #include <vcl/idle.hxx>
25 
26 class SvxSuperContourDlg;
27 
29 {
31 
32 protected:
33 
34  virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override;
35 
36 public:
37 
39 };
40 
41 class ContourWindow;
42 
44 {
45 private:
47 public:
49  : m_rWnd(rWnd)
50  {
51  }
52  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
53  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
54  {
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);
60  }
61 };
62 
64 {
74  void* pCheckObj;
76  sal_Int32 mnGrfChanged;
77  bool bExecState;
80 
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;
91 
92  DECL_LINK( Tbx1ClickHdl, const OString&, 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 );
102 
103  void SetActiveTool(const OString& rId);
104  void SetActivePoly(const OString& rId);
105 
107 
108 public:
109 
110  SvxSuperContourDlg(weld::Builder& rBuilder, weld::Dialog& rDialog, SfxBindings* pBindings);
112 
113  void SetExecState( bool bEnable );
114 
115  void SetGraphic( const Graphic& rGraphic );
116  const Graphic& GetGraphic() const { return aGraphic; }
117  bool IsGraphicChanged() const { return mnGrfChanged > 0; }
118 
119  void SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
121 
122  const void* GetEditingObject() const { return pCheckObj; }
123 
124  void UpdateGraphic( const Graphic& rGraphic, bool bGraphicLinked,
125  const tools::PolyPolygon* pPolyPoly,
126  void* pEditingObj );
127 };
128 
129 
130 #endif // INCLUDED_SVX_SOURCE_DIALOG_CONTIMP_HXX
131 
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool bUpdateGraphicLinked
Definition: contimp.hxx:78
Graphic aUndoGraphic
Definition: contimp.hxx:66
std::unique_ptr< weld::Toolbar > m_xTbx1
Definition: contimp.hxx:84
SvxContourDlgItem(SvxSuperContourDlg &rDlg, SfxBindings &rBindings)
Definition: _contdlg.cxx:42
void SetExecState(bool bEnable)
Definition: _contdlg.cxx:267
std::unique_ptr< StatusColor > m_xStbStatusColor
Definition: contimp.hxx:83
Graphic aRedoGraphic
Definition: contimp.hxx:67
std::unique_ptr< weld::Button > m_xCancelBtn
Definition: contimp.hxx:88
Graphic aGraphic
Definition: contimp.hxx:65
SvxContourDlgItem aContourItem
Definition: contimp.hxx:75
const Graphic & GetGraphic() const
Definition: contimp.hxx:116
std::unique_ptr< weld::CustomWeld > m_xContourWndWeld
Definition: contimp.hxx:90
tools::PolyPolygon aUpdatePolyPoly
Definition: contimp.hxx:69
StatusColor(ContourWindow &rWnd)
Definition: contimp.hxx:48
void UpdateGraphic(const Graphic &rGraphic, bool bGraphicLinked, const tools::PolyPolygon *pPolyPoly, void *pEditingObj)
Definition: _contdlg.cxx:336
weld::Dialog & m_rDialog
Definition: contimp.hxx:81
std::unique_ptr< weld::Label > m_xStbStatus3
Definition: contimp.hxx:87
const void * GetEditingObject() const
Definition: contimp.hxx:122
Graphic aUpdateGraphic
Definition: contimp.hxx:68
std::unique_ptr< weld::MetricSpinButton > m_xMtfTolerance
Definition: contimp.hxx:85
tools::PolyPolygon GetPolyPolygon()
Definition: _contdlg.cxx:309
void SetActiveTool(const OString &rId)
Definition: _contdlg.cxx:459
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: _contdlg.cxx:48
bool IsGraphicChanged() const
Definition: contimp.hxx:117
SvxSuperContourDlg & rDlg
Definition: contimp.hxx:30
SfxBindings & GetBindings()
Definition: contimp.hxx:106
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: contimp.hxx:53
void SetOutputSizePixel(const Size &rSize)
void SetPolyPolygon(const tools::PolyPolygon &rPolyPoly)
Definition: _contdlg.cxx:280
void * pUpdateEditingObject
Definition: contimp.hxx:73
std::unique_ptr< ContourWindow > m_xContourWnd
Definition: contimp.hxx:82
SfxItemState
DECL_LINK(Tbx1ClickHdl, const OString &, void)
std::unique_ptr< weld::CustomWeld > m_xStbStatusColorWeld
Definition: contimp.hxx:89
virtual int get_text_height() const =0
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
SfxBindings * mpBindings
Definition: contimp.hxx:72
void SetGraphic(const Graphic &rGraphic)
Definition: _contdlg.cxx:272
SvxSuperContourDlg(weld::Builder &rBuilder, weld::Dialog &rDialog, SfxBindings *pBindings)
Definition: _contdlg.cxx:192
sal_Int32 mnGrfChanged
Definition: contimp.hxx:76
ContourWindow & m_rWnd
Definition: contimp.hxx:46
virtual void set_size_request(int nWidth, int nHeight)=0
std::unique_ptr< weld::Label > m_xStbStatus2
Definition: contimp.hxx:86
virtual float get_approximate_digit_width() const =0
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: _contdlg.cxx:600
void SetActivePoly(const OString &rId)
Definition: _contdlg.cxx:467