xref: /aoo4110/main/sfx2/inc/sfx2/macropg.hxx (revision b1cdbd2c)
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 #ifndef _MACROPG_HXX
24 #define _MACROPG_HXX
25 
26 #include "sal/config.h"
27 #include "sfx2/dllapi.h"
28 
29 #include <sfx2/basedlgs.hxx>
30 #include <sfx2/tabdlg.hxx>
31 #include <svl/macitem.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <com/sun/star/frame/XFrame.hpp>
34 
35 class _SfxMacroTabPage;
36 class SvStringsDtor;
37 class SvTabListBox;
38 class Edit;
39 class String;
40 class SfxObjectShell;
41 
42 typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
43 typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
44 
45 class SfxConfigGroupListBox_Impl;
46 class SfxConfigFunctionListBox_Impl;
47 
48 class _HeaderTabListBox;
49 class _SfxMacroTabPage_Impl;
50 
51 class SFX2_DLLPUBLIC _SfxMacroTabPage : public SfxTabPage
52 {
53 	SvxMacroTableDtor			aTbl;
54 //#if 0 // _SOLAR__PRIVATE
55 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
56 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
57 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
58 
59 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
60 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
61 
62 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
63 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit* );
64     DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
65 //#endif
66 protected:
67 	_SfxMacroTabPage_Impl*		mpImpl;
68 
69 								_SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
70 
71 	void						InitAndSetHandler();
72 	void						FillEvents();
73 	void						FillMacroList();
74 	void						EnableButtons( const String& rLanguage );
75 
76 public:
77 
78 	virtual						~_SfxMacroTabPage();
79 
80 	void						AddEvent( const String & rEventName, sal_uInt16 nEventId );
81 
82 	const SvxMacroTableDtor&	GetMacroTbl() const;
83 	void						SetMacroTbl( const SvxMacroTableDtor& rTbl );
84 	void						ClearMacroTbl();
85 
86 	virtual void				ScriptChanged( const String& rLanguage );
87 
88 	// zum setzen / abfragen der Links
89 	void						SetGetRangeLink( FNGetRangeHdl pFn );
90 	FNGetRangeHdl				GetGetRangeLink() const;
91 	void						SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn );
92 	FNGetMacrosOfRangeHdl		GetGetMacrosOfRangeLink() const;
93 
94 	// --------- Erben aus der Basis -------------
95 	virtual	sal_Bool				FillItemSet( SfxItemSet& rSet );
96 	virtual	void				Reset( const SfxItemSet& rSet );
97 
98 	void						SetReadOnly( sal_Bool bSet );
99 	sal_Bool						IsReadOnly() const;
100 	void						SelectEvent( const String& rEventName, sal_uInt16 nEventId );
101 };
102 
GetMacroTbl() const103 inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
104 {
105 	return aTbl;
106 }
107 
SetMacroTbl(const SvxMacroTableDtor & rTbl)108 inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
109 {
110 	aTbl = rTbl;
111 }
112 
ClearMacroTbl()113 inline void _SfxMacroTabPage::ClearMacroTbl()
114 {
115 	aTbl.DelDtor();
116 }
117 
118 class SFX2_DLLPUBLIC SfxMacroTabPage : public _SfxMacroTabPage
119 {
120 public:
121 	SfxMacroTabPage(
122         Window* pParent,
123         const ResId& rId,
124         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
125 		const SfxItemSet& rSet
126     );
127 
128 	// --------- Erben aus der Basis -------------
129 	static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
130 };
131 
132 class SFX2_DLLPUBLIC SfxMacroAssignDlg : public SfxSingleTabDialog
133 {
134 public:
135     SfxMacroAssignDlg(
136         Window* pParent,
137         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
138         SfxItemSet& rSet );
139     SfxMacroAssignDlg(
140         Window* pParent,
141         const SfxObjectShell* _pShell,
142         SfxItemSet& rSet );
143 	virtual	~SfxMacroAssignDlg();
144 };
145 
146 #endif
147