summaryrefslogtreecommitdiff
path: root/indra/newview/lluilistener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lluilistener.cpp')
-rw-r--r--indra/newview/lluilistener.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
index c73c93859a..2b2187a73b 100644
--- a/indra/newview/lluilistener.cpp
+++ b/indra/newview/lluilistener.cpp
@@ -55,6 +55,13 @@ LLUIListener::LLUIListener():
&LLUIListener::call,
llsd::map("function", LLSD(), "reply", LLSD()));
+ add("callables",
+ "Return a list [\"callables\"] of dicts {name, access} of functions registered to\n"
+ "invoke with \"call\".\n"
+ "access has values \"allow\", \"block\" or \"throttle\".",
+ &LLUIListener::callables,
+ llsd::map("reply", LLSD::String()));
+
add("getValue",
"For the UI control identified by the path in [\"path\"], return the control's\n"
"current value as [\"value\"] reply.",
@@ -131,6 +138,42 @@ void LLUIListener::call(const LLSD& event)
(info->callback_func)(NULL, event["parameter"]);
}
+void LLUIListener::callables(const LLSD& event) const
+{
+ Response response(LLSD(), event);
+
+ using Registry = LLUICtrl::CommitCallbackRegistry;
+ using Method = Registry::Registrar& (*)();
+ static Method registrars[] =
+ {
+ &Registry::defaultRegistrar,
+ &Registry::currentRegistrar,
+ };
+ LLSD list;
+ for (auto method : registrars)
+ {
+ auto& registrar{ (*method)() };
+ for (auto it = registrar.beginItems(), end = registrar.endItems(); it != end; ++it)
+ {
+ LLSD entry{ llsd::map("name", it->first) };
+ switch (it->second.handle_untrusted)
+ {
+ case LLUICtrl::CommitCallbackInfo::UNTRUSTED_ALLOW:
+ entry["access"] = "allow";
+ break;
+ case LLUICtrl::CommitCallbackInfo::UNTRUSTED_BLOCK:
+ entry["access"] = "block";
+ break;
+ case LLUICtrl::CommitCallbackInfo::UNTRUSTED_THROTTLE:
+ entry["access"] = "throttle";
+ break;
+ }
+ list.append(entry);
+ }
+ }
+ response["callables"] = list;
+}
+
void LLUIListener::getValue(const LLSD&event) const
{
Response response(LLSD(), event);