PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llnotificationmanager.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 77 lines | 24 code | 16 blank | 37 comment | 0 complexity | c3b43ae8a3016838b103ccd9912e7f75 MD5 | raw file
 1// Notification Manager Class
 2/** 
 3 * @file llnotificationmanager.h
 4 * @brief Class implements a brige between the old and a new notification sistems
 5 *
 6 * $LicenseInfo:firstyear=2003&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_LLNOTIFICATIONMANAGER_H
29#define LL_LLNOTIFICATIONMANAGER_H
30
31#include "lluictrl.h"
32#include "llnotificationhandler.h"
33
34
35#include <map>
36#include <string>
37
38#include <boost/shared_ptr.hpp>
39
40namespace LLNotificationsUI {
41
42class LLToast;
43
44/**
45 * Responsible for registering notification handlers.
46 */
47class LLNotificationManager : public LLSingleton<LLNotificationManager>
48{
49	typedef std::pair<std::string, LLEventHandler*> eventhandlers;
50public:	
51	LLNotificationManager();	
52	virtual ~LLNotificationManager();
53
54	//TODO: make private
55	// this method initialize handlers' map for different types of notifications
56	void init(void);
57	//TODO: combine processing and storage (*)
58	
59	// this method reacts on system notifications and calls an appropriate handler
60	bool onNotification(const LLSD& notification);
61
62	// this method reacts on chat notifications and calls an appropriate handler
63	void onChat(const LLChat& msg, const LLSD &args);
64
65	// get a handler for a certain type of notification
66	LLEventHandler* getHandlerForNotification(std::string notification_type);
67
68
69private:
70	//TODO (*)
71	std::map<std::string, boost::shared_ptr<LLEventHandler> > mNotifyHandlers;
72	// cruft std::map<std::string, LLChatHandler*> mChatHandlers;
73};
74
75}
76#endif
77