PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLWEBPROFILE_H
  27. #define LL_LLWEBPROFILE_H
  28. #include "llimage.h"
  29. namespace LLWebProfileResponders
  30. {
  31. class ConfigResponder;
  32. class PostImageResponder;
  33. class PostImageRedirectResponder;
  34. };
  35. /**
  36. * @class LLWebProfile
  37. *
  38. * Manages interaction with, a web service allowing the upload of snapshot images
  39. * taken within the viewer.
  40. */
  41. class LLWebProfile
  42. {
  43. LOG_CLASS(LLWebProfile);
  44. public:
  45. typedef boost::function<void(bool ok)> status_callback_t;
  46. static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location);
  47. static void setAuthCookie(const std::string& cookie);
  48. static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; }
  49. private:
  50. friend class LLWebProfileResponders::ConfigResponder;
  51. friend class LLWebProfileResponders::PostImageResponder;
  52. friend class LLWebProfileResponders::PostImageRedirectResponder;
  53. static void post(LLPointer<LLImageFormatted> image, const LLSD& config, const std::string& url);
  54. static void reportImageUploadStatus(bool ok);
  55. static std::string getAuthCookie();
  56. static std::string sAuthCookie;
  57. static status_callback_t mStatusCallback;
  58. };
  59. #endif // LL_LLWEBPROFILE_H