1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _CONTENT_HXX
29*cdf0e10cSrcweir #define _CONTENT_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <vos/ref.hxx>
32*cdf0e10cSrcweir #include <ucbhelper/contenthelper.hxx>
33*cdf0e10cSrcweir #include <com/sun/star/io/XInputStream.hpp>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include "urlparameter.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace beans {
38*cdf0e10cSrcweir 	struct Property;
39*cdf0e10cSrcweir 	struct PropertyValue;
40*cdf0e10cSrcweir } } } }
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace sdbc {
43*cdf0e10cSrcweir 	class XRow;
44*cdf0e10cSrcweir } } } }
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir namespace chelp
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir //=========================================================================
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir // UNO service name for the content.
52*cdf0e10cSrcweir #define MYUCP_CONTENT_SERVICE_NAME \
53*cdf0e10cSrcweir 							"com.sun.star.ucb.CHelpContent"
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir //=========================================================================
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir 	class Databases;
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 	struct ContentProperties
60*cdf0e10cSrcweir 	{
61*cdf0e10cSrcweir 		::rtl::OUString aTitle;    		// Title
62*cdf0e10cSrcweir 		::rtl::OUString aContentType;	// ContentType
63*cdf0e10cSrcweir 		sal_Bool        bIsDocument;    // IsDocument
64*cdf0e10cSrcweir 		sal_Bool        bIsFolder;    	// IsFolder
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 		ContentProperties()
67*cdf0e10cSrcweir 			: bIsDocument( sal_True ), bIsFolder( sal_False ) {}
68*cdf0e10cSrcweir 	};
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir //=========================================================================
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 	class Content : public ::ucbhelper::ContentImplHelper
73*cdf0e10cSrcweir 	{
74*cdf0e10cSrcweir 	public:
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 		Content( const ::com::sun::star::uno::Reference<
77*cdf0e10cSrcweir 				 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
78*cdf0e10cSrcweir 				 ::ucbhelper::ContentProviderImplHelper* pProvider,
79*cdf0e10cSrcweir 				 const ::com::sun::star::uno::Reference<
80*cdf0e10cSrcweir 				 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
81*cdf0e10cSrcweir 				 Databases* pDatabases );
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 		virtual ~Content();
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 		// XInterface
86*cdf0e10cSrcweir 		XINTERFACE_DECL()
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 		// XTypeProvider
89*cdf0e10cSrcweir 		XTYPEPROVIDER_DECL()
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 		// XServiceInfo
92*cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL
93*cdf0e10cSrcweir 		getImplementationName()
94*cdf0e10cSrcweir 			throw( ::com::sun::star::uno::RuntimeException );
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
97*cdf0e10cSrcweir 		getSupportedServiceNames()
98*cdf0e10cSrcweir 			throw( ::com::sun::star::uno::RuntimeException );
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 		// XContent
101*cdf0e10cSrcweir 		virtual rtl::OUString SAL_CALL
102*cdf0e10cSrcweir 		getContentType()
103*cdf0e10cSrcweir 			throw( com::sun::star::uno::RuntimeException );
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 		// XCommandProcessor
106*cdf0e10cSrcweir 		virtual com::sun::star::uno::Any SAL_CALL
107*cdf0e10cSrcweir 		execute( const com::sun::star::ucb::Command& aCommand,
108*cdf0e10cSrcweir 				 sal_Int32 CommandId,
109*cdf0e10cSrcweir 				 const com::sun::star::uno::Reference<
110*cdf0e10cSrcweir 				 com::sun::star::ucb::XCommandEnvironment >& Environment )
111*cdf0e10cSrcweir 			throw( com::sun::star::uno::Exception,
112*cdf0e10cSrcweir 				   com::sun::star::ucb::CommandAbortedException,
113*cdf0e10cSrcweir 				   com::sun::star::uno::RuntimeException );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 		virtual void SAL_CALL
116*cdf0e10cSrcweir 		abort( sal_Int32 CommandId )
117*cdf0e10cSrcweir 			throw( com::sun::star::uno::RuntimeException );
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	private:
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 		// private members;
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 		ContentProperties m_aProps;
125*cdf0e10cSrcweir 		URLParameter      m_aURLParameter;
126*cdf0e10cSrcweir 		Databases*        m_pDatabases;
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 		// private methods
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir 		virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
132*cdf0e10cSrcweir 		getProperties( const com::sun::star::uno::Reference<
133*cdf0e10cSrcweir 					   com::sun::star::ucb::XCommandEnvironment > & xEnv );
134*cdf0e10cSrcweir 		virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
135*cdf0e10cSrcweir 		getCommands( const com::sun::star::uno::Reference<
136*cdf0e10cSrcweir 					 com::sun::star::ucb::XCommandEnvironment > & xEnv );
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 		virtual ::rtl::OUString getParentURL() { return ::rtl::OUString(); }
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
141*cdf0e10cSrcweir 		getPropertyValues( const ::com::sun::star::uno::Sequence<
142*cdf0e10cSrcweir 						   ::com::sun::star::beans::Property >& rProperties );
143*cdf0e10cSrcweir 		void setPropertyValues(
144*cdf0e10cSrcweir 			const ::com::sun::star::uno::Sequence<
145*cdf0e10cSrcweir 			::com::sun::star::beans::PropertyValue >& rValues );
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir 	};
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir }
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir #endif
153