1*89dcb3daSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*89dcb3daSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*89dcb3daSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*89dcb3daSAndrew Rist  * distributed with this work for additional information
6*89dcb3daSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*89dcb3daSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*89dcb3daSAndrew Rist  * "License"); you may not use this file except in compliance
9*89dcb3daSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*89dcb3daSAndrew Rist  *
11*89dcb3daSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*89dcb3daSAndrew Rist  *
13*89dcb3daSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*89dcb3daSAndrew Rist  * software distributed under the License is distributed on an
15*89dcb3daSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*89dcb3daSAndrew Rist  * KIND, either express or implied.  See the License for the
17*89dcb3daSAndrew Rist  * specific language governing permissions and limitations
18*89dcb3daSAndrew Rist  * under the License.
19*89dcb3daSAndrew Rist  *
20*89dcb3daSAndrew Rist  *************************************************************/
21*89dcb3daSAndrew Rist 
22*89dcb3daSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_xmlhelp.hxx"
26cdf0e10cSrcweir #include <com/sun/star/ucb/Command.hpp>
27cdf0e10cSrcweir #include <com/sun/star/ucb/XCommandEnvironment.hpp>
28cdf0e10cSrcweir #include <com/sun/star/ucb/XCommandProcessor.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "resultsetforroot.hxx"
31cdf0e10cSrcweir #include "databases.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir using namespace chelp;
34cdf0e10cSrcweir using namespace com::sun::star;
35cdf0e10cSrcweir using namespace com::sun::star::ucb;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
ResultSetForRoot(const uno::Reference<lang::XMultiServiceFactory> & xMSF,const uno::Reference<XContentProvider> & xProvider,sal_Int32 nOpenMode,const uno::Sequence<beans::Property> & seq,const uno::Sequence<NumberedSortingInfo> & seqSort,URLParameter & aURLParameter,Databases * pDatabases)39cdf0e10cSrcweir ResultSetForRoot::ResultSetForRoot( const uno::Reference< lang::XMultiServiceFactory >&  xMSF,
40cdf0e10cSrcweir 									const uno::Reference< XContentProvider >&  xProvider,
41cdf0e10cSrcweir 									sal_Int32 nOpenMode,
42cdf0e10cSrcweir 									const uno::Sequence< beans::Property >& seq,
43cdf0e10cSrcweir 									const uno::Sequence< NumberedSortingInfo >& seqSort,
44cdf0e10cSrcweir 									URLParameter& aURLParameter,
45cdf0e10cSrcweir 									Databases* pDatabases )
46cdf0e10cSrcweir 	: ResultSetBase( xMSF,xProvider,nOpenMode,seq,seqSort ),
47cdf0e10cSrcweir 	  m_aURLParameter( aURLParameter ),
48cdf0e10cSrcweir 	  m_pDatabases( pDatabases )
49cdf0e10cSrcweir {
50cdf0e10cSrcweir 	m_aPath = m_pDatabases->getModuleList( m_aURLParameter.get_language() );
51cdf0e10cSrcweir 	m_aItems.resize( m_aPath.size() );
52cdf0e10cSrcweir 	m_aIdents.resize( m_aPath.size() );
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	Command aCommand;
55cdf0e10cSrcweir 	aCommand.Name = rtl::OUString::createFromAscii( "getPropertyValues" );
56cdf0e10cSrcweir 	aCommand.Argument <<= m_sProperty;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	for( sal_uInt32 i = 0; i < m_aPath.size(); ++i )
59cdf0e10cSrcweir 	{
60cdf0e10cSrcweir 		m_aPath[i] =
61cdf0e10cSrcweir 			rtl::OUString::createFromAscii( "vnd.sun.star.help://" ) +
62cdf0e10cSrcweir 			m_aPath[i]                                               +
63cdf0e10cSrcweir 			rtl::OUString::createFromAscii( "?Language=" )           +
64cdf0e10cSrcweir 			m_aURLParameter.get_language()                           +
65cdf0e10cSrcweir 			rtl::OUString::createFromAscii( "&System=" )             +
66cdf0e10cSrcweir 			m_aURLParameter.get_system();
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		m_nRow = sal_Int32( i );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 		uno::Reference< XContent > content = queryContent();
71cdf0e10cSrcweir 		if( content.is() )
72cdf0e10cSrcweir 		{
73cdf0e10cSrcweir 			uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
74cdf0e10cSrcweir 			cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( 0 ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
75cdf0e10cSrcweir 		}
76cdf0e10cSrcweir 		m_nRow = 0xffffffff;
77cdf0e10cSrcweir 	}
78cdf0e10cSrcweir }
79