LibreOffice Module basctl (master) 1
baside3.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include "dlged.hxx"
23#include "layout.hxx"
24#include "bastypes.hxx"
25#include "propbrw.hxx"
26#include <svl/undo.hxx>
27#include <memory>
28
29class Printer;
30class StarBASIC;
31class SfxItemSet;
32class SfxUndoManager;
33class SdrUndoAction;
34
35namespace basctl
36{
37
38class DlgEditor;
39class DlgEdModel;
40class DlgEdPage;
41class DlgEdView;
42
43class DialogWindowLayout;
44class ObjectCatalog;
45
46bool implImportDialog(weld::Window* pWin, const ScriptDocument& rDocument, const OUString& rLibName);
47
49{
50private:
52 std::unique_ptr<DlgEditor> m_pEditor;
53 std::unique_ptr<SfxUndoManager> m_pUndoMgr; // never nullptr
54 sal_uInt16 m_nControlSlotId;
55
56protected:
57 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
58 virtual void Resize() override;
59 virtual void dispose() override;
60
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;
67
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;
72 void InitSettings();
73
74public:
75 DialogWindow (DialogWindowLayout* pParent, ScriptDocument const& rDocument, const OUString& aLibName, const OUString& aName, css::uno::Reference<css::container::XNameContainer> const& xDialogModel);
76
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();
86 void UpdateBrowser();
87 void SaveDialog();
88 void ImportDialog();
89
90 virtual OUString GetTitle() override;
91 virtual EntryDescriptor CreateEntryDescriptor() override;
92 virtual void SetReadOnly (bool bReadOnly) override;
93 virtual bool IsReadOnly() override;
94
95 virtual void StoreData() override;
96 virtual bool IsModified() override;
97 bool IsPasteAllowed();
98
99 virtual SfxUndoManager* GetUndoManager() override;
100 // return number of pages to be printed
101 virtual sal_Int32 countPages( Printer* pPrinter ) override;
102 // print page
103 virtual void printPage (sal_Int32 nPage, Printer*) override;
104
105 virtual void Activating () override;
106 virtual void Deactivating () override;
107
108 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
109
110 virtual OUString GetHid () const override;
111 virtual ItemType GetType () const override;
112};
113
114
115// DialogWindowLayout
116
118{
119public:
121 virtual ~DialogWindowLayout() override;
122 virtual void dispose() override;
123public:
124 void ShowPropertyBrowser ();
125 void UpdatePropertyBrowser ();
127public:
128 // Layout:
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 {};
134protected:
135 // Layout:
136 virtual void OnFirstSize (tools::Long nWidth, tools::Long nHeight) override;
137
138private:
139 // dockable windows:
140 // object catalog (owned by Shell)
142 // property browser (created by this, deleted by toolkit)
144
145private:
146 void AddPropertyBrowser ();
147private:
148 friend class DialogWindow;
149};
150
151
152} // namespace basctl
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
friend class DialogWindow
Definition: bastypes.hxx:171
DialogWindowLayout(vcl::Window *pParent, ObjectCatalog &)
Definition: baside3.cxx:1202
virtual void OnFirstSize(tools::Long nWidth, tools::Long nHeight) override
Definition: baside3.cxx:1310
ObjectCatalog & rObjectCatalog
Definition: baside3.hxx:141
virtual void Deactivating() override
Definition: baside3.cxx:1270
virtual void Activating(BaseWindow &) override
Definition: baside3.cxx:1259
virtual void dispose() override
Definition: baside3.cxx:1215
VclPtr< PropBrw > pPropertyBrowser
Definition: baside3.hxx:143
virtual void ExecuteGlobal(SfxRequest &) override
Definition: baside3.cxx:1278
virtual void GetState(SfxItemSet &, unsigned nWhich) override
Definition: baside3.cxx:1296
virtual void UpdateDebug(bool) override
Definition: baside3.hxx:133
virtual ~DialogWindowLayout() override
Definition: baside3.cxx:1210
DialogWindowLayout & m_rLayout
Definition: baside3.hxx:51
virtual void KeyInput(const KeyEvent &rKEvt) override
Definition: baside3.cxx:165
virtual sal_Int32 countPages(Printer *pPrinter) override
Definition: baside3.cxx:1149
DlgEdView & GetView() const
Definition: baside3.cxx:1062
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Definition: baside3.cxx:1183
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: baside3.cxx:120
virtual void dispose() override
Definition: baside3.cxx:106
virtual EntryDescriptor CreateEntryDescriptor() override
Definition: baside3.cxx:1082
virtual void Resize() override
Definition: baside3.cxx:125
virtual void DoInit() override
Definition: baside3.cxx:233
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: baside3.cxx:133
bool RenameDialog(const OUString &rNewName)
Definition: baside3.cxx:581
std::unique_ptr< SfxUndoManager > m_pUndoMgr
Definition: baside3.hxx:53
virtual void printPage(sal_Int32 nPage, Printer *) override
Definition: baside3.cxx:1154
virtual OUString GetHid() const override
Definition: baside3.cxx:1188
virtual void SetReadOnly(bool bReadOnly) override
Definition: baside3.cxx:1090
virtual bool IsModified() override
Definition: baside3.cxx:1067
DlgEdModel & GetModel() const
Definition: baside3.cxx:1052
sal_uInt16 m_nControlSlotId
Definition: baside3.hxx:54
virtual void Command(const CommandEvent &rCEvt) override
Definition: baside3.cxx:194
virtual OUString GetTitle() override
Definition: baside3.cxx:1077
virtual void LoseFocus() override
Definition: baside3.cxx:112
virtual void StoreData() override
Definition: baside3.cxx:1105
virtual void DoScroll(Scrollable *pCurScrollBar) override
Definition: baside3.cxx:238
DlgEditor & GetEditor() const
Definition: baside3.hxx:79
std::unique_ptr< DlgEditor > m_pEditor
Definition: baside3.hxx:52
virtual ItemType GetType() const override
Definition: baside3.cxx:1193
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: baside3.cxx:160
virtual bool IsReadOnly() override
Definition: baside3.cxx:1095
virtual void GetState(SfxItemSet &) override
Definition: baside3.cxx:243
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: baside3.cxx:141
DlgEdPage & GetPage() const
Definition: baside3.cxx:1057
virtual void Deactivating() override
Definition: baside3.cxx:1141
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: baside3.cxx:1159
css::uno::Reference< css::container::XNameContainer > const & GetDialog() const
Definition: baside3.cxx:576
virtual void Activating() override
Definition: baside3.cxx:1135
static void NotifyUndoActionHdl(std::unique_ptr< SdrUndoAction >)
Definition: baside3.cxx:226
virtual void ExecuteCommand(SfxRequest &rReq) override
Definition: baside3.cxx:390
virtual SfxUndoManager * GetUndoManager() override
Definition: baside3.cxx:1072
A docking window that contains a tree of the currently loaded macros.
encapsulates a document which contains Basic scripts and dialogs
bool implImportDialog(weld::Window *pWin, const ScriptDocument &rDocument, const OUString &aLibName)
Definition: baside3.cxx:784
ItemType
Definition: sbxitem.hxx:28
long Long