ImagingTools Core SDK
CLocalizedHelpPathProviderComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <iprm/ISelectionParam.h>
7#include <ifile/IFileNameParam.h>
8#include <icomp/CComponentBase.h>
9#include <idoc/IHelpFileProvider.h>
10
11
12namespace imtbase
13{
14
15
20 public icomp::CComponentBase,
21 virtual public idoc::IHelpFileProvider
22{
23public:
24 typedef icomp::CComponentBase BaseClass;
25
26 I_BEGIN_COMPONENT(CLocalizedHelpPathProviderComp);
27 I_REGISTER_INTERFACE(idoc::IHelpFileProvider);
28 I_ASSIGN(m_languageSelectionCompPtr, "LanguageSelection", "Language selector", true, "LanguageSelection");
29 I_ASSIGN_MULTI_0(m_helpUrlPathListCompPtr, "HelpUrlPaths", "List of help URL paths related to the locale-IDs", false);
30 I_ASSIGN_MULTI_0(m_helpLocalPathListCompPtr, "HelpLocalPaths", "List of help local paths related to the locale-IDs", false);
31 I_ASSIGN_MULTI_0(m_localeIdsAttrPtr, "LocaleIds", "List of registered locale-IDs for corresponding help file paths", true);
32 I_END_COMPONENT;
33
34 // reimplemented (idoc::IHelpFileProvider)
35 virtual QString GetHelpFilePath(const QString& contextText, const istd::IPolymorphic* contextObjectPtr) const override;
36
37 // reimplemented (idoc::IHelpFileInfoProvider)
38 virtual double GetHelpQuality(const QString& contextText, const istd::IPolymorphic* contextObjectPtr) const override;
39
40private:
41 QString GetPathForLocale(int languageIndex = -1) const;
42
43private:
44 I_REF(iprm::ISelectionParam, m_languageSelectionCompPtr);
45 I_MULTIREF(ifile::IFileNameParam, m_helpUrlPathListCompPtr);
46 I_MULTIREF(ifile::IFileNameParam, m_helpLocalPathListCompPtr);
47 I_MULTIATTR(QByteArray, m_localeIdsAttrPtr);
48};
49
50
51} // namespace imtbase
52
53