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 .
20 #ifndef INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
23 #include <com/sun/star/awt/XControlContainer.hpp>
24 #include <com/sun/star/container/XNameContainer.hpp>
25 #include <com/sun/star/datatransfer/DataFlavor.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
28 #include <o3tl/deleter.hxx>
29 #include <svl/SfxBroadcaster.hxx>
30 #include <svl/hint.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 #define DLGED_PAGE_WIDTH_MIN 1280
52 #define DLGED_PAGE_HEIGHT_MIN 1024
60 class DlgEdHint
: public SfxHint
77 DlgEdHint (Kind
, DlgEdObj
* pObj
);
78 virtual ~DlgEdHint() override
;
80 Kind
GetKind() const { return eKind
; }
81 DlgEdObj
* GetObject() const { return pDlgEdObj
; }
95 class DlgEditor
: public SfxBroadcaster
106 DECL_LINK(MarkTimeout
, Timer
*, void);
108 static void Print( Printer
* pPrinter
, const OUString
& rTitle
);
111 VclPtr
<ScrollBar
> pHScroll
;
112 VclPtr
<ScrollBar
> pVScroll
;
113 std::unique_ptr
<DlgEdModel
> pDlgEdModel
; // never nullptr
114 DlgEdPage
* pDlgEdPage
; // never nullptr
115 std::unique_ptr
<DlgEdView
> pDlgEdView
; // never nullptr
116 DlgEdForm
* pDlgEdForm
; // never nullptr
117 css::uno::Reference
< css::container::XNameContainer
> m_xUnoControlDialogModel
;
118 css::uno::Reference
< css::awt::XControlContainer
> m_xControlContainer
;
119 css::uno::Sequence
< css::datatransfer::DataFlavor
> m_ClipboardDataFlavors
;
120 css::uno::Sequence
< css::datatransfer::DataFlavor
> m_ClipboardDataFlavorsResource
;
121 css::uno::Reference
< css::util::XNumberFormatsSupplier
> m_xSupplier
;
122 std::unique_ptr
<DlgEdFactory
, o3tl::default_delete
<DlgEdFactory
>> pObjFac
; // never nullptr
123 vcl::Window
& rWindow
; // DialogWindow
124 std::unique_ptr
<DlgEdFunc
> pFunc
;
125 DialogWindowLayout
& rLayout
;
130 tools::Rectangle aPaintRect
;
131 bool bDialogModelChanged
;
134 css::uno::Reference
< css::frame::XModel
> m_xDocument
;
138 vcl::Window
&, DialogWindowLayout
&,
139 css::uno::Reference
<css::frame::XModel
> const& xModel
,
140 css::uno::Reference
<css::container::XNameContainer
> const & xDialogModel
142 virtual ~DlgEditor() override
;
144 vcl::Window
& GetWindow() const { return rWindow
; }
146 /** returns the control container associated with our window
150 css::uno::Reference
< css::awt::XControlContainer
> const &
151 GetWindowControlContainer();
153 void SetScrollBars( ScrollBar
* pHScroll
, ScrollBar
* pVScroll
);
154 void InitScrollBars();
155 ScrollBar
* GetHScroll() const { return pHScroll
; }
156 ScrollBar
* GetVScroll() const { return pVScroll
; }
158 void UpdateScrollBars();
160 void SetDialog (const css::uno::Reference
<css::container::XNameContainer
>& xUnoControlDialogModel
);
162 const css::uno::Reference
< css::container::XNameContainer
>& GetDialog() const
163 {return m_xUnoControlDialogModel
;}
165 css::uno::Reference
< css::util::XNumberFormatsSupplier
> const & GetNumberFormatsSupplier();
167 DlgEdModel
& GetModel() const { return *pDlgEdModel
; }
168 DlgEdView
& GetView() const { return *pDlgEdView
; }
169 DlgEdPage
& GetPage() const { return *pDlgEdPage
; }
176 void SetDialogModelChanged() { bDialogModelChanged
= true; }
178 bool IsModified () const;
179 void ClearModifyFlag();
181 void MouseButtonDown( const MouseEvent
& rMEvt
);
182 void MouseButtonUp( const MouseEvent
& rMEvt
);
183 void MouseMove( const MouseEvent
& rMEvt
);
184 void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
);
185 bool KeyInput( const KeyEvent
& rKEvt
);
187 void SetMode (Mode eMode
);
188 void SetInsertObj( sal_uInt16 eObj
);
189 void CreateDefaultObject();
190 Mode
GetMode() const { return eMode
; }
191 bool IsCreateOK() const { return bCreateOK
; }
197 bool IsPasteAllowed();
199 void ShowProperties();
200 void UpdatePropertyBrowserDelayed();
202 static void printPage( sal_Int32 nPage
, Printer
* pPrinter
, const OUString
& );
204 bool AdjustPageSize();
206 bool isInPaint() const { return mnPaintGuard
> 0; }
209 } // namespace basctl
211 #endif // INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */