PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llwebprofile.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 69 lines | 28 code | 10 blank | 31 comment | 0 complexity | 5ec1636026ae9e0f88cf52ae008eb2c0 MD5 | raw file
 1/** 
 2 * @file llwebprofile.h
 3 * @brief Web profile access.
 4 *
 5 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2011, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLWEBPROFILE_H
28#define LL_LLWEBPROFILE_H
29
30#include "llimage.h"
31
32namespace LLWebProfileResponders
33{
34    class ConfigResponder;
35    class PostImageResponder;
36    class PostImageRedirectResponder;
37};
38
39/**
40 * @class LLWebProfile
41 *
42 * Manages interaction with, a web service allowing the upload of snapshot images
43 * taken within the viewer.
44 */
45class LLWebProfile
46{
47	LOG_CLASS(LLWebProfile);
48
49public:
50	typedef boost::function<void(bool ok)> status_callback_t;
51
52	static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location);
53	static void setAuthCookie(const std::string& cookie);
54	static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; }
55
56private:
57	friend class LLWebProfileResponders::ConfigResponder;
58	friend class LLWebProfileResponders::PostImageResponder;
59	friend class LLWebProfileResponders::PostImageRedirectResponder;
60
61	static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url);
62	static void reportImageUploadStatus(bool ok);
63	static std::string getAuthCookie();
64
65	static std::string sAuthCookie;
66	static status_callback_t mStatusCallback;
67};
68
69#endif // LL_LLWEBPROFILE_H