1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <cppuhelper/queryinterface.hxx>
25 using namespace fileaccess
;
26 using namespace com::sun::star
;
27 using namespace com::sun::star::ucb
;
30 FileContentIdentifier::FileContentIdentifier(
31 const OUString
& aUnqPath
,
36 fileaccess::shell::getUrlFromUnq( aUnqPath
,m_aContentId
);
37 m_aNormalizedId
= aUnqPath
;
38 shell::getScheme( m_aProviderScheme
);
42 fileaccess::shell::getUnqFromUrl( aUnqPath
,m_aNormalizedId
);
43 m_aContentId
= aUnqPath
;
44 shell::getScheme( m_aProviderScheme
);
48 FileContentIdentifier::~FileContentIdentifier()
54 FileContentIdentifier::acquire(
58 OWeakObject::acquire();
63 FileContentIdentifier::release(
67 OWeakObject::release();
72 FileContentIdentifier::queryInterface(
73 const uno::Type
& rType
)
74 throw( uno::RuntimeException
, std::exception
)
76 uno::Any aRet
= cppu::queryInterface( rType
,
77 (static_cast< lang::XTypeProvider
* >(this)),
78 (static_cast< XContentIdentifier
* >(this)) );
79 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
83 uno::Sequence
< sal_Int8
> SAL_CALL
84 FileContentIdentifier::getImplementationId()
85 throw( uno::RuntimeException
, std::exception
)
87 return css::uno::Sequence
<sal_Int8
>();
91 uno::Sequence
< uno::Type
> SAL_CALL
92 FileContentIdentifier::getTypes(
94 throw( uno::RuntimeException
, std::exception
)
96 static cppu::OTypeCollection
* pCollection
= NULL
;
98 osl::Guard
< osl::Mutex
> aGuard( osl::Mutex::getGlobalMutex() );
101 static cppu::OTypeCollection
collection(
102 cppu::UnoType
<lang::XTypeProvider
>::get(),
103 cppu::UnoType
<XContentIdentifier
>::get() );
104 pCollection
= &collection
;
107 return (*pCollection
).getTypes();
113 FileContentIdentifier::getContentIdentifier(
115 throw( uno::RuntimeException
, std::exception
)
122 FileContentIdentifier::getContentProviderScheme(
124 throw( uno::RuntimeException
, std::exception
)
126 return m_aProviderScheme
;
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */