LCOV - code coverage report
Current view: top level - extensions/source/propctrlr - xsdvalidationhelper.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 2 0.0 %
Date: 2014-11-03 Functions: 0 2 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             : #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONHELPER_HXX
      21             : #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONHELPER_HXX
      22             : 
      23             : #include "eformshelper.hxx"
      24             : #include "xsddatatypes.hxx"
      25             : 
      26             : #include <com/sun/star/xsd/XDataType.hpp>
      27             : #include <com/sun/star/beans/XPropertySet.hpp>
      28             : #include <rtl/ref.hxx>
      29             : 
      30             : 
      31             : namespace pcr
      32             : {
      33             : 
      34             : 
      35             :     class XSDDataType;
      36             : 
      37             :     //= XSDValidationHelper
      38             : 
      39           0 :     class XSDValidationHelper : public EFormsHelper
      40             :     {
      41             :     private:
      42             :         bool    m_bInspectingFormattedField;
      43             :     public:
      44           0 :         bool    isInspectingFormattedField() const { return m_bInspectingFormattedField; }
      45             : 
      46             :     public:
      47             :         XSDValidationHelper(
      48             :             ::osl::Mutex& _rMutex,
      49             :             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxIntrospectee,
      50             :             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxContextDocument
      51             :         );
      52             : 
      53             :         /** retrieves the names of all XForms models in the document the control lives in
      54             :         */
      55             :         void    getAvailableDataTypeNames( ::std::vector< OUString >& /* [out] */ _rNames ) const;
      56             : 
      57             :         /** retrieves a particular data type given by name
      58             :         */
      59             :         ::rtl::Reference< XSDDataType >
      60             :                 getDataTypeByName( const OUString& _rName ) const;
      61             : 
      62             :         /** retrieves the DataType instance which the control model is currently validated against
      63             : 
      64             :             If there is a binding set at our control model, which at the same time acts as validator,
      65             :             and if this validator is bound to an XDataType, then this data type is retrieved here.
      66             :         */
      67             :         ::rtl::Reference< XSDDataType >
      68             :                 getValidatingDataType( ) const;
      69             : 
      70             :         /** retrieves the name of the data type which the control model is currently validated against
      71             : 
      72             :             @seealso getValidatingDataType
      73             :         */
      74             :         OUString
      75             :                 getValidatingDataTypeName( ) const;
      76             : 
      77             :         /** binds the validator to a new data type
      78             : 
      79             :             To be called with an active binding only.
      80             :         */
      81             :         void    setValidatingDataTypeByName( const OUString& _rName ) const;
      82             : 
      83             :         /** removes the data type given by name from the data type repository
      84             :         */
      85             :         bool    removeDataTypeFromRepository( const OUString& _rName ) const;
      86             : 
      87             :         /** creates a new data type, which is a clone of an existing data type
      88             :         */
      89             :         bool    cloneDataType( const ::rtl::Reference< XSDDataType >& _pDataType, const OUString& _rNewName ) const;
      90             : 
      91             :         /** retrieves the name of the basic data type which has the given class
      92             :         */
      93             :         OUString
      94             :                 getBasicTypeNameForClass( sal_Int16 _eClass ) const;
      95             : 
      96             :         /** copy a data type from one model to another
      97             : 
      98             :             If a data type with the given name already exists in the target model, then nothing
      99             :             happens. In particular, the facets of the data type are not copied.
     100             :         */
     101             :         void    copyDataType( const OUString& _rFromModel, const OUString& _rToModel,
     102             :                     const OUString& _rDataTypeName ) const;
     103             : 
     104             :         /** finds (and sets) a default format for the formatted field we're inspecting,
     105             :             according to the current data type the control value is evaluated against
     106             :         */
     107             :         void findDefaultFormatForIntrospectee();
     108             : 
     109             :     private:
     110             :         /** retrieves the data type repository associated with the current model
     111             :         */
     112             :         ::com::sun::star::uno::Reference< ::com::sun::star::xforms::XDataTypeRepository >
     113             :                 getDataTypeRepository() const;
     114             : 
     115             :         /** retrieves the data type repository associated with any model
     116             :         */
     117             :         ::com::sun::star::uno::Reference< ::com::sun::star::xforms::XDataTypeRepository >
     118             :                 getDataTypeRepository( const OUString& _rModelName ) const;
     119             : 
     120             :         /** retrieves the data type object for the given name
     121             :         */
     122             :         ::com::sun::star::uno::Reference< ::com::sun::star::xsd::XDataType >
     123             :             getDataType( const OUString& _rName ) const;
     124             : 
     125             :         /** retrieves the name of the basic data type which has the given class, in the given repository
     126             :         */
     127             :         OUString
     128             :                 getBasicTypeNameForClass(
     129             :                     sal_Int16 _nClass,
     130             :                     ::com::sun::star::uno::Reference< ::com::sun::star::xforms::XDataTypeRepository > _rxRepository
     131             :                 ) const;
     132             :     };
     133             : 
     134             : 
     135             : } // namespace pcr
     136             : 
     137             : 
     138             : #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_XSDVALIDATIONHELPER_HXX
     139             : 
     140             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10