summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerlistener.h
blob: 73227cb95a771e2a74092f3cf74197ae230a2c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
 * @file   llappviewerlistener.h
 * @author Nat Goodspeed
 * @date   2009-06-18
 * @brief  Wrap subset of LLAppViewer API in event API
 * 
 * $LicenseInfo:firstyear=2009&license=viewergpl$
 * Copyright (c) 2009, Linden Research, Inc.
 * $/LicenseInfo$
 */

#if ! defined(LL_LLAPPVIEWERLISTENER_H)
#define LL_LLAPPVIEWERLISTENER_H

#include "lleventdispatcher.h"
#include <boost/function.hpp>

class LLAppViewer;
class LLSD;

/// Listen on an LLEventPump with specified name for LLAppViewer request events.
class LLAppViewerListener: public LLDispatchListener
{
public:
    typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter;
    /// Specify the pump name on which to listen, and bind the LLAppViewer
    /// instance to use (e.g. LLAppViewer::instance()).
    LLAppViewerListener(const std::string& pumpname, const LLAppViewerGetter& getter);

private:
    void requestQuit(const LLSD& event);
    void forceQuit(const LLSD& event);

    LLAppViewerGetter mAppViewerGetter;
};

#endif /* ! defined(LL_LLAPPVIEWERLISTENER_H) */