2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-19 19:45:04 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
2008-03-25 14:21:11 +00:00
|
|
|
*
|
2012-11-19 19:45:04 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2008-03-25 14:21:11 +00:00
|
|
|
*
|
2012-11-19 19:45:04 +00:00
|
|
|
* This file incorporates work covered by the following license notice:
|
2008-03-25 14:21:11 +00:00
|
|
|
*
|
2012-11-19 19:45:04 +00:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
#ifndef _DATABASES_HXX_
|
|
|
|
#define _DATABASES_HXX_
|
|
|
|
|
2013-06-13 18:41:41 +02:00
|
|
|
#include <config_global.h>
|
|
|
|
|
2008-03-25 14:21:11 +00:00
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
2013-06-13 18:41:41 +02:00
|
|
|
#if !HAVE_CXX11
|
2012-09-19 20:44:03 +02:00
|
|
|
#define BOOST_NO_0X_HDR_TYPEINDEX
|
|
|
|
#endif
|
2011-02-05 13:18:52 +01:00
|
|
|
#include <boost/unordered_map.hpp>
|
|
|
|
#include <boost/unordered_set.hpp>
|
2008-03-25 14:21:11 +00:00
|
|
|
#include <osl/mutex.hxx>
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <rtl/string.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/ucb/XContent.hpp>
|
|
|
|
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
|
|
|
|
#include <com/sun/star/io/XInputStream.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
|
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
#include <com/sun/star/i18n/XCollator.hpp>
|
|
|
|
#include <com/sun/star/deployment/XPackage.hpp>
|
2012-11-02 17:46:30 +02:00
|
|
|
#include "com/sun/star/ucb/XSimpleFileAccess3.hpp"
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
// Forward declaration
|
|
|
|
|
2012-11-19 19:45:04 +00:00
|
|
|
namespace helpdatafileproxy {
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2012-11-19 19:45:04 +00:00
|
|
|
class Hdf;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace chelp {
|
|
|
|
|
|
|
|
class Databases;
|
|
|
|
class URLParameter;
|
|
|
|
|
|
|
|
class StaticModuleInformation
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aStartId;
|
|
|
|
OUString m_aProgramSwitch;
|
|
|
|
OUString m_aTitle;
|
|
|
|
OUString m_aHeading;
|
|
|
|
OUString m_aFulltext;
|
2008-03-25 14:21:11 +00:00
|
|
|
int m_nOrder;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
StaticModuleInformation( OUString aTitle,
|
|
|
|
OUString aStartId,
|
|
|
|
OUString aProgramSwitch,
|
|
|
|
OUString aHeading,
|
|
|
|
OUString aFulltext,
|
|
|
|
OUString aOrder )
|
2008-03-25 14:21:11 +00:00
|
|
|
: m_aStartId( aStartId ),
|
|
|
|
m_aProgramSwitch( aProgramSwitch ),
|
|
|
|
m_aTitle( aTitle ),
|
|
|
|
m_aHeading( aHeading ),
|
|
|
|
m_aFulltext( aFulltext ),
|
|
|
|
m_nOrder( aOrder.toInt32() )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~StaticModuleInformation() { }
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString get_title() const { return m_aTitle; }
|
|
|
|
OUString get_id() const { return m_aStartId; }
|
|
|
|
OUString get_program() const { return m_aProgramSwitch; }
|
|
|
|
OUString get_heading() const { return m_aHeading; }
|
|
|
|
OUString get_fulltext() const { return m_aFulltext; }
|
2010-11-25 11:07:46 +00:00
|
|
|
int get_order() const { return m_nOrder; }
|
2008-03-25 14:21:11 +00:00
|
|
|
}; // end class StaticModuleInformation
|
|
|
|
|
|
|
|
class KeywordInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
class KeywordElement
|
|
|
|
{
|
|
|
|
friend struct KeywordElementComparator;
|
|
|
|
friend class KeywordInfo;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
KeywordElement( Databases* pDatabases,
|
2012-11-19 19:45:04 +00:00
|
|
|
helpdatafileproxy::Hdf* pHdf,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString& key,
|
|
|
|
OUString& ids );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString key;
|
|
|
|
com::sun::star::uno::Sequence< OUString > listId;
|
|
|
|
com::sun::star::uno::Sequence< OUString > listAnchor;
|
|
|
|
com::sun::star::uno::Sequence< OUString > listTitle;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void init( Databases *pDatabases,helpdatafileproxy::Hdf* pHdf,const OUString& ids );
|
2008-03-25 14:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
KeywordInfo( const std::vector< KeywordElement >& aVector );
|
|
|
|
|
|
|
|
~KeywordInfo() { };
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< OUString >&
|
2008-03-25 14:21:11 +00:00
|
|
|
getKeywordList() { return listKey; }
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< OUString > >&
|
2008-03-25 14:21:11 +00:00
|
|
|
getIdList() { return listId; }
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< OUString > >&
|
2008-03-25 14:21:11 +00:00
|
|
|
getAnchorList() { return listAnchor; }
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< OUString > >&
|
2008-03-25 14:21:11 +00:00
|
|
|
getTitleList() { return listTitle; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
com::sun::star::uno::Sequence< OUString > listKey;
|
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< OUString > > listId,listAnchor,listTitle;
|
2008-03-25 14:21:11 +00:00
|
|
|
}; // end class KeywordInfo
|
|
|
|
|
|
|
|
class Databases
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct eq
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
bool operator()( const OUString& rKey1, const OUString& rKey2 ) const
|
2008-03-25 14:21:11 +00:00
|
|
|
{
|
2013-04-21 17:52:54 +05:30
|
|
|
return (rKey1 == rKey2);
|
2008-03-25 14:21:11 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ha
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
size_t operator()( const OUString& rName ) const
|
2008-03-25 14:21:11 +00:00
|
|
|
{
|
|
|
|
return rName.hashCode();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Input is the installdirectory in system dependent notation
|
|
|
|
*/
|
|
|
|
|
|
|
|
Databases( sal_Bool showBasic,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& instPath,
|
|
|
|
const com::sun::star::uno::Sequence< OUString >& imagesZipPaths,
|
|
|
|
const OUString& productName,
|
|
|
|
const OUString& productVersion,
|
|
|
|
const OUString& styleSheet,
|
2008-03-25 14:21:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext );
|
|
|
|
|
|
|
|
~Databases();
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OString getImagesZipFileURL();
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString getInstallPathAsURL();
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
const std::vector< OUString >& getModuleList( const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
StaticModuleInformation* getStaticInformationForModule( const OUString& Module,
|
|
|
|
const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
bool checkModuleMatchForExtension( const OUString& Database, const OUString& doclist );
|
|
|
|
KeywordInfo* getKeyword( const OUString& Module,
|
|
|
|
const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
helpdatafileproxy::Hdf* getHelpDataFile( const OUString& Module,
|
|
|
|
const OUString& Language, bool helpText = false,
|
|
|
|
const OUString* pExtensionPath = NULL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The following method returns the Collator for the given language-country combination
|
|
|
|
*/
|
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::i18n::XCollator >
|
2013-04-07 12:06:47 +02:00
|
|
|
getCollator( const OUString& Language,
|
|
|
|
const OUString& System ); // System not used by current implementation
|
2008-03-25 14:21:11 +00:00
|
|
|
// // of XCollator
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the cascading stlye sheet used to format the HTML-output.
|
|
|
|
* First try is language directory, second try is main installation directory.
|
|
|
|
*/
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void cascadingStylesheet( const OUString& Language,
|
2008-03-25 14:21:11 +00:00
|
|
|
char** buffer,
|
|
|
|
int* byteCount );
|
|
|
|
|
|
|
|
/**
|
2013-02-22 09:48:17 +02:00
|
|
|
* Changes the stylesheet for further reads.
|
2008-03-25 14:21:11 +00:00
|
|
|
*/
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void changeCSS(const OUString& newStyleSheet);
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the active help text for the given module, language and id.
|
|
|
|
*/
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void setActiveText( const OUString& Module,
|
|
|
|
const OUString& Language,
|
|
|
|
const OUString& Id,
|
2008-03-25 14:21:11 +00:00
|
|
|
char** buffer,
|
|
|
|
int* byteCount );
|
|
|
|
|
|
|
|
/**
|
2013-02-22 09:48:17 +02:00
|
|
|
* Has the purpose of forcing the jarfile to stay open
|
2008-03-25 14:21:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
|
2013-04-07 12:06:47 +02:00
|
|
|
jarFile( const OUString& jar,
|
|
|
|
const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
|
2013-04-07 12:06:47 +02:00
|
|
|
findJarFileForPath( const OUString& jar, const OUString& Language,
|
|
|
|
const OUString& path, OUString* o_pExtensionPath = NULL,
|
|
|
|
OUString* o_pExtensionRegistryPath = NULL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps a given language-locale combination to language.
|
|
|
|
*/
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString processLang( const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps a given language-locale combination to locale.
|
|
|
|
* The returned string maybe empty
|
|
|
|
*/
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString country( const OUString& Language );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void replaceName( OUString& oustring ) const;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString getProductName() const { return m_vReplacement[0]; }
|
|
|
|
OUString getProductVersion() const { return m_vReplacement[1]; }
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString expandURL( const OUString& aURL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
static OUString expandURL( const OUString& aURL,
|
2008-12-10 14:25:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext );
|
|
|
|
|
2008-03-25 14:21:11 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
osl::Mutex m_aMutex;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > m_xSMgr;
|
2012-11-02 17:46:30 +02:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess3 > m_xSFA;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2012-09-25 17:21:29 +02:00
|
|
|
bool m_bShowBasic;
|
2008-03-25 14:21:11 +00:00
|
|
|
char* m_pErrorDoc;
|
|
|
|
|
|
|
|
int m_nCustomCSSDocLength;
|
|
|
|
char* m_pCustomCSSDoc;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aCSS;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2010-12-14 16:32:58 +01:00
|
|
|
enum {
|
|
|
|
PRODUCTNAME = 0,
|
|
|
|
PRODUCTVERSION,
|
|
|
|
VENDORNAME,
|
|
|
|
VENDORVERSION,
|
|
|
|
VENDORSHORT,
|
|
|
|
NEWPRODUCTNAME,
|
|
|
|
NEWPRODUCTVERSION
|
|
|
|
};
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
int m_vAdd[7];
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_vReplacement[7];
|
|
|
|
OUString newProdName,newProdVersion,
|
2008-03-25 14:21:11 +00:00
|
|
|
prodName,prodVersion,vendName,vendVersion,vendShort;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aInstallDirectory; // Installation directory
|
|
|
|
com::sun::star::uno::Sequence< OUString > m_aImagesZipPaths;
|
|
|
|
OString m_aImagesZipFileURL;
|
|
|
|
OUString m_aSymbolsStyleName;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
std::vector< OUString > m_avModules;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
typedef boost::unordered_map< OUString,helpdatafileproxy::Hdf*,ha,eq > DatabasesTable;
|
2008-03-25 14:21:11 +00:00
|
|
|
DatabasesTable m_aDatabases; // Language and module dependent databases
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
typedef boost::unordered_map< OUString,OUString,ha,eq > LangSetTable;
|
2008-03-25 14:21:11 +00:00
|
|
|
LangSetTable m_aLangSet; // Mapping to of lang-country to lang
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
typedef boost::unordered_map< OUString,StaticModuleInformation*,ha,eq > ModInfoTable;
|
2008-03-25 14:21:11 +00:00
|
|
|
ModInfoTable m_aModInfo; // Module information
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
typedef boost::unordered_map< OUString,KeywordInfo*,ha,eq > KeywordInfoTable;
|
2008-03-25 14:21:11 +00:00
|
|
|
KeywordInfoTable m_aKeywordInfo; // Module information
|
|
|
|
|
|
|
|
typedef
|
2011-02-05 13:18:52 +01:00
|
|
|
boost::unordered_map<
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString,
|
2008-03-25 14:21:11 +00:00
|
|
|
::com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >,
|
|
|
|
ha,
|
|
|
|
eq > ZipFileTable;
|
|
|
|
ZipFileTable m_aZipFileTable; // No closing of an once opened jarfile
|
|
|
|
|
|
|
|
typedef
|
2011-02-05 13:18:52 +01:00
|
|
|
boost::unordered_map<
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString,
|
2008-03-25 14:21:11 +00:00
|
|
|
::com::sun::star::uno::Reference< com::sun::star::i18n::XCollator >,
|
|
|
|
ha,
|
|
|
|
eq > CollatorTable;
|
|
|
|
CollatorTable m_aCollatorTable;
|
|
|
|
|
|
|
|
struct ostring_eq
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
bool operator()( const OString& rKey1, const OString& rKey2 ) const
|
2008-03-25 14:21:11 +00:00
|
|
|
{
|
2013-04-21 17:52:54 +05:30
|
|
|
return (rKey1 == rKey2);
|
2008-03-25 14:21:11 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ostring_ha
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
size_t operator()( const OString& rName ) const
|
2008-03-25 14:21:11 +00:00
|
|
|
{
|
|
|
|
return rName.hashCode();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef
|
2011-02-05 13:18:52 +01:00
|
|
|
boost::unordered_set<
|
2013-04-07 12:06:47 +02:00
|
|
|
OString,
|
2008-03-25 14:21:11 +00:00
|
|
|
ostring_ha,
|
|
|
|
ostring_eq > EmptyActiveTextSet;
|
|
|
|
EmptyActiveTextSet m_aEmptyActiveTextSet;
|
|
|
|
|
|
|
|
// methods
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void setInstallPath( const OUString& aInstallDirectory );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
}; // end class Databases
|
|
|
|
|
|
|
|
enum IteratorState
|
|
|
|
{
|
|
|
|
INITIAL_MODULE,
|
|
|
|
//SHARED_MODULE, // Later, avoids redundancies in help compiling
|
|
|
|
USER_EXTENSIONS,
|
|
|
|
SHARED_EXTENSIONS,
|
2010-04-06 17:15:01 +02:00
|
|
|
BUNDLED_EXTENSIONS,
|
2008-03-25 14:21:11 +00:00
|
|
|
END_REACHED
|
|
|
|
};
|
|
|
|
|
|
|
|
// Hashtable to cache extension help status
|
2011-02-05 13:18:52 +01:00
|
|
|
typedef boost::unordered_map
|
2008-03-25 14:21:11 +00:00
|
|
|
<
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString,
|
2008-03-25 14:21:11 +00:00
|
|
|
bool,
|
|
|
|
Databases::ha,
|
|
|
|
Databases::eq
|
|
|
|
>
|
|
|
|
ExtensionHelpExistanceMap;
|
|
|
|
|
|
|
|
class ExtensionIteratorBase
|
|
|
|
{
|
|
|
|
static ExtensionHelpExistanceMap aHelpExistanceMap;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ExtensionIteratorBase( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext,
|
2013-04-07 12:06:47 +02:00
|
|
|
Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage );
|
|
|
|
ExtensionIteratorBase( Databases& rDatabases, const OUString& aInitialModule,
|
|
|
|
const OUString& aLanguage );
|
2008-03-25 14:21:11 +00:00
|
|
|
void init( void );
|
|
|
|
|
|
|
|
private:
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetHelpPackageFromPackage
|
|
|
|
( const com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage,
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextUserHelpPackage
|
|
|
|
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextSharedHelpPackage
|
|
|
|
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
|
2010-04-06 17:15:01 +02:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > implGetNextBundledHelpPackage
|
|
|
|
( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString implGetFileFromPackage( const OUString& rFileExtension,
|
2008-12-10 14:25:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
|
2013-04-07 12:06:47 +02:00
|
|
|
void implGetLanguageVectorFromPackage( ::std::vector< OUString > &rv,
|
2009-05-15 12:21:35 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
|
2012-11-02 17:46:30 +02:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess3 > m_xSFA;
|
2008-03-25 14:21:11 +00:00
|
|
|
Databases& m_rDatabases;
|
|
|
|
|
|
|
|
IteratorState m_eState;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aExtensionPath;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aInitialModule;
|
|
|
|
OUString m_aLanguage;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Reference
|
|
|
|
< com::sun::star::deployment::XPackage > > m_aUserPackagesSeq;
|
|
|
|
bool m_bUserPackagesLoaded;
|
|
|
|
|
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Reference
|
|
|
|
< com::sun::star::deployment::XPackage > > m_aSharedPackagesSeq;
|
|
|
|
bool m_bSharedPackagesLoaded;
|
|
|
|
|
2010-04-06 17:15:01 +02:00
|
|
|
com::sun::star::uno::Sequence< com::sun::star::uno::Reference
|
|
|
|
< com::sun::star::deployment::XPackage > > m_aBundledPackagesSeq;
|
|
|
|
bool m_bBundledPackagesLoaded;
|
|
|
|
|
2008-03-25 14:21:11 +00:00
|
|
|
int m_iUserPackage;
|
|
|
|
int m_iSharedPackage;
|
2010-04-06 17:15:01 +02:00
|
|
|
int m_iBundledPackage;
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
}; // end class ExtensionIteratorBase
|
|
|
|
|
|
|
|
class DataBaseIterator : public ExtensionIteratorBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DataBaseIterator( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext,
|
2013-04-07 12:06:47 +02:00
|
|
|
Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage, bool bHelpText )
|
2008-03-25 14:21:11 +00:00
|
|
|
: ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage )
|
|
|
|
, m_bHelpText( bHelpText )
|
|
|
|
{}
|
2013-04-07 12:06:47 +02:00
|
|
|
DataBaseIterator( Databases& rDatabases, const OUString& aInitialModule,
|
|
|
|
const OUString& aLanguage, bool bHelpText )
|
2008-03-25 14:21:11 +00:00
|
|
|
: ExtensionIteratorBase( rDatabases, aInitialModule, aLanguage )
|
|
|
|
, m_bHelpText( bHelpText )
|
|
|
|
{}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
helpdatafileproxy::Hdf* nextHdf( OUString* o_pExtensionPath = NULL, OUString* o_pExtensionRegistryPath = NULL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
private:
|
2012-11-19 19:45:04 +00:00
|
|
|
helpdatafileproxy::Hdf* implGetHdfFromPackage(
|
2008-03-25 14:21:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString* o_pExtensionPath, OUString* o_pExtensionRegistryPath );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
bool m_bHelpText;
|
|
|
|
|
|
|
|
}; // end class DataBaseIterator
|
|
|
|
|
|
|
|
class KeyDataBaseFileIterator : public ExtensionIteratorBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KeyDataBaseFileIterator( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext,
|
2013-04-07 12:06:47 +02:00
|
|
|
Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage )
|
2008-03-25 14:21:11 +00:00
|
|
|
: ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage )
|
|
|
|
{}
|
2011-02-25 15:46:46 +01:00
|
|
|
//Returns a file URL
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString nextDbFile( bool& o_rbExtension );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
private:
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString implGetDbFileFromPackage(
|
2008-03-25 14:21:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
|
|
|
|
|
|
|
|
}; // end class KeyDataBaseFileIterator
|
|
|
|
|
|
|
|
class JarFileIterator : public ExtensionIteratorBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
JarFileIterator( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext,
|
2013-04-07 12:06:47 +02:00
|
|
|
Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage )
|
2008-03-25 14:21:11 +00:00
|
|
|
: ExtensionIteratorBase( xContext, rDatabases, aInitialModule, aLanguage )
|
|
|
|
{}
|
|
|
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
|
2009-02-13 08:59:55 +00:00
|
|
|
nextJarFile( com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >& o_xParentPackageBundle,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString* o_pExtensionPath = NULL, OUString* o_pExtensionRegistryPath = NULL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >
|
2009-05-15 12:21:35 +00:00
|
|
|
implGetJarFromPackage(com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage,
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString* o_pExtensionPath = NULL, OUString* o_pExtensionRegistryPath = NULL );
|
2008-03-25 14:21:11 +00:00
|
|
|
|
|
|
|
}; // end class JarFileIterator
|
|
|
|
|
2008-12-10 14:25:11 +00:00
|
|
|
class IndexFolderIterator : public ExtensionIteratorBase
|
|
|
|
{
|
|
|
|
public:
|
2013-04-07 12:06:47 +02:00
|
|
|
IndexFolderIterator( Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage )
|
2008-12-10 14:25:11 +00:00
|
|
|
: ExtensionIteratorBase( rDatabases, aInitialModule, aLanguage )
|
|
|
|
{}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString nextIndexFolder( bool& o_rbExtension, bool& o_rbTemporary );
|
|
|
|
void deleteTempIndexFolder( const OUString& aIndexFolder );
|
2008-12-10 14:25:11 +00:00
|
|
|
|
|
|
|
private:
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString implGetIndexFolderFromPackage( bool& o_rbTemporary,
|
2008-12-10 14:25:11 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage );
|
|
|
|
|
|
|
|
}; // end class KeyDataBaseFileIterator
|
|
|
|
|
2008-03-25 14:21:11 +00:00
|
|
|
} // end namespace chelp
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|