fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svx / sidebar / ValueSetWithTextControl.hxx
blobd0e524ca4e70054fd14774090df1c763b37399ff
1 /*
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>
24 #include <limits.h>
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>
31 #include <vector>
33 namespace com{namespace sun{ namespace star{
34 namespace container{
35 class XIndexAccess;
37 namespace beans{
38 struct PropertyValue;
40 namespace text{
41 class XNumberingFormatter;
43 }}}
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
55 public:
56 // control type of specialized <ValueSet>:
57 // - image + text
58 // - text + text
59 enum tControlType
61 IMAGE_TEXT,
62 TEXT_TEXT
65 ValueSetWithTextControl(
66 const tControlType eControlType,
67 Window* pParent,
68 const ResId& rResId);
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
78 void AddItem(
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
94 void AddItem(
95 const XubString& rItemText,
96 const XubString& rItemText2,
97 const XubString* pItemHelpText );
99 virtual void UserDraw( const UserDrawEvent& rUDEvt );
101 private:
102 struct ValueSetWithTextItem
104 Image maItemImage;
105 Image maSelectedItemImage;
106 XubString maItemText;
107 XubString maItemText2;
110 typedef ::std::vector< ValueSetWithTextItem > tItemList;
112 const tControlType meControlType;
113 tItemList maItems;
116 class SVX_DLLPUBLIC SvxNumValueSet2 : public ValueSet
118 Color aLineColor;
119 Rectangle aOrgRect;
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;
130 public:
131 SvxNumValueSet2( Window* pParent, const ResId& rResId);
132 ~SvxNumValueSet2();
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
147 public:
148 SvxNumValueSet3( Window* pParent, const ResId& rResId);
149 ~SvxNumValueSet3();
151 virtual void UserDraw( const UserDrawEvent& rUDEvt );
155 } } // end of namespace svx::sidebar
157 #endif