from PyQt4 import QtCore, QtWebKit, QtGui
from GUI.main import BrowserGUI, BrowserTabGUI

actions = {"Alt+Left" : QtWebKit.QWebPage.Back, "Alt+Right" : QtWebKit.QWebPage.Forward, "F5" : QtWebKit.QWebPage.Reload }

class BaseBrowser(BrowserGUI):
    """
        This class is the base for a simple web browser

        Inherit from this class and override all the virtual methods
        to make a full functional browser
    """

    def __init__(self):

        BrowserGUI.__init__(self)

        self.connect(self.ui.tb_url, QtCore.SIGNAL("returnPressed()"), self.browse)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL("tabCloseRequested(int)"), self.tab_closed)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL("currentChanged(int)"), self.tab_changed)

    # overridable methods section

    def browse():
        pass

    def tab_closed(index):
        pass

    def tab_changed(index):
        pass

    def add_tab():
        pass


class BaseBrowserTab(BrowserTabGUI):
    """
        This class is the base for a browser tab

        Inherit from this class and override all the virtual methods
        to make a browser tab
    """

    def __init__(self, parent):

        BrowserTabGUI.__init__(self, parent)

        self.connect(self.parent.bt_back, QtCore.SIGNAL("clicked()"), self.back)
        self.connect(self.parent.bt_ahead, QtCore.SIGNAL("clicked()"), self.ahead)
        self.connect(self.parent.bt_reload, QtCore.SIGNAL("clicked()"), self.reload)
        self.connect(self.html, QtCore.SIGNAL("loadStarted()"), self.load_start)
        self.connect(self.html, QtCore.SIGNAL("loadFinished(bool)"), self.loaded_bar)
        self.connect(self.html, QtCore.SIGNAL("loadProgress(int)"), self.load_bar)
        self.connect(self.html, QtCore.SIGNAL("urlChanged(const QUrl)"), self.url_changed)


    # overridable methods section

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass

    def back(self):
        pass

    def ahead(self):
        pass

    def reload():
        pass

3f02f6789aaf4ebc9c537dc7e5f037c05e9abdf9
<mask token>


class BaseBrowserTab(BrowserTabGUI):
    <mask token>
    <mask token>

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass
    <mask token>

    def ahead(self):
        pass

    def reload():
        pass

<mask token>


class BaseBrowserTab(BrowserTabGUI):
    <mask token>
    <mask token>

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass

    def back(self):
        pass

    def ahead(self):
        pass

    def reload():
        pass

<mask token>


class BaseBrowser(BrowserGUI):
    <mask token>

    def __init__(self):
        BrowserGUI.__init__(self)
        self.connect(self.ui.tb_url, QtCore.SIGNAL('returnPressed()'), self
            .browse)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL(
            'tabCloseRequested(int)'), self.tab_closed)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL('currentChanged(int)'
            ), self.tab_changed)

    def browse():
        pass

    def tab_closed(index):
        pass

    def tab_changed(index):
        pass

    def add_tab():
        pass


class BaseBrowserTab(BrowserTabGUI):
    """
        This class is the base for a browser tab

        Inherit from this class and override all the virtual methods
        to make a browser tab
    """

    def __init__(self, parent):
        BrowserTabGUI.__init__(self, parent)
        self.connect(self.parent.bt_back, QtCore.SIGNAL('clicked()'), self.back
            )
        self.connect(self.parent.bt_ahead, QtCore.SIGNAL('clicked()'), self
            .ahead)
        self.connect(self.parent.bt_reload, QtCore.SIGNAL('clicked()'),
            self.reload)
        self.connect(self.html, QtCore.SIGNAL('loadStarted()'), self.load_start
            )
        self.connect(self.html, QtCore.SIGNAL('loadFinished(bool)'), self.
            loaded_bar)
        self.connect(self.html, QtCore.SIGNAL('loadProgress(int)'), self.
            load_bar)
        self.connect(self.html, QtCore.SIGNAL('urlChanged(const QUrl)'),
            self.url_changed)

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass

    def back(self):
        pass

    def ahead(self):
        pass

    def reload():
        pass

<mask token>
actions = {'Alt+Left': QtWebKit.QWebPage.Back, 'Alt+Right': QtWebKit.
    QWebPage.Forward, 'F5': QtWebKit.QWebPage.Reload}


class BaseBrowser(BrowserGUI):
    """
        This class is the base for a simple web browser

        Inherit from this class and override all the virtual methods
        to make a full functional browser
    """

    def __init__(self):
        BrowserGUI.__init__(self)
        self.connect(self.ui.tb_url, QtCore.SIGNAL('returnPressed()'), self
            .browse)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL(
            'tabCloseRequested(int)'), self.tab_closed)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL('currentChanged(int)'
            ), self.tab_changed)

    def browse():
        pass

    def tab_closed(index):
        pass

    def tab_changed(index):
        pass

    def add_tab():
        pass


class BaseBrowserTab(BrowserTabGUI):
    """
        This class is the base for a browser tab

        Inherit from this class and override all the virtual methods
        to make a browser tab
    """

    def __init__(self, parent):
        BrowserTabGUI.__init__(self, parent)
        self.connect(self.parent.bt_back, QtCore.SIGNAL('clicked()'), self.back
            )
        self.connect(self.parent.bt_ahead, QtCore.SIGNAL('clicked()'), self
            .ahead)
        self.connect(self.parent.bt_reload, QtCore.SIGNAL('clicked()'),
            self.reload)
        self.connect(self.html, QtCore.SIGNAL('loadStarted()'), self.load_start
            )
        self.connect(self.html, QtCore.SIGNAL('loadFinished(bool)'), self.
            loaded_bar)
        self.connect(self.html, QtCore.SIGNAL('loadProgress(int)'), self.
            load_bar)
        self.connect(self.html, QtCore.SIGNAL('urlChanged(const QUrl)'),
            self.url_changed)

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass

    def back(self):
        pass

    def ahead(self):
        pass

    def reload():
        pass

from PyQt4 import QtCore, QtWebKit, QtGui
from GUI.main import BrowserGUI, BrowserTabGUI

actions = {"Alt+Left" : QtWebKit.QWebPage.Back, "Alt+Right" : QtWebKit.QWebPage.Forward, "F5" : QtWebKit.QWebPage.Reload }

class BaseBrowser(BrowserGUI):
    """
        This class is the base for a simple web browser

        Inherit from this class and override all the virtual methods
        to make a full functional browser
    """

    def __init__(self):

        BrowserGUI.__init__(self)

        self.connect(self.ui.tb_url, QtCore.SIGNAL("returnPressed()"), self.browse)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL("tabCloseRequested(int)"), self.tab_closed)
        self.connect(self.ui.tab_pages, QtCore.SIGNAL("currentChanged(int)"), self.tab_changed)

    # overridable methods section

    def browse():
        pass

    def tab_closed(index):
        pass

    def tab_changed(index):
        pass

    def add_tab():
        pass


class BaseBrowserTab(BrowserTabGUI):
    """
        This class is the base for a browser tab

        Inherit from this class and override all the virtual methods
        to make a browser tab
    """

    def __init__(self, parent):

        BrowserTabGUI.__init__(self, parent)

        self.connect(self.parent.bt_back, QtCore.SIGNAL("clicked()"), self.back)
        self.connect(self.parent.bt_ahead, QtCore.SIGNAL("clicked()"), self.ahead)
        self.connect(self.parent.bt_reload, QtCore.SIGNAL("clicked()"), self.reload)
        self.connect(self.html, QtCore.SIGNAL("loadStarted()"), self.load_start)
        self.connect(self.html, QtCore.SIGNAL("loadFinished(bool)"), self.loaded_bar)
        self.connect(self.html, QtCore.SIGNAL("loadProgress(int)"), self.load_bar)
        self.connect(self.html, QtCore.SIGNAL("urlChanged(const QUrl)"), self.url_changed)


    # overridable methods section

    def load_start(self):
        pass

    def load_bar(self):
        pass

    def loaded_bar(self):
        pass

    def url_changed(self):
        pass

    def back(self):
        pass

    def ahead(self):
        pass

    def reload():
        pass
