1*96821c26SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96821c26SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96821c26SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96821c26SAndrew Rist  * distributed with this work for additional information
6*96821c26SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96821c26SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96821c26SAndrew Rist  * "License"); you may not use this file except in compliance
9*96821c26SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96821c26SAndrew Rist  *
11*96821c26SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96821c26SAndrew Rist  *
13*96821c26SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96821c26SAndrew Rist  * software distributed under the License is distributed on an
15*96821c26SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96821c26SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96821c26SAndrew Rist  * specific language governing permissions and limitations
18*96821c26SAndrew Rist  * under the License.
19*96821c26SAndrew Rist  *
20*96821c26SAndrew Rist  *************************************************************/
21*96821c26SAndrew Rist 
22*96821c26SAndrew Rist 
23cdf0e10cSrcweir //
24cdf0e10cSrcweir #ifndef _MACRODLG_HXX
25cdf0e10cSrcweir #define _MACRODLG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svheader.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <bastype2.hxx>
30cdf0e10cSrcweir #include <bastype3.hxx>
31cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
32cdf0e10cSrcweir #include <vcl/fixed.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX //autogen
35cdf0e10cSrcweir #include <vcl/button.hxx>
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #define MACRO_CLOSE			10
39cdf0e10cSrcweir #define MACRO_OK_RUN		11
40cdf0e10cSrcweir #define MACRO_NEW 			12
41cdf0e10cSrcweir #define MACRO_EDIT			14
42cdf0e10cSrcweir #define MACRO_ORGANIZE		15
43cdf0e10cSrcweir #define MACRO_ASSIGN		16
44cdf0e10cSrcweir 
45cdf0e10cSrcweir #define MACROCHOOSER_ALL			1
46cdf0e10cSrcweir #define MACROCHOOSER_CHOOSEONLY		2
47cdf0e10cSrcweir #define MACROCHOOSER_RECORDING		3
48cdf0e10cSrcweir 
49cdf0e10cSrcweir class BasicManager;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class MacroChooser : public SfxModalDialog
52cdf0e10cSrcweir {
53cdf0e10cSrcweir private:
54cdf0e10cSrcweir 	FixedText 				aMacroNameTxt;
55cdf0e10cSrcweir 	Edit 					aMacroNameEdit;
56cdf0e10cSrcweir 	FixedText 				aMacroFromTxT;
57cdf0e10cSrcweir 	FixedText 				aMacrosSaveInTxt;
58cdf0e10cSrcweir 	BasicTreeListBox		aBasicBox;
59cdf0e10cSrcweir 	FixedText 				aMacrosInTxt;
60cdf0e10cSrcweir 	String	 				aMacrosInTxtBaseStr;
61cdf0e10cSrcweir 	SvTreeListBox			aMacroBox;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	PushButton				aRunButton;
64cdf0e10cSrcweir 	CancelButton 			aCloseButton;
65cdf0e10cSrcweir 	PushButton				aAssignButton;
66cdf0e10cSrcweir 	PushButton				aEditButton;
67cdf0e10cSrcweir 	PushButton				aNewDelButton;
68cdf0e10cSrcweir 	PushButton 				aOrganizeButton;
69cdf0e10cSrcweir 	HelpButton				aHelpButton;
70cdf0e10cSrcweir 	PushButton 				aNewLibButton;
71cdf0e10cSrcweir 	PushButton 				aNewModButton;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	sal_Bool				bNewDelIsDel;
74cdf0e10cSrcweir 	sal_Bool				bForceStoreBasic;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	sal_uInt16				nMode;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	DECL_LINK( MacroSelectHdl, SvTreeListBox * );
79cdf0e10cSrcweir 	DECL_LINK( MacroDoubleClickHdl, SvTreeListBox * );
80cdf0e10cSrcweir 	DECL_LINK( BasicSelectHdl, SvTreeListBox * );
81cdf0e10cSrcweir 	DECL_LINK( EditModifyHdl, Edit * );
82cdf0e10cSrcweir 	DECL_LINK( ButtonHdl, Button * );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	void				CheckButtons();
85cdf0e10cSrcweir 	void				SaveSetCurEntry( SvTreeListBox& rBox, SvLBoxEntry* pEntry );
86cdf0e10cSrcweir 	void				UpdateFields();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	void				EnableButton( Button& rButton, sal_Bool bEnable );
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	String				GetInfo( SbxVariable* pVar );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	void				StoreMacroDescription();
93cdf0e10cSrcweir 	void				RestoreMacroDescription();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir public:
96cdf0e10cSrcweir 						MacroChooser( Window* pParent, sal_Bool bCreateEntries = sal_True );
97cdf0e10cSrcweir 						~MacroChooser();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	SbMethod*			GetMacro();
100cdf0e10cSrcweir     void                DeleteMacro();
101cdf0e10cSrcweir 	SbMethod*			CreateMacro();
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	virtual short		Execute();
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	void				SetMode( sal_uInt16 nMode );
GetMode() const106cdf0e10cSrcweir 	sal_uInt16				GetMode() const { return nMode; }
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir #endif	// _MACRODLG_HXX
110