bump product version to 5.0.4.1
[LibreOffice.git] / basctl / source / basicide / macrodlg.hxx
blobc9c36cee13a60550f25ef1093d15181d57ce49a0
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 <vcl/button.hxx>
28 namespace basctl
31 enum MacroExitCode {
32 Macro_Close = 10,
33 Macro_OkRun = 11,
34 Macro_New = 12,
35 Macro_Edit = 14,
38 class MacroChooser : public SfxModalDialog
40 public:
41 enum Mode {
42 All = 1,
43 ChooseOnly = 2,
44 Recording = 3,
47 private:
48 VclPtr<Edit> m_pMacroNameEdit;
49 VclPtr<FixedText> m_pMacroFromTxT;
50 VclPtr<FixedText> m_pMacrosSaveInTxt;
51 VclPtr<TreeListBox> m_pBasicBox;
52 VclPtr<FixedText> m_pMacrosInTxt;
53 OUString m_aMacrosInTxtBaseStr;
54 VclPtr<SvTreeListBox> m_pMacroBox;
56 VclPtr<PushButton> m_pRunButton;
57 VclPtr<CloseButton> m_pCloseButton;
58 VclPtr<PushButton> m_pAssignButton;
59 VclPtr<PushButton> m_pEditButton;
60 VclPtr<PushButton> m_pDelButton;
61 VclPtr<PushButton> m_pOrganizeButton;
62 VclPtr<PushButton> m_pNewLibButton;
63 VclPtr<PushButton> m_pNewModButton;
65 bool bNewDelIsDel;
66 bool bForceStoreBasic;
68 Mode nMode;
70 DECL_LINK( MacroSelectHdl, SvTreeListBox * );
71 DECL_LINK(MacroDoubleClickHdl, void *);
72 DECL_LINK( BasicSelectHdl, SvTreeListBox * );
73 DECL_LINK( EditModifyHdl, Edit * );
74 DECL_LINK( ButtonHdl, Button * );
76 void CheckButtons();
77 void SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry );
78 void UpdateFields();
80 void EnableButton( Button& rButton, bool bEnable );
82 static OUString GetInfo( SbxVariable* pVar );
84 void StoreMacroDescription();
85 void RestoreMacroDescription();
87 public:
88 MacroChooser( vcl::Window* pParent, bool bCreateEntries = true );
89 virtual ~MacroChooser();
90 virtual void dispose() SAL_OVERRIDE;
92 SbMethod* GetMacro();
93 void DeleteMacro();
94 SbMethod* CreateMacro();
96 virtual short Execute() SAL_OVERRIDE;
98 void SetMode (Mode);
99 Mode GetMode () const { return nMode; }
102 } // namespace basctl
104 #endif // INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */