1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*353d8f4dSAndrew Rist * distributed with this work for additional information
6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at
10*353d8f4dSAndrew Rist *
11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist *
13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the
17*353d8f4dSAndrew Rist * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist * under the License.
19*353d8f4dSAndrew Rist *
20*353d8f4dSAndrew Rist *************************************************************/
21*353d8f4dSAndrew Rist
22*353d8f4dSAndrew Rist
23cdf0e10cSrcweir #ifndef _MACROPG_HXX
24cdf0e10cSrcweir #define _MACROPG_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include "sal/config.h"
27cdf0e10cSrcweir #include "sfx2/dllapi.h"
28cdf0e10cSrcweir
29cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
30cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
31cdf0e10cSrcweir #include <svl/macitem.hxx>
32cdf0e10cSrcweir #include <vcl/lstbox.hxx>
33cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
34cdf0e10cSrcweir
35cdf0e10cSrcweir class _SfxMacroTabPage;
36cdf0e10cSrcweir class SvStringsDtor;
37cdf0e10cSrcweir class SvTabListBox;
38cdf0e10cSrcweir class Edit;
39cdf0e10cSrcweir class String;
40cdf0e10cSrcweir class SfxObjectShell;
41cdf0e10cSrcweir
42cdf0e10cSrcweir typedef SvStringsDtor* (*FNGetRangeHdl)( _SfxMacroTabPage*, const String& rLanguage );
43cdf0e10cSrcweir typedef SvStringsDtor* (*FNGetMacrosOfRangeHdl)( _SfxMacroTabPage*, const String& rLanguage, const String& rRange );
44cdf0e10cSrcweir
45cdf0e10cSrcweir class SfxConfigGroupListBox_Impl;
46cdf0e10cSrcweir class SfxConfigFunctionListBox_Impl;
47cdf0e10cSrcweir
48cdf0e10cSrcweir class _HeaderTabListBox;
49cdf0e10cSrcweir class _SfxMacroTabPage_Impl;
50cdf0e10cSrcweir
51cdf0e10cSrcweir class SFX2_DLLPUBLIC _SfxMacroTabPage : public SfxTabPage
52cdf0e10cSrcweir {
53cdf0e10cSrcweir SvxMacroTableDtor aTbl;
54cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
55cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox * );
56cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox * );
57cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox * );
58cdf0e10cSrcweir
59cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, DoubleClickHdl_Impl, Control* );
60cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton * );
61cdf0e10cSrcweir
62cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton * );
63cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit* );
64cdf0e10cSrcweir DECL_DLLPRIVATE_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer* );
65cdf0e10cSrcweir //#endif
66cdf0e10cSrcweir protected:
67cdf0e10cSrcweir _SfxMacroTabPage_Impl* mpImpl;
68cdf0e10cSrcweir
69cdf0e10cSrcweir _SfxMacroTabPage( Window* pParent, const ResId& rId, const SfxItemSet& rItemSet );
70cdf0e10cSrcweir
71cdf0e10cSrcweir void InitAndSetHandler();
72cdf0e10cSrcweir void FillEvents();
73cdf0e10cSrcweir void FillMacroList();
74cdf0e10cSrcweir void EnableButtons( const String& rLanguage );
75cdf0e10cSrcweir
76cdf0e10cSrcweir public:
77cdf0e10cSrcweir
78cdf0e10cSrcweir virtual ~_SfxMacroTabPage();
79cdf0e10cSrcweir
80cdf0e10cSrcweir void AddEvent( const String & rEventName, sal_uInt16 nEventId );
81cdf0e10cSrcweir
82cdf0e10cSrcweir const SvxMacroTableDtor& GetMacroTbl() const;
83cdf0e10cSrcweir void SetMacroTbl( const SvxMacroTableDtor& rTbl );
84cdf0e10cSrcweir void ClearMacroTbl();
85cdf0e10cSrcweir
86cdf0e10cSrcweir virtual void ScriptChanged( const String& rLanguage );
87cdf0e10cSrcweir
88cdf0e10cSrcweir // zum setzen / abfragen der Links
89cdf0e10cSrcweir void SetGetRangeLink( FNGetRangeHdl pFn );
90cdf0e10cSrcweir FNGetRangeHdl GetGetRangeLink() const;
91cdf0e10cSrcweir void SetGetMacrosOfRangeLink( FNGetMacrosOfRangeHdl pFn );
92cdf0e10cSrcweir FNGetMacrosOfRangeHdl GetGetMacrosOfRangeLink() const;
93cdf0e10cSrcweir
94cdf0e10cSrcweir // --------- Erben aus der Basis -------------
95cdf0e10cSrcweir virtual sal_Bool FillItemSet( SfxItemSet& rSet );
96cdf0e10cSrcweir virtual void Reset( const SfxItemSet& rSet );
97cdf0e10cSrcweir
98cdf0e10cSrcweir void SetReadOnly( sal_Bool bSet );
99cdf0e10cSrcweir sal_Bool IsReadOnly() const;
100cdf0e10cSrcweir void SelectEvent( const String& rEventName, sal_uInt16 nEventId );
101cdf0e10cSrcweir };
102cdf0e10cSrcweir
GetMacroTbl() const103cdf0e10cSrcweir inline const SvxMacroTableDtor& _SfxMacroTabPage::GetMacroTbl() const
104cdf0e10cSrcweir {
105cdf0e10cSrcweir return aTbl;
106cdf0e10cSrcweir }
107cdf0e10cSrcweir
SetMacroTbl(const SvxMacroTableDtor & rTbl)108cdf0e10cSrcweir inline void _SfxMacroTabPage::SetMacroTbl( const SvxMacroTableDtor& rTbl )
109cdf0e10cSrcweir {
110cdf0e10cSrcweir aTbl = rTbl;
111cdf0e10cSrcweir }
112cdf0e10cSrcweir
ClearMacroTbl()113cdf0e10cSrcweir inline void _SfxMacroTabPage::ClearMacroTbl()
114cdf0e10cSrcweir {
115cdf0e10cSrcweir aTbl.DelDtor();
116cdf0e10cSrcweir }
117cdf0e10cSrcweir
118cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxMacroTabPage : public _SfxMacroTabPage
119cdf0e10cSrcweir {
120cdf0e10cSrcweir public:
121cdf0e10cSrcweir SfxMacroTabPage(
122cdf0e10cSrcweir Window* pParent,
123cdf0e10cSrcweir const ResId& rId,
124cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
125cdf0e10cSrcweir const SfxItemSet& rSet
126cdf0e10cSrcweir );
127cdf0e10cSrcweir
128cdf0e10cSrcweir // --------- Erben aus der Basis -------------
129cdf0e10cSrcweir static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
130cdf0e10cSrcweir };
131cdf0e10cSrcweir
132cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxMacroAssignDlg : public SfxSingleTabDialog
133cdf0e10cSrcweir {
134cdf0e10cSrcweir public:
135cdf0e10cSrcweir SfxMacroAssignDlg(
136cdf0e10cSrcweir Window* pParent,
137cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame,
138cdf0e10cSrcweir SfxItemSet& rSet );
139cdf0e10cSrcweir SfxMacroAssignDlg(
140cdf0e10cSrcweir Window* pParent,
141cdf0e10cSrcweir const SfxObjectShell* _pShell,
142cdf0e10cSrcweir SfxItemSet& rSet );
143cdf0e10cSrcweir virtual ~SfxMacroAssignDlg();
144cdf0e10cSrcweir };
145cdf0e10cSrcweir
146cdf0e10cSrcweir #endif
147