Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <com/sun/star/ucb/Command.hpp>
21 : #include <com/sun/star/ucb/XCommandEnvironment.hpp>
22 : #include <com/sun/star/ucb/XCommandProcessor.hpp>
23 :
24 : #include "resultsetforroot.hxx"
25 : #include "databases.hxx"
26 :
27 : using namespace chelp;
28 : using namespace com::sun::star;
29 : using namespace com::sun::star::ucb;
30 :
31 :
32 :
33 38 : ResultSetForRoot::ResultSetForRoot( const uno::Reference< uno::XComponentContext >& rxContext,
34 : const uno::Reference< XContentProvider >& xProvider,
35 : sal_Int32 nOpenMode,
36 : const uno::Sequence< beans::Property >& seq,
37 : const uno::Sequence< NumberedSortingInfo >& seqSort,
38 : URLParameter& aURLParameter,
39 : Databases* pDatabases )
40 : : ResultSetBase( rxContext, xProvider,nOpenMode,seq,seqSort ),
41 : m_aURLParameter( aURLParameter ),
42 38 : m_pDatabases( pDatabases )
43 : {
44 38 : m_aPath = m_pDatabases->getModuleList( m_aURLParameter.get_language() );
45 38 : m_aItems.resize( m_aPath.size() );
46 38 : m_aIdents.resize( m_aPath.size() );
47 :
48 38 : Command aCommand;
49 38 : aCommand.Name = "getPropertyValues";
50 38 : aCommand.Argument <<= m_sProperty;
51 :
52 38 : for( size_t i = 0; i < m_aPath.size(); ++i )
53 : {
54 0 : m_aPath[i] =
55 0 : "vnd.sun.star.help://" +
56 0 : m_aPath[i] +
57 0 : "?Language=" +
58 0 : m_aURLParameter.get_language() +
59 0 : "&System=" +
60 0 : m_aURLParameter.get_system();
61 :
62 0 : m_nRow = sal_Int32( i );
63 :
64 0 : uno::Reference< XContent > content = queryContent();
65 0 : if( content.is() )
66 : {
67 0 : uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
68 0 : cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( 0 ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
69 : }
70 0 : m_nRow = 0xffffffff;
71 38 : }
72 38 : }
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|