merge the formfield patch from ooo-build
[ooovba.git] / basctl / source / basicide / macrodlg.hxx
blob638fb70b349cb9080ffb7a4ce595d806940a1329
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: macrodlg.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _MACRODLG_HXX
32 #define _MACRODLG_HXX
34 #include <svheader.hxx>
36 #include <bastype2.hxx>
37 #include <bastype3.hxx>
38 #include <sfx2/basedlgs.hxx>
39 #include <vcl/fixed.hxx>
41 #ifndef _SV_BUTTON_HXX //autogen
42 #include <vcl/button.hxx>
43 #endif
45 #define MACRO_CLOSE 10
46 #define MACRO_OK_RUN 11
47 #define MACRO_NEW 12
48 #define MACRO_EDIT 14
49 #define MACRO_ORGANIZE 15
50 #define MACRO_ASSIGN 16
52 #define MACROCHOOSER_ALL 1
53 #define MACROCHOOSER_CHOOSEONLY 2
54 #define MACROCHOOSER_RECORDING 3
56 class BasicManager;
58 class MacroChooser : public SfxModalDialog
60 private:
61 FixedText aMacroNameTxt;
62 Edit aMacroNameEdit;
63 FixedText aMacroFromTxT;
64 FixedText aMacrosSaveInTxt;
65 BasicTreeListBox aBasicBox;
66 FixedText aMacrosInTxt;
67 String aMacrosInTxtBaseStr;
68 SvTreeListBox aMacroBox;
70 PushButton aRunButton;
71 CancelButton aCloseButton;
72 PushButton aAssignButton;
73 PushButton aEditButton;
74 PushButton aNewDelButton;
75 PushButton aOrganizeButton;
76 HelpButton aHelpButton;
77 PushButton aNewLibButton;
78 PushButton aNewModButton;
80 BOOL bNewDelIsDel;
81 BOOL bForceStoreBasic;
83 USHORT nMode;
85 DECL_LINK( MacroSelectHdl, SvTreeListBox * );
86 DECL_LINK( MacroDoubleClickHdl, SvTreeListBox * );
87 DECL_LINK( BasicSelectHdl, SvTreeListBox * );
88 DECL_LINK( EditModifyHdl, Edit * );
89 DECL_LINK( ButtonHdl, Button * );
91 void CheckButtons();
92 void SaveSetCurEntry( SvTreeListBox& rBox, SvLBoxEntry* pEntry );
93 void UpdateFields();
95 void EnableButton( Button& rButton, BOOL bEnable );
97 String GetInfo( SbxVariable* pVar );
99 void StoreMacroDescription();
100 void RestoreMacroDescription();
102 public:
103 MacroChooser( Window* pParent, BOOL bCreateEntries = TRUE );
104 ~MacroChooser();
106 SbMethod* GetMacro();
107 void DeleteMacro();
108 SbMethod* CreateMacro();
110 virtual short Execute();
112 void SetMode( USHORT nMode );
113 USHORT GetMode() const { return nMode; }
116 #endif // _MACRODLG_HXX