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 #include "FFDataHandler.hxx"
21 #include <ooxml/resourceids.hxx>
22 #include "dmapperLoggers.hxx"
24 namespace writerfilter
{
27 /************************
28 * class: FFDataHandler *
29 ************************/
31 FFDataHandler::FFDataHandler() :
32 LoggedProperties(dmapper_logger
, "FFDataHandler"),
34 m_bCheckboxAutoHeight(false),
35 m_nCheckboxChecked(-1),
36 m_nCheckboxDefault(-1)
41 FFDataHandler::~FFDataHandler()
45 const OUString
& FFDataHandler::getName() const
50 const OUString
& FFDataHandler::getHelpText() const
55 const OUString
& FFDataHandler::getStatusText() const
60 sal_uInt32
FFDataHandler::getCheckboxHeight() const
62 return m_nCheckboxHeight
;
65 bool FFDataHandler::getCheckboxAutoHeight() const
67 return m_bCheckboxAutoHeight
;
70 bool FFDataHandler::getCheckboxChecked() const
72 if (m_nCheckboxChecked
!= -1)
73 return m_nCheckboxChecked
;
74 else if (m_nCheckboxDefault
!= -1)
75 return m_nCheckboxDefault
;
80 const OUString
& FFDataHandler::getDropDownResult() const
82 return m_sDropDownResult
;
85 const FFDataHandler::DropDownEntries_t
& FFDataHandler::getDropDownEntries() const
87 return m_DropDownEntries
;
90 const OUString
& FFDataHandler::getTextDefault() const
92 return m_sTextDefault
;
95 void FFDataHandler::lcl_sprm(Sprm
& r_Sprm
)
97 switch(r_Sprm
.getId())
99 case NS_ooxml::LN_CT_FFData_name
:
101 m_sName
= r_Sprm
.getValue()->getString();
104 case NS_ooxml::LN_CT_FFData_helpText
:
109 case NS_ooxml::LN_CT_FFData_statusText
:
114 case NS_ooxml::LN_CT_FFCheckBox_size
:
116 m_nCheckboxHeight
= r_Sprm
.getValue()->getInt();
119 case NS_ooxml::LN_CT_FFCheckBox_sizeAuto
:
121 m_bCheckboxAutoHeight
= r_Sprm
.getValue()->getInt();
124 case NS_ooxml::LN_CT_FFCheckBox_checked
:
126 m_nCheckboxChecked
= r_Sprm
.getValue()->getInt();
129 case NS_ooxml::LN_CT_FFCheckBox_default
:
131 m_nCheckboxDefault
= r_Sprm
.getValue()->getInt();
134 case NS_ooxml::LN_CT_FFData_checkBox
:
139 case NS_ooxml::LN_CT_FFDDList_result
:
141 m_sDropDownResult
= r_Sprm
.getValue()->getString();
144 case NS_ooxml::LN_CT_FFDDList_listEntry
:
146 m_DropDownEntries
.push_back(r_Sprm
.getValue()->getString());
149 case NS_ooxml::LN_CT_FFData_ddList
:
154 case NS_ooxml::LN_CT_FFTextInput_default
:
156 m_sTextDefault
= r_Sprm
.getValue()->getString();
159 case NS_ooxml::LN_CT_FFData_textInput
:
165 #ifdef DEBUG_DOMAINMAPPER
166 dmapper_logger
->element("unhandled");
172 void FFDataHandler::resolveSprm(Sprm
& r_Sprm
)
174 writerfilter::Reference
<Properties
>::Pointer_t pProperties
= r_Sprm
.getProps();
175 if( pProperties
.get())
176 pProperties
->resolve(*this);
179 void FFDataHandler::lcl_attribute(Id name
, Value
& val
)
183 case NS_ooxml::LN_CT_FFHelpText_val
:
185 m_sHelpText
= val
.getString();
188 case NS_ooxml::LN_CT_FFStatusText_val
:
190 m_sStatusText
= val
.getString();
194 #ifdef DEBUG_DOMAINMAPPER
195 dmapper_logger
->element("unhandled");
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */