diff options
Diffstat (limited to 'indra/llui/llnotifications.h')
-rw-r--r-- | indra/llui/llnotifications.h | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 2cc8803f10..1799ca65b7 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -3,25 +3,31 @@ * @brief Non-UI manager and support for keeping a prioritized list of notifications * @author Q (with assistance from Richard and Coco) * -* $LicenseInfo:firstyear=2008&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. +* $LicenseInfo:firstyear=2008&license=viewergpl$ +* +* Copyright (c) 2008-2009, 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. +* Second Life Viewer Source Code +* The source code in this file ("Source Code") is provided by Linden Lab +* to you under the terms of the GNU General Public License, version 2.0 +* ("GPL"), unless you have obtained a separate licensing agreement +* ("Other License"), formally executed by you and Linden Lab. Terms of +* the GPL can be found in doc/GPL-license.txt in this distribution, or +* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * -* 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. +* There are special exceptions to the terms and conditions of the GPL as +* it is applied to this Source Code. View the full text of the exception +* in the file doc/FLOSS-exception.txt in this software distribution, or +* online at +* http://secondlifegrid.net/programs/open_source/licensing/flossexception * -* 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 +* By copying, modifying or distributing this software, you acknowledge +* that you have read and understood your obligations described above, +* and agree to abide by those obligations. * -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO +* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, +* COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -110,23 +116,8 @@ typedef enum e_notification_priority NOTIFICATION_PRIORITY_CRITICAL } ENotificationPriority; -class LLNotificationResponderInterface -{ -public: - LLNotificationResponderInterface(){}; - virtual ~LLNotificationResponderInterface(){}; - - virtual void handleRespond(const LLSD& notification, const LLSD& response) = 0; - - virtual LLSD asLLSD() = 0; - - virtual void fromLLSD(const LLSD& params) = 0; -}; - typedef boost::function<void (const LLSD&, const LLSD&)> LLNotificationResponder; -typedef boost::shared_ptr<LLNotificationResponderInterface> LLNotificationResponderPtr; - typedef LLFunctorRegistry<LLNotificationResponder> LLNotificationFunctorRegistry; typedef LLFunctorRegistration<LLNotificationResponder> LLNotificationFunctorRegistration; @@ -312,12 +303,10 @@ public: { Alternative<std::string> name; Alternative<LLNotificationFunctorRegistry::ResponseFunctor> function; - Alternative<LLNotificationResponderPtr> responder; Functor() : name("functor_name"), - function("functor"), - responder("responder") + function("functor") {} }; Optional<Functor> functor; @@ -347,8 +336,6 @@ public: } }; - LLNotificationResponderPtr getResponderPtr() { return mResponder; } - private: LLUUID mId; @@ -362,13 +349,12 @@ private: bool mIgnored; ENotificationPriority mPriority; LLNotificationFormPtr mForm; - void* mResponderObj; // TODO - refactor/remove this field + void* mResponderObj; bool mIsReusable; - LLNotificationResponderPtr mResponder; - + // a reference to the template LLNotificationTemplatePtr mTemplatep; - + /* We want to be able to store and reload notifications so that they can survive a shutdown/restart of the client. So we can't simply pass in callbacks; @@ -396,6 +382,8 @@ private: void cancel(); + bool payloadContainsAll(const std::vector<std::string>& required_fields) const; + public: // constructor from a saved notification @@ -405,8 +393,6 @@ public: void setResponseFunctor(const LLNotificationFunctorRegistry::ResponseFunctor& cb); - void setResponseFunctor(const LLNotificationResponderPtr& responder); - typedef enum e_response_template_type { WITHOUT_DEFAULT_BUTTON, @@ -473,12 +459,7 @@ public: { return mTemplatep->mName; } - - bool isPersistent() const - { - return mTemplatep->mPersist; - } - + const LLUUID& id() const { return mId; |