PageRenderTime 364ms CodeModel.GetById 181ms app.highlight 6ms RepoModel.GetById 175ms app.codeStats 0ms

/indra/newview/lluploadfloaterobservers.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 97 lines | 48 code | 24 blank | 25 comment | 0 complexity | 300a6fab28d9a1ea79bed5b201ca9e49 MD5 | raw file
 1/**
 2 * @file lluploadfloaterobservers.h
 3 * @brief LLUploadModelPremissionsResponder declaration
 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_LLUPLOADFLOATEROBSERVERS_H
28#define LL_LLUPLOADFLOATEROBSERVERS_H
29
30#include "llfloater.h"
31#include "llhttpclient.h"
32#include "llhandle.h"
33
34class LLUploadPermissionsObserver
35{
36public:
37
38	LLUploadPermissionsObserver(){mUploadPermObserverHandle.bind(this);}
39	virtual ~LLUploadPermissionsObserver() {}
40
41	virtual void onPermissionsReceived(const LLSD& result) = 0;
42	virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
43
44	LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;}
45
46protected:
47	LLRootHandle<LLUploadPermissionsObserver> mUploadPermObserverHandle;
48};
49
50class LLWholeModelFeeObserver
51{
52public:
53	LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); }
54	virtual ~LLWholeModelFeeObserver() {}
55
56	virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
57	virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
58
59	LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
60
61protected:
62	LLRootHandle<LLWholeModelFeeObserver> mWholeModelFeeObserverHandle;
63};
64
65
66class LLWholeModelUploadObserver
67{
68public:
69	LLWholeModelUploadObserver() { mWholeModelUploadObserverHandle.bind(this); }
70	virtual ~LLWholeModelUploadObserver() {}
71
72	virtual void onModelUploadSuccess() = 0;
73
74	virtual void onModelUploadFailure() = 0;
75
76	LLHandle<LLWholeModelUploadObserver> getWholeModelUploadObserverHandle() const { return mWholeModelUploadObserverHandle; }
77
78protected:
79	LLRootHandle<LLWholeModelUploadObserver> mWholeModelUploadObserverHandle;
80};
81
82
83class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder
84{
85public:
86
87	LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
88
89	void error(U32 status, const std::string& reason);
90
91	void result(const LLSD& content);
92
93private:
94	LLHandle<LLUploadPermissionsObserver> mObserverHandle;
95};
96
97#endif /* LL_LLUPLOADFLOATEROBSERVERS_H */