1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <com/sun/star/awt/XControlContainer.hpp>
23 #include <com/sun/star/container/XNameContainer.hpp>
24 #include <com/sun/star/datatransfer/DataFlavor.hpp>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
27 #include <o3tl/deleter.hxx>
28 #include <svl/SfxBroadcaster.hxx>
29 #include <svl/hint.hxx>
30 #include <svx/svdobjkind.hxx>
31 #include <tools/gen.hxx>
32 #include <vcl/timer.hxx>
33 #include <vcl/idle.hxx>
34 #include <vcl/vclptr.hxx>
35 #include <vcl/window.hxx>
44 namespace vcl
{ class Window
; }
49 class DialogWindowLayout
;
51 constexpr auto DLGED_PAGE_WIDTH_MIN
= 1280;
52 constexpr auto DLGED_PAGE_HEIGHT_MIN
= 1024;
59 class DlgEdHint
: public SfxHint
76 DlgEdHint (Kind
, DlgEdObj
* pObj
);
77 virtual ~DlgEdHint() override
;
79 Kind
GetKind() const { return eKind
; }
80 DlgEdObj
* GetObject() const { return pDlgEdObj
; }
94 class DlgEditor
: public SfxBroadcaster
105 DECL_LINK(MarkTimeout
, Timer
*, void);
107 static void Print( Printer
* pPrinter
, const OUString
& rTitle
);
110 VclPtr
<ScrollAdaptor
> pHScroll
;
111 VclPtr
<ScrollAdaptor
> pVScroll
;
112 std::unique_ptr
<DlgEdModel
> pDlgEdModel
; // never nullptr
113 DlgEdPage
* pDlgEdPage
; // never nullptr
114 std::unique_ptr
<DlgEdView
> pDlgEdView
; // never nullptr
115 rtl::Reference
<DlgEdForm
> pDlgEdForm
; // never nullptr
116 css::uno::Reference
< css::container::XNameContainer
> m_xUnoControlDialogModel
;
117 css::uno::Reference
< css::awt::XControlContainer
> m_xControlContainer
;
118 css::uno::Sequence
< css::datatransfer::DataFlavor
> m_ClipboardDataFlavors
;
119 css::uno::Sequence
< css::datatransfer::DataFlavor
> m_ClipboardDataFlavorsResource
;
120 css::uno::Reference
< css::util::XNumberFormatsSupplier
> m_xSupplier
;
121 std::unique_ptr
<DlgEdFactory
, o3tl::default_delete
<DlgEdFactory
>> pObjFac
; // never nullptr
122 vcl::Window
& rWindow
; // DialogWindow
123 std::unique_ptr
<DlgEdFunc
> pFunc
;
124 DialogWindowLayout
& rLayout
;
129 tools::Rectangle aPaintRect
;
130 bool bDialogModelChanged
;
132 tools::Long mnPaintGuard
;
133 css::uno::Reference
< css::frame::XModel
> m_xDocument
;
137 vcl::Window
&, DialogWindowLayout
&,
138 css::uno::Reference
<css::frame::XModel
> const& xModel
,
139 css::uno::Reference
<css::container::XNameContainer
> const & xDialogModel
141 virtual ~DlgEditor() override
;
143 vcl::Window
& GetWindow() const { return rWindow
; }
145 /** returns the control container associated with our window
149 css::uno::Reference
< css::awt::XControlContainer
> const &
150 GetWindowControlContainer();
152 void SetScrollBars(ScrollAdaptor
* pHScroll
, ScrollAdaptor
* pVScroll
);
153 void InitScrollBars();
154 ScrollAdaptor
* GetHScroll() const { return pHScroll
; }
155 ScrollAdaptor
* GetVScroll() const { return pVScroll
; }
157 void UpdateScrollBars();
159 void SetDialog (const css::uno::Reference
<css::container::XNameContainer
>& xUnoControlDialogModel
);
161 const css::uno::Reference
< css::container::XNameContainer
>& GetDialog() const
162 {return m_xUnoControlDialogModel
;}
164 css::uno::Reference
< css::util::XNumberFormatsSupplier
> const & GetNumberFormatsSupplier();
166 DlgEdModel
& GetModel() const { return *pDlgEdModel
; }
167 DlgEdView
& GetView() const { return *pDlgEdView
; }
168 DlgEdPage
& GetPage() const { return *pDlgEdPage
; }
175 void SetDialogModelChanged() { bDialogModelChanged
= true; }
177 bool IsModified () const;
178 void ClearModifyFlag();
180 void MouseButtonDown( const MouseEvent
& rMEvt
);
181 void MouseButtonUp( const MouseEvent
& rMEvt
);
182 void MouseMove( const MouseEvent
& rMEvt
);
183 void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
);
184 bool KeyInput( const KeyEvent
& rKEvt
);
186 void SetMode (Mode eMode
);
187 void SetInsertObj(SdrObjKind eObj
);
188 void CreateDefaultObject();
189 Mode
GetMode() const { return eMode
; }
190 bool IsCreateOK() const { return bCreateOK
; }
196 bool IsPasteAllowed();
198 void ShowProperties();
199 void UpdatePropertyBrowserDelayed();
201 static void printPage( sal_Int32 nPage
, Printer
* pPrinter
, const OUString
& );
203 bool AdjustPageSize();
205 bool isInPaint() const { return mnPaintGuard
> 0; }
208 } // namespace basctl
210 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */