diff options
Diffstat (limited to 'include/svx/sidebar')
-rw-r--r-- | include/svx/sidebar/ColorControl.hxx | 83 | ||||
-rw-r--r-- | include/svx/sidebar/ColorPopup.hxx | 51 | ||||
-rw-r--r-- | include/svx/sidebar/ContextChangeEventMultiplexer.hxx | 65 | ||||
-rw-r--r-- | include/svx/sidebar/Popup.hxx | 103 | ||||
-rw-r--r-- | include/svx/sidebar/PopupContainer.hxx | 44 | ||||
-rw-r--r-- | include/svx/sidebar/PopupControl.hxx | 47 | ||||
-rw-r--r-- | include/svx/sidebar/SelectionAnalyzer.hxx | 67 | ||||
-rw-r--r-- | include/svx/sidebar/SelectionChangeHandler.hxx | 85 | ||||
-rw-r--r-- | include/svx/sidebar/SidebarDialControl.hxx | 41 | ||||
-rw-r--r-- | include/svx/sidebar/ValueSetWithTextControl.hxx | 157 |
10 files changed, 743 insertions, 0 deletions
diff --git a/include/svx/sidebar/ColorControl.hxx b/include/svx/sidebar/ColorControl.hxx new file mode 100644 index 000000000000..606a906eccdb --- /dev/null +++ b/include/svx/sidebar/ColorControl.hxx @@ -0,0 +1,83 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#include "svx/sidebar/PopupControl.hxx" + +#include <svtools/valueset.hxx> +#include <boost/function.hpp> +#include <svx/SvxColorValueSet.hxx> + +class Window; +class SfxBindings; +class RedId; +class FloatingWindow; + + +namespace svx { namespace sidebar { + +/** The ColorControl uses a ValueSet control for displaying all named + colors in a matrix. +*/ +class SVX_DLLPUBLIC ColorControl + : public PopupControl +{ +public: + /** Create a new ColorControl object. + @param rControlResId + The resource id for the whole color control. + @param rNoColorGetter + A functor for getting the color which will be returned when the + WB_NONEFIELD is used and got selected + @param rColorSetter + A functor for setting the color that is selected by the + user. + @param pNoColorStringResId + Resource id of an optional string for the "no color" + string. When a value is given then a + field/button is created above the color matrix for + selecting "no color" ie. transparent. + When zero is given then no such field is created. + */ + ColorControl ( + Window* pParent, + SfxBindings* pBindings, + const ResId& rControlResId, + const ResId& rValueSetResId, + const ::boost::function<Color(void)>& rNoColorGetter, + const ::boost::function<void(String&,Color)>& rColorSetter, + FloatingWindow* pFloatingWindow, + const ResId* pNoColorStringResId); + virtual ~ColorControl (void); + + void GetFocus (void); + void SetCurColorSelect ( + const Color aCol, + const bool bAvl); + +private: + SfxBindings* mpBindings; + SvxColorValueSet maVSColor; + FloatingWindow* mpFloatingWindow; + const String msNoColorString; + ::boost::function<Color(void)> maNoColorGetter; + ::boost::function<void(String&,Color)> maColorSetter; + + void FillColors (void); + DECL_LINK(VSSelectHdl, void *); +}; + +} } // end of namespace svx::sidebar diff --git a/include/svx/sidebar/ColorPopup.hxx b/include/svx/sidebar/ColorPopup.hxx new file mode 100644 index 000000000000..cdac568c7fd5 --- /dev/null +++ b/include/svx/sidebar/ColorPopup.hxx @@ -0,0 +1,51 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_COLOR_POPUP_HXX_ +#define _SVX_SIDEBAR_COLOR_POPUP_HXX_ + +#include "svx/sidebar/Popup.hxx" + +#include <tools/color.hxx> + + +namespace svx { namespace sidebar { + +/** Popup control that displays all named colors in a matrix. + The number of rows and columns of the matrix are computed from + the number of named colors so that both have roughly the same + value. + + The ColorPopup uses ColorControl as control for its content. +*/ +class SVX_DLLPUBLIC ColorPopup + : public Popup +{ +public : + ColorPopup ( + Window* pParent, + const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator); + virtual ~ColorPopup (void); + + void SetCurrentColor ( + const Color aCurrentColor, + const bool bIsColorAvailable); +}; + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/ContextChangeEventMultiplexer.hxx b/include/svx/sidebar/ContextChangeEventMultiplexer.hxx new file mode 100644 index 000000000000..5075cdac70be --- /dev/null +++ b/include/svx/sidebar/ContextChangeEventMultiplexer.hxx @@ -0,0 +1,65 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_CONTEXT_CHANGE_EVENT_MULTIPLEXER_HXX_ +#define _SVX_SIDEBAR_CONTEXT_CHANGE_EVENT_MULTIPLEXER_HXX_ + +#include "svx/svxdllapi.h" +#include <sfx2/sidebar/EnumContext.hxx> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/frame/XFrame.hpp> + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + +class SfxViewShell; + +/** Convenience frontend for com::sun::star::ui::ContextChangeEventMultiplexer +*/ +class SVX_DLLPUBLIC ContextChangeEventMultiplexer +{ +public: + /** Notify the activation of a context. + @param rxController + This controller is used to determine the module (ie + application like Writer or Calc). + @param eContext + The activated context. + */ + static void NotifyContextChange ( + const cssu::Reference<css::frame::XController>& rxController, + const ::sfx2::sidebar::EnumContext::Context eContext); + + /** Notify the activation of a context. + @param pViewShell + This view shell is used to determine the module (ie + application like Writer or Calc). When <NULL/> then no + notification is made. + @param eContext + The activated context. + */ + static void NotifyContextChange ( + SfxViewShell* pViewShell, + const ::sfx2::sidebar::EnumContext::Context eContext); + +private: + static ::rtl::OUString GetModuleName ( + const cssu::Reference<css::frame::XFrame>& rxFrame); +}; + +#endif + diff --git a/include/svx/sidebar/Popup.hxx b/include/svx/sidebar/Popup.hxx new file mode 100644 index 000000000000..25571f11a5a7 --- /dev/null +++ b/include/svx/sidebar/Popup.hxx @@ -0,0 +1,103 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_POPUP_HXX_ +#define _SVX_SIDEBAR_POPUP_HXX_ + +#include "svx/svxdllapi.h" +#include <rtl/ustring.hxx> +#include <tools/link.hxx> + +#include <boost/function.hpp> +#include <boost/scoped_ptr.hpp> + +class Window; +class ToolBox; + +namespace svx { namespace sidebar { + +class PopupContainer; +class PopupControl; + +/** A wrapper around a PopupContainer and a PopupControl object. + Usually used as drop down for a toolbox. Use Show() to start + drop down mode and Hide() to end it. +*/ +class SVX_DLLPUBLIC Popup +{ +public : + /** Create a Popup wrapper object. + @param pParent + Parent window of the PopupContainer, which in turn is the + parent of the PopupControl. + @param rControlCreator + A functor that is called to create the PopupControl object + (usually an instance of a class derived from + PopupControl). + */ + Popup ( + Window* pParent, + const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator, + const ::rtl::OUString& rsAccessibleName); + virtual ~Popup (void); + + /** Show the popup. + @rToolBox + The tool box is used to determine the position at which + the popup is displayed. + */ + void Show (ToolBox& rToolBox); + + /** Hide the popup. + This method is called automatically when eg. the user clicks + outside the popup or when the ESC-key is pressed. The + application can call Hide() when the popup should be closed + for other, non-standard reasons. + */ + void Hide (void); + + /** If you want to be informed when the popup closes then add a + callback that is called after that. + */ + void SetPopupModeEndHandler (const ::boost::function<void(void)>& rCallback); + +protected: + ::boost::scoped_ptr<PopupControl> mpControl; + + /** Make sure that both PopupContainer and PopupControl objects + exist. Calls the maControlCreator functor if necessary. + */ + void ProvideContainerAndControl (void); + + /** A derived specialisation class can override this method to do + additional work. + */ + virtual void CreateContainerAndControl (void); + +private: + Window* mpParent; + ::boost::function<PopupControl*(PopupContainer*)> maControlCreator; + ::boost::function<void(void)> maPopupModeEndCallback; + const ::rtl::OUString msAccessibleName; + ::boost::scoped_ptr<PopupContainer> mpContainer; + + DECL_LINK(PopupModeEndHandler, void*); +}; + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/PopupContainer.hxx b/include/svx/sidebar/PopupContainer.hxx new file mode 100644 index 000000000000..1b33988c50fd --- /dev/null +++ b/include/svx/sidebar/PopupContainer.hxx @@ -0,0 +1,44 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_POPUP_CONTAINER_HXX_ +#define _SVX_SIDEBAR_POPUP_CONTAINER_HXX_ + +#include "svx/svxdllapi.h" +#include <vcl/floatwin.hxx> + +namespace svx { namespace sidebar { + +/** Simple base class for popup container windows used by sidebar + related drop downs. + It initializes the underlying floating window with the right + flags and closes the drop down when appropriate. +*/ +class SVX_DLLPUBLIC PopupContainer + : public FloatingWindow +{ +public: + PopupContainer (Window* pParent); + virtual ~PopupContainer (void); + + virtual long Notify (NotifyEvent& rNEvt); +}; + + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/PopupControl.hxx b/include/svx/sidebar/PopupControl.hxx new file mode 100644 index 000000000000..de116750109f --- /dev/null +++ b/include/svx/sidebar/PopupControl.hxx @@ -0,0 +1,47 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_POPUP_CONTROL_HXX_ +#define _SVX_SIDEBAR_POPUP_CONTROL_HXX_ + +#include "svx/svxdllapi.h" +#include <vcl/ctrl.hxx> + +namespace svx { namespace sidebar { + +/** Base class for sidebar related popup controls. + A PopupControl is typically a child of a PopupContainer and + provides the actual content of a popup. + This base class takes care of painting the proper background and + border for sidebar popups. + Specialize by derivation. +*/ +class SVX_DLLPUBLIC PopupControl + : public Control +{ +public : + PopupControl ( + Window* pParent, + const ResId& rResId); + virtual ~PopupControl (void); + + virtual void Paint (const Rectangle& rect); +}; + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx new file mode 100644 index 000000000000..601a96e977f9 --- /dev/null +++ b/include/svx/sidebar/SelectionAnalyzer.hxx @@ -0,0 +1,67 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_SELECTION_ANALYZER_HXX_ +#define _SVX_SIDEBAR_SELECTION_ANALYZER_HXX_ + +#include <sfx2/sidebar/EnumContext.hxx> +#include "svx/svxdllapi.h" + +class SdrMarkList; +class SdrObject; + + +namespace svx { namespace sidebar { + +/** Analyze the current selection of Calc or Draw/Impress documents + and return the associated sidebar context. + + The decision is based on heuristics. Do not expect pretty code. +*/ +class SVX_DLLPUBLIC SelectionAnalyzer +{ +public : + static sfx2::sidebar::EnumContext::Context GetContextForSelection_SC ( + const SdrMarkList& rMarkList); + static sfx2::sidebar::EnumContext::Context GetContextForSelection_SD ( + const SdrMarkList& rMarkList, + const bool bIsMasterPage, + const bool bIsHandoutPage, + const bool bIsNotesPage); + +private: + static sfx2::sidebar::EnumContext::Context GetContextForObjectId_SC ( + const sal_uInt16 nObjectId); + static sfx2::sidebar::EnumContext::Context GetContextForObjectId_SD ( + const sal_uInt16 nObjectId, + const bool bIsHandoutPage, + const bool bIsNotesPage); + static sal_uInt32 GetInventorTypeFromMark ( + const SdrMarkList& rMarkList); + static sal_uInt16 GetObjectTypeFromMark ( + const SdrMarkList& rMarkList); + static sal_uInt16 GetObjectTypeFromGroup ( + const SdrObject* pObj); + static bool IsShapeType ( + const sal_uInt16 nType); + static bool IsTextObjType ( + const sal_uInt16 nType); +}; + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/SelectionChangeHandler.hxx b/include/svx/sidebar/SelectionChangeHandler.hxx new file mode 100644 index 000000000000..29116e5249b8 --- /dev/null +++ b/include/svx/sidebar/SelectionChangeHandler.hxx @@ -0,0 +1,85 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_SELECTION_CHANGE_HANDLER_HXX_ +#define _SVX_SIDEBAR_SELECTION_CHANGE_HANDLER_HXX_ + +#include "svx/svxdllapi.h" +#include <sfx2/sidebar/EnumContext.hxx> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <com/sun/star/view/XSelectionChangeListener.hpp> + +#include <cppuhelper/compbase1.hxx> +#include <cppuhelper/basemutex.hxx> + +#include <boost/noncopyable.hpp> +#include <boost/function.hpp> + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + + +class SdrMarkView; + + +namespace svx { namespace sidebar { + +namespace { + typedef ::cppu::WeakComponentImplHelper1 < + css::view::XSelectionChangeListener + > SelectionChangeHandlerInterfaceBase; +} + + +class SVX_DLLPUBLIC SelectionChangeHandler + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public SelectionChangeHandlerInterfaceBase +{ +public: + SelectionChangeHandler ( + const boost::function<sfx2::sidebar::EnumContext::Context(void)>& rSelectionChangeCallback, + const cssu::Reference<css::frame::XController>& rxController, + const sfx2::sidebar::EnumContext::Context eDefaultContext); + virtual ~SelectionChangeHandler (void); + + virtual void SAL_CALL selectionChanged (const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException); + + virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException); + + virtual void SAL_CALL disposing (void) + throw (cssu::RuntimeException); + + void Connect (void); + void Disconnect (void); + +private: + const boost::function<sfx2::sidebar::EnumContext::Context(void)> maSelectionChangeCallback; + cssu::Reference<css::frame::XController> mxController; + const sfx2::sidebar::EnumContext::Context meDefaultContext; + bool mbIsConnected; +}; + + +} } // end of namespace svx::sidebar + + +#endif + diff --git a/include/svx/sidebar/SidebarDialControl.hxx b/include/svx/sidebar/SidebarDialControl.hxx new file mode 100644 index 000000000000..f468784cb36f --- /dev/null +++ b/include/svx/sidebar/SidebarDialControl.hxx @@ -0,0 +1,41 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SVX_SIDEBAR_DIAL_CONTROL_HXX +#define SVX_SIDEBAR_DIAL_CONTROL_HXX + +#include <svx/dialcontrol.hxx> + +namespace svx { namespace sidebar { + +/** Provide some improvements over the standard DialControl. +*/ +class SVX_DLLPUBLIC SidebarDialControl : public svx::DialControl +{ +public: + SidebarDialControl (Window* pParent, const ResId& rResId); + virtual ~SidebarDialControl (void); + + virtual void MouseButtonDown (const MouseEvent& rMEvt); + +protected: + virtual void HandleMouseEvent (const Point& rPos, bool bInitial); +}; + +} } // end of namespace svx::sidebar + +#endif diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx new file mode 100644 index 000000000000..d0e524ca4e70 --- /dev/null +++ b/include/svx/sidebar/ValueSetWithTextControl.hxx @@ -0,0 +1,157 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SVX_SIDEBAR_VALUESETWITHTEXT_CONTROL_HXX_ +#define _SVX_SIDEBAR_VALUESETWITHTEXT_CONTROL_HXX_ + +#include "svx/svxdllapi.h" + +#include <svtools/valueset.hxx> +#include <limits.h> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/lang/Locale.hpp> + +#include <vcl/image.hxx> + +#include <vector> + +namespace com{namespace sun{ namespace star{ + namespace container{ + class XIndexAccess; + } + namespace beans{ + struct PropertyValue; + } + namespace text{ + class XNumberingFormatter; + } +}}} + +namespace svx { namespace sidebar { + +/** Specialization of class <ValueSet>. + This specialization allows is a one-columned ValueSet which allow + items containing an image and a text or a text and a second text. + + Especially, used for sidebar related controls. +*/ +class SVX_DLLPUBLIC ValueSetWithTextControl : public ValueSet +{ +public: + // control type of specialized <ValueSet>: + // - image + text + // - text + text + enum tControlType + { + IMAGE_TEXT, + TEXT_TEXT + }; + + ValueSetWithTextControl( + const tControlType eControlType, + Window* pParent, + const ResId& rResId); + + virtual ~ValueSetWithTextControl(void); + + // add item for control type IMAGE_TEXT + // if control type does not match IMAGE_TEXT no item is added. + // @param pSelectedItemImage + // selection item image is optional. if not provided, it is the same as the image item + // @param pItemHelpText + // help text is optional. if not provided, it is the same as the item text + void AddItem( + const Image& rItemImage, + const Image* pSelectedItemImage, + const XubString& rItemText, + const XubString* pItemHelpText ); + + // replace item images for control type IMAGE_TEXT + void ReplaceItemImages( + const sal_uInt16 nItemId, + const Image& rItemImage, + const Image* pSelectedItemImage ); + + // add item for control type TEXT_TEXT + // if control type does not match TEXT_TEXT no item is added. + // @param pItemHelpText + // help text is optional. if not provided, it is the same as the item text + void AddItem( + const XubString& rItemText, + const XubString& rItemText2, + const XubString* pItemHelpText ); + + virtual void UserDraw( const UserDrawEvent& rUDEvt ); + +private: + struct ValueSetWithTextItem + { + Image maItemImage; + Image maSelectedItemImage; + XubString maItemText; + XubString maItemText2; + }; + + typedef ::std::vector< ValueSetWithTextItem > tItemList; + + const tControlType meControlType; + tItemList maItems; +}; + +class SVX_DLLPUBLIC SvxNumValueSet2 : public ValueSet +{ + Color aLineColor; + Rectangle aOrgRect; + VirtualDevice* pVDev; + + com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> xFormatter; + com::sun::star::lang::Locale aLocale; + + com::sun::star::uno::Sequence< + com::sun::star::uno::Sequence< + com::sun::star::beans::PropertyValue> > aNumSettings; + + + public: + SvxNumValueSet2( Window* pParent, const ResId& rResId); + ~SvxNumValueSet2(); + + virtual void UserDraw( const UserDrawEvent& rUDEvt ); + + + void SetNumberingSettings( + const com::sun::star::uno::Sequence< + com::sun::star::uno::Sequence< + com::sun::star::beans::PropertyValue> >& aNum, + com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& xFormatter, + const com::sun::star::lang::Locale& rLocale ); +}; + +class SVX_DLLPUBLIC SvxNumValueSet3 : public ValueSet +{ + public: + SvxNumValueSet3( Window* pParent, const ResId& rResId); + ~SvxNumValueSet3(); + + virtual void UserDraw( const UserDrawEvent& rUDEvt ); + +}; + +} } // end of namespace svx::sidebar + +#endif |