1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pkgprovider.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PKGPROVIDER_HXX
32 #define _PKGPROVIDER_HXX
34 #include <ucbhelper/providerhelper.hxx>
37 namespace com
{ namespace sun
{ namespace star
{ namespace container
{
38 class XHierarchicalNameAccess
;
41 namespace package_ucp
{
43 //=========================================================================
45 // UNO service name for the provider. This name will be used by the UCB to
46 // create instances of the provider.
47 #define PACKAGE_CONTENT_PROVIDER_SERVICE_NAME \
48 "com.sun.star.ucb.PackageContentProvider"
49 #define PACKAGE_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 39
52 #define PACKAGE_FOLDER_CONTENT_TYPE \
53 "application/" PACKAGE_URL_SCHEME "-folder"
54 #define PACKAGE_STREAM_CONTENT_TYPE \
55 "application/" PACKAGE_URL_SCHEME "-stream"
56 #define PACKAGE_ZIP_FOLDER_CONTENT_TYPE \
57 "application/" PACKAGE_ZIP_URL_SCHEME "-folder"
58 #define PACKAGE_ZIP_STREAM_CONTENT_TYPE \
59 "application/" PACKAGE_ZIP_URL_SCHEME "-stream"
61 //=========================================================================
65 class ContentProvider
: public ::ucbhelper::ContentProviderImplHelper
67 Packages
* m_pPackages
;
70 ContentProvider( const ::com::sun::star::uno::Reference
<
71 ::com::sun::star::lang::XMultiServiceFactory
>& rSMgr
);
72 virtual ~ContentProvider();
84 virtual ::com::sun::star::uno::Reference
<
85 ::com::sun::star::ucb::XContent
> SAL_CALL
86 queryContent( const ::com::sun::star::uno::Reference
<
87 ::com::sun::star::ucb::XContentIdentifier
>& Identifier
)
88 throw( ::com::sun::star::ucb::IllegalIdentifierException
,
89 ::com::sun::star::uno::RuntimeException
);
91 //////////////////////////////////////////////////////////////////////
92 // Additional interfaces
93 //////////////////////////////////////////////////////////////////////
95 //////////////////////////////////////////////////////////////////////
96 // Non-interface methods.
97 //////////////////////////////////////////////////////////////////////
99 ::com::sun::star::uno::Reference
<
100 ::com::sun::star::container::XHierarchicalNameAccess
>
101 createPackage( const rtl::OUString
& rName
, const rtl::OUString
& rParam
);
103 removePackage( const rtl::OUString
& rName
);