Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / basctl / source / inc / baside3.hxx
blob23bffd38eba357699ff0675b542ea27b7b189f9d
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 #pragma once
22 #include "dlged.hxx"
23 #include "layout.hxx"
24 #include "bastypes.hxx"
25 #include "propbrw.hxx"
26 #include <svl/undo.hxx>
27 #include <memory>
29 class Printer;
30 class StarBASIC;
31 class SfxItemSet;
32 class SfxUndoManager;
33 class SdrUndoAction;
35 namespace basctl
38 class DlgEditor;
39 class DlgEdModel;
40 class DlgEdPage;
41 class DlgEdView;
43 class DialogWindowLayout;
44 class ObjectCatalog;
46 bool implImportDialog(weld::Window* pWin, const ScriptDocument& rDocument, const OUString& rLibName);
48 class DialogWindow: public BaseWindow
50 private:
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;
56 protected:
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;
72 void InitSettings();
74 public:
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();
86 void UpdateBrowser();
87 void SaveDialog();
88 void ImportDialog();
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;
102 // print page
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
119 public:
120 DialogWindowLayout (vcl::Window* pParent, ObjectCatalog&);
121 virtual ~DialogWindowLayout() override;
122 virtual void dispose() override;
123 public:
124 void ShowPropertyBrowser ();
125 void UpdatePropertyBrowser ();
126 void DisablePropertyBrowser ();
127 public:
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 {};
134 protected:
135 // Layout:
136 virtual void OnFirstSize (tools::Long nWidth, tools::Long nHeight) override;
138 private:
139 // dockable windows:
140 // object catalog (owned by Shell)
141 ObjectCatalog& rObjectCatalog;
142 // property browser (created by this, deleted by toolkit)
143 VclPtr<PropBrw> pPropertyBrowser;
145 private:
146 void AddPropertyBrowser ();
147 private:
148 friend class DialogWindow;
152 } // namespace basctl
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */