1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGWIDGET_BROWSER
15#define OSGWIDGET_BROWSER
17#include <osgWidget/PdfReader>
24class OSGWIDGET_EXPORT BrowserManager : public osg::Object
28 static osg::ref_ptr<BrowserManager>& instance();
30 virtual void init(const std::string& application);
32 void setApplication(const std::string& application) { _application = application; }
33 const std::string& getApplication() const { return _application; }
35 virtual BrowserImage* createBrowserImage(const std::string& url, int width, int height);
40 BrowserManager(const BrowserManager& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
41 osg::Object(rhs,copyop) {}
43 virtual ~BrowserManager();
45 META_Object(osgWidget,BrowserManager);
47 std::string _application;
51/** Pure virtual base class that provides the browser interface for integration with 3rd party implementations.
52 * Implementations of BrowserImage are provided via the gecko plugin.*/
53class BrowserImage : public osg::Image
59 virtual void navigateTo(const std::string& url) = 0;
63 virtual ~BrowserImage() {}
68/** Convenience class that provides an interactive quad that can be placed directly into the scene.*/
69class OSGWIDGET_EXPORT Browser : public osg::Geode
75 Browser(const std::string& url, const GeometryHints& hints = GeometryHints());
77 bool assign(BrowserImage* browserImage, const GeometryHints& hints = GeometryHints());
79 bool open(const std::string& url, const GeometryHints& hints = GeometryHints());
81 void navigateTo(const std::string& url);
85 osg::ref_ptr<BrowserImage> _browserImage;