OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Browser.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2  *
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.
7  *
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.
12 */
13 
14 #ifndef OSGWIDGET_BROWSER
15 #define OSGWIDGET_BROWSER
16 
17 #include <osgWidget/PdfReader>
18 
19 namespace osgWidget {
20 
21 
22 class BrowserImage;
23 
25 {
26  public:
27 
28  static osg::ref_ptr<BrowserManager>& instance();
29 
30  virtual void init(const std::string& application);
31 
32  void setApplication(const std::string& application) { _application = application; }
33  const std::string& getApplication() const { return _application; }
34 
35  virtual BrowserImage* createBrowserImage(const std::string& url, int width, int height);
36 
37  protected:
38 
41  osg::Object(rhs,copyop) {}
42 
43  virtual ~BrowserManager();
44 
46 
47  std::string _application;
48 };
49 
50 
53 class BrowserImage : public osg::Image
54 {
55  public:
56 
58 
59  virtual void navigateTo(const std::string& url) = 0;
60 
61  protected:
62 
63  virtual ~BrowserImage() {}
64 
65 };
66 
67 
70 {
71  public:
72 
73  Browser() {}
74 
75  Browser(const std::string& url, const GeometryHints& hints = GeometryHints());
76 
77  bool assign(BrowserImage* browserImage, const GeometryHints& hints = GeometryHints());
78 
79  bool open(const std::string& url, const GeometryHints& hints = GeometryHints());
80 
81  void navigateTo(const std::string& url);
82 
83  protected:
84 
86 };
87 
88 }
89 
90 #endif
Definition: Box.h:21
#define OSGWIDGET_EXPORT
Definition: Export.h:42
void OSGDB_EXPORT open(std::fstream &fs, const char *filename, std::ios_base::openmode mode)
const std::string & getApplication() const
Definition: Browser.h:33
virtual void navigateTo(const std::string &url)=0
virtual ~BrowserImage()
Definition: Browser.h:63
#define META_Object(library, name)
Definition: Object.h:42
GLint GLenum GLsizei width
Definition: GLU.h:71
std::string _application
Definition: Browser.h:47
BrowserManager(const BrowserManager &rhs, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition: Browser.h:40
osg::ref_ptr< BrowserImage > _browserImage
Definition: Browser.h:85
GLint GLenum GLsizei GLsizei height
Definition: GLU.h:71
void setApplication(const std::string &application)
Definition: Browser.h:32
Definition: AlphaFunc.h:19