update credits
[LibreOffice.git] / basctl / source / inc / baside3.hxx
blob49358a97a2fcaca530e24b51b70a378496d30071
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 "../basicide/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 <com/sun/star/script/XLibraryContainer.hpp>
35 #include <boost/scoped_ptr.hpp>
37 class Printer;
38 class StarBASIC;
39 class SfxItemSet;
40 class SfxUndoManager;
42 namespace basctl
45 class DlgEditor;
46 class DlgEdModel;
47 class DlgEdPage;
48 class DlgEdView;
50 class DialogWindowLayout;
51 class ObjectCatalog;
53 bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& aLibName );
55 class DialogWindow: public BaseWindow
57 private:
58 DialogWindowLayout& rLayout;
59 boost::scoped_ptr<DlgEditor> pEditor;
60 boost::scoped_ptr<SfxUndoManager> pUndoMgr; // never nullptr
61 OUString aCurPath;
63 protected:
64 virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
65 virtual void Resize() SAL_OVERRIDE;
66 virtual void dispose() SAL_OVERRIDE;
68 virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
69 virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
70 virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
71 virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
72 virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
73 virtual void LoseFocus() SAL_OVERRIDE;
75 DECL_STATIC_LINK( DialogWindow, NotifyUndoActionHdl, SfxUndoAction * );
76 virtual void DoInit() SAL_OVERRIDE;
77 virtual void DoScroll( ScrollBar* pCurScrollBar ) SAL_OVERRIDE;
78 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
79 void InitSettings(bool bFont, bool bForeground, bool bBackground);
81 public:
82 TYPEINFO_OVERRIDE();
83 DialogWindow (DialogWindowLayout* pParent, ScriptDocument const& rDocument, const OUString& aLibName, const OUString& aName, com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> const& xDialogModel);
84 DialogWindow( DialogWindow* pCurView ); // never implemented
86 virtual void ExecuteCommand( SfxRequest& rReq ) SAL_OVERRIDE;
87 virtual void GetState( SfxItemSet& ) SAL_OVERRIDE;
88 DlgEditor& GetEditor() const { return *pEditor; }
89 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetDialog() const;
90 DlgEdModel& GetModel() const;
91 DlgEdPage& GetPage() const;
92 DlgEdView& GetView() const;
93 bool RenameDialog( const OUString& rNewName );
94 void DisableBrowser();
95 void UpdateBrowser();
96 bool SaveDialog();
97 bool ImportDialog();
99 virtual OUString GetTitle() SAL_OVERRIDE;
100 virtual EntryDescriptor CreateEntryDescriptor() SAL_OVERRIDE;
101 virtual void SetReadOnly (bool bReadOnly) SAL_OVERRIDE;
102 virtual bool IsReadOnly() SAL_OVERRIDE;
104 virtual void StoreData() SAL_OVERRIDE;
105 virtual bool IsModified() SAL_OVERRIDE;
106 virtual bool IsPasteAllowed() SAL_OVERRIDE;
108 virtual svl::IUndoManager* GetUndoManager() SAL_OVERRIDE;
109 // return number of pages to be printed
110 virtual sal_Int32 countPages( Printer* pPrinter ) SAL_OVERRIDE;
111 // print page
112 virtual void printPage (sal_Int32 nPage, Printer*) SAL_OVERRIDE;
114 virtual void Activating () SAL_OVERRIDE;
115 virtual void Deactivating () SAL_OVERRIDE;
117 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
119 virtual char const* GetHid () const SAL_OVERRIDE;
120 virtual ItemType GetType () const SAL_OVERRIDE;
124 // DialogWindowLayout
126 class DialogWindowLayout : public Layout
128 public:
129 DialogWindowLayout (vcl::Window* pParent, ObjectCatalog&);
130 virtual ~DialogWindowLayout();
131 virtual void dispose() SAL_OVERRIDE;
132 public:
133 void ShowPropertyBrowser ();
134 void UpdatePropertyBrowser ();
135 void DisablePropertyBrowser ();
136 public:
137 // Layout:
138 virtual void Activating (BaseWindow&) SAL_OVERRIDE;
139 virtual void Deactivating () SAL_OVERRIDE;
140 virtual void ExecuteGlobal (SfxRequest&) SAL_OVERRIDE;
141 virtual void GetState (SfxItemSet&, unsigned nWhich) SAL_OVERRIDE;
142 virtual void UpdateDebug (bool) SAL_OVERRIDE {};
143 protected:
144 // Layout:
145 virtual void OnFirstSize (long nWidth, long nHeight) SAL_OVERRIDE;
147 private:
148 // child window
149 VclPtr<DialogWindow> pChild;
150 // dockable windows:
151 // object catalog (owned by Shell)
152 ObjectCatalog& rObjectCatalog;
153 // property browser (created by this, deleted by toolkit)
154 VclPtr<PropBrw> pPropertyBrowser;
156 private:
157 void AddPropertyBrowser ();
158 private:
159 friend class DialogWindow;
163 } // namespace basctl
165 #endif // INCLUDED_BASCTL_SOURCE_INC_BASIDE3_HXX
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */