bump product version to 4.2.0.1
[LibreOffice.git] / include / svx / sidebar / ValueSetWithTextControl.hxx
blob318bb6f1abfa62a7e24694992fede5e15acbb898
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
25 #include <limits.h>
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>
32 #include <vector>
34 namespace com{namespace sun{ namespace star{
35 namespace container{
36 class XIndexAccess;
38 namespace beans{
39 struct PropertyValue;
41 namespace text{
42 class XNumberingFormatter;
44 }}}
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
56 public:
57 // control type of specialized <ValueSet>:
58 // - image + text
59 // - text + text
60 enum tControlType
62 IMAGE_TEXT,
63 TEXT_TEXT
66 ValueSetWithTextControl(
67 const tControlType eControlType,
68 Window* pParent,
69 const ResId& rResId);
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
79 void AddItem(
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
95 void AddItem(
96 const OUString& rItemText,
97 const OUString& rItemText2,
98 const OUString* pItemHelpText );
100 virtual void UserDraw( const UserDrawEvent& rUDEvt );
102 private:
103 struct ValueSetWithTextItem
105 Image maItemImage;
106 Image maSelectedItemImage;
107 OUString maItemText;
108 OUString maItemText2;
111 typedef ::std::vector< ValueSetWithTextItem > tItemList;
113 const tControlType meControlType;
114 tItemList maItems;
117 class SVX_DLLPUBLIC SvxNumValueSet2 : public ValueSet
119 Color aLineColor;
120 Rectangle aOrgRect;
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;
131 public:
132 SvxNumValueSet2( Window* pParent, const ResId& rResId);
133 ~SvxNumValueSet2();
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
148 public:
149 SvxNumValueSet3( Window* pParent, const ResId& rResId);
150 ~SvxNumValueSet3();
152 virtual void UserDraw( const UserDrawEvent& rUDEvt );
156 } } // end of namespace svx::sidebar
158 #endif
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */