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_BASIDE3_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_BASIDE3_HXX
24 #include "bastypes.hxx"
25 #include "propbrw.hxx"
27 #include <svl/undo.hxx>
28 #include <vcl/dialog.hxx>
29 #include <vcl/button.hxx>
30 #include <vcl/lstbox.hxx>
31 #include <vcl/fixed.hxx>
49 class DialogWindowLayout
;
52 bool implImportDialog(weld::Window
* pWin
, const OUString
& rCurPath
, const ScriptDocument
& rDocument
, const OUString
& rLibName
);
54 class DialogWindow
: public BaseWindow
57 DialogWindowLayout
& m_rLayout
;
58 std::unique_ptr
<DlgEditor
> m_pEditor
;
59 std::unique_ptr
<SfxUndoManager
> m_pUndoMgr
; // never nullptr
61 sal_uInt16 m_nControlSlotId
;
64 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
65 virtual void Resize() override
;
66 virtual void dispose() override
;
68 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
69 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
70 virtual void MouseMove( const MouseEvent
& rMEvt
) override
;
71 virtual void KeyInput( const KeyEvent
& rKEvt
) override
;
72 virtual void Command( const CommandEvent
& rCEvt
) override
;
73 virtual void LoseFocus() override
;
75 DECL_STATIC_LINK( DialogWindow
, NotifyUndoActionHdl
, SdrUndoAction
*, void );
76 virtual void DoInit() override
;
77 virtual void DoScroll( ScrollBar
* pCurScrollBar
) override
;
78 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
82 DialogWindow (DialogWindowLayout
* pParent
, ScriptDocument
const& rDocument
, const OUString
& aLibName
, const OUString
& aName
, css::uno::Reference
<css::container::XNameContainer
> const& xDialogModel
);
84 virtual void ExecuteCommand( SfxRequest
& rReq
) override
;
85 virtual void GetState( SfxItemSet
& ) override
;
86 DlgEditor
& GetEditor() const { return *m_pEditor
; }
87 css::uno::Reference
< css::container::XNameContainer
> const & GetDialog() const;
88 DlgEdModel
& GetModel() const;
89 DlgEdPage
& GetPage() const;
90 DlgEdView
& GetView() const;
91 bool RenameDialog( const OUString
& rNewName
);
92 void DisableBrowser();
97 virtual OUString
GetTitle() override
;
98 virtual EntryDescriptor
CreateEntryDescriptor() override
;
99 virtual void SetReadOnly (bool bReadOnly
) override
;
100 virtual bool IsReadOnly() override
;
102 virtual void StoreData() override
;
103 virtual bool IsModified() override
;
104 bool IsPasteAllowed();
106 virtual svl::IUndoManager
* GetUndoManager() override
;
107 // return number of pages to be printed
108 virtual sal_Int32
countPages( Printer
* pPrinter
) override
;
110 virtual void printPage (sal_Int32 nPage
, Printer
*) override
;
112 virtual void Activating () override
;
113 virtual void Deactivating () override
;
115 virtual css::uno::Reference
< css::accessibility::XAccessible
> CreateAccessible() override
;
117 virtual char const* GetHid () const override
;
118 virtual ItemType
GetType () const override
;
122 // DialogWindowLayout
124 class DialogWindowLayout
: public Layout
127 DialogWindowLayout (vcl::Window
* pParent
, ObjectCatalog
&);
128 virtual ~DialogWindowLayout() override
;
129 virtual void dispose() override
;
131 void ShowPropertyBrowser ();
132 void UpdatePropertyBrowser ();
133 void DisablePropertyBrowser ();
136 virtual void Activating (BaseWindow
&) override
;
137 virtual void Deactivating () override
;
138 virtual void ExecuteGlobal (SfxRequest
&) override
;
139 virtual void GetState (SfxItemSet
&, unsigned nWhich
) override
;
140 virtual void UpdateDebug (bool) override
{};
143 virtual void OnFirstSize (long nWidth
, long nHeight
) override
;
147 VclPtr
<DialogWindow
> pChild
;
149 // object catalog (owned by Shell)
150 ObjectCatalog
& rObjectCatalog
;
151 // property browser (created by this, deleted by toolkit)
152 VclPtr
<PropBrw
> pPropertyBrowser
;
155 void AddPropertyBrowser ();
157 friend class DialogWindow
;
161 } // namespace basctl
163 #endif // INCLUDED_BASCTL_SOURCE_INC_BASIDE3_HXX
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */