llfloatermediabrowser.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /**
  2. * @file llfloatermediabrowser.cpp
  3. * @brief Web browser floaters
  4. *
  5. * $LicenseInfo:firstyear=2006&license=viewergpl$
  6. *
  7. * Copyright (c) 2006-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_LLFLOATERHTMLHELP_H
  33. #define LL_LLFLOATERHTMLHELP_H
  34. #include "llfloater.h"
  35. #include "llhtmlhelp.h"
  36. #include "llmediactrl.h"
  37. class LLButton;
  38. class LLComboBox;
  39. class LLParcel;
  40. class LLPluginClassMedia;
  41. class LLTextBox;
  42. class LLViewerHtmlHelp final : public LLHtmlHelp
  43. {
  44. public:
  45. LLViewerHtmlHelp();
  46. ~LLViewerHtmlHelp() override;
  47. void show() override;
  48. void show(std::string start_url) override;
  49. void show(std::string start_url, std::string title);
  50. static bool onClickF1HelpLoadURL(const LLSD& notification,
  51. const LLSD& response);
  52. };
  53. class LLFloaterMediaBrowser final : public LLFloater,
  54. public LLViewerMediaObserver
  55. {
  56. protected:
  57. LOG_CLASS(LLFloaterMediaBrowser);
  58. public:
  59. LLFloaterMediaBrowser(const LLSD& media_url);
  60. ~LLFloaterMediaBrowser() override;
  61. bool postBuild() override;
  62. void onClose(bool app_quitting) override;
  63. void draw() override;
  64. // Inherited from LLViewerMediaObserver
  65. void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent evt) override;
  66. void openMedia(const std::string& media_url, bool trusted = false);
  67. void openMedia(const std::string& media_url, const std::string& target,
  68. bool trusted = false);
  69. void setCurrentURL(const std::string& url);
  70. static LLFloaterMediaBrowser* getInstance(const LLSD& media_url);
  71. static LLFloaterMediaBrowser* showInstance(const LLSD& media_url,
  72. bool trusted = false);
  73. private:
  74. void buildURLHistory();
  75. void geometryChanged(S32 x, S32 y, S32 width, S32 height);
  76. static void onEnterAddress(LLUICtrl* ctrl, void* user_data);
  77. static void onClickRefresh(void* user_data);
  78. static void onClickBack(void* user_data);
  79. static void onClickForward(void* user_data);
  80. static void onClickGo(void* user_data);
  81. static void onClickClose(void* user_data);
  82. static void onClickOpenWebBrowser(void* user_data);
  83. static void onClickAssign(void* user_data);
  84. static void onClickRewind(void* user_data);
  85. static void onClickPlay(void* user_data);
  86. static void onClickStop(void* user_data);
  87. static void onClickSeek(void* user_data);
  88. private:
  89. LLMediaCtrl* mBrowser;
  90. LLParcel* mParcel;
  91. LLButton* mBackButton;
  92. LLButton* mForwardButton;
  93. LLButton* mReloadButton;
  94. LLButton* mRewindButton;
  95. LLButton* mPlayButton;
  96. LLButton* mPauseButton;
  97. LLButton* mStopButton;
  98. LLButton* mSeekButton;
  99. LLButton* mGoButton;
  100. LLButton* mCloseButton;
  101. LLButton* mBrowserButton;
  102. LLButton* mAssignButton;
  103. LLComboBox* mAddressCombo;
  104. LLTextBox* mLoadingText;
  105. std::string mInitalUrl;
  106. std::string mCurrentURL;
  107. typedef std::vector<LLFloaterMediaBrowser*> instances_vec_t;
  108. static instances_vec_t sInstances;
  109. };
  110. extern LLViewerHtmlHelp gViewerHtmlHelp;
  111. #endif // LL_LLFLOATERHTMLHELP_H