PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/llappviewerlistener.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 53 lines | 17 code | 7 blank | 29 comment | 0 complexity | 1a9a124178e5d41099c84a446fe531fd MD5 | raw file
 1/**
 2 * @file   llappviewerlistener.h
 3 * @author Nat Goodspeed
 4 * @date   2009-06-18
 5 * @brief  Wrap subset of LLAppViewer API in event API
 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#if ! defined(LL_LLAPPVIEWERLISTENER_H)
30#define LL_LLAPPVIEWERLISTENER_H
31
32#include "lleventapi.h"
33#include <boost/function.hpp>
34
35class LLAppViewer;
36class LLSD;
37
38/// Listen on an LLEventPump with specified name for LLAppViewer request events.
39class LLAppViewerListener: public LLEventAPI
40{
41public:
42    typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter;
43    /// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()).
44    LLAppViewerListener(const LLAppViewerGetter& getter);
45
46private:
47    void requestQuit(const LLSD& event);
48    void forceQuit(const LLSD& event);
49
50    LLAppViewerGetter mAppViewerGetter;
51};
52
53#endif /* ! defined(LL_LLAPPVIEWERLISTENER_H) */