1*7b6bd0c4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*7b6bd0c4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*7b6bd0c4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*7b6bd0c4SAndrew Rist  * distributed with this work for additional information
6*7b6bd0c4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*7b6bd0c4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*7b6bd0c4SAndrew Rist  * "License"); you may not use this file except in compliance
9*7b6bd0c4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*7b6bd0c4SAndrew Rist  *
11*7b6bd0c4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*7b6bd0c4SAndrew Rist  *
13*7b6bd0c4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*7b6bd0c4SAndrew Rist  * software distributed under the License is distributed on an
15*7b6bd0c4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7b6bd0c4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*7b6bd0c4SAndrew Rist  * specific language governing permissions and limitations
18*7b6bd0c4SAndrew Rist  * under the License.
19*7b6bd0c4SAndrew Rist  *
20*7b6bd0c4SAndrew Rist  *************************************************************/
21*7b6bd0c4SAndrew Rist 
22*7b6bd0c4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _CONTENT_HXX
25cdf0e10cSrcweir #define _CONTENT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vos/ref.hxx>
28cdf0e10cSrcweir #include <ucbhelper/contenthelper.hxx>
29cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "urlparameter.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace beans {
34cdf0e10cSrcweir 	struct Property;
35cdf0e10cSrcweir 	struct PropertyValue;
36cdf0e10cSrcweir } } } }
37cdf0e10cSrcweir 
38cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace sdbc {
39cdf0e10cSrcweir 	class XRow;
40cdf0e10cSrcweir } } } }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir namespace chelp
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 
45cdf0e10cSrcweir //=========================================================================
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // UNO service name for the content.
48cdf0e10cSrcweir #define MYUCP_CONTENT_SERVICE_NAME \
49cdf0e10cSrcweir 							"com.sun.star.ucb.CHelpContent"
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //=========================================================================
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	class Databases;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	struct ContentProperties
56cdf0e10cSrcweir 	{
57cdf0e10cSrcweir 		::rtl::OUString aTitle;    		// Title
58cdf0e10cSrcweir 		::rtl::OUString aContentType;	// ContentType
59cdf0e10cSrcweir 		sal_Bool        bIsDocument;    // IsDocument
60cdf0e10cSrcweir 		sal_Bool        bIsFolder;    	// IsFolder
61cdf0e10cSrcweir 
ContentPropertieschelp::ContentProperties62cdf0e10cSrcweir 		ContentProperties()
63cdf0e10cSrcweir 			: bIsDocument( sal_True ), bIsFolder( sal_False ) {}
64cdf0e10cSrcweir 	};
65cdf0e10cSrcweir 
66cdf0e10cSrcweir //=========================================================================
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	class Content : public ::ucbhelper::ContentImplHelper
69cdf0e10cSrcweir 	{
70cdf0e10cSrcweir 	public:
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 		Content( const ::com::sun::star::uno::Reference<
73cdf0e10cSrcweir 				 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
74cdf0e10cSrcweir 				 ::ucbhelper::ContentProviderImplHelper* pProvider,
75cdf0e10cSrcweir 				 const ::com::sun::star::uno::Reference<
76cdf0e10cSrcweir 				 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
77cdf0e10cSrcweir 				 Databases* pDatabases );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 		virtual ~Content();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 		// XInterface
82cdf0e10cSrcweir 		XINTERFACE_DECL()
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 		// XTypeProvider
85cdf0e10cSrcweir 		XTYPEPROVIDER_DECL()
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 		// XServiceInfo
88cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL
89cdf0e10cSrcweir 		getImplementationName()
90cdf0e10cSrcweir 			throw( ::com::sun::star::uno::RuntimeException );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
93cdf0e10cSrcweir 		getSupportedServiceNames()
94cdf0e10cSrcweir 			throw( ::com::sun::star::uno::RuntimeException );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 		// XContent
97cdf0e10cSrcweir 		virtual rtl::OUString SAL_CALL
98cdf0e10cSrcweir 		getContentType()
99cdf0e10cSrcweir 			throw( com::sun::star::uno::RuntimeException );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 		// XCommandProcessor
102cdf0e10cSrcweir 		virtual com::sun::star::uno::Any SAL_CALL
103cdf0e10cSrcweir 		execute( const com::sun::star::ucb::Command& aCommand,
104cdf0e10cSrcweir 				 sal_Int32 CommandId,
105cdf0e10cSrcweir 				 const com::sun::star::uno::Reference<
106cdf0e10cSrcweir 				 com::sun::star::ucb::XCommandEnvironment >& Environment )
107cdf0e10cSrcweir 			throw( com::sun::star::uno::Exception,
108cdf0e10cSrcweir 				   com::sun::star::ucb::CommandAbortedException,
109cdf0e10cSrcweir 				   com::sun::star::uno::RuntimeException );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 		virtual void SAL_CALL
112cdf0e10cSrcweir 		abort( sal_Int32 CommandId )
113cdf0e10cSrcweir 			throw( com::sun::star::uno::RuntimeException );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	private:
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 		// private members;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 		ContentProperties m_aProps;
121cdf0e10cSrcweir 		URLParameter      m_aURLParameter;
122cdf0e10cSrcweir 		Databases*        m_pDatabases;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 		// private methods
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 		virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
128cdf0e10cSrcweir 		getProperties( const com::sun::star::uno::Reference<
129cdf0e10cSrcweir 					   com::sun::star::ucb::XCommandEnvironment > & xEnv );
130cdf0e10cSrcweir 		virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
131cdf0e10cSrcweir 		getCommands( const com::sun::star::uno::Reference<
132cdf0e10cSrcweir 					 com::sun::star::ucb::XCommandEnvironment > & xEnv );
133cdf0e10cSrcweir 
getParentURL()134cdf0e10cSrcweir 		virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
137cdf0e10cSrcweir 		getPropertyValues( const ::com::sun::star::uno::Sequence<
138cdf0e10cSrcweir 						   ::com::sun::star::beans::Property >& rProperties );
139cdf0e10cSrcweir 		void setPropertyValues(
140cdf0e10cSrcweir 			const ::com::sun::star::uno::Sequence<
141cdf0e10cSrcweir 			::com::sun::star::beans::PropertyValue >& rValues );
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	};
145cdf0e10cSrcweir 
146cdf0e10cSrcweir }
147cdf0e10cSrcweir 
148cdf0e10cSrcweir #endif
149