xref: /trunk/main/cui/source/inc/macroass.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _MACROASS_HXX
28 #define _MACROASS_HXX
29 
30 #include "sal/config.h"
31 
32 #include <sfx2/basedlgs.hxx>
33 #include <sfx2/tabdlg.hxx>
34 #include <svl/macitem.hxx>
35 #include <vcl/lstbox.hxx>
36 #include <com/sun/star/frame/XFrame.hpp>
37 
38 class _SfxMacroTabPage;
39 class SvStringsDtor;
40 class SvTabListBox;
41 class Edit;
42 class String;
43 
44 class SfxConfigGroupListBox_Impl;
45 class SfxConfigFunctionListBox_Impl;
46 class _HeaderTabListBox;
47 class _SfxMacroTabPage_Impl;
48 
49 class _SfxMacroTabPage : public SfxTabPage
50 {
51 	SvxMacroTableDtor			aTbl;
52 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
53 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
54 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
55 
56 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
57 	DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
58 
59     DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
60 
61 protected:
62 	_SfxMacroTabPage_Impl*		mpImpl;
63 
64 								_SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
65 
66 	void						InitAndSetHandler();
67 	void						FillEvents();
68 	void						FillMacroList();
69 	void						EnableButtons();
70 
71 public:
72 
73 	virtual						~_SfxMacroTabPage();
74 
75 	void						AddEvent( const String & rEventName, sal_uInt16 nEventId );
76 
77 	const SvxMacroTableDtor&	GetMacroTbl() const;
78 	void						SetMacroTbl( const SvxMacroTableDtor& rTbl );
79 	void						ClearMacroTbl();
80 
81 	virtual void				ScriptChanged();
82 	virtual void				PageCreated (SfxAllItemSet aSet);
83 
84 	// --------- Erben aus der Basis -------------
85 	virtual	sal_Bool				FillItemSet( SfxItemSet& rSet );
86 	virtual	void				Reset( const SfxItemSet& rSet );
87 
88 	sal_Bool						IsReadOnly() const;
89 };
90 
91 inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
92 {
93 	return aTbl;
94 }
95 
96 inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
97 {
98 	aTbl = rTbl;
99 }
100 
101 inline void _SfxMacroTabPage::ClearMacroTbl()
102 {
103 	aTbl.DelDtor();
104 }
105 
106 class SfxMacroTabPage : public _SfxMacroTabPage
107 {
108 public:
109 	SfxMacroTabPage(
110         Window* pParent,
111         const ResId& rId,
112         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
113 		const SfxItemSet& rSet
114     );
115 
116 	// --------- Erben aus der Basis -------------
117 	static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
118 };
119 
120 class SfxMacroAssignDlg : public SfxSingleTabDialog
121 {
122 public:
123     SfxMacroAssignDlg(
124         Window* pParent,
125         const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
126         const SfxItemSet& rSet );
127 	virtual	~SfxMacroAssignDlg();
128 };
129 
130 #endif
131