2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-10-16 13:56:13 +00:00
|
|
|
|
2006-09-17 12:44:14 +00:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
/**************************************************************************
|
|
|
|
TODO
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "identify.hxx"
|
|
|
|
|
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::ucb;
|
|
|
|
|
2011-02-21 15:48:08 +02:00
|
|
|
using ::rtl::OUString;
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
//=========================================================================
|
|
|
|
//
|
|
|
|
// ContentIdentifier Implementation.
|
|
|
|
//
|
|
|
|
//=========================================================================
|
|
|
|
|
|
|
|
ContentIdentifier::ContentIdentifier(
|
|
|
|
const Reference< XMultiServiceFactory >& rxSMgr,
|
|
|
|
const OUString& ContentId )
|
|
|
|
: m_xSMgr( rxSMgr ),
|
|
|
|
m_aContentId( ContentId )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// virtual
|
|
|
|
ContentIdentifier::~ContentIdentifier()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//
|
|
|
|
// XInterface methods.
|
|
|
|
//
|
|
|
|
//=========================================================================
|
|
|
|
|
|
|
|
XINTERFACE_IMPL_2( ContentIdentifier,
|
|
|
|
XTypeProvider,
|
|
|
|
XContentIdentifier );
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//
|
|
|
|
// XTypeProvider methods.
|
|
|
|
//
|
|
|
|
//=========================================================================
|
|
|
|
|
|
|
|
XTYPEPROVIDER_IMPL_2( ContentIdentifier,
|
|
|
|
XTypeProvider,
|
2001-05-11 07:43:57 +00:00
|
|
|
XContentIdentifier );
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
//
|
|
|
|
// XContentIdentifier methods.
|
|
|
|
//
|
|
|
|
//=========================================================================
|
|
|
|
|
|
|
|
// virtual
|
|
|
|
OUString SAL_CALL ContentIdentifier::getContentIdentifier()
|
|
|
|
throw( RuntimeException )
|
|
|
|
{
|
|
|
|
return m_aContentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// virtual
|
|
|
|
OUString SAL_CALL ContentIdentifier::getContentProviderScheme()
|
|
|
|
throw( RuntimeException )
|
|
|
|
{
|
2012-01-18 23:47:02 -02:00
|
|
|
if ( m_aProviderScheme.isEmpty() && !m_aContentId.isEmpty() )
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
|
|
|
// The content provider scheme is the part before the first ':'
|
|
|
|
// within the content id.
|
|
|
|
sal_Int32 nPos = m_aContentId.indexOf( ':', 0 );
|
|
|
|
if ( nPos != -1 )
|
|
|
|
{
|
|
|
|
OUString aScheme( m_aContentId.copy( 0, nPos ) );
|
2001-05-11 07:43:57 +00:00
|
|
|
m_aProviderScheme = aScheme.toAsciiLowerCase();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_aProviderScheme;
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|