LibreOffice Module forms (master) 1
datatyperepository.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 <com/sun/star/xforms/XDataTypeRepository.hpp>
24#include <rtl/ref.hxx>
25
26#include <map>
27
28
29namespace xforms
30{
31
32 class OXSDDataType;
33
34 typedef ::cppu::WeakImplHelper < css::xforms::XDataTypeRepository
37 {
38 private:
39 typedef ::rtl::Reference< OXSDDataType > DataType;
40 typedef ::std::map< OUString, DataType > Repository;
41
42 ::osl::Mutex m_aMutex;
44
45 public:
47
48 protected:
49 virtual ~ODataTypeRepository( ) override;
50
51 // XDataTypeRepository
52 virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL getBasicDataType( sal_Int16 dataTypeClass ) override;
53 virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL cloneDataType( const OUString& sourceName, const OUString& newName ) override;
54 virtual void SAL_CALL revokeDataType( const OUString& typeName ) override;
55 virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL getDataType( const OUString& typeName ) override;
56
57 // XEnumerationAccess (base of XDataTypeRepository)
58 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) override;
59
60 // XNameAccess (base of XDataTypeRepository)
61 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
62 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
63 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
64
65 // XElementAccess (base of XEnumerationAccess and XNameAccess)
66 virtual css::uno::Type SAL_CALL getElementType( ) override;
67 virtual sal_Bool SAL_CALL hasElements( ) override;
68
69 private:
72
73 private:
76 Repository::iterator implLocate( const OUString& _rName, bool _bAllowMiss = false );
77 };
78
79
80} // namespace xforms
81
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ODataTypeRepository & operator=(const ODataTypeRepository &)=delete
Repository::iterator implLocate(const OUString &_rName, bool _bAllowMiss=false)
locates the type with the given name in our repository, or throws an exception if there is no such ty...
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
::rtl::Reference< OXSDDataType > DataType
virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL getDataType(const OUString &typeName) override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL getBasicDataType(sal_Int16 dataTypeClass) override
virtual css::uno::Reference< css::xsd::XDataType > SAL_CALL cloneDataType(const OUString &sourceName, const OUString &newName) override
ODataTypeRepository(const ODataTypeRepository &)=delete
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
::std::map< OUString, DataType > Repository
virtual void SAL_CALL revokeDataType(const OUString &typeName) override
virtual ~ODataTypeRepository() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
::cppu::WeakImplHelper< css::xforms::XDataTypeRepository > ODataTypeRepository_Base
unsigned char sal_Bool