llfloatertos.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. * @file llfloatertos.h
  3. * @brief Terms of Service Agreement dialog
  4. *
  5. * $LicenseInfo:firstyear=2003&license=viewergpl$
  6. *
  7. * Copyright (c) 2003-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLFLOATERTOS_H
  33. #define LL_LLFLOATERTOS_H
  34. #include "llmodaldialog.h"
  35. #include "llstring.h"
  36. #include "llmediactrl.h"
  37. class LLButton;
  38. class LLCheckBoxCtrl;
  39. class LLMediaCtrl;
  40. class LLTextEditor;
  41. class LLFloaterTOS final : public LLModalDialog, public LLViewerMediaObserver
  42. {
  43. protected:
  44. LOG_CLASS(LLFloaterTOS);
  45. public:
  46. ~LLFloaterTOS() override;
  47. bool postBuild() override;
  48. void draw() override;
  49. // Types of dialog.
  50. enum ETOSType
  51. {
  52. TOS_TOS = 0,
  53. TOS_CRITICAL_MESSAGE = 1,
  54. TOS_FIRST_TPV_USE = 2
  55. };
  56. static LLFloaterTOS* show(ETOSType type,
  57. const std::string& message = LLStringUtil::null,
  58. bool start_modal = true);
  59. void setSiteIsAlive(bool alive);
  60. // Inherited from LLViewerMediaObserver
  61. void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent evt) override;
  62. private:
  63. static void updateAgree(LLUICtrl*, void* userdata);
  64. static void onContinue(void* userdata);
  65. static void onCancel(void* userdata);
  66. // Asset_id is overwritten with LLUUID::null when agree is clicked.
  67. LLFloaterTOS(ETOSType type, const std::string& message);
  68. static void testSiteIsAliveCoro(LLHandle<LLFloater> handle,
  69. const std::string& url);
  70. private:
  71. LLButton* mContinueButton;
  72. LLCheckBoxCtrl* mAgreeCheck;
  73. LLMediaCtrl* mWebBrowser;
  74. ETOSType mType;
  75. std::string mMessage;
  76. bool mLoadingScreenLoaded;
  77. bool mSiteAlive;
  78. bool mRealNavigateBegun;
  79. static LLFloaterTOS* sInstance;
  80. };
  81. #endif // LL_LLFLOATERTOS_H