PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms 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
 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
29#ifndef LL_LLNOTIFICATIONSLISTENER_H
30#define LL_LLNOTIFICATIONSLISTENER_H
31
32#include "lleventapi.h"
33#include "llnotificationptr.h"
34#include <boost/shared_ptr.hpp>
35#include <map>
36#include <string>
37
38class LLNotifications;
39class LLSD;
40
41class LLNotificationsListener : public LLEventAPI
42{
43public:
44    LLNotificationsListener(LLNotifications & notifications);
45    ~LLNotificationsListener();
46
47private:
48    void requestAdd(LLSD const & event_data) const;
49
50	void NotificationResponder(const std::string& replypump, 
51							   const LLSD& notification, 
52							   const LLSD& response) const;
53
54    void listChannels(const LLSD& params) const;
55    void listChannelNotifications(const LLSD& params) const;
56    void respond(const LLSD& params) const;
57    void cancel(const LLSD& params) const;
58    void ignore(const LLSD& params) const;
59    void forward(const LLSD& params);
60
61    static LLSD asLLSD(LLNotificationPtr);
62
63    class Forwarder;
64    typedef std::map<std::string, boost::shared_ptr<Forwarder> > ForwarderMap;
65    ForwarderMap mForwarders;
66	LLNotifications & mNotifications;
67};
68
69#endif // LL_LLNOTIFICATIONSLISTENER_H