LCOV - code coverage report
Current view: top level - libreoffice/xmloff/source/forms - valueproperties.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 66 0.0 %
Date: 2012-12-27 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          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             : 
      20             : #include "valueproperties.hxx"
      21             : #include "strings.hxx"
      22             : #include <com/sun/star/form/FormComponentType.hpp>
      23             : 
      24             : //.........................................................................
      25             : namespace xmloff
      26             : {
      27             : //.........................................................................
      28             : 
      29             :     using namespace ::com::sun::star::form;
      30             : 
      31             :     //=====================================================================
      32             :     //= OValuePropertiesMetaData
      33             :     //=====================================================================
      34             :     //---------------------------------------------------------------------
      35           0 :     void OValuePropertiesMetaData::getValuePropertyNames(
      36             :             OControlElement::ElementType _eType, sal_Int16 _nFormComponentType,
      37             :             sal_Char const * & _rpCurrentValuePropertyName, sal_Char const * & _rpValuePropertyName)
      38             :     {
      39             :         // reset the pointers in case we can't determine the property names
      40           0 :         _rpCurrentValuePropertyName = _rpValuePropertyName = NULL;
      41           0 :         switch (_nFormComponentType)
      42             :         {
      43             :             case FormComponentType::TEXTFIELD:
      44           0 :                 if (OControlElement::FORMATTED_TEXT == _eType)
      45             :                 {
      46           0 :                     _rpCurrentValuePropertyName = PROPERTY_EFFECTIVE_VALUE.ascii;
      47           0 :                     _rpValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT.ascii;
      48             :                 }
      49             :                 else
      50             :                 {
      51           0 :                     if (OControlElement::PASSWORD != _eType)
      52             :                         // no CurrentValue" for passwords
      53           0 :                         _rpCurrentValuePropertyName = PROPERTY_TEXT.ascii;
      54           0 :                     _rpValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
      55             :                 }
      56           0 :                 break;
      57             : 
      58             :             case FormComponentType::NUMERICFIELD:
      59             :             case FormComponentType::CURRENCYFIELD:
      60           0 :                 _rpCurrentValuePropertyName = PROPERTY_VALUE.ascii;
      61           0 :                 _rpValuePropertyName = PROPERTY_DEFAULT_VALUE.ascii;
      62           0 :                 break;
      63             : 
      64             :             case FormComponentType::PATTERNFIELD:
      65             :             case FormComponentType::FILECONTROL:
      66             :             case FormComponentType::COMBOBOX:
      67           0 :                 _rpValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
      68             :                 // NO BREAK!!
      69             :             case FormComponentType::COMMANDBUTTON:
      70           0 :                 _rpCurrentValuePropertyName = PROPERTY_TEXT.ascii;
      71           0 :                 break;
      72             : 
      73             :             case FormComponentType::CHECKBOX:
      74             :             case FormComponentType::RADIOBUTTON:
      75           0 :                 _rpValuePropertyName = PROPERTY_REFVALUE.ascii;
      76           0 :                 break;
      77             : 
      78             :             case FormComponentType::HIDDENCONTROL:
      79           0 :                 _rpValuePropertyName = PROPERTY_HIDDEN_VALUE.ascii;
      80           0 :                 break;
      81             : 
      82             :             case FormComponentType::SCROLLBAR:
      83           0 :                 _rpCurrentValuePropertyName = PROPERTY_SCROLLVALUE.ascii;
      84           0 :                 _rpValuePropertyName = PROPERTY_SCROLLVALUE_DEFAULT.ascii;
      85           0 :                 break;
      86             : 
      87             :             case FormComponentType::SPINBUTTON:
      88           0 :                 _rpCurrentValuePropertyName = PROPERTY_SPINVALUE.ascii;
      89           0 :                 _rpValuePropertyName = PROPERTY_DEFAULT_SPINVALUE.ascii;
      90           0 :                 break;
      91             : 
      92             :             default:
      93             :                 OSL_ENSURE( false, "OValuePropertiesMetaData::getValuePropertyNames: unsupported component type!" );
      94           0 :                 break;
      95             :         }
      96           0 :     }
      97             : 
      98             : 
      99             :     //---------------------------------------------------------------------
     100           0 :     void OValuePropertiesMetaData::getValueLimitPropertyNames(sal_Int16 _nFormComponentType,
     101             :         sal_Char const * & _rpMinValuePropertyName, sal_Char const * & _rpMaxValuePropertyName)
     102             :     {
     103           0 :         _rpMinValuePropertyName = _rpMaxValuePropertyName = NULL;
     104           0 :         switch (_nFormComponentType)
     105             :         {
     106             :             case FormComponentType::NUMERICFIELD:
     107             :             case FormComponentType::CURRENCYFIELD:
     108           0 :                 _rpMinValuePropertyName = PROPERTY_VALUE_MIN.ascii;
     109           0 :                 _rpMaxValuePropertyName = PROPERTY_VALUE_MAX.ascii;
     110           0 :                 break;
     111             : 
     112             :             case FormComponentType::TEXTFIELD:
     113           0 :                 _rpMinValuePropertyName = PROPERTY_EFFECTIVE_MIN.ascii;
     114           0 :                 _rpMaxValuePropertyName = PROPERTY_EFFECTIVE_MAX.ascii;
     115           0 :                 break;
     116             : 
     117             :             case FormComponentType::SCROLLBAR:
     118           0 :                 _rpMinValuePropertyName = PROPERTY_SCROLLVALUE_MIN.ascii;
     119           0 :                 _rpMaxValuePropertyName = PROPERTY_SCROLLVALUE_MAX.ascii;
     120           0 :                 break;
     121             : 
     122             :             case FormComponentType::SPINBUTTON:
     123           0 :                 _rpMinValuePropertyName = PROPERTY_SPINVALUE_MIN.ascii;
     124           0 :                 _rpMaxValuePropertyName = PROPERTY_SPINVALUE_MAX.ascii;
     125           0 :                 break;
     126             : 
     127             :             default:
     128             :                 OSL_ENSURE( false, "OValuePropertiesMetaData::getValueLimitPropertyNames: unsupported component type!" );
     129           0 :                 break;
     130             :         }
     131           0 :     }
     132             : 
     133             :     //---------------------------------------------------------------------
     134           0 :     void OValuePropertiesMetaData::getRuntimeValuePropertyNames(
     135             :         OControlElement::ElementType _eType, sal_Int16 _nFormComponentType,
     136             :         sal_Char const * & _rpValuePropertyName, sal_Char const * & _rpDefaultValuePropertyName )
     137             :     {
     138             :         // reset the pointers in case we can't determine the property names
     139           0 :         _rpValuePropertyName = _rpDefaultValuePropertyName = NULL;
     140           0 :         switch (_nFormComponentType)
     141             :         {
     142             :             case FormComponentType::TEXTFIELD:
     143           0 :                 if (OControlElement::FORMATTED_TEXT == _eType)
     144             :                 {
     145           0 :                     _rpValuePropertyName = PROPERTY_EFFECTIVE_VALUE.ascii;
     146           0 :                     _rpDefaultValuePropertyName = PROPERTY_EFFECTIVE_DEFAULT.ascii;
     147             :                 }
     148             :                 else
     149             :                 {
     150           0 :                     _rpValuePropertyName = PROPERTY_TEXT.ascii;
     151           0 :                     _rpDefaultValuePropertyName = PROPERTY_DEFAULT_TEXT.ascii;
     152             :                 }
     153           0 :                 break;
     154             : 
     155             :             case FormComponentType::DATEFIELD:
     156           0 :                 _rpValuePropertyName = PROPERTY_DATE.ascii;
     157           0 :                 _rpDefaultValuePropertyName = PROPERTY_DEFAULT_DATE.ascii;
     158           0 :                 break;
     159             : 
     160             :             case FormComponentType::TIMEFIELD:
     161           0 :                 _rpValuePropertyName = PROPERTY_TIME.ascii;
     162           0 :                 _rpDefaultValuePropertyName = PROPERTY_DEFAULT_TIME.ascii;
     163           0 :                 break;
     164             : 
     165             :             case FormComponentType::NUMERICFIELD:
     166             :             case FormComponentType::CURRENCYFIELD:
     167             :             case FormComponentType::PATTERNFIELD:
     168             :             case FormComponentType::FILECONTROL:
     169             :             case FormComponentType::COMBOBOX:
     170             :             case FormComponentType::SCROLLBAR:
     171             :             case FormComponentType::SPINBUTTON:
     172             :                 // For these types, the runtime properties are the same as the ones which in the XML
     173             :                 // stream are named "value properties"
     174           0 :                 getValuePropertyNames( _eType, _nFormComponentType, _rpValuePropertyName, _rpDefaultValuePropertyName );
     175           0 :                 break;
     176             : 
     177             :             case FormComponentType::CHECKBOX:
     178             :             case FormComponentType::RADIOBUTTON:
     179           0 :                 _rpValuePropertyName = PROPERTY_STATE.ascii;
     180           0 :                 _rpDefaultValuePropertyName = PROPERTY_DEFAULT_STATE.ascii;
     181           0 :                 break;
     182             :         }
     183           0 :     }
     184             : 
     185             : //.........................................................................
     186             : }   // namespace xmloff
     187             : //.........................................................................
     188             : 
     189             : 
     190             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10