/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. #ifndef LL_LLNOTIFICATIONMANAGER_H
  28. #define LL_LLNOTIFICATIONMANAGER_H
  29. #include "lluictrl.h"
  30. #include "llnotificationhandler.h"
  31. #include <map>
  32. #include <string>
  33. #include <boost/shared_ptr.hpp>
  34. namespace LLNotificationsUI {
  35. class LLToast;
  36. /**
  37. * Responsible for registering notification handlers.
  38. */
  39. class LLNotificationManager : public LLSingleton<LLNotificationManager>
  40. {
  41. typedef std::pair<std::string, LLEventHandler*> eventhandlers;
  42. public:
  43. LLNotificationManager();
  44. virtual ~LLNotificationManager();
  45. //TODO: make private
  46. // this method initialize handlers' map for different types of notifications
  47. void init(void);
  48. //TODO: combine processing and storage (*)
  49. // this method reacts on system notifications and calls an appropriate handler
  50. bool onNotification(const LLSD& notification);
  51. // this method reacts on chat notifications and calls an appropriate handler
  52. void onChat(const LLChat& msg, const LLSD &args);
  53. // get a handler for a certain type of notification
  54. LLEventHandler* getHandlerForNotification(std::string notification_type);
  55. private:
  56. //TODO (*)
  57. std::map<std::string, boost::shared_ptr<LLEventHandler> > mNotifyHandlers;
  58. // cruft std::map<std::string, LLChatHandler*> mChatHandlers;
  59. };
  60. }
  61. #endif