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 .
24 #include "bastypes.hxx"
25 #include "propbrw.hxx"
26 #include <svl/undo.hxx>
43 class DialogWindowLayout
;
46 bool implImportDialog(weld::Window
* pWin
, const ScriptDocument
& rDocument
, const OUString
& rLibName
);
48 class DialogWindow
: public BaseWindow
51 DialogWindowLayout
& m_rLayout
;
52 std::unique_ptr
<DlgEditor
> m_pEditor
;
53 std::unique_ptr
<SfxUndoManager
> m_pUndoMgr
; // never nullptr
54 sal_uInt16 m_nControlSlotId
;
57 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
58 virtual void Resize() override
;
59 virtual void dispose() override
;
61 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
62 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
63 virtual void MouseMove( const MouseEvent
& rMEvt
) override
;
64 virtual void KeyInput( const KeyEvent
& rKEvt
) override
;
65 virtual void Command( const CommandEvent
& rCEvt
) override
;
66 virtual void LoseFocus() override
;
68 static void NotifyUndoActionHdl( std::unique_ptr
<SdrUndoAction
> );
69 virtual void DoInit() override
;
70 virtual void DoScroll( Scrollable
* pCurScrollBar
) override
;
71 virtual void DataChanged( const DataChangedEvent
& rDCEvt
) override
;
75 DialogWindow (DialogWindowLayout
* pParent
, ScriptDocument
const& rDocument
, const OUString
& aLibName
, const OUString
& aName
, css::uno::Reference
<css::container::XNameContainer
> const& xDialogModel
);
77 virtual void ExecuteCommand( SfxRequest
& rReq
) override
;
78 virtual void GetState( SfxItemSet
& ) override
;
79 DlgEditor
& GetEditor() const { return *m_pEditor
; }
80 css::uno::Reference
< css::container::XNameContainer
> const & GetDialog() const;
81 DlgEdModel
& GetModel() const;
82 DlgEdPage
& GetPage() const;
83 DlgEdView
& GetView() const;
84 bool RenameDialog( const OUString
& rNewName
);
85 void DisableBrowser();
90 virtual OUString
GetTitle() override
;
91 virtual EntryDescriptor
CreateEntryDescriptor() override
;
92 virtual void SetReadOnly (bool bReadOnly
) override
;
93 virtual bool IsReadOnly() override
;
95 virtual void StoreData() override
;
96 virtual bool IsModified() override
;
97 bool IsPasteAllowed();
99 virtual SfxUndoManager
* GetUndoManager() override
;
100 // return number of pages to be printed
101 virtual sal_Int32
countPages( Printer
* pPrinter
) override
;
103 virtual void printPage (sal_Int32 nPage
, Printer
*) override
;
105 virtual void Activating () override
;
106 virtual void Deactivating () override
;
108 virtual css::uno::Reference
< css::accessibility::XAccessible
> CreateAccessible() override
;
110 virtual OUString
GetHid () const override
;
111 virtual SbxItemType
GetSbxType () const override
;
115 // DialogWindowLayout
117 class DialogWindowLayout
: public Layout
120 DialogWindowLayout (vcl::Window
* pParent
, ObjectCatalog
&);
121 virtual ~DialogWindowLayout() override
;
122 virtual void dispose() override
;
124 void ShowPropertyBrowser ();
125 void UpdatePropertyBrowser ();
126 void DisablePropertyBrowser ();
129 virtual void Activating (BaseWindow
&) override
;
130 virtual void Deactivating () override
;
131 virtual void ExecuteGlobal (SfxRequest
&) override
;
132 virtual void GetState (SfxItemSet
&, unsigned nWhich
) override
;
133 virtual void UpdateDebug (bool) override
{};
136 virtual void OnFirstSize (tools::Long nWidth
, tools::Long nHeight
) override
;
140 // object catalog (owned by Shell)
141 ObjectCatalog
& rObjectCatalog
;
142 // property browser (created by this, deleted by toolkit)
143 VclPtr
<PropBrw
> pPropertyBrowser
;
146 void AddPropertyBrowser ();
148 friend class DialogWindow
;
152 } // namespace basctl
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */