PageRenderTime 342ms CodeModel.GetById 219ms app.highlight 4ms RepoModel.GetById 117ms app.codeStats 0ms

/indra/llplugin/llpluginclassmediaowner.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 90 lines | 49 code | 14 blank | 27 comment | 0 complexity | b5bc1589efdd6f395b1d520857b0726c MD5 | raw file
 1/** 
 2 * @file llpluginclassmediaowner.h
 3 * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class.
 4 *
 5 * @cond
 6 * $LicenseInfo:firstyear=2008&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 * @endcond
27 */
28
29#ifndef LL_LLPLUGINCLASSMEDIAOWNER_H
30#define LL_LLPLUGINCLASSMEDIAOWNER_H
31
32#include "llpluginprocessparent.h"
33#include "llrect.h"
34#include <queue>
35
36class LLPluginClassMedia;
37class LLPluginCookieStore;
38
39class LLPluginClassMediaOwner
40{
41public:
42	typedef enum
43	{
44		MEDIA_EVENT_CONTENT_UPDATED,		// contents/dirty rect have updated 
45		MEDIA_EVENT_TIME_DURATION_UPDATED,	// current time and/or duration have updated
46		MEDIA_EVENT_SIZE_CHANGED,			// media size has changed
47		MEDIA_EVENT_CURSOR_CHANGED,			// plugin has requested a cursor change
48		
49		MEDIA_EVENT_NAVIGATE_BEGIN,			// browser has begun navigation
50		MEDIA_EVENT_NAVIGATE_COMPLETE,		// browser has finished navigation
51		MEDIA_EVENT_PROGRESS_UPDATED,		// browser has updated loading progress
52		MEDIA_EVENT_STATUS_TEXT_CHANGED,	// browser has updated the status text
53		MEDIA_EVENT_NAME_CHANGED,			// browser has updated the name of the media (typically <title> tag)
54		MEDIA_EVENT_LOCATION_CHANGED,		// browser location (URL) has changed (maybe due to internal navagation/frames/etc)
55		MEDIA_EVENT_NAVIGATE_ERROR_PAGE,	// browser navigated to a page that resulted in an HTTP error
56		MEDIA_EVENT_CLICK_LINK_HREF,		// I'm not entirely sure what the semantics of these two are
57		MEDIA_EVENT_CLICK_LINK_NOFOLLOW,
58		MEDIA_EVENT_CLOSE_REQUEST,			// The plugin requested its window be closed (currently hooked up to javascript window.close in webkit)
59		MEDIA_EVENT_PICK_FILE_REQUEST,		// The plugin wants the user to pick a file
60		MEDIA_EVENT_GEOMETRY_CHANGE,		// The plugin requested its window geometry be changed (per the javascript window interface)
61	
62		MEDIA_EVENT_PLUGIN_FAILED_LAUNCH,	// The plugin failed to launch 
63		MEDIA_EVENT_PLUGIN_FAILED,			// The plugin died unexpectedly
64
65		MEDIA_EVENT_AUTH_REQUEST,			// The plugin wants to display an auth dialog
66
67		MEDIA_EVENT_DEBUG_MESSAGE,			// plugin sending back debug information for host to process
68
69		MEDIA_EVENT_LINK_HOVERED			// Got a "link hovered" event from the plugin
70		
71	} EMediaEvent;
72	
73	typedef enum
74	{
75		MEDIA_NONE,			// Uninitialized -- no useful state
76		MEDIA_LOADING,		// loading or navigating
77		MEDIA_LOADED,		// navigation/preroll complete
78		MEDIA_ERROR,		// navigation/preroll failed
79		MEDIA_PLAYING,		// playing (only for time-based media)
80		MEDIA_PAUSED,		// paused (only for time-based media)
81		MEDIA_DONE			// finished playing (only for time-based media)
82	
83	} EMediaStatus;
84	
85	virtual ~LLPluginClassMediaOwner() {};
86	virtual void handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent /*event*/) {};
87	virtual void handleCookieSet(LLPluginClassMedia* /*self*/, const std::string &/*cookie*/) {};
88};
89
90#endif // LL_LLPLUGINCLASSMEDIAOWNER_H