fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / writerfilter / source / dmapper / FFDataHandler.cxx
blob799416d24fefad16e4117ae634c27d5626110d79
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 #include "FFDataHandler.hxx"
21 #include <ooxml/resourceids.hxx>
22 #include "dmapperLoggers.hxx"
24 namespace writerfilter {
25 namespace dmapper {
27 /************************
28 * class: FFDataHandler *
29 ************************/
31 FFDataHandler::FFDataHandler() :
32 LoggedProperties(dmapper_logger, "FFDataHandler"),
33 m_nCheckboxHeight(0),
34 m_bCheckboxAutoHeight(false),
35 m_nCheckboxChecked(-1),
36 m_nCheckboxDefault(-1)
41 FFDataHandler::~FFDataHandler()
45 const OUString & FFDataHandler::getName() const
47 return m_sName;
50 const OUString & FFDataHandler::getHelpText() const
52 return m_sHelpText;
55 const OUString & FFDataHandler::getStatusText() const
57 return m_sStatusText;
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;
76 else
77 return false;
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();
103 break;
104 case NS_ooxml::LN_CT_FFData_helpText:
106 resolveSprm(r_Sprm);
108 break;
109 case NS_ooxml::LN_CT_FFData_statusText:
111 resolveSprm(r_Sprm);
113 break;
114 case NS_ooxml::LN_CT_FFCheckBox_size:
116 m_nCheckboxHeight = r_Sprm.getValue()->getInt();
118 break;
119 case NS_ooxml::LN_CT_FFCheckBox_sizeAuto:
121 m_bCheckboxAutoHeight = r_Sprm.getValue()->getInt();
123 break;
124 case NS_ooxml::LN_CT_FFCheckBox_checked:
126 m_nCheckboxChecked = r_Sprm.getValue()->getInt();
128 break;
129 case NS_ooxml::LN_CT_FFCheckBox_default:
131 m_nCheckboxDefault = r_Sprm.getValue()->getInt();
133 break;
134 case NS_ooxml::LN_CT_FFData_checkBox:
136 resolveSprm(r_Sprm);
138 break;
139 case NS_ooxml::LN_CT_FFDDList_result:
141 m_sDropDownResult = r_Sprm.getValue()->getString();
143 break;
144 case NS_ooxml::LN_CT_FFDDList_listEntry:
146 m_DropDownEntries.push_back(r_Sprm.getValue()->getString());
148 break;
149 case NS_ooxml::LN_CT_FFData_ddList:
151 resolveSprm(r_Sprm);
153 break;
154 case NS_ooxml::LN_CT_FFTextInput_default:
156 m_sTextDefault = r_Sprm.getValue()->getString();
158 break;
159 case NS_ooxml::LN_CT_FFData_textInput:
161 resolveSprm(r_Sprm);
163 break;
164 default:
165 #ifdef DEBUG_DOMAINMAPPER
166 dmapper_logger->element("unhandled");
167 #endif
168 break;
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)
181 switch (name)
183 case NS_ooxml::LN_CT_FFHelpText_val:
185 m_sHelpText = val.getString();
187 break;
188 case NS_ooxml::LN_CT_FFStatusText_val:
190 m_sStatusText = val.getString();
192 break;
193 default:
194 #ifdef DEBUG_DOMAINMAPPER
195 dmapper_logger->element("unhandled");
196 #endif
197 break;
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */