00001 #ifndef TABVIEW_H
00002 #define TABVIEW_H
00003
00004 #include "webpage.h"
00005
00006 #include <kapplication.h>
00007 #include <kmainwindow.h>
00008 #include <qtabwidget.h>
00009 #include <qptrstack.h>
00010 #include <qptrlist.h>
00011 #include <qvaluestack.h>
00012 #include <qdatetime.h>
00013
00014 #include "mythtv/mythdialogs.h"
00015
00016 using namespace std;
00017
00018 typedef QPtrStack<QWidget> WIDGET_HISTORY;
00019 typedef QValueStack<QString> URL_HISTORY;
00020
00021 class TabView : public MythDialog
00022 {
00023 Q_OBJECT
00024
00025 protected:
00026 virtual bool eventFilter(QObject* object, QEvent* event);
00027
00028 public:
00029 TabView(MythMainWindow *parent, const char *name, QStringList urls,
00030 int zoom, int width, int height, WFlags flags);
00031 ~TabView();
00032
00033 signals:
00034 void menuPressed();
00035 void closeMenu();
00036
00037 public slots:
00038 void newUrlRequested(const KURL &url, const KParts::URLArgs &args);
00039 void newPage(QString URL);
00040 void newWindowRequested(const KURL &url, const KParts::URLArgs &args,
00041 const KParts::WindowArgs &windowArgs,
00042 KParts::ReadOnlyPart *&part);
00043 private slots:
00044 void openMenu();
00045 void actionBack();
00046 void actionNextTab();
00047 void actionPrevTab();
00048 void actionRemoveTab();
00049 void actionZoomOut();
00050 void actionZoomIn();
00051 void cancelMenu();
00052 void actionAddBookmark();
00053 void finishAddBookmark(const char* group, const char* desc, const char* url);
00054 void handleMouseAction(QString action);
00055
00056
00057 void showEnterURLDialog();
00058
00059
00060 void pageCompleted(WebPage *page);
00061
00062 private:
00063 int z,w,h;
00064 WFlags f;
00065
00066 int mouseEmulation, saveMouseEmulation;
00067
00068 QStringList urls;
00069 QTabWidget *mytab;
00070
00071 QCursor *mouse;
00072
00073 bool menuIsOpen;
00074 MythPopupBox *menu;
00075
00076 QWidget *hadFocus;
00077
00078 QPtrList<URL_HISTORY> urlHistory;
00079
00080 ButtonState lastButtonState;
00081 int lastPosX;
00082 int lastPosY;
00083 int scrollSpeed;
00084 int scrollPage;
00085 int hideScrollbars;
00086 bool inputToggled;
00087
00088 QString lastMouseAction;
00089 int mouseKeyCount;
00090 QTime lastMouseActionTime;
00091 };
00092
00093 #endif // TABVIEW_H