summaryrefslogtreecommitdiff
path: root/indra/llui/llurlentry.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-14 02:00:16 +0300
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-07-17 15:46:18 +0300
commit4c89ad558688f6dfa8f7216ad7613ed75823b069 (patch)
treef475763d3047575e754fe655c610d304b1c492df /indra/llui/llurlentry.h
parentd573bc2f926fb6ff473d9b346cdeb4d73e3b0ab3 (diff)
SL-19306 A method of displaying user-customized keybindings in user-visible text
Diffstat (limited to 'indra/llui/llurlentry.h')
-rw-r--r--indra/llui/llurlentry.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 63a1506731..5d0f5479f6 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -550,4 +550,37 @@ public:
std::string mHostPath;
};
+class LLKeyBindingToStringHandler;
+
+///
+/// LLUrlEntryKeybinding A way to access keybindings and show currently used one in text.
+/// secondlife:///app/keybinding/control_name
+class LLUrlEntryKeybinding: public LLUrlEntryBase
+{
+public:
+ LLUrlEntryKeybinding();
+ /*virtual*/ std::string getLabel(const std::string& url, const LLUrlLabelCallback& cb);
+ /*virtual*/ std::string getTooltip(const std::string& url) const;
+ void setHandler(LLKeyBindingToStringHandler* handler) {pHandler = handler;}
+private:
+ std::string getControlName(const std::string& url) const;
+ std::string getMode(const std::string& url) const;
+ void initLocalization();
+ void initLocalizationFromFile(const std::string& filename);
+
+ struct LLLocalizationData
+ {
+ LLLocalizationData() {}
+ LLLocalizationData(const std::string& localization, const std::string& tooltip)
+ : mLocalization(localization)
+ , mTooltip(tooltip)
+ {}
+ std::string mLocalization;
+ std::string mTooltip;
+ };
+
+ std::map<std::string, LLLocalizationData> mLocalizations;
+ LLKeyBindingToStringHandler* pHandler;
+};
+
#endif