/** * @file llnotifications.cpp * @brief Non-UI queue manager for keeping a prioritized list of notifications * * $LicenseInfo:firstyear=2008&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include "linden_common.h" #include "llnotifications.h" #include "llinstantmessage.h" #include "llxmlnode.h" #include "lluictrl.h" #include "lluictrlfactory.h" #include "lldir.h" #include "llsdserialize.h" #include "lltrans.h" #include "llnotificationslistener.h" #include "llstring.h" #include #include 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