PageRenderTime 27ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llnotificationslistener.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 69 lines | 32 code | 10 blank | 27 comment | 0 complexity | 680255f34f4b894815d75b84181442d5 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llnotificationslistener.h
  3. * @author Brad Kittenbrink
  4. * @date 2009-07-08
  5. * @brief Wrap subset of LLNotifications API in event API for test scripts.
  6. *
  7. * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  8. * Second Life Viewer Source Code
  9. * Copyright (C) 2010, Linden Research, Inc.
  10. *
  11. * This library is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU Lesser General Public
  13. * License as published by the Free Software Foundation;
  14. * version 2.1 of the License only.
  15. *
  16. * This library is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * Lesser General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public
  22. * License along with this library; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. *
  25. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  26. * $/LicenseInfo$
  27. */
  28. #ifndef LL_LLNOTIFICATIONSLISTENER_H
  29. #define LL_LLNOTIFICATIONSLISTENER_H
  30. #include "lleventapi.h"
  31. #include "llnotificationptr.h"
  32. #include <boost/shared_ptr.hpp>
  33. #include <map>
  34. #include <string>
  35. class LLNotifications;
  36. class LLSD;
  37. class LLNotificationsListener : public LLEventAPI
  38. {
  39. public:
  40. LLNotificationsListener(LLNotifications & notifications);
  41. ~LLNotificationsListener();
  42. private:
  43. void requestAdd(LLSD const & event_data) const;
  44. void NotificationResponder(const std::string& replypump,
  45. const LLSD& notification,
  46. const LLSD& response) const;
  47. void listChannels(const LLSD& params) const;
  48. void listChannelNotifications(const LLSD& params) const;
  49. void respond(const LLSD& params) const;
  50. void cancel(const LLSD& params) const;
  51. void ignore(const LLSD& params) const;
  52. void forward(const LLSD& params);
  53. static LLSD asLLSD(LLNotificationPtr);
  54. class Forwarder;
  55. typedef std::map<std::string, boost::shared_ptr<Forwarder> > ForwarderMap;
  56. ForwarderMap mForwarders;
  57. LLNotifications & mNotifications;
  58. };
  59. #endif // LL_LLNOTIFICATIONSLISTENER_H