1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_SIDEBAR_VALUESETWITHTEXTCONTROL_HXX
20 #define INCLUDED_SVX_SIDEBAR_VALUESETWITHTEXTCONTROL_HXX
22 #include <svx/svxdllapi.h>
24 #include <svtools/valueset.hxx>
26 #include <com/sun/star/uno/Reference.h>
27 #include <com/sun/star/uno/Sequence.h>
28 #include <com/sun/star/lang/Locale.hpp>
30 #include <vcl/image.hxx>
34 namespace com
{namespace sun
{ namespace star
{
42 class XNumberingFormatter
;
46 namespace svx
{ namespace sidebar
{
48 /** Specialization of class <ValueSet>.
49 This specialization allows is a one-columned ValueSet which allow
50 items containing an image and a text or a text and a second text.
52 Especially, used for sidebar related controls.
54 class SVX_DLLPUBLIC ValueSetWithTextControl
: public ValueSet
57 // control type of specialized <ValueSet>:
66 ValueSetWithTextControl(
67 const tControlType eControlType
,
71 virtual ~ValueSetWithTextControl(void);
73 // add item for control type IMAGE_TEXT
74 // if control type does not match IMAGE_TEXT no item is added.
75 // @param pSelectedItemImage
76 // selection item image is optional. if not provided, it is the same as the image item
77 // @param pItemHelpText
78 // help text is optional. if not provided, it is the same as the item text
80 const Image
& rItemImage
,
81 const Image
* pSelectedItemImage
,
82 const OUString
& rItemText
,
83 const OUString
* pItemHelpText
);
85 // replace item images for control type IMAGE_TEXT
86 void ReplaceItemImages(
87 const sal_uInt16 nItemId
,
88 const Image
& rItemImage
,
89 const Image
* pSelectedItemImage
);
91 // add item for control type TEXT_TEXT
92 // if control type does not match TEXT_TEXT no item is added.
93 // @param pItemHelpText
94 // help text is optional. if not provided, it is the same as the item text
96 const OUString
& rItemText
,
97 const OUString
& rItemText2
,
98 const OUString
* pItemHelpText
);
100 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
103 struct ValueSetWithTextItem
106 Image maSelectedItemImage
;
108 OUString maItemText2
;
111 typedef ::std::vector
< ValueSetWithTextItem
> tItemList
;
113 const tControlType meControlType
;
117 class SVX_DLLPUBLIC SvxNumValueSet2
: public ValueSet
121 VirtualDevice
* pVDev
;
123 com::sun::star::uno::Reference
<com::sun::star::text::XNumberingFormatter
> xFormatter
;
124 com::sun::star::lang::Locale aLocale
;
126 com::sun::star::uno::Sequence
<
127 com::sun::star::uno::Sequence
<
128 com::sun::star::beans::PropertyValue
> > aNumSettings
;
132 SvxNumValueSet2( Window
* pParent
, const ResId
& rResId
);
135 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
138 void SetNumberingSettings(
139 const com::sun::star::uno::Sequence
<
140 com::sun::star::uno::Sequence
<
141 com::sun::star::beans::PropertyValue
> >& aNum
,
142 com::sun::star::uno::Reference
<com::sun::star::text::XNumberingFormatter
>& xFormatter
,
143 const com::sun::star::lang::Locale
& rLocale
);
146 class SVX_DLLPUBLIC SvxNumValueSet3
: public ValueSet
149 SvxNumValueSet3( Window
* pParent
, const ResId
& rResId
);
152 virtual void UserDraw( const UserDrawEvent
& rUDEvt
);
156 } } // end of namespace svx::sidebar
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */