Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / basctl / source / basicide / macrodlg.hxx
blob8a0e1ff16a93a8158b8b034ac523133ece8f3240
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_BASICIDE_MACRODLG_HXX
21 #define INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
23 #include <bastype2.hxx>
24 #include <sfx2/basedlgs.hxx>
26 #include <com/sun/star/frame/XFrame.hpp>
28 #include <vcl/button.hxx>
30 namespace basctl
33 enum MacroExitCode {
34 Macro_Close = 10,
35 Macro_OkRun = 11,
36 Macro_New = 12,
37 Macro_Edit = 14,
40 class MacroChooser : public SfxModalDialog
42 public:
43 enum Mode {
44 All = 1,
45 ChooseOnly = 2,
46 Recording = 3,
49 private:
50 VclPtr<Edit> m_pMacroNameEdit;
51 VclPtr<FixedText> m_pMacroFromTxT;
52 VclPtr<FixedText> m_pMacrosSaveInTxt;
53 VclPtr<TreeListBox> m_pBasicBox;
54 VclPtr<FixedText> m_pMacrosInTxt;
55 OUString m_aMacrosInTxtBaseStr;
56 VclPtr<SvTreeListBox> m_pMacroBox;
58 VclPtr<PushButton> m_pRunButton;
59 VclPtr<CloseButton> m_pCloseButton;
60 VclPtr<PushButton> m_pAssignButton;
61 VclPtr<PushButton> m_pEditButton;
62 VclPtr<PushButton> m_pDelButton;
63 VclPtr<PushButton> m_pOrganizeButton;
64 VclPtr<PushButton> m_pNewLibButton;
65 VclPtr<PushButton> m_pNewModButton;
67 // For forwarding to Assign dialog
68 ::css::uno::Reference< ::css::frame::XFrame > m_xDocumentFrame;
70 bool bNewDelIsDel;
71 bool bForceStoreBasic;
73 Mode nMode;
75 DECL_LINK( MacroSelectHdl, SvTreeListBox *, void );
76 DECL_LINK( MacroDoubleClickHdl, SvTreeListBox*, bool );
77 DECL_LINK( BasicSelectHdl, SvTreeListBox *, void );
78 DECL_LINK( EditModifyHdl, Edit&, void );
79 DECL_LINK( ButtonHdl, Button *, void );
81 void CheckButtons();
82 void SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry );
83 void UpdateFields();
85 void EnableButton( Button& rButton, bool bEnable );
87 static OUString GetInfo( SbxVariable* pVar );
89 void StoreMacroDescription();
90 void RestoreMacroDescription();
92 public:
93 MacroChooser( vcl::Window* pParent, const ::css::uno::Reference< ::css::frame::XFrame >& xDocFrame, bool bCreateEntries );
94 virtual ~MacroChooser() override;
95 virtual void dispose() override;
97 SbMethod* GetMacro();
98 void DeleteMacro();
99 SbMethod* CreateMacro();
101 virtual short Execute() override;
103 void SetMode (Mode);
104 Mode GetMode () const { return nMode; }
107 } // namespace basctl
109 #endif // INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */