From 1ad5663463721c4bca6ca8e91b9894226e999cca Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 14 Sep 2010 10:53:05 -0700 Subject: converted notifications.xml to paramblock parsing for easier reuse and extension --- indra/llui/llnotifications.cpp | 654 ++++++++++++++++++++++++++++------------- indra/llui/llnotifications.h | 30 +- 2 files changed, 464 insertions(+), 220 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7dba53e746..3baf8d4f7b 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -44,6 +44,229 @@ const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; +void NotificationPriorityValues::declareValues() +{ + declare("low", NOTIFICATION_PRIORITY_LOW); + declare("normal", NOTIFICATION_PRIORITY_NORMAL); + declare("high", NOTIFICATION_PRIORITY_HIGH); + declare("critical", NOTIFICATION_PRIORITY_CRITICAL); +} + + +namespace LLNotificationTemplateParams +{ + using namespace LLInitParam; + + struct GlobalString : public Block + { + Mandatory name, + value; + + GlobalString() + : name("name"), + value("value") + {} + }; + + struct UniquenessContext : public Block + { + Mandatory key; + + UniquenessContext() + : key("key") + {} + + }; + + struct UniquenessConstraint : public Block + { + Multiple contexts; + + UniquenessConstraint() + : contexts("context") + {} + }; + + struct FormElementBase : public Block + { + Mandatory name; + FormElementBase() + : name("name") + {} + }; + + struct FormIgnore : public Block + { + Optional text; + Optional save_option; + + FormIgnore() + : text("text"), + save_option("save_option", false) + {} + }; + + struct FormButton : public Block + { + Mandatory index; + Mandatory text; + Optional ignore; + Optional is_default; + + FormButton() + : index("index"), + text("text"), + ignore("ignore"), + is_default("default") + {} + }; + + struct FormInput : public Block + { + Mandatory type; + Optional width; + + FormInput() + : type("type"), + width("width", 0) + {} + }; + + struct FormElement : public Choice + { + Alternative button; + Alternative input; + + FormElement() + : button("button"), + input("input") + {} + }; + + struct Form : public Block
+ { + Optional name; + Optional ignore; + Multiple form_elements; + + Form() + : name("form"), + ignore("ignore"), + form_elements("") + {} + }; + + // Templates are used to define common form types, such as OK/Cancel dialogs, etc. + + struct Template : public Block