PageRenderTime 1078ms CodeModel.GetById 28ms RepoModel.GetById 8ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLUPLOADFLOATEROBSERVERS_H
  27. #define LL_LLUPLOADFLOATEROBSERVERS_H
  28. #include "llfloater.h"
  29. #include "llhttpclient.h"
  30. #include "llhandle.h"
  31. class LLUploadPermissionsObserver
  32. {
  33. public:
  34. LLUploadPermissionsObserver(){mUploadPermObserverHandle.bind(this);}
  35. virtual ~LLUploadPermissionsObserver() {}
  36. virtual void onPermissionsReceived(const LLSD& result) = 0;
  37. virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
  38. LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;}
  39. protected:
  40. LLRootHandle<LLUploadPermissionsObserver> mUploadPermObserverHandle;
  41. };
  42. class LLWholeModelFeeObserver
  43. {
  44. public:
  45. LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); }
  46. virtual ~LLWholeModelFeeObserver() {}
  47. virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
  48. virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
  49. LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
  50. protected:
  51. LLRootHandle<LLWholeModelFeeObserver> mWholeModelFeeObserverHandle;
  52. };
  53. class LLWholeModelUploadObserver
  54. {
  55. public:
  56. LLWholeModelUploadObserver() { mWholeModelUploadObserverHandle.bind(this); }
  57. virtual ~LLWholeModelUploadObserver() {}
  58. virtual void onModelUploadSuccess() = 0;
  59. virtual void onModelUploadFailure() = 0;
  60. LLHandle<LLWholeModelUploadObserver> getWholeModelUploadObserverHandle() const { return mWholeModelUploadObserverHandle; }
  61. protected:
  62. LLRootHandle<LLWholeModelUploadObserver> mWholeModelUploadObserverHandle;
  63. };
  64. class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder
  65. {
  66. public:
  67. LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
  68. void error(U32 status, const std::string& reason);
  69. void result(const LLSD& content);
  70. private:
  71. LLHandle<LLUploadPermissionsObserver> mObserverHandle;
  72. };
  73. #endif /* LL_LLUPLOADFLOATEROBSERVERS_H */