Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
20 : #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
21 :
22 : #include "FFDataHandler.hxx"
23 : #include <com/sun/star/text/XTextDocument.hpp>
24 : #include <com/sun/star/text/XFormField.hpp>
25 : #include <com/sun/star/uno/Reference.hxx>
26 : #include "FieldTypes.hxx"
27 :
28 : namespace writerfilter {
29 : namespace dmapper {
30 :
31 : class FormControlHelper
32 : {
33 : public:
34 : typedef std::shared_ptr<FormControlHelper> Pointer_t;
35 : FormControlHelper(FieldId eFieldId,
36 : css::uno::Reference<css::text::XTextDocument> const& rTextDocument,
37 : FFDataHandler::Pointer_t pFFData);
38 : ~FormControlHelper();
39 :
40 : bool insertControl(css::uno::Reference<css::text::XTextRange> const& xTextRange);
41 : bool processField(css::uno::Reference<css::text::XFormField> const& xFormField);
42 32 : bool hasFFDataHandler() const { return (m_pFFData != nullptr); }
43 : private:
44 : FFDataHandler::Pointer_t m_pFFData;
45 : struct FormControlHelper_Impl;
46 : typedef std::shared_ptr<FormControlHelper_Impl> ImplPointer_t;
47 : ImplPointer_t m_pImpl;
48 :
49 : bool createCheckbox(css::uno::Reference<css::text::XTextRange> const& xTextRange,
50 : const OUString & rControlName);
51 : bool createDropdown(css::uno::Reference<css::text::XTextRange> const& xTextRange,
52 : const OUString & rControlName);
53 : };
54 :
55 : }
56 : }
57 :
58 : #endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
59 :
60 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|