2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef _SVX_SIDEBAR_VALUESETWITHTEXT_CONTROL_HXX_
19 #define _SVX_SIDEBAR_VALUESETWITHTEXT_CONTROL_HXX_
21 #include "svx/svxdllapi.h"
23 #include <svtools/valueset.hxx>
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <com/sun/star/lang/Locale.hpp>
29 #include <vcl/image.hxx>
33 namespace com
{namespace sun
{ namespace star
{
41 class XNumberingFormatter
;
45 namespace svx
{ namespace sidebar
{
47 /** Specialization of class <ValueSet>.
48 This specialization allows is a one-columned ValueSet which allow
49 items containing an image and a text or a text and a second text.
51 Especially, used for sidebar related controls.
53 class SVX_DLLPUBLIC ValueSetWithTextControl
: public ValueSet
56 // control type of specialized <ValueSet>:
65 ValueSetWithTextControl(
66 const tControlType eControlType
,
70 virtual ~ValueSetWithTextControl(void);
72 // add item for control type IMAGE_TEXT
73 // if control type does not match IMAGE_TEXT no item is added.
74 // @param pSelectedItemImage
75 // selection item image is optional. if not provided, it is the same as the image item
76 // @param pItemHelpText
77 // help text is optional. if not provided, it is the same as the item text
79 const Image
& rItemImage
,
80 const Image
* pSelectedItemImage
,
81 const XubString
& rItemText
,
82 const XubString
* pItemHelpText
);
84 // replace item images for control type IMAGE_TEXT
85 void ReplaceItemImages(
86 const sal_uInt16 nItemId
,
87 const Image
& rItemImage
,
88 const Image
* pSelectedItemImage
);
90 // add item for control type TEXT_TEXT
91 // if control type does not match TEXT_TEXT no item is added.
92 // @param pItemHelpText
93 // help text is optional. if not provided, it is the same as the item text
95 const XubString
& rItemText
,
96 const XubString
& rItemText2
,
97 const XubString
* pItemHelpText
);
99 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
102 struct ValueSetWithTextItem
105 Image maSelectedItemImage
;
106 XubString maItemText
;
107 XubString maItemText2
;
110 typedef ::std::vector
< ValueSetWithTextItem
> tItemList
;
112 const tControlType meControlType
;
116 class SVX_DLLPUBLIC SvxNumValueSet2
: public ValueSet
120 VirtualDevice
* pVDev
;
122 com::sun::star::uno::Reference
<com::sun::star::text::XNumberingFormatter
> xFormatter
;
123 com::sun::star::lang::Locale aLocale
;
125 com::sun::star::uno::Sequence
<
126 com::sun::star::uno::Sequence
<
127 com::sun::star::beans::PropertyValue
> > aNumSettings
;
131 SvxNumValueSet2( Window
* pParent
, const ResId
& rResId
);
134 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
137 void SetNumberingSettings(
138 const com::sun::star::uno::Sequence
<
139 com::sun::star::uno::Sequence
<
140 com::sun::star::beans::PropertyValue
> >& aNum
,
141 com::sun::star::uno::Reference
<com::sun::star::text::XNumberingFormatter
>& xFormatter
,
142 const com::sun::star::lang::Locale
& rLocale
);
145 class SVX_DLLPUBLIC SvxNumValueSet3
: public ValueSet
148 SvxNumValueSet3( Window
* pParent
, const ResId
& rResId
);
151 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
155 } } // end of namespace svx::sidebar