merge the formfield patch from ooo-build
[ooovba.git] / svx / source / cui / cfg.hxx
blob4aee5295e2b4582f9085d887c6c6f36a3f65bf0e
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: cfg.hxx,v $
10 * $Revision: 1.17 $
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 _SVXCFG_HXX
31 #define _SVXCFG_HXX
33 #include <vcl/lstbox.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <vcl/fixed.hxx>
36 #include <vcl/group.hxx>
37 #include <vcl/menubtn.hxx>
38 #include <vcl/toolbox.hxx>
39 #include <svtools/svtreebx.hxx>
40 #include <svtools/svmedit2.hxx>
41 #include <svtools/svmedit.hxx>
42 #include <com/sun/star/beans/XPropertySet.hpp>
43 #include <com/sun/star/container/XIndexContainer.hpp>
44 #include <com/sun/star/container/XNameAccess.hpp>
45 #include <com/sun/star/frame/XModuleManager.hpp>
46 #include <com/sun/star/ui/XUIConfigurationListener.hpp>
47 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
48 #include <com/sun/star/ui/XImageManager.hpp>
49 #include <com/sun/star/graphic/XGraphicProvider.hpp>
50 #include <com/sun/star/frame/XFrame.hpp>
51 #include <com/sun/star/frame/XStorable.hpp>
52 #include <com/sun/star/uno/XComponentContext.hpp>
53 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
55 #define _SVSTDARR_USHORTS
56 #define _SVSTDARR_STRINGSDTOR
57 #include <svtools/svstdarr.hxx> // SvUShorts
58 #include <sfx2/minarray.hxx>
59 #include <sfx2/tabdlg.hxx>
60 #include <vector>
61 #include <vcl/msgbox.hxx>
63 #include "selector.hxx"
65 class SvxConfigEntry;
66 class SvxConfigPage;
67 class SvxMenuConfigPage;
68 class SvxToolbarConfigPage;
70 typedef std::vector< SvxConfigEntry* > SvxEntries;
72 class SvxConfigDialog : public SfxTabDialog
74 private:
75 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
77 public:
78 SvxConfigDialog( Window*, const SfxItemSet* );
79 ~SvxConfigDialog();
81 void ActivateTabPage( USHORT );
83 virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
84 virtual short Ok();
86 void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame);
89 class SaveInData : public ImageProvider
91 private:
93 bool bModified;
95 bool bDocConfig;
96 bool bReadOnly;
98 ::com::sun::star::uno::Reference
99 < com::sun::star::ui::XUIConfigurationManager > m_xCfgMgr;
101 ::com::sun::star::uno::Reference
102 < com::sun::star::ui::XUIConfigurationManager > m_xParentCfgMgr;
104 ::com::sun::star::uno::Reference
105 < com::sun::star::ui::XImageManager > m_xImgMgr;
107 ::com::sun::star::uno::Reference
108 < com::sun::star::ui::XImageManager > m_xParentImgMgr;
110 static ::com::sun::star::uno::Reference
111 < com::sun::star::ui::XImageManager >* xDefaultImgMgr;
113 public:
115 SaveInData(
116 const ::com::sun::star::uno::Reference <
117 ::com::sun::star::ui::XUIConfigurationManager >& xCfgMgr,
118 const ::com::sun::star::uno::Reference <
119 ::com::sun::star::ui::XUIConfigurationManager >& xParentCfgMgr,
120 const rtl::OUString& aModuleId,
121 bool docConfig );
123 ~SaveInData() {}
125 bool PersistChanges(
126 const com::sun::star::uno::Reference
127 < com::sun::star::uno::XInterface >& xManager );
129 void SetModified( bool bValue = TRUE ) { bModified = bValue; }
130 bool IsModified( ) { return bModified; }
132 bool IsReadOnly( ) { return bReadOnly; }
133 bool IsDocConfig( ) { return bDocConfig; }
135 ::com::sun::star::uno::Reference
136 < ::com::sun::star::ui::XUIConfigurationManager >
137 GetConfigManager() { return m_xCfgMgr; };
139 ::com::sun::star::uno::Reference
140 < ::com::sun::star::ui::XUIConfigurationManager >
141 GetParentConfigManager() { return m_xParentCfgMgr; };
143 ::com::sun::star::uno::Reference
144 < ::com::sun::star::ui::XImageManager >
145 GetImageManager() { return m_xImgMgr; };
147 ::com::sun::star::uno::Reference
148 < ::com::sun::star::ui::XImageManager >
149 GetParentImageManager() { return m_xParentImgMgr; };
151 ::com::sun::star::uno::Reference
152 < com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
154 ::com::sun::star::uno::Reference
155 < com::sun::star::container::XNameAccess > m_xCommandToLabelMap;
157 com::sun::star::uno::Reference
158 < com::sun::star::uno::XComponentContext > m_xComponentContext;
160 com::sun::star::uno::Sequence
161 < com::sun::star::beans::PropertyValue > m_aSeparatorSeq;
163 Image GetImage( const rtl::OUString& rCommandURL );
165 virtual bool HasURL( const rtl::OUString& aURL ) = 0;
166 virtual bool HasSettings() = 0;
167 virtual SvxEntries* GetEntries() = 0;
168 virtual void SetEntries( SvxEntries* ) = 0;
169 virtual void Reset() = 0;
170 virtual bool Apply() = 0;
173 class MenuSaveInData : public SaveInData
175 private:
177 rtl::OUString m_aMenuResourceURL;
178 rtl::OUString m_aDescriptorContainer;
180 ::com::sun::star::uno::Reference
181 < com::sun::star::container::XIndexAccess > m_xMenuSettings;
183 SvxConfigEntry* pRootEntry;
185 // static holder of the default menu data
186 static MenuSaveInData* pDefaultData;
188 static void SetDefaultData( MenuSaveInData* pData ) {pDefaultData = pData;}
189 static MenuSaveInData* GetDefaultData() { return pDefaultData; }
191 void Apply( bool bDefault );
193 void Apply(
194 SvxConfigEntry* pRootEntry,
195 com::sun::star::uno::Reference<
196 com::sun::star::container::XIndexContainer >& rNewMenuBar,
197 com::sun::star::uno::Reference<
198 com::sun::star::lang::XSingleComponentFactory >& rFactory,
199 SvLBoxEntry *pParent = NULL );
201 void ApplyMenu(
202 com::sun::star::uno::Reference<
203 com::sun::star::container::XIndexContainer >& rNewMenuBar,
204 com::sun::star::uno::Reference<
205 com::sun::star::lang::XSingleComponentFactory >& rFactory,
206 SvxConfigEntry *pMenuData = NULL );
208 bool LoadSubMenus(
209 const ::com::sun::star::uno::Reference<
210 com::sun::star::container::XIndexAccess >& xMenuBarSettings,
211 const rtl::OUString& rBaseTitle, SvxConfigEntry* pParentData );
213 public:
215 MenuSaveInData(
216 const ::com::sun::star::uno::Reference <
217 ::com::sun::star::ui::XUIConfigurationManager >&,
218 const ::com::sun::star::uno::Reference <
219 ::com::sun::star::ui::XUIConfigurationManager >&,
220 const rtl::OUString& aModuleId,
221 bool docConfig );
223 ~MenuSaveInData();
225 // methods inherited from SaveInData
226 SvxEntries* GetEntries();
227 void SetEntries( SvxEntries* );
228 bool HasURL( const rtl::OUString& URL ) { (void)URL; return FALSE; }
229 bool HasSettings() { return m_xMenuSettings.is(); }
230 void Reset();
231 bool Apply();
234 class SvxConfigEntry
236 private:
238 // common properties
239 USHORT nId;
240 ::rtl::OUString aHelpText;
241 ::rtl::OUString aLabel;
242 ::rtl::OUString aCommand;
243 ::rtl::OUString aHelpURL;
245 bool bPopUp;
246 bool bStrEdited;
247 bool bIsUserDefined;
248 bool bIsMain;
249 bool bIsDeletable;
250 bool bIsMovable;
251 bool bIsParentData;
253 // toolbar specific properties
254 bool bIsVisible;
255 sal_Int32 nStyle;
257 ::com::sun::star::uno::Reference<
258 ::com::sun::star::graphic::XGraphic > xBackupGraphic;
260 SvxEntries *pEntries;
262 public:
264 SvxConfigEntry(
265 const ::com::sun::star::uno::Sequence<
266 ::com::sun::star::beans::PropertyValue >& rProperties,
267 const ::com::sun::star::uno::Reference<
268 ::com::sun::star::container::XNameAccess >& rCommandToLabelMap );
270 SvxConfigEntry( const ::rtl::OUString& rDisplayName,
271 const ::rtl::OUString& rCommandURL,
272 bool bPopup = FALSE,
273 bool bParentData = FALSE );
275 SvxConfigEntry()
277 nId( 0 ),
278 bPopUp( FALSE ),
279 bStrEdited( FALSE ),
280 bIsUserDefined( FALSE ),
281 bIsMain( FALSE ),
282 bIsParentData( FALSE ),
283 bIsVisible( TRUE ),
284 nStyle( 0 ),
285 pEntries( 0 )
288 ~SvxConfigEntry();
290 const ::rtl::OUString& GetCommand() const { return aCommand; }
291 void SetCommand( const String& rCmd ) { aCommand = rCmd; }
293 const ::rtl::OUString& GetName() const { return aLabel; }
294 void SetName( const String& rStr ) { aLabel = rStr; bStrEdited = TRUE; }
295 bool HasChangedName() const { return bStrEdited; }
297 const ::rtl::OUString& GetHelpText() ;
298 void SetHelpText( const String& rStr ) { aHelpText = rStr; }
300 const ::rtl::OUString& GetHelpURL() const { return aHelpURL; }
301 void SetHelpURL( const String& rStr ) { aHelpURL = rStr; }
303 void SetPopup( bool bOn = TRUE ) { bPopUp = bOn; }
304 bool IsPopup() const { return bPopUp; }
306 void SetUserDefined( bool bOn = TRUE ) { bIsUserDefined = bOn; }
307 bool IsUserDefined() const { return bIsUserDefined; }
309 bool IsBinding() const { return !bPopUp; }
310 bool IsSeparator() const { return nId == 0; }
312 SvxEntries* GetEntries() const { return pEntries; }
313 void SetEntries( SvxEntries* entries ) { pEntries = entries; }
314 bool HasEntries() const { return pEntries != NULL; }
316 void SetMain( bool bValue = TRUE ) { bIsMain = bValue; }
317 bool IsMain() { return bIsMain; }
319 void SetParentData( bool bValue = TRUE ) { bIsParentData = bValue; }
320 bool IsParentData() { return bIsParentData; }
322 bool IsMovable();
323 bool IsDeletable();
324 bool IsRenamable();
326 void SetVisible( bool b ) { bIsVisible = b; }
327 bool IsVisible() const { return bIsVisible; }
329 void SetBackupGraphic(
330 ::com::sun::star::uno::Reference<
331 ::com::sun::star::graphic::XGraphic > graphic )
332 { xBackupGraphic = graphic; }
334 ::com::sun::star::uno::Reference<
335 ::com::sun::star::graphic::XGraphic >
336 GetBackupGraphic()
337 { return xBackupGraphic; }
339 bool IsIconModified() { return xBackupGraphic.is(); }
341 sal_Int32 GetStyle() { return nStyle; }
342 void SetStyle( sal_Int32 style ) { nStyle = style; }
344 com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
345 GetProperties(
346 const ::com::sun::star::uno::Reference<
347 ::com::sun::star::container::XNameAccess >& rCommandToLabelMap );
350 class SvxMenuEntriesListBox : public SvTreeListBox
352 private:
353 SvxConfigPage* pPage;
355 protected:
356 bool m_bIsInternalDrag;
358 public:
359 SvxMenuEntriesListBox( Window*, const ResId& );
360 ~SvxMenuEntriesListBox();
362 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
364 virtual BOOL NotifyAcceptDrop( SvLBoxEntry* pEntry );
366 virtual BOOL NotifyMoving( SvLBoxEntry*, SvLBoxEntry*,
367 SvLBoxEntry*&, ULONG& );
369 virtual BOOL NotifyCopying( SvLBoxEntry*, SvLBoxEntry*,
370 SvLBoxEntry*&, ULONG&);
372 virtual DragDropMode NotifyStartDrag(
373 TransferDataContainer&, SvLBoxEntry* );
375 virtual void DragFinished( sal_Int8 );
377 void KeyInput( const KeyEvent& rKeyEvent );
380 class SvxDescriptionEdit : public ExtMultiLineEdit
382 private:
383 Rectangle m_aRealRect;
385 public:
386 SvxDescriptionEdit( Window* pParent, const ResId& _rId );
387 inline ~SvxDescriptionEdit() {}
389 void SetNewText( const String& _rText );
390 inline void Clear() { SetNewText( String() ); }
393 class SvxConfigPage : public SfxTabPage
395 private:
397 bool bInitialised;
398 SaveInData* pCurrentSaveInData;
400 DECL_LINK( SelectSaveInLocation, ListBox * );
401 DECL_LINK( AsyncInfoMsg, String* );
403 bool SwapEntryData( SvLBoxEntry* pSourceEntry, SvLBoxEntry* pTargetEntry );
404 void AlignControls();
406 protected:
408 // the top section of the tab page where top level menus and toolbars
409 // are displayed in a listbox
410 FixedLine aTopLevelSeparator;
411 FixedText aTopLevelLabel;
412 ListBox aTopLevelListBox;
413 PushButton aNewTopLevelButton;
414 MenuButton aModifyTopLevelButton;
416 // the contents section where the contents of the selected
417 // menu or toolbar are displayed
418 FixedLine aContentsSeparator;
419 FixedText aContentsLabel;
420 SvTreeListBox* aContentsListBox;
422 PushButton aAddCommandsButton;
423 MenuButton aModifyCommandButton;
425 ImageButton aMoveUpButton;
426 ImageButton aMoveDownButton;
428 FixedText aSaveInText;
429 ListBox aSaveInListBox;
431 FixedText aDescriptionLabel;
432 SvxDescriptionEdit aDescriptionField;
434 SvxScriptSelectorDialog* pSelectorDlg;
436 // the ResourceURL to select when opening the dialog
437 rtl::OUString m_aURLToSelect;
439 ::com::sun::star::uno::Reference
440 < ::com::sun::star::frame::XFrame > m_xFrame;
442 SvxConfigPage( Window*, /* const ResId&, */ const SfxItemSet& );
443 virtual ~SvxConfigPage();
445 DECL_LINK( MoveHdl, Button * );
447 virtual SaveInData* CreateSaveInData(
448 const ::com::sun::star::uno::Reference <
449 ::com::sun::star::ui::XUIConfigurationManager >&,
450 const ::com::sun::star::uno::Reference <
451 ::com::sun::star::ui::XUIConfigurationManager >&,
452 const rtl::OUString& aModuleId,
453 bool docConfig ) = 0;
455 virtual void Init() = 0;
456 virtual void UpdateButtonStates() = 0;
457 virtual short QueryReset() = 0;
459 void PositionContentsListBox();
461 SvLBoxEntry* InsertEntry( SvxConfigEntry* pNewEntryData,
462 SvLBoxEntry* pTarget = NULL,
463 bool bFront = FALSE );
465 void AddSubMenusToUI( const String& rBaseTitle,
466 SvxConfigEntry* pParentData );
468 SvLBoxEntry* InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
469 ULONG nPos = LIST_APPEND );
471 SvxEntries* FindParentForChild( SvxEntries* pParentEntries,
472 SvxConfigEntry* pChildData );
474 void ReloadTopLevelListBox( SvxConfigEntry* pSelection = NULL );
476 public:
478 static bool CanConfig( const ::rtl::OUString& rModuleId );
480 SaveInData* GetSaveInData() { return pCurrentSaveInData; }
482 SvLBoxEntry* AddFunction( SvLBoxEntry* pTarget = NULL,
483 bool bFront = FALSE,
484 bool bAllowDuplicates = FALSE );
486 virtual void MoveEntry( bool bMoveUp );
488 bool MoveEntryData( SvLBoxEntry* pSourceEntry,
489 SvLBoxEntry* pTargetEntry );
491 BOOL FillItemSet( SfxItemSet& );
492 void Reset( const SfxItemSet& );
494 virtual bool DeleteSelectedContent() = 0;
495 virtual void DeleteSelectedTopLevel() = 0;
497 SvxConfigEntry* GetTopLevelSelection()
499 return (SvxConfigEntry*) aTopLevelListBox.GetEntryData(
500 aTopLevelListBox.GetSelectEntryPos() );
503 /** identifies the module in the given frame. If the frame is <NULL/>, a default
504 frame will be determined beforehand.
506 If the given frame is <NULL/>, a default frame will be used: The method the active
507 frame of the desktop, then the current frame. If both are <NULL/>,
508 the SfxViewFrame::Current's XFrame is used. If this is <NULL/>, too, an empty string is returned.
510 If the given frame is not <NULL/>, or an default frame could be successfully determined, then
511 the ModuleManager is asked for the module ID of the component in the frame.
513 static ::rtl::OUString
514 GetFrameWithDefaultAndIdentify( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _inout_rxFrame );
517 class SvxMenuConfigPage : public SvxConfigPage
519 private:
521 DECL_LINK( SelectMenu, ListBox * );
522 DECL_LINK( SelectMenuEntry, Control * );
523 DECL_LINK( NewMenuHdl, Button * );
524 DECL_LINK( MenuSelectHdl, MenuButton * );
525 DECL_LINK( EntrySelectHdl, MenuButton * );
526 DECL_LINK( AddCommandsHdl, Button * );
527 DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
529 void Init();
530 void UpdateButtonStates();
531 short QueryReset();
532 bool DeleteSelectedContent();
533 void DeleteSelectedTopLevel();
535 public:
536 SvxMenuConfigPage( Window *pParent, const SfxItemSet& rItemSet );
537 ~SvxMenuConfigPage();
539 SaveInData* CreateSaveInData(
540 const ::com::sun::star::uno::Reference <
541 ::com::sun::star::ui::XUIConfigurationManager >&,
542 const ::com::sun::star::uno::Reference <
543 ::com::sun::star::ui::XUIConfigurationManager >&,
544 const rtl::OUString& aModuleId,
545 bool docConfig );
548 class SvxMainMenuOrganizerDialog : public ModalDialog
550 FixedText aMenuNameText;
551 Edit aMenuNameEdit;
552 FixedText aMenuListText;
553 SvTreeListBox aMenuListBox;
554 ImageButton aMoveUpButton;
555 ImageButton aMoveDownButton;
556 OKButton aOKButton;
557 CancelButton aCloseButton;
558 HelpButton aHelpButton;
560 SvxEntries* pEntries;
561 SvLBoxEntry* pNewMenuEntry;
562 bool bModified;
564 void UpdateButtonStates();
566 DECL_LINK( MoveHdl, Button * );
567 DECL_LINK( ModifyHdl, Edit * );
568 DECL_LINK( SelectHdl, Control* );
570 public:
571 SvxMainMenuOrganizerDialog (
572 Window*, SvxEntries*,
573 SvxConfigEntry*, bool bCreateMenu = FALSE );
575 ~SvxMainMenuOrganizerDialog ();
577 SvxEntries* GetEntries();
578 void SetEntries( SvxEntries* );
579 SvxConfigEntry* GetSelectedEntry();
582 class SvxToolbarEntriesListBox : public SvxMenuEntriesListBox
584 Size m_aCheckBoxImageSizePixel;
585 Link m_aChangedListener;
586 SvLBoxButtonData* m_pButtonData;
587 BOOL m_bHiContrastMode;
588 SvxConfigPage* pPage;
590 void ChangeVisibility( SvLBoxEntry* pEntry );
592 protected:
594 virtual void CheckButtonHdl();
595 virtual void DataChanged( const DataChangedEvent& rDCEvt );
596 void BuildCheckBoxButtonImages( SvLBoxButtonData* );
597 Image GetSizedImage(
598 VirtualDevice& aDev, const Size& aNewSize, const Image& aImage );
600 public:
602 SvxToolbarEntriesListBox(
603 Window* pParent, const ResId& );
605 ~SvxToolbarEntriesListBox();
607 void SetChangedListener( const Link& aChangedListener )
608 { m_aChangedListener = aChangedListener; }
610 const Link& GetChangedListener() const { return m_aChangedListener; }
612 Size GetCheckBoxPixelSize() const
613 { return m_aCheckBoxImageSizePixel; }
615 virtual BOOL NotifyMoving(
616 SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG& );
618 virtual BOOL NotifyCopying(
619 SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG&);
621 void KeyInput( const KeyEvent& rKeyEvent );
624 class SvxToolbarConfigPage : public SvxConfigPage
626 private:
628 DECL_LINK( SelectToolbar, ListBox * );
629 DECL_LINK( SelectToolbarEntry, Control * );
630 DECL_LINK( ToolbarSelectHdl, MenuButton * );
631 DECL_LINK( EntrySelectHdl, MenuButton * );
632 DECL_LINK( NewToolbarHdl, Button * );
633 DECL_LINK( AddCommandsHdl, Button * );
634 DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog * );
635 DECL_LINK( MoveHdl, Button * );
637 void UpdateButtonStates();
638 short QueryReset();
639 void Init();
640 bool DeleteSelectedContent();
641 void DeleteSelectedTopLevel();
643 public:
644 SvxToolbarConfigPage( Window *pParent, const SfxItemSet& rItemSet );
645 ~SvxToolbarConfigPage();
647 SvLBoxEntry* AddFunction( SvLBoxEntry* pTarget = NULL,
648 bool bFront = FALSE,
649 bool bAllowDuplicates = TRUE );
651 void MoveEntry( bool bMoveUp );
653 SaveInData* CreateSaveInData(
654 const ::com::sun::star::uno::Reference <
655 ::com::sun::star::ui::XUIConfigurationManager >&,
656 const ::com::sun::star::uno::Reference <
657 ::com::sun::star::ui::XUIConfigurationManager >&,
658 const rtl::OUString& aModuleId,
659 bool docConfig );
662 class ToolbarSaveInData : public SaveInData
664 private:
666 SvxConfigEntry* pRootEntry;
667 rtl::OUString m_aDescriptorContainer;
669 ::com::sun::star::uno::Reference
670 < com::sun::star::container::XNameAccess > m_xPersistentWindowState;
672 bool LoadToolbar(
673 const ::com::sun::star::uno::Reference<
674 com::sun::star::container::XIndexAccess >& xToolBarSettings,
675 SvxConfigEntry* pParentData );
677 void ApplyToolbar(
678 com::sun::star::uno::Reference<
679 com::sun::star::container::XIndexContainer >& rNewToolbarBar,
680 com::sun::star::uno::Reference<
681 com::sun::star::lang::XSingleComponentFactory >& rFactory,
682 SvxConfigEntry *pToolbar = NULL );
684 public:
686 ToolbarSaveInData(
687 const ::com::sun::star::uno::Reference <
688 ::com::sun::star::ui::XUIConfigurationManager >&,
689 const ::com::sun::star::uno::Reference <
690 ::com::sun::star::ui::XUIConfigurationManager >&,
691 const rtl::OUString& aModuleId,
692 bool docConfig );
694 ~ToolbarSaveInData();
696 void CreateToolbar( SvxConfigEntry* pToolbar );
697 void RestoreToolbar( SvxConfigEntry* pToolbar );
698 void RemoveToolbar( SvxConfigEntry* pToolbar );
699 void ApplyToolbar( SvxConfigEntry* pToolbar );
700 void ReloadToolbar( const rtl::OUString& rURL );
702 rtl::OUString GetSystemUIName( const rtl::OUString& rResourceURL );
704 sal_Int32 GetSystemStyle( const rtl::OUString& rResourceURL );
706 void SetSystemStyle(
707 const rtl::OUString& rResourceURL, sal_Int32 nStyle );
709 void SetSystemStyle(
710 ::com::sun::star::uno::Reference
711 < ::com::sun::star::frame::XFrame > xFrame,
712 const rtl::OUString& rResourceURL, sal_Int32 nStyle );
714 SvxEntries* GetEntries();
715 void SetEntries( SvxEntries* );
716 bool HasSettings();
717 bool HasURL( const rtl::OUString& rURL );
718 void Reset();
719 bool Apply();
722 class SvxNewToolbarDialog : public ModalDialog
724 private:
725 FixedText aFtDescription;
726 Edit aEdtName;
727 FixedText aSaveInText;
728 OKButton aBtnOK;
729 CancelButton aBtnCancel;
730 HelpButton aBtnHelp;
732 Link aCheckNameHdl;
734 DECL_LINK(ModifyHdl, Edit*);
736 public:
737 SvxNewToolbarDialog( Window* pWindow, const String& rName );
739 ListBox aSaveInListBox;
741 void GetName( rtl::OUString& rName ){rName = aEdtName.GetText();}
743 void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
745 aCheckNameHdl = rLink;
746 if ( bCheckImmediately )
747 aBtnOK.Enable( rLink.Call( this ) > 0 );
750 void SetEditHelpId(ULONG nHelpId) {aEdtName.SetHelpId(nHelpId);}
753 class SvxIconSelectorDialog : public ModalDialog
755 private:
756 FixedText aFtDescription;
757 ToolBox aTbSymbol;
758 FixedText aFtNote;
759 OKButton aBtnOK;
760 CancelButton aBtnCancel;
761 HelpButton aBtnHelp;
762 PushButton aBtnImport;
763 PushButton aBtnDelete;
764 FixedLine aFlSeparator;
765 sal_uInt16 m_nNextId;
767 sal_Int32 m_nExpectedSize;
769 ::com::sun::star::uno::Reference<
770 ::com::sun::star::ui::XImageManager > m_xImageManager;
772 ::com::sun::star::uno::Reference<
773 ::com::sun::star::ui::XImageManager > m_xParentImageManager;
775 ::com::sun::star::uno::Reference<
776 ::com::sun::star::ui::XImageManager > m_xImportedImageManager;
778 ::com::sun::star::uno::Reference<
779 ::com::sun::star::graphic::XGraphicProvider > m_xGraphProvider;
781 bool ReplaceGraphicItem( const ::rtl::OUString& aURL );
783 bool ImportGraphic( const ::rtl::OUString& aURL );
785 void ImportGraphics(
786 const com::sun::star::uno::Sequence< rtl::OUString >& aURLs );
788 BitmapEx AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize);// Added by shizhoubo
790 public:
792 SvxIconSelectorDialog(
793 Window *pWindow,
794 const ::com::sun::star::uno::Reference<
795 ::com::sun::star::ui::XImageManager >& rXImageManager,
796 const ::com::sun::star::uno::Reference<
797 ::com::sun::star::ui::XImageManager >& rXParentImageManager
800 ~SvxIconSelectorDialog();
802 ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
803 GetSelectedIcon();
805 DECL_LINK( SelectHdl, ToolBox * );
806 DECL_LINK( ImportHdl, PushButton * );
807 DECL_LINK( DeleteHdl, PushButton * );
810 class SvxIconReplacementDialog : public MessBox
812 public:
813 SvxIconReplacementDialog(
814 Window *pWindow,
815 const rtl::OUString& aMessage,
816 bool aYestoAll);
818 SvxIconReplacementDialog(
819 Window *pWindow,
820 const rtl::OUString& aMessage );
822 rtl::OUString ReplaceIconName( const rtl::OUString& );
823 USHORT ShowDialog();
825 //added for issue83555
826 class SvxIconChangeDialog : public ModalDialog
828 private:
829 FixedImage aFImageInfo;
830 OKButton aBtnOK;
831 FixedText aDescriptionLabel;
832 SvxDescriptionEdit aLineEditDescription;
833 public:
834 SvxIconChangeDialog(Window *pWindow, const rtl::OUString& aMessage);
836 #endif // _SVXCFG_HXX