update dev300-m58
[ooovba.git] / xmlhelp / source / cxxhelp / provider / content.hxx
blob1a6635ae819194f4e69d044199947b636b068d61
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: content.hxx,v $
10 * $Revision: 1.3 $
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 _CONTENT_HXX
32 #define _CONTENT_HXX
34 #include <vos/ref.hxx>
35 #include <ucbhelper/contenthelper.hxx>
36 #include <com/sun/star/io/XInputStream.hpp>
38 #include "urlparameter.hxx"
40 namespace com { namespace sun { namespace star { namespace beans {
41 struct Property;
42 struct PropertyValue;
43 } } } }
45 namespace com { namespace sun { namespace star { namespace sdbc {
46 class XRow;
47 } } } }
49 namespace chelp
52 //=========================================================================
54 // UNO service name for the content.
55 #define MYUCP_CONTENT_SERVICE_NAME \
56 "com.sun.star.ucb.CHelpContent"
58 //=========================================================================
60 class Databases;
62 struct ContentProperties
64 ::rtl::OUString aTitle; // Title
65 ::rtl::OUString aContentType; // ContentType
66 sal_Bool bIsDocument; // IsDocument
67 sal_Bool bIsFolder; // IsFolder
69 ContentProperties()
70 : bIsDocument( sal_True ), bIsFolder( sal_False ) {}
73 //=========================================================================
75 class Content : public ::ucbhelper::ContentImplHelper
77 public:
79 Content( const ::com::sun::star::uno::Reference<
80 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
81 ::ucbhelper::ContentProviderImplHelper* pProvider,
82 const ::com::sun::star::uno::Reference<
83 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
84 Databases* pDatabases );
86 virtual ~Content();
88 // XInterface
89 XINTERFACE_DECL()
91 // XTypeProvider
92 XTYPEPROVIDER_DECL()
94 // XServiceInfo
95 virtual ::rtl::OUString SAL_CALL
96 getImplementationName()
97 throw( ::com::sun::star::uno::RuntimeException );
99 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
100 getSupportedServiceNames()
101 throw( ::com::sun::star::uno::RuntimeException );
103 // XContent
104 virtual rtl::OUString SAL_CALL
105 getContentType()
106 throw( com::sun::star::uno::RuntimeException );
108 // XCommandProcessor
109 virtual com::sun::star::uno::Any SAL_CALL
110 execute( const com::sun::star::ucb::Command& aCommand,
111 sal_Int32 CommandId,
112 const com::sun::star::uno::Reference<
113 com::sun::star::ucb::XCommandEnvironment >& Environment )
114 throw( com::sun::star::uno::Exception,
115 com::sun::star::ucb::CommandAbortedException,
116 com::sun::star::uno::RuntimeException );
118 virtual void SAL_CALL
119 abort( sal_Int32 CommandId )
120 throw( com::sun::star::uno::RuntimeException );
123 private:
125 // private members;
127 ContentProperties m_aProps;
128 URLParameter m_aURLParameter;
129 Databases* m_pDatabases;
132 // private methods
134 virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
135 getProperties( const com::sun::star::uno::Reference<
136 com::sun::star::ucb::XCommandEnvironment > & xEnv );
137 virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
138 getCommands( const com::sun::star::uno::Reference<
139 com::sun::star::ucb::XCommandEnvironment > & xEnv );
141 virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); }
143 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
144 getPropertyValues( const ::com::sun::star::uno::Sequence<
145 ::com::sun::star::beans::Property >& rProperties );
146 void setPropertyValues(
147 const ::com::sun::star::uno::Sequence<
148 ::com::sun::star::beans::PropertyValue >& rValues );
155 #endif