diff options
Diffstat (limited to 'indra/newview/llnotificationhandler.h')
-rw-r--r-- | indra/newview/llnotificationhandler.h | 109 |
1 files changed, 86 insertions, 23 deletions
diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index 0fb438bfe9..060eccf5c7 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -2,31 +2,25 @@ * @file llnotificationhandler.h * @brief Here are implemented Notification Handling Classes. * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * 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 + * 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. * - * 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 + * 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. * - * 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. + * 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 * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -42,6 +36,8 @@ #include "llinstantmessage.h" #include "llnotificationptr.h" +class LLIMFloater; + namespace LLNotificationsUI { // ENotificationType enumerates all possible types of notifications that could be met @@ -122,9 +118,17 @@ protected: class LLSysHandler : public LLEventHandler { public: + LLSysHandler(); virtual ~LLSysHandler() {}; virtual bool processNotification(const LLSD& notify)=0; + +protected : + static void init(); + void removeExclusiveNotifications(const LLNotificationPtr& notif); + + typedef std::list< std::set<std::string> > exclusive_notif_sets; + static exclusive_notif_sets sExclusiveNotificationGroups; }; /** @@ -135,7 +139,7 @@ class LLChatHandler : public LLEventHandler public: virtual ~LLChatHandler() {}; - virtual void processChat(const LLChat& chat_msg)=0; + virtual void processChat(const LLChat& chat_msg, const LLSD &args)=0; }; /** @@ -171,6 +175,7 @@ public: protected: virtual void onDeleteToast(LLToast* toast); + virtual void onRejectToast(const LLUUID& id); virtual void initChannel(); }; @@ -277,6 +282,16 @@ public: static bool canSpawnIMSession(const LLNotificationPtr& notification); /** + * Checks sufficient conditions to add notification toast panel IM floater. + */ + static bool canAddNotifPanelToIM(const LLNotificationPtr& notification); + + /** + * Checks whether notification can be used multiple times or not. + */ + static bool isNotificationReusable(const LLNotificationPtr& notification); + + /** * Checks if passed notification can create IM session and be written into it. * * This method uses canLogToIM() & canSpawnIMSession(). @@ -284,6 +299,21 @@ public: static bool canSpawnSessionAndLogToIM(const LLNotificationPtr& notification); /** + * Checks if passed notification can create toast. + */ + static bool canSpawnToast(const LLNotificationPtr& notification); + + /** + * Determines whether IM floater is opened. + */ + static bool isIMFloaterOpened(const LLNotificationPtr& notification); + + /** + * Determines whether IM floater is focused. + */ + static bool isIMFloaterFocused(const LLNotificationPtr& notification); + + /** * Writes notification message to IM session. */ static void logToIM(const EInstantMessage& session_type, @@ -297,6 +327,11 @@ public: static void logToIMP2P(const LLNotificationPtr& notification); /** + * Writes notification message to IM p2p session. + */ + static void logToIMP2P(const LLNotificationPtr& notification, bool to_file_only); + + /** * Writes group notice notification message to IM group session. */ static void logGroupNoticeToIMGroup(const LLNotificationPtr& notification); @@ -309,7 +344,7 @@ public: /** * Spawns IM session. */ - static void spawnIMSession(const std::string& name, const LLUUID& from_id); + static LLUUID spawnIMSession(const std::string& name, const LLUUID& from_id); /** * Returns name from the notification's substitution. @@ -319,6 +354,34 @@ public: * @param notification - Notification which substitution's name will be returned. */ static std::string getSubstitutionName(const LLNotificationPtr& notification); + + /** + * Adds notification panel to the IM floater. + */ + static void addNotifPanelToIM(const LLNotificationPtr& notification); + + /** + * Updates messages of IM floater. + */ + static void updateIMFLoaterMesages(const LLUUID& session_id); + + /** + * Updates messages of visible IM floater. + */ + static void updateVisibleIMFLoaterMesages(const LLNotificationPtr& notification); + + /** + * Decrements counter of IM messages. + */ + static void decIMMesageCounter(const LLNotificationPtr& notification); + +private: + + /** + * Find IM floater based on "from_id" + */ + static LLIMFloater* findIMFloater(const LLNotificationPtr& notification); + }; } |