LibreOffice Module extensions (master) 1
xsdvalidationhelper.hxx
Go to the documentation of this file.
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#pragma once
21
22#include "eformshelper.hxx"
23#include "xsddatatypes.hxx"
24
25#include <com/sun/star/xsd/XDataType.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <rtl/ref.hxx>
28
29
30namespace pcr
31{
32
33
34 class XSDDataType;
35
36 //= XSDValidationHelper
37
39 {
40 private:
42 public:
44
45 public:
47 ::osl::Mutex& _rMutex,
48 const css::uno::Reference< css::beans::XPropertySet >& _rxIntrospectee,
49 const css::uno::Reference< css::frame::XModel >& _rxContextDocument
50 );
51
54 void getAvailableDataTypeNames( std::vector< OUString >& /* [out] */ _rNames ) const;
55
59 getDataTypeByName( const OUString& _rName ) const;
60
67 getValidatingDataType( ) const;
68
73 OUString
75
80 void setValidatingDataTypeByName( const OUString& _rName ) const;
81
84 bool removeDataTypeFromRepository( const OUString& _rName ) const;
85
88 bool cloneDataType( const ::rtl::Reference< XSDDataType >& _pDataType, const OUString& _rNewName ) const;
89
92 OUString
93 getBasicTypeNameForClass( sal_Int16 _eClass ) const;
94
100 void copyDataType( const OUString& _rFromModel, const OUString& _rToModel,
101 const OUString& _rDataTypeName ) const;
102
107
108 private:
111 css::uno::Reference< css::xforms::XDataTypeRepository >
112 getDataTypeRepository() const;
113
116 css::uno::Reference< css::xforms::XDataTypeRepository >
117 getDataTypeRepository( const OUString& _rModelName ) const;
118
121 css::uno::Reference< css::xsd::XDataType >
122 getDataType( const OUString& _rName ) const;
123
126 static OUString
128 sal_Int16 _nClass,
129 const css::uno::Reference< css::xforms::XDataTypeRepository >& _rxRepository
130 );
131 };
132
133
134} // namespace pcr
135
136
137/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::xsd::XDataType > getDataType(const OUString &_rName) const
retrieves the data type object for the given name
::rtl::Reference< XSDDataType > getDataTypeByName(const OUString &_rName) const
retrieves a particular data type given by name
void findDefaultFormatForIntrospectee()
finds (and sets) a default format for the formatted field we're inspecting, according to the current ...
void setValidatingDataTypeByName(const OUString &_rName) const
binds the validator to a new data type
OUString getValidatingDataTypeName() const
retrieves the name of the data type which the control model is currently validated against
css::uno::Reference< css::xforms::XDataTypeRepository > getDataTypeRepository() const
retrieves the data type repository associated with the current model
static OUString getBasicTypeNameForClass(sal_Int16 _nClass, const css::uno::Reference< css::xforms::XDataTypeRepository > &_rxRepository)
retrieves the name of the basic data type which has the given class, in the given repository
bool removeDataTypeFromRepository(const OUString &_rName) const
removes the data type given by name from the data type repository
XSDValidationHelper(::osl::Mutex &_rMutex, const css::uno::Reference< css::beans::XPropertySet > &_rxIntrospectee, const css::uno::Reference< css::frame::XModel > &_rxContextDocument)
::rtl::Reference< XSDDataType > getValidatingDataType() const
retrieves the DataType instance which the control model is currently validated against
bool cloneDataType(const ::rtl::Reference< XSDDataType > &_pDataType, const OUString &_rNewName) const
creates a new data type, which is a clone of an existing data type
void getAvailableDataTypeNames(std::vector< OUString > &_rNames) const
retrieves the names of all XForms models in the document the control lives in
void copyDataType(const OUString &_rFromModel, const OUString &_rToModel, const OUString &_rDataTypeName) const
copy a data type from one model to another
OUString getBasicTypeNameForClass(sal_Int16 _eClass) const
retrieves the name of the basic data type which has the given class
a property handler for any virtual string properties
Definition: browserline.cxx:39