Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / basctl / source / inc / baside3.hxx
blob9c078e608d00b8cc9af3968d3a0797db702d6ebd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include "layout.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>
33 #include <memory>
35 class Printer;
36 class StarBASIC;
37 class SfxItemSet;
38 class SfxUndoManager;
39 class SdrUndoAction;
41 namespace basctl
44 class DlgEditor;
45 class DlgEdModel;
46 class DlgEdPage;
47 class DlgEdView;
49 class DialogWindowLayout;
50 class ObjectCatalog;
52 bool implImportDialog(weld::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& rLibName);
54 class DialogWindow: public BaseWindow
56 private:
57 DialogWindowLayout& m_rLayout;
58 std::unique_ptr<DlgEditor> m_pEditor;
59 std::unique_ptr<SfxUndoManager> m_pUndoMgr; // never nullptr
60 OUString m_sCurPath;
61 sal_uInt16 m_nControlSlotId;
63 protected:
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;
79 void InitSettings();
81 public:
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();
93 void UpdateBrowser();
94 void SaveDialog();
95 void ImportDialog();
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;
109 // print page
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
126 public:
127 DialogWindowLayout (vcl::Window* pParent, ObjectCatalog&);
128 virtual ~DialogWindowLayout() override;
129 virtual void dispose() override;
130 public:
131 void ShowPropertyBrowser ();
132 void UpdatePropertyBrowser ();
133 void DisablePropertyBrowser ();
134 public:
135 // Layout:
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 {};
141 protected:
142 // Layout:
143 virtual void OnFirstSize (long nWidth, long nHeight) override;
145 private:
146 // child window
147 VclPtr<DialogWindow> pChild;
148 // dockable windows:
149 // object catalog (owned by Shell)
150 ObjectCatalog& rObjectCatalog;
151 // property browser (created by this, deleted by toolkit)
152 VclPtr<PropBrw> pPropertyBrowser;
154 private:
155 void AddPropertyBrowser ();
156 private:
157 friend class DialogWindow;
161 } // namespace basctl
163 #endif // INCLUDED_BASCTL_SOURCE_INC_BASIDE3_HXX
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */