bump product version to 4.1.6.2
[LibreOffice.git] / basctl / source / basicide / macrodlg.hxx
blob1d1854d4bda4ff9ec494586be65f9c6e3c9f71dd
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 BASCTL_MACRODLG_HXX
21 #define BASCTL_MACRODLG_HXX
23 #include <svheader.hxx>
25 #include <bastype2.hxx>
26 #include <bastype3.hxx>
27 #include <sfx2/basedlgs.hxx>
28 #include <vcl/fixed.hxx>
30 #include <vcl/button.hxx>
32 namespace basctl
35 enum MacroExitCode {
36 Macro_Close = 10,
37 Macro_OkRun = 11,
38 Macro_New = 12,
39 Macro_Edit = 14,
42 class MacroChooser : public SfxModalDialog
44 public:
45 enum Mode {
46 All = 1,
47 ChooseOnly = 2,
48 Recording = 3,
51 private:
52 Edit* m_pMacroNameEdit;
53 FixedText* m_pMacroFromTxT;
54 FixedText* m_pMacrosSaveInTxt;
55 TreeListBox* m_pBasicBox;
56 FixedText* m_pMacrosInTxt;
57 String m_aMacrosInTxtBaseStr;
58 SvTreeListBox* m_pMacroBox;
60 PushButton* m_pRunButton;
61 CloseButton* m_pCloseButton;
62 PushButton* m_pAssignButton;
63 PushButton* m_pEditButton;
64 PushButton* m_pDelButton;
65 PushButton* m_pOrganizeButton;
66 PushButton* m_pNewLibButton;
67 PushButton* m_pNewModButton;
69 bool bNewDelIsDel;
70 bool bForceStoreBasic;
72 Mode nMode;
74 DECL_LINK( MacroSelectHdl, SvTreeListBox * );
75 DECL_LINK(MacroDoubleClickHdl, void *);
76 DECL_LINK( BasicSelectHdl, SvTreeListBox * );
77 DECL_LINK( EditModifyHdl, Edit * );
78 DECL_LINK( ButtonHdl, Button * );
80 void CheckButtons();
81 void SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry );
82 void UpdateFields();
84 void EnableButton( Button& rButton, bool bEnable );
86 String GetInfo( SbxVariable* pVar );
88 void StoreMacroDescription();
89 void RestoreMacroDescription();
91 public:
92 MacroChooser( Window* pParent, bool bCreateEntries = true );
93 ~MacroChooser();
95 SbMethod* GetMacro();
96 void DeleteMacro();
97 SbMethod* CreateMacro();
99 virtual short Execute();
101 void SetMode (Mode);
102 Mode GetMode () const { return nMode; }
105 } // namespace basctl
107 #endif // BASCTL_MACRODLG_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */