LibreOffice Module framework (master) 1
|
implements a job component, which handle the special feature to show a suitable help page for every (visible!) loaded document. More...
#include <helponstartup.hxx>
Public Member Functions | |
HelpOnStartup (css::uno::Reference< css::uno::XComponentContext > xContext) | |
create new instance of this class. More... | |
virtual | ~HelpOnStartup () override |
does nothing real ... More... | |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &sServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
virtual css::uno::Any SAL_CALL | execute (const css::uno::Sequence< css::beans::NamedValue > &lArguments) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &aEvent) override |
Private Member Functions | |
OUString | its_getModuleIdFromEnv (const css::uno::Sequence< css::beans::NamedValue > &lArguments) |
analyze the given job arguments, try to locate a model reference and try to classify this model. More... | |
OUString | its_getCurrentHelpURL () |
tries to locate the open help module and return the url of the currently shown help content. More... | |
bool | its_isHelpUrlADefaultOne (std::u16string_view sHelpURL) |
checks if the given help url match to a default help url of any office module. More... | |
OUString | its_checkIfHelpEnabledAndGetURL (const OUString &sModule) |
checks, if the help module should be shown automatically for the currently opened office module. More... | |
Static Private Member Functions | |
static OUString | ist_createHelpURL (std::u16string_view sBaseURL, std::u16string_view sLocale, std::u16string_view sSystem) |
create a help URL for the given parameters. More... | |
Private Attributes | |
std::mutex | m_mutex |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
reference to a uno service manager. More... | |
css::uno::Reference< css::frame::XModuleManager2 > | m_xModuleManager |
such module manager is used to classify new opened documents. More... | |
css::uno::Reference< css::frame::XDesktop2 > | m_xDesktop |
is needed to locate a might open help frame. More... | |
css::uno::Reference< css::container::XNameAccess > | m_xConfig |
provides read access to the underlying configuration. More... | |
OUString | m_sLocale |
knows the current locale of this office session, which is needed to build complete help URLs. More... | |
OUString | m_sSystem |
knows the current operating system of this office session, which is needed to build complete help URLs. More... | |
implements a job component, which handle the special feature to show a suitable help page for every (visible!) loaded document.
Definition at line 43 of file helponstartup.hxx.
framework::HelpOnStartup::HelpOnStartup | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
create new instance of this class.
xContext | reference to the uno service manager, which created this instance. Can be used later to create own needed uno resources on demand. |
Definition at line 60 of file helponstartup.cxx.
References m_sLocale, m_sSystem, m_xConfig, m_xContext, m_xDesktop, and m_xModuleManager.
|
overridevirtual |
does nothing real ...
@descr But it should exists as virtual function, so this class can't make trouble related to inline/symbols etcpp.!
Definition at line 87 of file helponstartup.cxx.
|
overridevirtual |
Definition at line 135 of file helponstartup.cxx.
References aEvent, m_mutex, m_xConfig, m_xDesktop, and m_xModuleManager.
|
overridevirtual |
Definition at line 92 of file helponstartup.cxx.
References Application::GetHelp(), its_checkIfHelpEnabledAndGetURL(), its_getCurrentHelpURL(), its_getModuleIdFromEnv(), its_isHelpUrlADefaultOne(), and Help::Start().
|
overridevirtual |
Definition at line 45 of file helponstartup.cxx.
|
overridevirtual |
Definition at line 55 of file helponstartup.cxx.
References framework::SERVICENAME_JOB.
|
staticprivate |
create a help URL for the given parameters.
sBaseURL | must be the base URL for a requested help content e.g. "vnd.sun.star.help://swriter/" or "vnd.sun.star.help://swriter/67351" |
sLocale | the current office locale e.g. "en-US" |
sSystem | the current operating system e.g. "WIN" |
Definition at line 320 of file helponstartup.cxx.
Referenced by its_checkIfHelpEnabledAndGetURL(), and its_isHelpUrlADefaultOne().
|
private |
checks, if the help module should be shown automatically for the currently opened office module.
@descr This value is read from the module configuration. In case the help should be shown, this method returns a help URL, which can be used to show the right help content.
sModule | identifies the used office module. |
Definition at line 283 of file helponstartup.cxx.
References ist_createHelpURL(), m_mutex, m_sLocale, m_sSystem, and m_xConfig.
Referenced by execute().
|
private |
tries to locate the open help module and return the url of the currently shown help content.
@descr It returns an empty string, if the help isn't still open at calling time.
Definition at line 196 of file helponstartup.cxx.
References m_mutex, m_xDesktop, and framework::SPECIALTARGET_HELPTASK.
Referenced by execute().
|
private |
analyze the given job arguments, try to locate a model reference and try to classify this model.
@descr As a result of this operation a module identifier will be returned. It can be used against the module configuration then to retrieve further information.
lArguments | the list of job arguments which is given on our interface method execute(). |
Definition at line 146 of file helponstartup.cxx.
References comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), m_mutex, m_xModuleManager, xController, and xFrame.
Referenced by execute().
|
private |
checks if the given help url match to a default help url of any office module.
sHelpURL | the help url for checking. |
Definition at line 237 of file helponstartup.cxx.
References i, ist_createHelpURL(), m_mutex, m_sLocale, m_sSystem, and m_xConfig.
Referenced by execute().
|
overridevirtual |
Definition at line 50 of file helponstartup.cxx.
References sServiceName, and cppu::supportsService().
|
private |
Definition at line 48 of file helponstartup.hxx.
Referenced by disposing(), its_checkIfHelpEnabledAndGetURL(), its_getCurrentHelpURL(), its_getModuleIdFromEnv(), and its_isHelpUrlADefaultOne().
|
private |
knows the current locale of this office session, which is needed to build complete help URLs.
Definition at line 65 of file helponstartup.hxx.
Referenced by HelpOnStartup(), its_checkIfHelpEnabledAndGetURL(), and its_isHelpUrlADefaultOne().
|
private |
knows the current operating system of this office session, which is needed to build complete help URLs.
Definition at line 70 of file helponstartup.hxx.
Referenced by HelpOnStartup(), its_checkIfHelpEnabledAndGetURL(), and its_isHelpUrlADefaultOne().
|
private |
provides read access to the underlying configuration.
Definition at line 60 of file helponstartup.hxx.
Referenced by disposing(), HelpOnStartup(), its_checkIfHelpEnabledAndGetURL(), and its_isHelpUrlADefaultOne().
|
private |
reference to a uno service manager.
Definition at line 51 of file helponstartup.hxx.
Referenced by HelpOnStartup().
|
private |
is needed to locate a might open help frame.
Definition at line 57 of file helponstartup.hxx.
Referenced by disposing(), HelpOnStartup(), and its_getCurrentHelpURL().
|
private |
such module manager is used to classify new opened documents.
Definition at line 54 of file helponstartup.hxx.
Referenced by disposing(), HelpOnStartup(), and its_getModuleIdFromEnv().