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