LibreOffice Module xmlhelp (master) 1
resultsetforroot.cxx
Go to the documentation of this file.
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
27using namespace chelp;
28using namespace com::sun::star;
29using namespace com::sun::star::ucb;
30
31
32ResultSetForRoot::ResultSetForRoot( const uno::Reference< uno::XComponentContext >& rxContext,
33 const uno::Reference< XContentProvider >& xProvider,
34 const uno::Sequence< beans::Property >& seq,
35 URLParameter const & aURLParameter,
36 Databases* pDatabases )
37 : ResultSetBase( rxContext, xProvider,seq )
38{
39 m_aPath = pDatabases->getModuleList( aURLParameter.get_language() );
40 m_aItems.resize( m_aPath.size() );
41 m_aIdents.resize( m_aPath.size() );
42
44 aCommand.Name = "getPropertyValues";
45 aCommand.Argument <<= m_sProperty;
46
47 for( size_t i = 0; i < m_aPath.size(); ++i )
48 {
49 m_aPath[i] =
50 "vnd.sun.star.help://" +
51 m_aPath[i] +
52 "?Language=" +
53 aURLParameter.get_language() +
54 "&System=" +
55 aURLParameter.get_system();
56
57 m_nRow = sal_Int32( i );
58
59 uno::Reference< XContent > content = queryContent();
60 if( content.is() )
61 {
62 uno::Reference< XCommandProcessor > cmd( content,uno::UNO_QUERY );
63 cmd->execute( aCommand,0,uno::Reference< XCommandEnvironment >( nullptr ) ) >>= m_aItems[i]; //TODO: check return value of operator >>=
64 }
65 m_nRow = 0xffffffff;
66 }
67}
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const std::vector< OUString > & getModuleList(const OUString &Language)
Definition: databases.cxx:285
std::vector< OUString > m_aPath
css::uno::Sequence< css::beans::Property > m_sProperty
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
const OUString & get_system() const
OUString const & get_language() const
int i
OUString aCommand