fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / writerfilter / source / dmapper / SdtHelper.hxx
blob814dac0745cdd0cdb9cf6b07d2c5de26fbcfe961
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/.
8 */
10 #ifndef INCLUDED_SDTHELPER_HXX
11 #define INCLUDED_SDTHELPER_HXX
13 #include <boost/optional.hpp>
15 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
16 #include <rtl/ustrbuf.hxx>
18 #include <WriterFilterDllApi.hxx>
20 namespace com { namespace sun { namespace star {
21 namespace awt{
22 struct Size;
23 class XControlModel;
25 }}}
27 namespace writerfilter {
28 namespace dmapper {
30 /**
31 * Helper to create form controls from w:sdt tokens.
33 * w:sdt tokens can't be imported as form fields, as w:sdt supports
34 * e.g. date picking as well.
36 class SdtHelper
38 DomainMapper_Impl& m_rDM_Impl;
40 /// Items of the drop-down control.
41 std::vector<OUString> m_aDropDownItems;
42 /// Pieces of the default text -- currently used only by the dropdown control.
43 OUStringBuffer m_aSdtTexts;
44 /// Date format, see com/sun/star/awt/UnoControlDateFieldModel.idl
45 boost::optional<sal_Int16> m_oDateFormat;
47 bool m_bHasElements;
49 /// Create and append the drawing::XControlShape, containing the various models.
50 void createControlShape(com::sun::star::awt::Size aSize, com::sun::star::uno::Reference<com::sun::star::awt::XControlModel>);
51 public:
52 SdtHelper(DomainMapper_Impl& rDM_Impl);
53 virtual ~SdtHelper();
55 std::vector<OUString>& getDropDownItems();
56 OUStringBuffer& getSdtTexts();
57 boost::optional<sal_Int16>& getDateFormat();
58 /// If createControlShape() was ever called.
59 bool hasElements();
61 /// Create drop-down control from w:sdt's w:dropDownList.
62 void createDropDownControl();
63 /// Create date control from w:sdt's w:date.
64 void createDateControl(OUString& rDefaultText);
67 } // namespace dmapper
68 } // namespace writerfilter
70 #endif
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */