Update ooo320-m1
[ooovba.git] / svx / source / cui / macroass.hxx
blob55476b1120a449a16b8cc41c725e78179e4be2d2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: macropg.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _MACROASS_HXX
31 #define _MACROASS_HXX
33 #include "sal/config.h"
35 #include <sfx2/basedlgs.hxx>
36 #include <sfx2/tabdlg.hxx>
37 #include <svtools/macitem.hxx>
38 #include <vcl/lstbox.hxx>
39 #include <com/sun/star/frame/XFrame.hpp>
41 class _SfxMacroTabPage;
42 class SvStringsDtor;
43 class SvTabListBox;
44 class Edit;
45 class String;
47 typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
48 typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
50 class SfxConfigGroupListBox_Impl;
51 class SfxConfigFunctionListBox_Impl;
52 class _HeaderTabListBox;
53 class _SfxMacroTabPage_Impl;
55 class _SfxMacroTabPage : public SfxTabPage
57 SvxMacroTableDtor aTbl;
58 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
59 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
60 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
62 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
63 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
65 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
66 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit* );
67 DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
69 protected:
70 _SfxMacroTabPage_Impl* mpImpl;
72 _SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
74 void InitAndSetHandler();
75 void FillEvents();
76 void FillMacroList();
77 void EnableButtons( const String& rLanguage );
79 public:
81 virtual ~_SfxMacroTabPage();
83 void AddEvent( const String & rEventName, USHORT nEventId );
85 const SvxMacroTableDtor& GetMacroTbl() const;
86 void SetMacroTbl( const SvxMacroTableDtor& rTbl );
87 void ClearMacroTbl();
89 virtual void ScriptChanged( const String& rLanguage );
90 virtual void PageCreated (SfxAllItemSet aSet);
92 // zum setzen / abfragen der Links
93 void SetGetRangeLink( FNGetRangeHdl pFn );
94 FNGetRangeHdl GetGetRangeLink() const;
95 void SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn );
96 FNGetMacrosOfRangeHdl GetGetMacrosOfRangeLink() const;
98 // --------- Erben aus der Basis -------------
99 virtual BOOL FillItemSet( SfxItemSet& rSet );
100 virtual void Reset( const SfxItemSet& rSet );
102 void SetReadOnly( BOOL bSet );
103 BOOL IsReadOnly() const;
104 void SelectEvent( const String& rEventName, USHORT nEventId );
107 inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
109 return aTbl;
112 inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
114 aTbl = rTbl;
117 inline void _SfxMacroTabPage::ClearMacroTbl()
119 aTbl.DelDtor();
122 class SfxMacroTabPage : public _SfxMacroTabPage
124 public:
125 SfxMacroTabPage(
126 Window* pParent,
127 const ResId& rId,
128 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
129 const SfxItemSet& rSet
132 // --------- Erben aus der Basis -------------
133 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
136 class SfxMacroAssignDlg : public SfxSingleTabDialog
138 public:
139 SfxMacroAssignDlg(
140 Window* pParent,
141 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
142 const SfxItemSet& rSet );
143 virtual ~SfxMacroAssignDlg();
146 #endif