1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: macropg.hxx,v $
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 ************************************************************************/
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
;
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
* );
70 _SfxMacroTabPage_Impl
* mpImpl
;
72 _SfxMacroTabPage( Window
* pParent
, const ResId
& rId
, const SfxItemSet
& rItemSet
);
74 void InitAndSetHandler();
77 void EnableButtons( const String
& rLanguage
);
81 virtual ~_SfxMacroTabPage();
83 void AddEvent( const String
& rEventName
, USHORT nEventId
);
85 const SvxMacroTableDtor
& GetMacroTbl() const;
86 void SetMacroTbl( const SvxMacroTableDtor
& rTbl
);
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
112 inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor
& rTbl
)
117 inline void _SfxMacroTabPage::ClearMacroTbl()
122 class SfxMacroTabPage
: public _SfxMacroTabPage
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
141 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rxDocumentFrame
,
142 const SfxItemSet
& rSet
);
143 virtual ~SfxMacroAssignDlg();