xref: /trunk/main/cui/source/inc/macroass.hxx (revision c4eee24d)
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 _MACROASS_HXX
24 #define _MACROASS_HXX
25 
26 #include "sal/config.h"
27 
28 #include <sfx2/basedlgs.hxx>
29 #include <sfx2/tabdlg.hxx>
30 #include <svl/macitem.hxx>
31 #include <vcl/lstbox.hxx>
32 #include <com/sun/star/frame/XFrame.hpp>
33 
34 class _SfxMacroTabPage;
35 class SvStringsDtor;
36 class SvTabListBox;
37 class Edit;
38 class String;
39 
40 class SfxConfigGroupListBox_Impl;
41 class SfxConfigFunctionListBox_Impl;
42 class _HeaderTabListBox;
43 class _SfxMacroTabPage_Impl;
44 
45 class _SfxMacroTabPage : public SfxTabPage
46 {
47 	SvxMacroTableDtor			aTbl;
48 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
49 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
50 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
51 
52 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
53 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
54 
55     DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
56 
57 protected:
58 	_SfxMacroTabPage_Impl*		mpImpl;
59 
60 								_SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
61 
62 	void						InitAndSetHandler();
63 	void						FillEvents();
64 	void						FillMacroList();
65 	void						EnableButtons();
66 
67 public:
68 
69 	virtual						~_SfxMacroTabPage();
70 
71 	void						AddEvent( const String & rEventName, sal_uInt16 nEventId );
72 
73 	const SvxMacroTableDtor&	GetMacroTbl() const;
74 	void						SetMacroTbl( const SvxMacroTableDtor& rTbl );
75 	void						ClearMacroTbl();
76 
77 	virtual void				ScriptChanged();
78 	virtual void				PageCreated (SfxAllItemSet aSet);
79 
80 	// --------- Erben aus der Basis -------------
81 	virtual	sal_Bool				FillItemSet( SfxItemSet& rSet );
82 	virtual	void				Reset( const SfxItemSet& rSet );
83 
84 	sal_Bool						IsReadOnly() const;
85 };
86 
GetMacroTbl() const87 inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
88 {
89 	return aTbl;
90 }
91 
SetMacroTbl(const SvxMacroTableDtor & rTbl)92 inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
93 {
94 	aTbl = rTbl;
95 }
96 
ClearMacroTbl()97 inline void _SfxMacroTabPage::ClearMacroTbl()
98 {
99 	aTbl.DelDtor();
100 }
101 
102 class SfxMacroTabPage : public _SfxMacroTabPage
103 {
104 public:
105 	SfxMacroTabPage(
106         Window* pParent,
107         const ResId& rId,
108         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
109 		const SfxItemSet& rSet
110     );
111 
112 	// --------- Erben aus der Basis -------------
113 	static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
114 };
115 
116 class SfxMacroAssignDlg : public SfxSingleTabDialog
117 {
118 public:
119     SfxMacroAssignDlg(
120         Window* pParent,
121         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
122         const SfxItemSet& rSet );
123 	virtual	~SfxMacroAssignDlg();
124 };
125 
126 #endif
127