PageRenderTime 50ms CodeModel.GetById 39ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloaterwebcontent.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 113 lines | 68 code | 19 blank | 26 comment | 0 complexity | 7c31c2f4d2dff3669b6822a53c714252 MD5 | raw file
  1/**
  2 * @file llfloaterwebcontent.h
  3 * @brief floater for displaying web content - e.g. profiles and search (eventually)
  4 *
  5 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, 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_LLFLOATERWEBCONTENT_H
 28#define LL_LLFLOATERWEBCONTENT_H
 29
 30#include "llfloater.h"
 31#include "llmediactrl.h"
 32#include "llsdparam.h"
 33
 34class LLMediaCtrl;
 35class LLComboBox;
 36class LLTextBox;
 37class LLProgressBar;
 38class LLIconCtrl;
 39
 40class LLFloaterWebContent :
 41	public LLFloater,
 42	public LLViewerMediaObserver,
 43	public LLInstanceTracker<LLFloaterWebContent, std::string>
 44{
 45public:
 46	typedef LLInstanceTracker<LLFloaterWebContent, std::string> instance_tracker_t;
 47    LOG_CLASS(LLFloaterWebContent);
 48
 49	struct _Params : public LLInitParam::Block<_Params>
 50	{
 51		Optional<std::string>	url,
 52								target,
 53								window_class,
 54								id;
 55		Optional<bool>			show_chrome,
 56								allow_address_entry,
 57								trusted_content,
 58								show_page_title;
 59		Optional<LLRect>		preferred_media_size;
 60
 61		_Params();
 62	};
 63
 64	typedef LLSDParamAdapter<_Params> Params;
 65
 66	LLFloaterWebContent(const Params& params);
 67
 68	void initializeURLHistory();
 69
 70	static LLFloater* create(Params);
 71
 72	static void closeRequest(const std::string &uuid);
 73	static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height);
 74	void geometryChanged(S32 x, S32 y, S32 width, S32 height);
 75
 76	/* virtual */ BOOL postBuild();
 77	/* virtual */ void onOpen(const LLSD& key);
 78	/* virtual */ bool matchesKey(const LLSD& key);
 79	/* virtual */ void onClose(bool app_quitting);
 80	/* virtual */ void draw();
 81
 82protected:
 83	// inherited from LLViewerMediaObserver
 84	/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
 85
 86	void onClickBack();
 87	void onClickForward();
 88	void onClickReload();
 89	void onClickStop();
 90	void onEnterAddress();
 91	void onPopExternal();
 92
 93	static void preCreate(Params& p);
 94	void open_media(const Params& );
 95	void set_current_url(const std::string& url);
 96
 97	LLMediaCtrl*	mWebBrowser;
 98	LLComboBox*		mAddressCombo;
 99	LLIconCtrl*		mSecureLockIcon;
100	LLTextBox*		mStatusBarText;
101	LLProgressBar*	mStatusBarProgress;
102
103	LLView*			mBtnBack;
104	LLView*			mBtnForward;
105	LLView*			mBtnReload;
106	LLView*			mBtnStop;
107
108	std::string		mCurrentURL;
109	std::string		mUUID;
110	bool			mShowPageTitle;
111};
112
113#endif  // LL_LLFLOATERWEBCONTENT_H