xref: /trunk/main/cui/source/inc/cfg.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c4eee24dSAndrew Rist  * distributed with this work for additional information
6*c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9*c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15*c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18*c4eee24dSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*c4eee24dSAndrew Rist  *************************************************************/
21*c4eee24dSAndrew Rist 
22*c4eee24dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVXCFG_HXX
24cdf0e10cSrcweir #define _SVXCFG_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/lstbox.hxx>
27cdf0e10cSrcweir #include <vcl/toolbox.hxx>
28cdf0e10cSrcweir #include <vcl/fixed.hxx>
29cdf0e10cSrcweir #include <vcl/group.hxx>
30cdf0e10cSrcweir #include <vcl/menubtn.hxx>
31cdf0e10cSrcweir #include <vcl/toolbox.hxx>
32cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
33cdf0e10cSrcweir #include <svtools/svmedit2.hxx>
34cdf0e10cSrcweir #include <svtools/svmedit.hxx>
35cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
36cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp>
37cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
38cdf0e10cSrcweir #include <com/sun/star/frame/XModuleManager.hpp>
39cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationListener.hpp>
40cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp>
41cdf0e10cSrcweir #include <com/sun/star/ui/XImageManager.hpp>
42cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphicProvider.hpp>
43cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
44cdf0e10cSrcweir #include <com/sun/star/frame/XStorable.hpp>
45cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
46cdf0e10cSrcweir #include <com/sun/star/lang/XSingleComponentFactory.hpp>
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #define _SVSTDARR_USHORTS
49cdf0e10cSrcweir #define _SVSTDARR_STRINGSDTOR
50cdf0e10cSrcweir #include <svl/svstdarr.hxx>     // SvUShorts
51cdf0e10cSrcweir #include <sfx2/minarray.hxx>
52cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
53cdf0e10cSrcweir #include <vector>
54cdf0e10cSrcweir #include <vcl/msgbox.hxx>
55cdf0e10cSrcweir 
56cdf0e10cSrcweir #include "selector.hxx"
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class SvxConfigEntry;
59cdf0e10cSrcweir class SvxConfigPage;
60cdf0e10cSrcweir class SvxMenuConfigPage;
61cdf0e10cSrcweir class SvxToolbarConfigPage;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir typedef std::vector< SvxConfigEntry* > SvxEntries;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir class SvxConfigDialog : public SfxTabDialog
66cdf0e10cSrcweir {
67cdf0e10cSrcweir private:
68cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir public:
71cdf0e10cSrcweir     SvxConfigDialog( Window*, const SfxItemSet* );
72cdf0e10cSrcweir     ~SvxConfigDialog();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     virtual void                PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
75cdf0e10cSrcweir     virtual short               Ok();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir class SaveInData : public ImageProvider
81cdf0e10cSrcweir {
82cdf0e10cSrcweir private:
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     bool        bModified;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     bool        bDocConfig;
87cdf0e10cSrcweir     bool        bReadOnly;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     ::com::sun::star::uno::Reference
90cdf0e10cSrcweir         < com::sun::star::ui::XUIConfigurationManager > m_xCfgMgr;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     ::com::sun::star::uno::Reference
93cdf0e10cSrcweir         < com::sun::star::ui::XUIConfigurationManager > m_xParentCfgMgr;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     ::com::sun::star::uno::Reference
96cdf0e10cSrcweir         < com::sun::star::ui::XImageManager > m_xImgMgr;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     ::com::sun::star::uno::Reference
99cdf0e10cSrcweir         < com::sun::star::ui::XImageManager > m_xParentImgMgr;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     static ::com::sun::star::uno::Reference
102cdf0e10cSrcweir         < com::sun::star::ui::XImageManager >* xDefaultImgMgr;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir public:
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     SaveInData(
107cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
108cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >& xCfgMgr,
109cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
110cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >& xParentCfgMgr,
111cdf0e10cSrcweir         const rtl::OUString& aModuleId,
112cdf0e10cSrcweir         bool docConfig );
113cdf0e10cSrcweir 
~SaveInData()114cdf0e10cSrcweir     ~SaveInData() {}
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     bool PersistChanges(
117cdf0e10cSrcweir         const com::sun::star::uno::Reference
118cdf0e10cSrcweir             < com::sun::star::uno::XInterface >& xManager );
119cdf0e10cSrcweir 
SetModified(bool bValue=sal_True)120cdf0e10cSrcweir     void SetModified( bool bValue = sal_True ) { bModified = bValue; }
IsModified()121cdf0e10cSrcweir     bool IsModified( ) { return bModified; }
122cdf0e10cSrcweir 
IsReadOnly()123cdf0e10cSrcweir     bool IsReadOnly( ) { return bReadOnly; }
IsDocConfig()124cdf0e10cSrcweir     bool IsDocConfig( ) { return bDocConfig; }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     ::com::sun::star::uno::Reference
127cdf0e10cSrcweir         < ::com::sun::star::ui::XUIConfigurationManager >
GetConfigManager()128cdf0e10cSrcweir             GetConfigManager() { return m_xCfgMgr; };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     ::com::sun::star::uno::Reference
131cdf0e10cSrcweir         < ::com::sun::star::ui::XUIConfigurationManager >
GetParentConfigManager()132cdf0e10cSrcweir             GetParentConfigManager() { return m_xParentCfgMgr; };
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     ::com::sun::star::uno::Reference
135cdf0e10cSrcweir         < ::com::sun::star::ui::XImageManager >
GetImageManager()136cdf0e10cSrcweir             GetImageManager() { return m_xImgMgr; };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     ::com::sun::star::uno::Reference
139cdf0e10cSrcweir         < ::com::sun::star::ui::XImageManager >
GetParentImageManager()140cdf0e10cSrcweir             GetParentImageManager() { return m_xParentImgMgr; };
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     ::com::sun::star::uno::Reference
143cdf0e10cSrcweir         < com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     ::com::sun::star::uno::Reference
146cdf0e10cSrcweir         < com::sun::star::container::XNameAccess > m_xCommandToLabelMap;
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     com::sun::star::uno::Reference
149cdf0e10cSrcweir         < com::sun::star::uno::XComponentContext > m_xComponentContext;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     com::sun::star::uno::Sequence
152cdf0e10cSrcweir         < com::sun::star::beans::PropertyValue > m_aSeparatorSeq;
153cdf0e10cSrcweir 
154cdf0e10cSrcweir     Image GetImage( const rtl::OUString& rCommandURL );
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     virtual bool HasURL( const rtl::OUString& aURL ) = 0;
157cdf0e10cSrcweir     virtual bool HasSettings() = 0;
158cdf0e10cSrcweir     virtual SvxEntries* GetEntries() = 0;
159cdf0e10cSrcweir     virtual void SetEntries( SvxEntries* ) = 0;
160cdf0e10cSrcweir     virtual void Reset() = 0;
161cdf0e10cSrcweir     virtual bool Apply() = 0;
162cdf0e10cSrcweir };
163cdf0e10cSrcweir 
164cdf0e10cSrcweir class MenuSaveInData : public SaveInData
165cdf0e10cSrcweir {
166cdf0e10cSrcweir private:
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     rtl::OUString               m_aMenuResourceURL;
169cdf0e10cSrcweir     rtl::OUString               m_aDescriptorContainer;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     ::com::sun::star::uno::Reference
172cdf0e10cSrcweir         < com::sun::star::container::XIndexAccess > m_xMenuSettings;
173cdf0e10cSrcweir 
174cdf0e10cSrcweir     SvxConfigEntry* pRootEntry;
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     // static holder of the default menu data
177cdf0e10cSrcweir     static MenuSaveInData* pDefaultData;
178cdf0e10cSrcweir 
SetDefaultData(MenuSaveInData * pData)179cdf0e10cSrcweir     static void SetDefaultData( MenuSaveInData* pData ) {pDefaultData = pData;}
GetDefaultData()180cdf0e10cSrcweir     static MenuSaveInData* GetDefaultData() { return pDefaultData; }
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     void        Apply( bool bDefault );
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     void        Apply(
185cdf0e10cSrcweir         SvxConfigEntry* pRootEntry,
186cdf0e10cSrcweir         com::sun::star::uno::Reference<
187cdf0e10cSrcweir             com::sun::star::container::XIndexContainer >& rNewMenuBar,
188cdf0e10cSrcweir         com::sun::star::uno::Reference<
189cdf0e10cSrcweir             com::sun::star::lang::XSingleComponentFactory >& rFactory,
190cdf0e10cSrcweir         SvLBoxEntry *pParent = NULL );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     void        ApplyMenu(
193cdf0e10cSrcweir         com::sun::star::uno::Reference<
194cdf0e10cSrcweir             com::sun::star::container::XIndexContainer >& rNewMenuBar,
195cdf0e10cSrcweir         com::sun::star::uno::Reference<
196cdf0e10cSrcweir             com::sun::star::lang::XSingleComponentFactory >& rFactory,
197cdf0e10cSrcweir         SvxConfigEntry *pMenuData = NULL );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     bool        LoadSubMenus(
200cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
201cdf0e10cSrcweir             com::sun::star::container::XIndexAccess >& xMenuBarSettings,
202cdf0e10cSrcweir         const rtl::OUString& rBaseTitle, SvxConfigEntry* pParentData );
203cdf0e10cSrcweir 
204cdf0e10cSrcweir public:
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     MenuSaveInData(
207cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
208cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
209cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
210cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
211cdf0e10cSrcweir         const rtl::OUString& aModuleId,
212cdf0e10cSrcweir         bool docConfig );
213cdf0e10cSrcweir 
214cdf0e10cSrcweir     ~MenuSaveInData();
215cdf0e10cSrcweir 
216cdf0e10cSrcweir     // methods inherited from SaveInData
217cdf0e10cSrcweir     SvxEntries*         GetEntries();
218cdf0e10cSrcweir     void                SetEntries( SvxEntries* );
HasURL(const rtl::OUString & URL)219cdf0e10cSrcweir     bool                HasURL( const rtl::OUString& URL ) { (void)URL; return sal_False; }
HasSettings()220cdf0e10cSrcweir     bool                HasSettings() { return m_xMenuSettings.is(); }
221cdf0e10cSrcweir     void                Reset();
222cdf0e10cSrcweir     bool                Apply();
223cdf0e10cSrcweir };
224cdf0e10cSrcweir 
225cdf0e10cSrcweir class SvxConfigEntry
226cdf0e10cSrcweir {
227cdf0e10cSrcweir private:
228cdf0e10cSrcweir 
229cdf0e10cSrcweir     // common properties
230cdf0e10cSrcweir     sal_uInt16                      nId;
231cdf0e10cSrcweir     ::rtl::OUString             aHelpText;
232cdf0e10cSrcweir     ::rtl::OUString             aLabel;
233cdf0e10cSrcweir     ::rtl::OUString             aCommand;
234cdf0e10cSrcweir     ::rtl::OUString             aHelpURL;
235cdf0e10cSrcweir 
236cdf0e10cSrcweir     bool                        bPopUp;
237cdf0e10cSrcweir     bool                        bStrEdited;
238cdf0e10cSrcweir     bool                        bIsUserDefined;
239cdf0e10cSrcweir     bool                        bIsMain;
240cdf0e10cSrcweir     bool                        bIsDeletable;
241cdf0e10cSrcweir     bool                        bIsMovable;
242cdf0e10cSrcweir     bool                        bIsParentData;
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     // toolbar specific properties
245cdf0e10cSrcweir     bool                        bIsVisible;
246cdf0e10cSrcweir     sal_Int32                   nStyle;
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
249cdf0e10cSrcweir         ::com::sun::star::graphic::XGraphic > xBackupGraphic;
250cdf0e10cSrcweir 
251cdf0e10cSrcweir     SvxEntries                  *pEntries;
252cdf0e10cSrcweir 
253cdf0e10cSrcweir public:
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     SvxConfigEntry( const ::rtl::OUString& rDisplayName,
256cdf0e10cSrcweir                     const ::rtl::OUString& rCommandURL,
257cdf0e10cSrcweir                     bool bPopup = sal_False,
258cdf0e10cSrcweir                     bool bParentData = sal_False );
259cdf0e10cSrcweir 
SvxConfigEntry()260cdf0e10cSrcweir     SvxConfigEntry()
261cdf0e10cSrcweir         :
262cdf0e10cSrcweir             nId( 0 ),
263cdf0e10cSrcweir             bPopUp( sal_False ),
264cdf0e10cSrcweir             bStrEdited( sal_False ),
265cdf0e10cSrcweir             bIsUserDefined( sal_False ),
266cdf0e10cSrcweir             bIsMain( sal_False ),
267cdf0e10cSrcweir             bIsParentData( sal_False ),
268cdf0e10cSrcweir             bIsVisible( sal_True ),
269cdf0e10cSrcweir             nStyle( 0 ),
270cdf0e10cSrcweir             pEntries( 0 )
271cdf0e10cSrcweir     {}
272cdf0e10cSrcweir 
273cdf0e10cSrcweir     ~SvxConfigEntry();
274cdf0e10cSrcweir 
GetCommand() const275cdf0e10cSrcweir     const ::rtl::OUString&      GetCommand() const { return aCommand; }
SetCommand(const String & rCmd)276cdf0e10cSrcweir     void    SetCommand( const String& rCmd ) { aCommand = rCmd; }
277cdf0e10cSrcweir 
GetName() const278cdf0e10cSrcweir     const ::rtl::OUString&      GetName() const { return aLabel; }
SetName(const String & rStr)279cdf0e10cSrcweir     void    SetName( const String& rStr ) { aLabel = rStr; bStrEdited = sal_True; }
HasChangedName() const280cdf0e10cSrcweir     bool    HasChangedName() const { return bStrEdited; }
281cdf0e10cSrcweir 
282cdf0e10cSrcweir     const ::rtl::OUString&      GetHelpText() ;
SetHelpText(const String & rStr)283cdf0e10cSrcweir     void    SetHelpText( const String& rStr ) { aHelpText = rStr; }
284cdf0e10cSrcweir 
GetHelpURL() const285cdf0e10cSrcweir     const ::rtl::OUString&      GetHelpURL() const { return aHelpURL; }
SetHelpURL(const String & rStr)286cdf0e10cSrcweir     void    SetHelpURL( const String& rStr ) { aHelpURL = rStr; }
287cdf0e10cSrcweir 
SetPopup(bool bOn=sal_True)288cdf0e10cSrcweir     void    SetPopup( bool bOn = sal_True ) { bPopUp = bOn; }
IsPopup() const289cdf0e10cSrcweir     bool    IsPopup() const { return bPopUp; }
290cdf0e10cSrcweir 
SetUserDefined(bool bOn=sal_True)291cdf0e10cSrcweir     void    SetUserDefined( bool bOn = sal_True ) { bIsUserDefined = bOn; }
IsUserDefined() const292cdf0e10cSrcweir     bool    IsUserDefined() const { return bIsUserDefined; }
293cdf0e10cSrcweir 
IsBinding() const294cdf0e10cSrcweir     bool    IsBinding() const { return !bPopUp; }
IsSeparator() const295cdf0e10cSrcweir     bool    IsSeparator() const { return nId == 0; }
296cdf0e10cSrcweir 
GetEntries() const297cdf0e10cSrcweir     SvxEntries* GetEntries() const { return pEntries; }
SetEntries(SvxEntries * entries)298cdf0e10cSrcweir     void    SetEntries( SvxEntries* entries ) { pEntries = entries; }
HasEntries() const299cdf0e10cSrcweir     bool    HasEntries() const { return pEntries != NULL; }
300cdf0e10cSrcweir 
SetMain(bool bValue=sal_True)301cdf0e10cSrcweir     void    SetMain( bool bValue = sal_True ) { bIsMain = bValue; }
IsMain()302cdf0e10cSrcweir     bool    IsMain() { return bIsMain; }
303cdf0e10cSrcweir 
SetParentData(bool bValue=sal_True)304cdf0e10cSrcweir     void    SetParentData( bool bValue = sal_True ) { bIsParentData = bValue; }
IsParentData()305cdf0e10cSrcweir     bool    IsParentData() { return bIsParentData; }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     bool    IsMovable();
308cdf0e10cSrcweir     bool    IsDeletable();
309cdf0e10cSrcweir     bool    IsRenamable();
310cdf0e10cSrcweir 
SetVisible(bool b)311cdf0e10cSrcweir     void    SetVisible( bool b ) { bIsVisible = b; }
IsVisible() const312cdf0e10cSrcweir     bool    IsVisible() const { return bIsVisible; }
313cdf0e10cSrcweir 
SetBackupGraphic(::com::sun::star::uno::Reference<::com::sun::star::graphic::XGraphic> graphic)314cdf0e10cSrcweir     void    SetBackupGraphic(
315cdf0e10cSrcweir         ::com::sun::star::uno::Reference<
316cdf0e10cSrcweir             ::com::sun::star::graphic::XGraphic > graphic )
317cdf0e10cSrcweir                 { xBackupGraphic = graphic; }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
320cdf0e10cSrcweir         ::com::sun::star::graphic::XGraphic >
GetBackupGraphic()321cdf0e10cSrcweir             GetBackupGraphic()
322cdf0e10cSrcweir                 { return xBackupGraphic; }
323cdf0e10cSrcweir 
IsIconModified()324cdf0e10cSrcweir     bool    IsIconModified() { return xBackupGraphic.is(); }
325cdf0e10cSrcweir 
GetStyle()326cdf0e10cSrcweir     sal_Int32   GetStyle() { return nStyle; }
SetStyle(sal_Int32 style)327cdf0e10cSrcweir     void        SetStyle( sal_Int32 style ) { nStyle = style; }
328cdf0e10cSrcweir };
329cdf0e10cSrcweir 
330cdf0e10cSrcweir class SvxMenuEntriesListBox : public SvTreeListBox
331cdf0e10cSrcweir {
332cdf0e10cSrcweir private:
333cdf0e10cSrcweir     SvxConfigPage*      pPage;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir protected:
336cdf0e10cSrcweir     bool                m_bIsInternalDrag;
337cdf0e10cSrcweir 
338cdf0e10cSrcweir public:
339cdf0e10cSrcweir     SvxMenuEntriesListBox( Window*, const ResId& );
340cdf0e10cSrcweir     ~SvxMenuEntriesListBox();
341cdf0e10cSrcweir 
342cdf0e10cSrcweir     virtual sal_Int8    AcceptDrop( const AcceptDropEvent& rEvt );
343cdf0e10cSrcweir 
344cdf0e10cSrcweir     virtual sal_Bool        NotifyAcceptDrop( SvLBoxEntry* pEntry );
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     virtual sal_Bool        NotifyMoving( SvLBoxEntry*, SvLBoxEntry*,
347cdf0e10cSrcweir                                       SvLBoxEntry*&, sal_uLong& );
348cdf0e10cSrcweir 
349cdf0e10cSrcweir     virtual sal_Bool        NotifyCopying( SvLBoxEntry*, SvLBoxEntry*,
350cdf0e10cSrcweir                                        SvLBoxEntry*&, sal_uLong&);
351cdf0e10cSrcweir 
352cdf0e10cSrcweir     virtual DragDropMode    NotifyStartDrag(
353cdf0e10cSrcweir         TransferDataContainer&, SvLBoxEntry* );
354cdf0e10cSrcweir 
355cdf0e10cSrcweir     virtual void        DragFinished( sal_Int8 );
356cdf0e10cSrcweir 
357cdf0e10cSrcweir     void                KeyInput( const KeyEvent& rKeyEvent );
358cdf0e10cSrcweir };
359cdf0e10cSrcweir 
360cdf0e10cSrcweir class SvxDescriptionEdit : public ExtMultiLineEdit
361cdf0e10cSrcweir {
362cdf0e10cSrcweir private:
363cdf0e10cSrcweir     Rectangle           m_aRealRect;
364cdf0e10cSrcweir 
365cdf0e10cSrcweir public:
366cdf0e10cSrcweir     SvxDescriptionEdit( Window* pParent, const ResId& _rId );
~SvxDescriptionEdit()367cdf0e10cSrcweir     inline ~SvxDescriptionEdit() {}
368cdf0e10cSrcweir 
369cdf0e10cSrcweir     void                SetNewText( const String& _rText );
Clear()370cdf0e10cSrcweir     inline void         Clear() { SetNewText( String() ); }
371cdf0e10cSrcweir };
372cdf0e10cSrcweir 
373cdf0e10cSrcweir class SvxConfigPage : public SfxTabPage
374cdf0e10cSrcweir {
375cdf0e10cSrcweir private:
376cdf0e10cSrcweir 
377cdf0e10cSrcweir     bool                                bInitialised;
378cdf0e10cSrcweir     SaveInData*                         pCurrentSaveInData;
379cdf0e10cSrcweir 
380cdf0e10cSrcweir     DECL_LINK(  SelectSaveInLocation, ListBox * );
381cdf0e10cSrcweir     DECL_LINK(  AsyncInfoMsg, String* );
382cdf0e10cSrcweir 
383cdf0e10cSrcweir     bool        SwapEntryData( SvLBoxEntry* pSourceEntry, SvLBoxEntry* pTargetEntry );
384cdf0e10cSrcweir     void        AlignControls();
385cdf0e10cSrcweir 
386cdf0e10cSrcweir protected:
387cdf0e10cSrcweir 
388cdf0e10cSrcweir     // the top section of the tab page where top level menus and toolbars
389cdf0e10cSrcweir     //  are displayed in a listbox
390cdf0e10cSrcweir     FixedLine                           aTopLevelSeparator;
391cdf0e10cSrcweir     FixedText                           aTopLevelLabel;
392cdf0e10cSrcweir     ListBox                             aTopLevelListBox;
393cdf0e10cSrcweir     PushButton                          aNewTopLevelButton;
394cdf0e10cSrcweir     MenuButton                          aModifyTopLevelButton;
395cdf0e10cSrcweir 
396cdf0e10cSrcweir     // the contents section where the contents of the selected
397cdf0e10cSrcweir     // menu or toolbar are displayed
398cdf0e10cSrcweir     FixedLine                           aContentsSeparator;
399cdf0e10cSrcweir     FixedText                           aContentsLabel;
400cdf0e10cSrcweir     SvTreeListBox*                      aContentsListBox;
401cdf0e10cSrcweir 
402cdf0e10cSrcweir     PushButton                          aAddCommandsButton;
403cdf0e10cSrcweir     MenuButton                          aModifyCommandButton;
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     ImageButton                         aMoveUpButton;
406cdf0e10cSrcweir     ImageButton                         aMoveDownButton;
407cdf0e10cSrcweir 
408cdf0e10cSrcweir     FixedText                           aSaveInText;
409cdf0e10cSrcweir     ListBox                             aSaveInListBox;
410cdf0e10cSrcweir 
411cdf0e10cSrcweir     FixedText                           aDescriptionLabel;
412cdf0e10cSrcweir     SvxDescriptionEdit                  aDescriptionField;
413cdf0e10cSrcweir 
414cdf0e10cSrcweir     SvxScriptSelectorDialog*            pSelectorDlg;
415cdf0e10cSrcweir 
416cdf0e10cSrcweir     // the ResourceURL to select when opening the dialog
417cdf0e10cSrcweir     rtl::OUString                       m_aURLToSelect;
418cdf0e10cSrcweir 
419cdf0e10cSrcweir     ::com::sun::star::uno::Reference
420cdf0e10cSrcweir         < ::com::sun::star::frame::XFrame > m_xFrame;
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     SvxConfigPage( Window*, /* const ResId&, */ const SfxItemSet& );
423cdf0e10cSrcweir     virtual ~SvxConfigPage();
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     DECL_LINK( MoveHdl, Button * );
426cdf0e10cSrcweir 
427cdf0e10cSrcweir     virtual SaveInData* CreateSaveInData(
428cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
429cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
430cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
431cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
432cdf0e10cSrcweir         const rtl::OUString& aModuleId,
433cdf0e10cSrcweir         bool docConfig ) = 0;
434cdf0e10cSrcweir 
435cdf0e10cSrcweir     virtual void            Init() = 0;
436cdf0e10cSrcweir     virtual void            UpdateButtonStates() = 0;
437cdf0e10cSrcweir     virtual short           QueryReset() = 0;
438cdf0e10cSrcweir 
439cdf0e10cSrcweir     void            PositionContentsListBox();
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     SvLBoxEntry*    InsertEntry(        SvxConfigEntry* pNewEntryData,
442cdf0e10cSrcweir                                         SvLBoxEntry* pTarget = NULL,
443cdf0e10cSrcweir                                         bool bFront = sal_False );
444cdf0e10cSrcweir 
445cdf0e10cSrcweir     void            AddSubMenusToUI(    const String& rBaseTitle,
446cdf0e10cSrcweir                                         SvxConfigEntry* pParentData );
447cdf0e10cSrcweir 
448cdf0e10cSrcweir     SvLBoxEntry*    InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
449cdf0e10cSrcweir                                         sal_uLong nPos = LIST_APPEND );
450cdf0e10cSrcweir 
451cdf0e10cSrcweir     SvxEntries*     FindParentForChild( SvxEntries* pParentEntries,
452cdf0e10cSrcweir                                         SvxConfigEntry* pChildData );
453cdf0e10cSrcweir 
454cdf0e10cSrcweir     void            ReloadTopLevelListBox( SvxConfigEntry* pSelection = NULL );
455cdf0e10cSrcweir 
456cdf0e10cSrcweir public:
457cdf0e10cSrcweir 
458cdf0e10cSrcweir     static bool     CanConfig( const ::rtl::OUString& rModuleId );
459cdf0e10cSrcweir 
GetSaveInData()460cdf0e10cSrcweir     SaveInData*     GetSaveInData() { return pCurrentSaveInData; }
461cdf0e10cSrcweir 
462cdf0e10cSrcweir     SvLBoxEntry*    AddFunction( SvLBoxEntry* pTarget = NULL,
463cdf0e10cSrcweir                                  bool bFront = sal_False,
464cdf0e10cSrcweir                                  bool bAllowDuplicates = sal_False );
465cdf0e10cSrcweir 
466cdf0e10cSrcweir     virtual void    MoveEntry( bool bMoveUp );
467cdf0e10cSrcweir 
468cdf0e10cSrcweir     bool            MoveEntryData(  SvLBoxEntry* pSourceEntry,
469cdf0e10cSrcweir                                     SvLBoxEntry* pTargetEntry );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir     sal_Bool            FillItemSet( SfxItemSet& );
472cdf0e10cSrcweir     void            Reset( const SfxItemSet& );
473cdf0e10cSrcweir 
474cdf0e10cSrcweir     virtual bool    DeleteSelectedContent() = 0;
475cdf0e10cSrcweir     virtual void    DeleteSelectedTopLevel() = 0;
476cdf0e10cSrcweir 
GetTopLevelSelection()477cdf0e10cSrcweir     SvxConfigEntry* GetTopLevelSelection()
478cdf0e10cSrcweir     {
479cdf0e10cSrcweir         return (SvxConfigEntry*) aTopLevelListBox.GetEntryData(
480cdf0e10cSrcweir             aTopLevelListBox.GetSelectEntryPos() );
481cdf0e10cSrcweir     }
482cdf0e10cSrcweir 
483cdf0e10cSrcweir     /** identifies the module in the given frame. If the frame is <NULL/>, a default
484cdf0e10cSrcweir         frame will be determined beforehand.
485cdf0e10cSrcweir 
486cdf0e10cSrcweir         If the given frame is <NULL/>, a default frame will be used: The method the active
487cdf0e10cSrcweir         frame of the desktop, then the current frame. If both are <NULL/>,
488cdf0e10cSrcweir         the SfxViewFrame::Current's XFrame is used. If this is <NULL/>, too, an empty string is returned.
489cdf0e10cSrcweir 
490cdf0e10cSrcweir         If the given frame is not <NULL/>, or an default frame could be successfully determined, then
491cdf0e10cSrcweir         the ModuleManager is asked for the module ID of the component in the frame.
492cdf0e10cSrcweir     */
493cdf0e10cSrcweir     static ::rtl::OUString
494cdf0e10cSrcweir         GetFrameWithDefaultAndIdentify( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _inout_rxFrame );
495cdf0e10cSrcweir };
496cdf0e10cSrcweir 
497cdf0e10cSrcweir class SvxMenuConfigPage : public SvxConfigPage
498cdf0e10cSrcweir {
499cdf0e10cSrcweir private:
500cdf0e10cSrcweir 
501cdf0e10cSrcweir     DECL_LINK( SelectMenu, ListBox * );
502cdf0e10cSrcweir     DECL_LINK( SelectMenuEntry, Control * );
503cdf0e10cSrcweir     DECL_LINK( NewMenuHdl, Button * );
504cdf0e10cSrcweir     DECL_LINK( MenuSelectHdl, MenuButton * );
505cdf0e10cSrcweir     DECL_LINK( EntrySelectHdl, MenuButton * );
506cdf0e10cSrcweir     DECL_LINK( AddCommandsHdl, Button * );
507cdf0e10cSrcweir     DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
508cdf0e10cSrcweir 
509cdf0e10cSrcweir     void            Init();
510cdf0e10cSrcweir     void            UpdateButtonStates();
511cdf0e10cSrcweir     short           QueryReset();
512cdf0e10cSrcweir     bool            DeleteSelectedContent();
513cdf0e10cSrcweir     void            DeleteSelectedTopLevel();
514cdf0e10cSrcweir 
515cdf0e10cSrcweir public:
516cdf0e10cSrcweir     SvxMenuConfigPage( Window *pParent, const SfxItemSet& rItemSet );
517cdf0e10cSrcweir     ~SvxMenuConfigPage();
518cdf0e10cSrcweir 
519cdf0e10cSrcweir     SaveInData* CreateSaveInData(
520cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
521cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
522cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
523cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
524cdf0e10cSrcweir         const rtl::OUString& aModuleId,
525cdf0e10cSrcweir         bool docConfig );
526cdf0e10cSrcweir };
527cdf0e10cSrcweir 
528cdf0e10cSrcweir class SvxMainMenuOrganizerDialog : public ModalDialog
529cdf0e10cSrcweir {
530cdf0e10cSrcweir     FixedText       aMenuNameText;
531cdf0e10cSrcweir     Edit            aMenuNameEdit;
532cdf0e10cSrcweir     FixedText       aMenuListText;
533cdf0e10cSrcweir     SvTreeListBox   aMenuListBox;
534cdf0e10cSrcweir     ImageButton     aMoveUpButton;
535cdf0e10cSrcweir     ImageButton     aMoveDownButton;
536cdf0e10cSrcweir     OKButton        aOKButton;
537cdf0e10cSrcweir     CancelButton    aCloseButton;
538cdf0e10cSrcweir     HelpButton      aHelpButton;
539cdf0e10cSrcweir 
540cdf0e10cSrcweir     SvxEntries*     pEntries;
541cdf0e10cSrcweir     SvLBoxEntry*    pNewMenuEntry;
542cdf0e10cSrcweir     bool            bModified;
543cdf0e10cSrcweir 
544cdf0e10cSrcweir     void UpdateButtonStates();
545cdf0e10cSrcweir 
546cdf0e10cSrcweir     DECL_LINK( MoveHdl, Button * );
547cdf0e10cSrcweir     DECL_LINK( ModifyHdl, Edit * );
548cdf0e10cSrcweir     DECL_LINK( SelectHdl, Control* );
549cdf0e10cSrcweir 
550cdf0e10cSrcweir public:
551cdf0e10cSrcweir     SvxMainMenuOrganizerDialog (
552cdf0e10cSrcweir         Window*, SvxEntries*,
553cdf0e10cSrcweir         SvxConfigEntry*, bool bCreateMenu = sal_False );
554cdf0e10cSrcweir 
555cdf0e10cSrcweir     ~SvxMainMenuOrganizerDialog ();
556cdf0e10cSrcweir 
557cdf0e10cSrcweir     SvxEntries*     GetEntries();
558cdf0e10cSrcweir     void            SetEntries( SvxEntries* );
559cdf0e10cSrcweir     SvxConfigEntry* GetSelectedEntry();
560cdf0e10cSrcweir };
561cdf0e10cSrcweir 
562cdf0e10cSrcweir class SvxToolbarEntriesListBox : public SvxMenuEntriesListBox
563cdf0e10cSrcweir {
564cdf0e10cSrcweir     Size            m_aCheckBoxImageSizePixel;
565cdf0e10cSrcweir     Link            m_aChangedListener;
566cdf0e10cSrcweir     SvLBoxButtonData*   m_pButtonData;
567cdf0e10cSrcweir     sal_Bool            m_bHiContrastMode;
568cdf0e10cSrcweir     SvxConfigPage*  pPage;
569cdf0e10cSrcweir 
570cdf0e10cSrcweir     void            ChangeVisibility( SvLBoxEntry* pEntry );
571cdf0e10cSrcweir 
572cdf0e10cSrcweir protected:
573cdf0e10cSrcweir 
574cdf0e10cSrcweir     virtual void    CheckButtonHdl();
575cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
576cdf0e10cSrcweir     void            BuildCheckBoxButtonImages( SvLBoxButtonData* );
577cdf0e10cSrcweir     Image           GetSizedImage(
578cdf0e10cSrcweir         VirtualDevice& aDev, const Size& aNewSize, const Image& aImage );
579cdf0e10cSrcweir 
580cdf0e10cSrcweir public:
581cdf0e10cSrcweir 
582cdf0e10cSrcweir     SvxToolbarEntriesListBox(
583cdf0e10cSrcweir         Window* pParent, const ResId& );
584cdf0e10cSrcweir 
585cdf0e10cSrcweir     ~SvxToolbarEntriesListBox();
586cdf0e10cSrcweir 
SetChangedListener(const Link & aChangedListener)587cdf0e10cSrcweir     void            SetChangedListener( const Link& aChangedListener )
588cdf0e10cSrcweir         { m_aChangedListener = aChangedListener; }
589cdf0e10cSrcweir 
GetChangedListener() const590cdf0e10cSrcweir     const Link&     GetChangedListener() const { return m_aChangedListener; }
591cdf0e10cSrcweir 
GetCheckBoxPixelSize() const592cdf0e10cSrcweir     Size            GetCheckBoxPixelSize() const
593cdf0e10cSrcweir         { return m_aCheckBoxImageSizePixel; }
594cdf0e10cSrcweir 
595cdf0e10cSrcweir     virtual sal_Bool    NotifyMoving(
596cdf0e10cSrcweir         SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, sal_uLong& );
597cdf0e10cSrcweir 
598cdf0e10cSrcweir     virtual sal_Bool    NotifyCopying(
599cdf0e10cSrcweir         SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, sal_uLong&);
600cdf0e10cSrcweir 
601cdf0e10cSrcweir     void            KeyInput( const KeyEvent& rKeyEvent );
602cdf0e10cSrcweir };
603cdf0e10cSrcweir 
604cdf0e10cSrcweir class SvxToolbarConfigPage : public SvxConfigPage
605cdf0e10cSrcweir {
606cdf0e10cSrcweir private:
607cdf0e10cSrcweir 
608cdf0e10cSrcweir     DECL_LINK( SelectToolbar, ListBox * );
609cdf0e10cSrcweir     DECL_LINK( SelectToolbarEntry, Control * );
610cdf0e10cSrcweir     DECL_LINK( ToolbarSelectHdl, MenuButton * );
611cdf0e10cSrcweir     DECL_LINK( EntrySelectHdl, MenuButton * );
612cdf0e10cSrcweir     DECL_LINK( NewToolbarHdl, Button * );
613cdf0e10cSrcweir     DECL_LINK( AddCommandsHdl, Button * );
614cdf0e10cSrcweir     DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
615cdf0e10cSrcweir     DECL_LINK( MoveHdl, Button * );
616cdf0e10cSrcweir 
617cdf0e10cSrcweir     void            UpdateButtonStates();
618cdf0e10cSrcweir     short           QueryReset();
619cdf0e10cSrcweir     void            Init();
620cdf0e10cSrcweir     bool            DeleteSelectedContent();
621cdf0e10cSrcweir     void            DeleteSelectedTopLevel();
622cdf0e10cSrcweir 
623cdf0e10cSrcweir public:
624cdf0e10cSrcweir     SvxToolbarConfigPage( Window *pParent, const SfxItemSet& rItemSet );
625cdf0e10cSrcweir     ~SvxToolbarConfigPage();
626cdf0e10cSrcweir 
627cdf0e10cSrcweir     SvLBoxEntry*    AddFunction( SvLBoxEntry* pTarget = NULL,
628cdf0e10cSrcweir                                              bool bFront = sal_False,
629cdf0e10cSrcweir                                              bool bAllowDuplicates = sal_True );
630cdf0e10cSrcweir 
631cdf0e10cSrcweir     void            MoveEntry( bool bMoveUp );
632cdf0e10cSrcweir 
633cdf0e10cSrcweir     SaveInData*     CreateSaveInData(
634cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
635cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
636cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
637cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
638cdf0e10cSrcweir         const rtl::OUString& aModuleId,
639cdf0e10cSrcweir         bool docConfig );
640cdf0e10cSrcweir };
641cdf0e10cSrcweir 
642cdf0e10cSrcweir class ToolbarSaveInData : public SaveInData
643cdf0e10cSrcweir {
644cdf0e10cSrcweir private:
645cdf0e10cSrcweir 
646cdf0e10cSrcweir     SvxConfigEntry*                                pRootEntry;
647cdf0e10cSrcweir     rtl::OUString                                  m_aDescriptorContainer;
648cdf0e10cSrcweir 
649cdf0e10cSrcweir     ::com::sun::star::uno::Reference
650cdf0e10cSrcweir         < com::sun::star::container::XNameAccess > m_xPersistentWindowState;
651cdf0e10cSrcweir 
652cdf0e10cSrcweir     bool        LoadToolbar(
653cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
654cdf0e10cSrcweir             com::sun::star::container::XIndexAccess >& xToolBarSettings,
655cdf0e10cSrcweir         SvxConfigEntry* pParentData );
656cdf0e10cSrcweir 
657cdf0e10cSrcweir     void        ApplyToolbar(
658cdf0e10cSrcweir         com::sun::star::uno::Reference<
659cdf0e10cSrcweir             com::sun::star::container::XIndexContainer >& rNewToolbarBar,
660cdf0e10cSrcweir         com::sun::star::uno::Reference<
661cdf0e10cSrcweir             com::sun::star::lang::XSingleComponentFactory >& rFactory,
662cdf0e10cSrcweir         SvxConfigEntry *pToolbar = NULL );
663cdf0e10cSrcweir 
664cdf0e10cSrcweir public:
665cdf0e10cSrcweir 
666cdf0e10cSrcweir     ToolbarSaveInData(
667cdf0e10cSrcweir         const ::com::sun::star::uno::Reference <
668cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
669cdf0e10cSrcweir             const ::com::sun::star::uno::Reference <
670cdf0e10cSrcweir             ::com::sun::star::ui::XUIConfigurationManager >&,
671cdf0e10cSrcweir         const rtl::OUString& aModuleId,
672cdf0e10cSrcweir         bool docConfig );
673cdf0e10cSrcweir 
674cdf0e10cSrcweir     ~ToolbarSaveInData();
675cdf0e10cSrcweir 
676cdf0e10cSrcweir     void            CreateToolbar( SvxConfigEntry* pToolbar );
677cdf0e10cSrcweir     void            RestoreToolbar( SvxConfigEntry* pToolbar );
678cdf0e10cSrcweir     void            RemoveToolbar( SvxConfigEntry* pToolbar );
679cdf0e10cSrcweir     void            ApplyToolbar( SvxConfigEntry* pToolbar );
680cdf0e10cSrcweir 
681cdf0e10cSrcweir     rtl::OUString   GetSystemUIName( const rtl::OUString& rResourceURL );
682cdf0e10cSrcweir 
683cdf0e10cSrcweir     sal_Int32       GetSystemStyle( const rtl::OUString& rResourceURL );
684cdf0e10cSrcweir 
685cdf0e10cSrcweir     void            SetSystemStyle(
686cdf0e10cSrcweir         const rtl::OUString& rResourceURL, sal_Int32 nStyle );
687cdf0e10cSrcweir 
688cdf0e10cSrcweir     void            SetSystemStyle(
689cdf0e10cSrcweir         ::com::sun::star::uno::Reference
690cdf0e10cSrcweir             < ::com::sun::star::frame::XFrame > xFrame,
691cdf0e10cSrcweir         const rtl::OUString& rResourceURL, sal_Int32 nStyle );
692cdf0e10cSrcweir 
693cdf0e10cSrcweir     SvxEntries*     GetEntries();
694cdf0e10cSrcweir     void            SetEntries( SvxEntries* );
695cdf0e10cSrcweir     bool            HasSettings();
696cdf0e10cSrcweir     bool            HasURL( const rtl::OUString& rURL );
697cdf0e10cSrcweir     void            Reset();
698cdf0e10cSrcweir     bool            Apply();
699cdf0e10cSrcweir };
700cdf0e10cSrcweir 
701cdf0e10cSrcweir class SvxNewToolbarDialog : public ModalDialog
702cdf0e10cSrcweir {
703cdf0e10cSrcweir private:
704cdf0e10cSrcweir     FixedText       aFtDescription;
705cdf0e10cSrcweir     Edit            aEdtName;
706cdf0e10cSrcweir     FixedText       aSaveInText;
707cdf0e10cSrcweir     OKButton        aBtnOK;
708cdf0e10cSrcweir     CancelButton    aBtnCancel;
709cdf0e10cSrcweir     HelpButton      aBtnHelp;
710cdf0e10cSrcweir 
711cdf0e10cSrcweir     Link            aCheckNameHdl;
712cdf0e10cSrcweir 
713cdf0e10cSrcweir     DECL_LINK(ModifyHdl, Edit*);
714cdf0e10cSrcweir 
715cdf0e10cSrcweir public:
716cdf0e10cSrcweir     SvxNewToolbarDialog( Window* pWindow, const String& rName );
717cdf0e10cSrcweir 
718cdf0e10cSrcweir     ListBox         aSaveInListBox;
719cdf0e10cSrcweir 
GetName(rtl::OUString & rName)720cdf0e10cSrcweir     void    GetName( rtl::OUString& rName ){rName = aEdtName.GetText();}
721cdf0e10cSrcweir 
SetCheckNameHdl(const Link & rLink,bool bCheckImmediately=false)722cdf0e10cSrcweir     void    SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
723cdf0e10cSrcweir     {
724cdf0e10cSrcweir         aCheckNameHdl = rLink;
725cdf0e10cSrcweir         if ( bCheckImmediately )
726cdf0e10cSrcweir             aBtnOK.Enable( rLink.Call( this ) > 0 );
727cdf0e10cSrcweir     }
728cdf0e10cSrcweir 
SetEditHelpId(const rtl::OString & aHelpId)729cdf0e10cSrcweir     void    SetEditHelpId( const rtl::OString& aHelpId) {aEdtName.SetHelpId(aHelpId);}
730cdf0e10cSrcweir };
731cdf0e10cSrcweir 
732cdf0e10cSrcweir class SvxIconSelectorDialog : public ModalDialog
733cdf0e10cSrcweir {
734cdf0e10cSrcweir private:
735cdf0e10cSrcweir     FixedText       aFtDescription;
736cdf0e10cSrcweir     ToolBox         aTbSymbol;
737cdf0e10cSrcweir     FixedText       aFtNote;
738cdf0e10cSrcweir     OKButton        aBtnOK;
739cdf0e10cSrcweir     CancelButton    aBtnCancel;
740cdf0e10cSrcweir     HelpButton      aBtnHelp;
741cdf0e10cSrcweir     PushButton      aBtnImport;
742cdf0e10cSrcweir     PushButton      aBtnDelete;
743cdf0e10cSrcweir     FixedLine       aFlSeparator;
744cdf0e10cSrcweir     sal_uInt16      m_nNextId;
745cdf0e10cSrcweir 
746cdf0e10cSrcweir     sal_Int32       m_nExpectedSize;
747cdf0e10cSrcweir 
748cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
749cdf0e10cSrcweir         ::com::sun::star::ui::XImageManager > m_xImageManager;
750cdf0e10cSrcweir 
751cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
752cdf0e10cSrcweir         ::com::sun::star::ui::XImageManager > m_xParentImageManager;
753cdf0e10cSrcweir 
754cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
755cdf0e10cSrcweir         ::com::sun::star::ui::XImageManager > m_xImportedImageManager;
756cdf0e10cSrcweir 
757cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
758cdf0e10cSrcweir         ::com::sun::star::graphic::XGraphicProvider > m_xGraphProvider;
759cdf0e10cSrcweir 
760cdf0e10cSrcweir     bool ReplaceGraphicItem( const ::rtl::OUString& aURL );
761cdf0e10cSrcweir 
762cdf0e10cSrcweir     bool ImportGraphic( const ::rtl::OUString& aURL );
763cdf0e10cSrcweir 
764cdf0e10cSrcweir     void ImportGraphics(
765cdf0e10cSrcweir         const com::sun::star::uno::Sequence< rtl::OUString >& aURLs );
766cdf0e10cSrcweir 
767cdf0e10cSrcweir     BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);// Added by shizhoubo
768cdf0e10cSrcweir 
769cdf0e10cSrcweir public:
770cdf0e10cSrcweir 
771cdf0e10cSrcweir     SvxIconSelectorDialog(
772cdf0e10cSrcweir         Window *pWindow,
773cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
774cdf0e10cSrcweir             ::com::sun::star::ui::XImageManager >& rXImageManager,
775cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
776cdf0e10cSrcweir             ::com::sun::star::ui::XImageManager >& rXParentImageManager
777cdf0e10cSrcweir             );
778cdf0e10cSrcweir 
779cdf0e10cSrcweir     ~SvxIconSelectorDialog();
780cdf0e10cSrcweir 
781cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
782cdf0e10cSrcweir         GetSelectedIcon();
783cdf0e10cSrcweir 
784cdf0e10cSrcweir     DECL_LINK( SelectHdl, ToolBox * );
785cdf0e10cSrcweir     DECL_LINK( ImportHdl, PushButton * );
786cdf0e10cSrcweir     DECL_LINK( DeleteHdl, PushButton * );
787cdf0e10cSrcweir };
788cdf0e10cSrcweir 
789cdf0e10cSrcweir class SvxIconReplacementDialog : public MessBox
790cdf0e10cSrcweir {
791cdf0e10cSrcweir public:
792cdf0e10cSrcweir     SvxIconReplacementDialog(
793cdf0e10cSrcweir         Window *pWindow,
794cdf0e10cSrcweir         const rtl::OUString& aMessage,
795cdf0e10cSrcweir         bool aYestoAll);
796cdf0e10cSrcweir 
797cdf0e10cSrcweir     SvxIconReplacementDialog(
798cdf0e10cSrcweir         Window *pWindow,
799cdf0e10cSrcweir         const rtl::OUString& aMessage );
800cdf0e10cSrcweir 
801cdf0e10cSrcweir     rtl::OUString ReplaceIconName( const rtl::OUString& );
802cdf0e10cSrcweir     sal_uInt16 ShowDialog();
803cdf0e10cSrcweir };
804cdf0e10cSrcweir //added for issue83555
805cdf0e10cSrcweir class SvxIconChangeDialog : public ModalDialog
806cdf0e10cSrcweir {
807cdf0e10cSrcweir private:
808cdf0e10cSrcweir     FixedImage      aFImageInfo;
809cdf0e10cSrcweir     OKButton        aBtnOK;
810cdf0e10cSrcweir     FixedText         aDescriptionLabel;
811cdf0e10cSrcweir     SvxDescriptionEdit aLineEditDescription;
812cdf0e10cSrcweir public:
813cdf0e10cSrcweir     SvxIconChangeDialog(Window *pWindow, const rtl::OUString& aMessage);
814cdf0e10cSrcweir };
815cdf0e10cSrcweir #endif // _SVXCFG_HXX
816