BrowserView.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2009 Jürgen Riegel <juergen.riegel@web.de>              *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_BROWSERVIEW_H
00025 #define GUI_BROWSERVIEW_H
00026 
00027 
00028 #include <Gui/MDIView.h>
00029 #include <Gui/Window.h>
00030 
00031 class QWebView;
00032 class QUrl;
00033 
00034 namespace WebGui {
00035 
00036 
00037 
00042 class WebGuiExport BrowserView : public Gui::MDIView, public Gui::WindowParameter
00043 {
00044     Q_OBJECT
00045 
00046 public:
00047     BrowserView(QWidget* parent);
00048     ~BrowserView();
00049 
00050     void load(const char* URL);
00051     void load(const QUrl & url);
00052     void setHtml(const QString& HtmlCode,const QUrl & BaseUrl,const QString& TabName=QString::fromAscii("Browser"));
00053     void stop(void);
00054 
00055     void OnChange(Base::Subject<const char*> &rCaller,const char* rcReason);
00056 
00057     const char *getName(void) const {return "BrowserView";}
00058     void onUpdate(void){};
00059 
00060     bool onMsg(const char* pMsg,const char** ppReturn);
00061     bool onHasMsg(const char* pMsg) const;
00062 
00063     bool canClose(void);
00064 
00067     //bool open   (const QString &f);
00068     //bool saveAs ();
00069     //void cut    ();
00070     //void copy   ();
00071     //void paste  ();
00072     //void undo   ();
00073     //void redo   ();
00074     //void run    ();
00075     //void print  ();
00076     //void printPdf();
00078 
00079 
00080 protected Q_SLOTS:
00081     void onLoadStarted();
00082     void onLoadProgress(int);
00083     void onLoadFinished();
00084     void onLinkClicked ( const QUrl & url ) ;
00085     bool chckHostAllowed(const QString& host);
00086 
00087 private:
00088     QWebView* WebView;
00089     bool isLoading;
00090     float textSizeMultiplier;
00091 };
00092 
00093 } // namespace WebGui
00094 
00095 #endif // GUI_EDITORVIEW_H

Generated on Wed Nov 23 18:59:59 2011 for FreeCAD by  doxygen 1.6.1