21 |
--------------------------------------------------------------------------------
/src/locationbar/privacyindicator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2010 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef PRIVACYINDICATOR_H
21 | #define PRIVACYINDICATOR_H
22 |
23 | #include
24 |
25 | class PrivacyIndicator : public QLabel
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | PrivacyIndicator(QWidget *parent = 0);
31 |
32 | protected:
33 | void mousePressEvent(QMouseEvent *event);
34 |
35 | };
36 |
37 | #endif // PRIVACYINDICATOR_H
38 |
39 |
--------------------------------------------------------------------------------
/manualtests/downloadmanager/main_downloadmanager.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "downloadmanager.h"
21 |
22 | int main(int argc, char **argv)
23 | {
24 | QApplication application(argc, argv);
25 |
26 | DownloadManager manager;
27 | QUrl url("http://10.0.0.3/~ben/distccKNOPPIX-1.3-2004-08-20-gcc-3.3.iso");
28 | manager.download(url);
29 | manager.show();
30 |
31 | return application.exec();
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchreader.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jakub Wieczorek
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef OPENSEARCHREADER_H
21 | #define OPENSEARCHREADER_H
22 |
23 | #include
24 |
25 | class OpenSearchEngine;
26 |
27 | class OpenSearchReader : public QXmlStreamReader
28 | {
29 | public:
30 | OpenSearchReader();
31 |
32 | OpenSearchEngine *read(QIODevice *device);
33 |
34 | private:
35 | OpenSearchEngine *read();
36 |
37 | };
38 |
39 | #endif // OPENSEARCHREADER_H
40 |
41 |
--------------------------------------------------------------------------------
/tools/htmlToXBel/data/htmlToXBel.1:
--------------------------------------------------------------------------------
1 | .TH HTMLTOXBEL "1" "July 2009"
2 |
3 | .SH NAME
4 | htmlToXBel - a tool to convert bookmarks stored in the html format into the xbel format.
5 |
6 | .SH SYNOPSIS
7 | .B htmlToXBel [stdin|htmlfile] [stdout|-o outFile]
8 |
9 | .SH DESCRIPTION
10 | .B htmlToXBel
11 | is a tool to convert bookmarks stored in the html format into the xbel format. Many browser have the ability to export their bookmarks as a html file. htmlToXBel takes that file as an input and will output those bookmarks in the XML Bookmark Exchange Language (XBEL) format.
12 |
13 | .SH OPTIONS
14 | .TP
15 | .B -o outFile
16 | Write the resulting XBEL to the file \fBoutFile\fR
17 | .TP
18 |
19 | .SH BUGS
20 | Please report bugs to \fIhttps://github.com/AaronDewes/endorphin-browser/issues\fR.
21 |
22 | .SH AUTHOR
23 | The author of htmlToXBel is Aaron Dewes .
24 | .PP
25 | This manual page was written by Aaron Dewes
26 | .PP
27 | Permission is granted to copy, distribute and/or modify this document under the
28 | terms of the
29 | GNU General Public License, Version 2 or any later version published by the Free
30 | Software Foundation.
31 | .PP
32 | On Debian systems, the complete text of the GNU General Public License can be
33 | found in /usr/share/common-licenses/GPL.
34 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchwriter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jakub Wieczorek
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef OPENSEARCHWRITER_H
21 | #define OPENSEARCHWRITER_H
22 |
23 | #include
24 |
25 | class OpenSearchEngine;
26 |
27 | class OpenSearchWriter : public QXmlStreamWriter
28 | {
29 | public:
30 | OpenSearchWriter();
31 |
32 | bool write(QIODevice *device, OpenSearchEngine *engine);
33 |
34 | private:
35 | void write(OpenSearchEngine *engine);
36 |
37 | };
38 |
39 | #endif // OPENSEARCHWRITER_H
40 |
41 |
--------------------------------------------------------------------------------
/src/endorphin.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Endorphin
3 | Name[en_US]=Endorphin
4 | Name[es]=Endorphin
5 | Name[gl]=Endorphin
6 | Name[sr]=Endorphin
7 | Name[sr@latin]=Endorphin
8 | Comment=Browse the World Wide Web
9 | Comment[ast]=Restola pola World Wide Web
10 | Comment[es]=Navegar por internet
11 | Comment[fr_FR]=Surfer sur le web
12 | Comment[gl]=Navegar pola internet
13 | Comment[nl]=Surfen op het wereldwijde web
14 | Comment[nl_NL]=Surfen op het wereldwijde web
15 | Comment[sr]=Крстарите интернетом
16 | Comment[sr@latin]=Krstarite Internetom
17 | Comment[ja_JP]=Webを閲覧します
18 | GenericName=Web Browser
19 | GenericName[ast]=Restolador web
20 | GenericName[cs_CZ]=Webový prohlížeč
21 | GenericName[en_US]=Web Browser
22 | GenericName[es]=Navegador web
23 | GenericName[fr_FR]=Navigateur web
24 | GenericName[gl]=Navegador web
25 | GenericName[nl]=Webbrowser
26 | GenericName[nl_NL]=Webbrowser
27 | GenericName[pl]=Przeglądarka WWW
28 | GenericName[sr]=Веб прегледач
29 | GenericName[sr@latin]=Web pregledač
30 | GenericName[nb_NO]=Nettleser
31 | GenericName[ja_JP]=Webブラウザ
32 | Exec=endorphin %u
33 | Terminal=false
34 | Type=Application
35 | Icon=endorphin
36 | Categories=Application;Qt;Network;WebBrowser;
37 | MimeType=text/html;text/xml;application/xhtml+xml;application/xml;image/gif;image/jpeg;image/png;
38 | StartupNotify=true
39 |
--------------------------------------------------------------------------------
/tools/htmlToXBel/mainapp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef MAINAPP_H
21 | #define MAINAPP_H
22 |
23 | #include
24 | #include
25 |
26 | class QWebEngineView;
27 | class QPushButton;
28 |
29 | class MainApp : public QObject
30 | {
31 | Q_OBJECT
32 | public:
33 | MainApp(QObject *parent = nullptr);
34 | QString get(QString &input);
35 | void ranJavaScript(QString &value);
36 |
37 | Q_SIGNALS:
38 | void notifyRanJavaScript();
39 |
40 | };
41 |
42 | #endif // MAINAPP_H
--------------------------------------------------------------------------------
/src/locale/locale.pri:
--------------------------------------------------------------------------------
1 |
2 | INCLUDEPATH += $$PWD
3 | DEPENDPATH += $$PWD
4 | VPATH += $$PWD
5 |
6 | TRANSLATIONS += \
7 | ast.ts \
8 | ca.ts \
9 | cs_CZ.ts \
10 | da_DK.ts \
11 | de_DE.ts \
12 | el_GR.ts \
13 | es.ts \
14 | es_CR.ts \
15 | et_EE.ts \
16 | fi_FI.ts \
17 | fr_CA.ts \
18 | fr_FR.ts \
19 | gl.ts \
20 | he_IL.ts \
21 | hu_HU.ts \
22 | it_IT.ts \
23 | ja_JP.ts \
24 | ko_KR.ts \
25 | ms.ts \
26 | nb_NO.ts \
27 | nl.ts \
28 | pl_PL.ts \
29 | pt_PT.ts \
30 | pt_BR.ts \
31 | ru_RU.ts \
32 | sk_SK.ts \
33 | sr_RS.ts \
34 | sr_RS@latin.ts \
35 | tr_TR.ts \
36 | uk.ts \
37 | zh_CN.ts \
38 | zh_TW.ts
39 |
40 | isEmpty(QMAKE_LRELEASE) {
41 | win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
42 | else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
43 | unix {
44 | !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
45 | } else {
46 | !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
47 | }
48 | }
49 |
50 | updateqm.input = TRANSLATIONS
51 | updateqm.output = .qm/locale/${QMAKE_FILE_BASE}.qm
52 | updateqm.commands = $$QMAKE_LRELEASE -silent ${QMAKE_FILE_IN} -qm .qm/locale/${QMAKE_FILE_BASE}.qm
53 | updateqm.CONFIG += no_link target_predeps
54 | QMAKE_EXTRA_COMPILERS += updateqm
55 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchengineaction.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef OPENSEARCHENGINEACTION_H
21 | #define OPENSEARCHENGINEACTION_H
22 |
23 | #include
24 |
25 | class OpenSearchEngine;
26 | class OpenSearchEngineAction : public QAction
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | OpenSearchEngineAction(OpenSearchEngine *engine, QObject *parent = 0);
32 |
33 | private slots:
34 | void imageChanged();
35 |
36 | private:
37 | OpenSearchEngine *m_engine;
38 | };
39 |
40 | #endif // OPENSEARCHENGINEACTION_H
41 |
42 |
--------------------------------------------------------------------------------
/src/aboutdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007-2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef ABOUTDIALOG_H
21 | #define ABOUTDIALOG_H
22 |
23 | #include
24 | #include "ui_aboutdialog.h"
25 |
26 | class AboutDialog : public QDialog, private Ui_AboutDialog
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | AboutDialog(QWidget *parent = 0);
32 |
33 | private slots:
34 | void authorsButtonClicked();
35 | void licenseButtonClicked();
36 |
37 | private:
38 | void displayFile(const QString &fileName, const QString &title);
39 | };
40 |
41 | #endif // ABOUTDIALOG_H
42 |
--------------------------------------------------------------------------------
/autotests/qtest_endorphin.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef QTEST_ENDORPHIN_H
21 | #define QTEST_ENDORPHIN_H
22 |
23 | #include
24 |
25 | #include
26 |
27 | #include "qtry.h"
28 |
29 | #undef QTEST_MAIN
30 |
31 | #define QTEST_MAIN(TestObject) \
32 | int main(int argc, char *argv[]) \
33 | { \
34 | Q_INIT_RESOURCE(htmls); \
35 | Q_INIT_RESOURCE(data); \
36 | BrowserApplication app(argc, argv); \
37 | TestObject tc; \
38 | return QTest::qExec(&tc, argc, argv); \
39 | }
40 |
41 | #endif
42 |
43 |
--------------------------------------------------------------------------------
/src/network/schemeaccesshandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jonas Gehring
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef SCHEMEACCESSHANDLER_H
21 | #define SCHEMEACCESSHANDLER_H
22 |
23 | #include
24 |
25 | #include
26 |
27 | class QNetworkReply;
28 | class SchemeAccessHandler : public QObject
29 | {
30 | public:
31 | SchemeAccessHandler(QObject *parent = 0);
32 |
33 | virtual QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0) = 0;
34 | };
35 |
36 | #endif // SCHEMEACCESSHANDLER_H
37 |
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "browserapplication.h"
21 |
22 | int main(int argc, char **argv)
23 | {
24 | Q_INIT_RESOURCE(htmls);
25 | Q_INIT_RESOURCE(data);
26 | #ifdef Q_WS_X11
27 | QApplication::setGraphicsSystem(QString::fromLatin1("raster"));
28 | #endif
29 | BrowserApplication application(argc, argv);
30 | if (!application.isRunning())
31 | return 0;
32 | #ifdef Q_OS_WIN
33 | application.setStyle(new ExplorerStyle);
34 | #endif
35 | application.newMainWindow();
36 | return application.exec();
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/src/htmls/startpage.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | font-family: "DejaVu Sans";
5 | }
6 |
7 | body {
8 | background: linear-gradient(90deg, #ccc, #fff 50%);
9 | margin-top: 100px;
10 | }
11 |
12 | #header, #search, #footer {
13 | width: 500px;
14 | margin: 10px auto;
15 | }
16 |
17 | #header, #search {
18 | border-radius: 0.8em;
19 | padding: 25px;
20 | }
21 |
22 | #header {
23 | background: linear-gradient(0deg, #228, #66a 90%,#668);
24 | height: 20px;
25 | }
26 |
27 | #header h1 {
28 | display: inline;
29 | font-size: 1.7em;
30 | color: #fff;
31 | font-weight: bold;
32 | }
33 |
34 | #header img {
35 | display: inline;
36 | float: right;
37 | height: 150px;
38 | margin-top: -80px;
39 | }
40 |
41 | #search {
42 | background: linear-gradient(90deg, #cdf, #eff 50%, #cdf);
43 | height: 50px;
44 | color: #000;
45 | text-align: center;
46 | padding-top: 40px !important;
47 | }
48 |
49 | #search fieldset {
50 | border: 0;
51 | }
52 |
53 | #search input[type=text] {
54 | width: 65%;
55 | }
56 |
57 | #search input[type=submit] {
58 | width: 25%;
59 | }
60 |
61 | #footer {
62 | text-align: center;
63 | color: #999;
64 | }
65 |
66 | #footer a {
67 | color: #555;
68 | text-decoration: none;
69 | }
70 |
71 | #footer a:hover {
72 | text-decoration: underline;
73 | }
74 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 | # -*- makefile -*-
3 | # Sample debian/rules that uses debhelper.
4 | # This file was originally written by Joey Hess and Craig Small.
5 | # As a special exception, when this file is copied by dh-make into a
6 | # dh-make output file, you may use that output file without restriction.
7 | # This special exception was added by Craig Small in version 0.37 of dh-make.
8 |
9 | # Uncomment this to turn on verbose mode.
10 | #export DH_VERBOSE=1
11 |
12 |
13 | builddir:
14 | mkdir -p builddir
15 |
16 | builddir/Makefile: builddir
17 | cd builddir && cmake ..
18 |
19 | build: build-stamp
20 |
21 | build-stamp: builddir/Makefile
22 | dh_testdir
23 | cd builddir && $(MAKE)
24 | touch $@
25 |
26 | clean:
27 | dh_testdir
28 | dh_testroot
29 | rm -rf builddir
30 | dh_clean build-stamp
31 |
32 | install: build
33 | dh_testdir
34 | dh_testroot
35 | dh_clean -k
36 | cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/endorphin install
37 |
38 | binary-indep: build install
39 |
40 | binary-arch: build install
41 | dh_testdir
42 | dh_testroot
43 | dh_installchangelogs ChangeLog
44 | dh_installdocs
45 | dh_link
46 | dh_strip
47 | dh_compress
48 | dh_fixperms
49 | dh_installdeb
50 | dh_shlibdeps
51 | dh_gencontrol
52 | dh_md5sums
53 | dh_builddeb
54 |
55 | binary: binary-indep binary-arch
56 | .PHONY: build clean binary-indep binary-arch binary install configure
57 |
--------------------------------------------------------------------------------
/manualtests/utils/squeezelabel/main_squeezelabel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include
21 |
22 | #include "squeezelabel.h"
23 |
24 | int main(int argc, char **argv)
25 | {
26 | QApplication application(argc, argv);
27 |
28 | SqueezeLabel label;
29 | if (application.arguments().count() > 1)
30 | label.setText(application.arguments().value(1));
31 | else
32 | label.setText("This is one long sentence that I will have to ponder the meaning of");
33 | label.show();
34 | label.resize(100, label.height());
35 |
36 | return application.exec();
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/src/clearprivatedata.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Jason A. Donenfeld
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef CLEARPRIVATEDATA_H
21 | #define CLEARPRIVATEDATA_H
22 |
23 | #include
24 |
25 | class QCheckBox;
26 |
27 | class ClearPrivateData : public QDialog
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | ClearPrivateData(QWidget *parent = 0);
33 |
34 | public slots:
35 | void accept();
36 |
37 | private:
38 | QCheckBox *m_browsingHistory;
39 | QCheckBox *m_downloadHistory;
40 | QCheckBox *m_searchHistory;
41 | QCheckBox *m_cookies;
42 | QCheckBox *m_cache;
43 | QCheckBox *m_favIcons;
44 | };
45 |
46 | #endif // CLEARPRIVATEDATA_H
47 |
48 |
--------------------------------------------------------------------------------
/src/network/networkproxyfactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Benjamin K. Stuhl
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef NETWORKPROXYFACTORY_H
21 | #define NETWORKPROXYFACTORY_H
22 |
23 | #include
24 |
25 | class NetworkProxyFactory : public QNetworkProxyFactory
26 | {
27 | public:
28 | NetworkProxyFactory();
29 |
30 | void setHttpProxy(const QNetworkProxy &proxy);
31 | void setGlobalProxy(const QNetworkProxy &proxy);
32 |
33 | virtual QList queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery());
34 |
35 | private:
36 | QNetworkProxy m_httpProxy;
37 | QNetworkProxy m_globalProxy;
38 | };
39 |
40 | #endif // NETWORKPROXYFACTORY_H
41 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchenginedelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jakub Wieczorek
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef OPENSEARCHENGINEDELEGATE_H
21 | #define OPENSEARCHENGINEDELEGATE_H
22 |
23 | #include
24 | #include
25 |
26 | class OpenSearchEngineDelegate
27 | {
28 | public:
29 | OpenSearchEngineDelegate();
30 | virtual ~OpenSearchEngineDelegate();
31 |
32 | virtual void performSearchRequest(const QNetworkRequest &request,
33 | QNetworkAccessManager::Operation operation,
34 | const QByteArray &data) = 0;
35 | };
36 |
37 | #endif // OPENSEARCHENGINEDELEGATE_H
38 |
--------------------------------------------------------------------------------
/src/plaintexteditsearch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 ChriChristian Franke >
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef PLAINTEXTEDITSEARCH_H
21 | #define PLAINTEXTEDITSEARCH_H
22 |
23 | #include "searchbar.h"
24 |
25 | #include
26 |
27 | class QPlainTextEdit;
28 | class PlainTextEditSearch : public SearchBar
29 | {
30 | Q_OBJECT
31 |
32 | public:
33 | PlainTextEditSearch(QPlainTextEdit *plainTextEdit, QWidget *parent = 0);
34 |
35 | public slots:
36 | void findNext();
37 | void findPrevious();
38 |
39 | private:
40 | void find(QTextDocument::FindFlags flags);
41 | QPlainTextEdit *m_edit;
42 | QString m_lastSearchTerm;
43 | };
44 |
45 | #endif // PLAINTEXTEDITSEARCH_H
46 |
47 |
--------------------------------------------------------------------------------
/src/searchbutton.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef SEARCHBUTTON_H
21 | #define SEARCHBUTTON_H
22 |
23 | #include
24 |
25 | class QCompleter;
26 | class SearchButton : public QAbstractButton
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | SearchButton(QWidget *parent = 0);
32 | void setImage(const QImage &image);
33 | void setShowMenuTriangle(bool show);
34 | bool showMenuTriangle() const;
35 | void paintEvent(QPaintEvent *event);
36 | QSize sizeHint() const;
37 |
38 | private:
39 | QImage generateSearchImage(bool dropDown);
40 | QImage m_cache;
41 | bool m_showMenuTriangle;
42 | };
43 |
44 | #endif // SEARCHBUTTON_H
45 |
46 |
--------------------------------------------------------------------------------
/src/locationbar/privacyindicator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2010 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "privacyindicator.h"
21 |
22 | #include "browserapplication.h"
23 |
24 | PrivacyIndicator::PrivacyIndicator(QWidget *parent)
25 | : QLabel(parent)
26 | {
27 | setPixmap(QPixmap(QLatin1String(":graphics/private.png")));
28 | connect(BrowserApplication::instance(), SIGNAL(privacyChanged(bool)),
29 | this, SLOT(setVisible(bool)));
30 | setCursor(Qt::ArrowCursor);
31 | setVisible(BrowserApplication::isPrivate());
32 | }
33 |
34 | void PrivacyIndicator::mousePressEvent(QMouseEvent *event)
35 | {
36 | Q_UNUSED(event)
37 | BrowserApplication::instance()->setPrivate(false);
38 | }
39 |
--------------------------------------------------------------------------------
/src/locationbar/locationbarsiteicon.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef LOCATIONBARSITEICON_H
21 | #define LOCATIONBARSITEICON_H
22 |
23 | #include
24 |
25 | class WebView;
26 | class LocationBarSiteIcon : public QLabel
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | LocationBarSiteIcon(QWidget *parent = 0);
32 | void setWebView(WebView *webView);
33 |
34 | protected:
35 | void mousePressEvent(QMouseEvent *event);
36 | void mouseMoveEvent(QMouseEvent *event);
37 |
38 | private slots:
39 | void webViewSiteIconChanged();
40 |
41 | private:
42 | WebView *m_webView;
43 | QPoint m_dragStartPos;
44 |
45 | };
46 |
47 | #endif // LOCATIONBARSITEICON_H
48 |
49 |
--------------------------------------------------------------------------------
/generateAuthors:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Generate a list of everyone who has contributed to the project merging those who commited under two names or email addresses.
4 | #
5 | # To can pass an arg (which goes to git log)
6 | # Example: to see everyone who contributed between tag 0.6 and now
7 | # ./generateAuthors 0.6..HEAD
8 | #
9 | # Currently this is sorted based on # of commits, sorting contributions is not a simple topic
10 | # as pointed out in this article http://lwn.net/Articles/222773/
11 | #
12 | git log --pretty="format:%an %ae" $1 \
13 | | sed -e 's/smart2128 /Vincenzo Reale /g' \
14 | | sed -e 's/buster\.xtense\.dyndns\.org/ts2server\.com/g' \
15 | | sed -e 's/^cfchris6 /Christian Franke /g' \
16 | | sed -e 's/^faw /Jakub Wieczorek /g' \
17 | | sed -e 's/^LEW21 /Janusz Lewandowski /g' \
18 | | sed -e 's/lew21@pecet.(none)$/lew21st@gmail.com/g' \
19 | | sed -e 's/adam\.treat@torchmobile\.com/treat@kde\.org/g' \
20 | | sed -e 's/torarnv@gmail\.com/tavestbo@trolltech\.com/g' \
21 | | sed -e 's/bks@coldkeck2\.colorado\.edu/bks24@cornell\.edu/g' \
22 | | sed -e 's/porphyr /Mark Reiche /g' \
23 | | sed -e 's/vinx@zulu\.(none)/smart2128@baslug\.org/g' \
24 | | sed -e 's/Matvey Kozhev/Maia Kozheva/g' \
25 | | sed -e 's/kristof@localhost.(none)/kristof.bal@gmail.com/g' \
26 | | sed -e 's/tavestbo@trolltech.com/tor.arne.vestbo@nokia.com/g' \
27 | | sed -e 's/ariya.hidayat@trolltech.com/ariya.hidayat@gmail.com/g' \
28 | | sort | uniq -c | sort -n -r | sed -e 's/^ *[0-9]* //g'
29 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Christian Franke
3 | * Copyright 2009 Jakub Wieczorek
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 | * Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef OPENSEARCHDIALOG_H
22 | #define OPENSEARCHDIALOG_H
23 |
24 | #include
25 |
26 | #include "ui_opensearchdialog.h"
27 |
28 | class OpenSearchEngineModel;
29 |
30 | class OpenSearchDialog : public QDialog, public Ui_OpenSearchDialog
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | OpenSearchDialog(QWidget *parent = 0);
36 |
37 | protected slots:
38 | void addButtonClicked();
39 | void deleteButtonClicked();
40 | void restoreButtonClicked();
41 |
42 | private:
43 | OpenSearchEngineModel *m_model;
44 | };
45 |
46 | #endif //OPENSEARCHDIALOG_H
47 |
48 |
--------------------------------------------------------------------------------
/autotests/modeltest/README:
--------------------------------------------------------------------------------
1 | ModelTest provides a way to check for common errors in implementations of http://doc.trolltech.com/4/qabstractitemmodel.html.
2 |
3 |
4 | ModelTest continuously checks a model as it changes, helping to verify the state and catching many common errors the moment they show up such as:
5 |
6 |
Verifing X number of rows have been inserted in the correct place after the signal rowsAboutToBeInserted() says X rows will be inserted.
7 |
The parent of the first index of the first row is a QModelIndex()
8 |
Calling index() twice in a row with the same values will return the same QModelIndex
9 |
If rowCount() says there are X number of rows, model test will verify that is true.
10 |
Many possible off by one bugs
11 |
hasChildren() returns true if rowCount() is greater then zero.
12 |
and many more...
13 |
14 |
15 | ---
16 |
17 | To Use the model test do the following:
18 |
19 | 1) Include the pri file at the end of your project pro file using the include() command like so:
20 |
21 | include(../path/to/dir/modeltest.pri)
22 |
23 | 2) Then in your source include "modeltest.h" and instantiate ModelTest with your model so the test can live for the lifetime of your model. For example:
24 |
25 | #include
26 |
27 | QDirModel *model = new QDirModel(this);
28 | new ModelTest(model, this);
29 |
30 | 3) That is it. When the test finds a problem it will assert. modeltest.cpp contains some hints on how to fix problems that the test finds.
31 |
--------------------------------------------------------------------------------
/src/network/networkproxyfactory.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Benjamin K. Stuhl
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "networkproxyfactory.h"
21 |
22 | NetworkProxyFactory::NetworkProxyFactory()
23 | : QNetworkProxyFactory()
24 | {
25 | }
26 |
27 | void NetworkProxyFactory::setHttpProxy(const QNetworkProxy &proxy)
28 | {
29 | m_httpProxy = proxy;
30 | }
31 |
32 | void NetworkProxyFactory::setGlobalProxy(const QNetworkProxy &proxy)
33 | {
34 | m_globalProxy = proxy;
35 | }
36 |
37 | QList NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query)
38 | {
39 | QList ret;
40 |
41 | if (query.protocolTag() == QLatin1String("http") && m_httpProxy.type() != QNetworkProxy::DefaultProxy)
42 | ret << m_httpProxy;
43 | ret << m_globalProxy;
44 |
45 | return ret;
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/tools/cacheinfo/data/endorphin-cacheinfo.1:
--------------------------------------------------------------------------------
1 | .TH ENDORPHIN-CACHEINFO "1" "July 2009"
2 |
3 | .SH NAME
4 | endorphin-cacheinfo - a tool for extracting files and metadata out of Endorphin cache files.
5 |
6 | .SH SYNOPSIS
7 | .B endorphin-cacheinfo [-o cachefile] [file | url]
8 |
9 | .SH DESCRIPTION
10 | .B Endorphin-cacheinfo
11 | is a tool for extracting files and displaying metadata out of an Endorphin cache files that are stored on the disk. Every cache file contains both the cached file (sometimes compressed) and metadata associated with it such as expiration date. Cache files names always include the md5sum of the url and passing a url to endorphin-cacheinfo will automatically determine the correct matching cache file name.
12 |
13 | .SH OPTIONS
14 | .TP
15 | .B -o cachefile
16 | Write the cached file if it exists to \fBcachefile\fR
17 | .TP
18 | .B file
19 | Specify the file to read from.
20 | .TP
21 | .B url
22 | Specify the url from which to compute the file to read from.
23 | .TP
24 |
25 | .SH BUGS
26 | Please report bugs to \fIhttps://github.com/AaronDewes/endorphin-browser/issues\fR.
27 |
28 | .SH AUTHOR
29 | The author of endorphin-cacheinfo is Aaron Dewes .
30 | .PP
31 | This manual page was written by Aaron Dewes
32 | .PP
33 | Permission is granted to copy, distribute and/or modify this document under the
34 | terms of the
35 | GNU General Public License, Version 2 or any later version published by the Free
36 | Software Foundation.
37 | .PP
38 | On Debian systems, the complete text of the GNU General Public License can be
39 | found in /usr/share/common-licenses/GPL.
40 |
--------------------------------------------------------------------------------
/webkittrunk.pri:
--------------------------------------------------------------------------------
1 | # To build Endorphin against WebKit trunk:
2 | # export QT_WEBKIT=webkit_trunk
3 | # export WEBKITDIR=$HOME/dev/webkit
4 | #
5 | # Optional:
6 | # export WEBKITOUTPUTDIR=$HOME/build/webkit
7 | # export WEBKITBRANCH=some_cool_git_branch_of_webkit
8 | #
9 | CONFIG += $$(QT_WEBKIT)
10 | webkit_trunk {
11 | WEBKITDIR = $$(WEBKITDIR)
12 | isEmpty(WEBKITDIR): error(Please point WEBKITDIR at the root of your WebKit source tree)
13 |
14 | OUTPUT_DIR = $$(WEBKITOUTPUTDIR)
15 | isEmpty(OUTPUT_DIR): OUTPUT_DIR = $$WEBKITDIR/WebKitBuild
16 |
17 | WEBKITBRANCH = $$(WEBKITBRANCH)
18 | !isEmpty(WEBKITBRANCH) {
19 | OUTPUT_DIR = $$OUTPUT_DIR/$$WEBKITBRANCH
20 | }
21 |
22 | # When building in debug try to link to the debug version of webkit
23 | # and vice versa in release, but when they can not be paired up
24 | # because webkit only has release or debug libs fall back to the other one
25 | CONFIG(debug) {
26 | exists($$OUTPUT_DIR/Debug) {
27 | OUTPUT_DIR = $$OUTPUT_DIR/Debug
28 | } else {
29 | OUTPUT_DIR = $$OUTPUT_DIR/Release
30 | }
31 | } else:CONFIG(release) {
32 | exists($$OUTPUT_DIR/Release) {
33 | OUTPUT_DIR = $$OUTPUT_DIR/Release
34 | } else {
35 | OUTPUT_DIR = $$OUTPUT_DIR/Debug
36 | }
37 | }
38 |
39 | message(Using WebKit Trunk at $$WEBKITDIR)
40 | message(Using WebKit Build at $$OUTPUT_DIR)
41 |
42 | QT -= webkit
43 | DEFINES += WEBKIT_TRUNK
44 | include($$WEBKITDIR/WebKit.pri)
45 | QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/src/sourcehighlighter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Christian Franke
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef SOURCEHIGHLIGHTER_H
21 | #define SOURCEHIGHLIGHTER_H
22 |
23 | #include
24 |
25 | class SourceHighlighter : public QSyntaxHighlighter
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | enum Construct {
31 | Entity,
32 | Tag,
33 | Comment,
34 | Attribute,
35 | LastConstruct = Attribute
36 | };
37 | SourceHighlighter(QTextDocument *document);
38 |
39 | QTextCharFormat getFormatFor(Construct construct);
40 | void setFormatFor(Construct construct, QTextCharFormat &format);
41 |
42 | protected:
43 | enum State {
44 | Normal = -1,
45 | InComment,
46 | InTag,
47 | InAttribute
48 | };
49 | void highlightBlock(const QString &text);
50 |
51 | private:
52 | QTextCharFormat formats[LastConstruct + 1];
53 | };
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/src/qwebplugins/webpluginfactory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef WEBPLUGINFACTORY_H
21 | #define WEBPLUGINFACTORY_H
22 |
23 | #include
24 | #include
25 |
26 | #include "endorphinwebplugin.h"
27 |
28 | class WebPluginFactory : public QWebPluginFactory
29 | {
30 | Q_OBJECT
31 |
32 | public:
33 | WebPluginFactory(QObject *parent = 0);
34 | ~WebPluginFactory();
35 |
36 | QObject *create(const QString &mimeType, const QUrl &url,
37 | const QStringList &argumentNames, const QStringList &argumentValues) const;
38 | QList plugins() const;
39 | void refreshPlugins();
40 |
41 | private:
42 | void init() const;
43 | mutable bool m_loaded;
44 | mutable QList m_plugins;
45 | mutable QHash m_pluginsCache;
46 | };
47 |
48 | #endif // WEBPLUGINFACTORY_H
49 |
50 |
--------------------------------------------------------------------------------
/src/webviewsearch.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef WEBVIEWSEARCH_H
21 | #define WEBVIEWSEARCH_H
22 |
23 | #include "searchbar.h"
24 |
25 | #include
26 |
27 | QT_BEGIN_NAMESPACE
28 | class QWebView;
29 | QT_END_NAMESPACE
30 |
31 | class WebViewSearch : public SearchBar
32 | {
33 | Q_OBJECT
34 |
35 | public:
36 | WebViewSearch(QWebView *webView, QWidget *parent = 0);
37 |
38 | public slots:
39 | void findNext();
40 | void findPrevious();
41 | void highlightAll();
42 |
43 | private:
44 | void find(QWebPage::FindFlags flags);
45 | QWebView *webView() const;
46 | };
47 |
48 | #include "webview.h"
49 |
50 | class WebViewWithSearch : public QWidget
51 | {
52 | Q_OBJECT
53 |
54 | public:
55 | WebViewWithSearch(WebView *webView, QWidget *parent = 0);
56 | WebView *m_webView;
57 | WebViewSearch *m_webViewSearch;
58 | };
59 |
60 |
61 | #endif // WEBVIEWSEARCH_H
62 |
63 |
--------------------------------------------------------------------------------
/tools/htmlToXBel/extract.js:
--------------------------------------------------------------------------------
1 |
2 | function walk() {
3 | var parent = arguments[0];
4 | var indent = arguments[1];
5 |
6 | var result = "";
7 | var children = parent.childNodes;
8 | var folderName = "";
9 | var folded = "";
10 | for (var i = 0; i < children.length; i++) {
11 | var object = children.item(i);
12 | if (object.nodeName == "HR") {
13 | result += indent + "\n";
14 | }
15 | if (object.nodeName == "H3") {
16 | folderName = object.innerHTML;
17 | folded = object.folded;
18 | if (object.folded == undefined)
19 | folded = "false";
20 | else
21 | folded = "true";
22 | }
23 | if (object.nodeName == "A") {
24 | result += indent + "\n";
25 | result += indent + indent + "" + object.innerHTML + "\n";
26 | result += indent + "\n";
27 | }
28 |
29 | var currentIndent = indent;
30 | if (object.nodeName == "DL") {
31 | result += indent + "\n";
32 | indent += " ";
33 | result += indent + "" + folderName + "\n";
34 | }
35 | result += walk(object, indent);
36 | if (object.nodeName == "DL") {
37 | result += currentIndent + "\n";
38 | }
39 | }
40 | return result;
41 | }
42 | var xbel = walk(document, " ");
43 |
44 | if (xbel != "") {
45 | xbel = "\n\n\n" + xbel + "\n";
46 | }
47 |
48 | xbel;
49 |
--------------------------------------------------------------------------------
/BUILDING.md:
--------------------------------------------------------------------------------
1 | # Step-by-Step Instructions to Run the latest Endorphin
2 |
3 | Endorphin is still in development, which means that there are no compiled installable packages yet. To try the latest code, follow this guide.
4 |
5 | ### Step 1: Make sure git is installed.
6 | To see if git is installed, open up a terminal window and type `git`. If it is not installed, the terminal will report back command not found. If it is installed, you'll receive the git help text. To install git: [Windows](https://gitforwindows.org/), [Mac](https://git-scm.com/download/mac), and for Linux, use your distro's package manager.
7 |
8 | ### Step 2: Download and install Qt 5.14 or greater.
9 | If you already have **Qt 5.14** or greater installed, you can skip this step.
10 | To install Qt 5.14, visit the [Download Page](https://www.qt.io/download) or use your distro's package manager on Linux. Be sure to add the correct PATH variable if required in the official install instructions. When you're done, skip the alternative method section, and move onto Step 3.
11 |
12 | ### Step 3: Download and compile the latest Endorphin.
13 | Now we will download the latest tree of Endorphin. Issue these commands:
14 | ```
15 | $ git clone git://github.com/EndorphinBrowser/browser.git
16 | $ cd browser
17 | $ mkdir build && cd build
18 | $ cmake ..
19 | $ make -j$(nproc)
20 | ```
21 | Endorphin is now compiled. To run endorphin, simply run `./endorphin` from the current directory.
22 |
23 | _**Optional**_: To update to the latest Endorphin in the future, you can issue these commands:
24 | ```
25 | $ cd browser
26 | $ git pull
27 | $ cd build
28 | $ make -j$(nproc)
29 | ```
30 |
31 | If you are looking for an IDE to develop Endorphin in you can checkout the free IDE Qt Creator that is available with Qt.
32 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchengineaction.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "opensearchengineaction.h"
21 |
22 | #include "browserapplication.h"
23 | #include "networkaccessmanager.h"
24 | #include "opensearchengine.h"
25 |
26 | OpenSearchEngineAction::OpenSearchEngineAction(OpenSearchEngine *engine, QObject *parent)
27 | : QAction(parent)
28 | , m_engine(engine)
29 | {
30 | if (!engine->networkAccessManager())
31 | engine->setNetworkAccessManager(BrowserApplication::networkAccessManager());
32 |
33 | setText(engine->name());
34 | imageChanged();
35 | connect(engine, SIGNAL(imageChanged()), this, SLOT(imageChanged()));
36 | }
37 |
38 | void OpenSearchEngineAction::imageChanged()
39 | {
40 | QImage image = m_engine->image();
41 | if (image.isNull())
42 | setIcon(BrowserApplication::icon(m_engine->imageUrl()));
43 | else
44 | setIcon(QIcon(QPixmap::fromImage(image)));
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/src/searchbar.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef SEARCHBAR_H
21 | #define SEARCHBAR_H
22 |
23 | #include
24 |
25 | #include "ui_searchbanner.h"
26 |
27 | QT_BEGIN_NAMESPACE
28 | class QTimeLine;
29 | QT_END_NAMESPACE
30 |
31 | class SearchBar : public QWidget
32 | {
33 | Q_OBJECT
34 |
35 | public:
36 | SearchBar(QWidget *parent = 0);
37 | void setSearchObject(QObject *object);
38 | QObject *searchObject() const;
39 |
40 | public slots:
41 | void animateHide();
42 | void clear();
43 | void showFind();
44 | virtual void findNext() = 0;
45 | virtual void findPrevious() = 0;
46 |
47 | protected:
48 | void resizeEvent(QResizeEvent *event);
49 | Ui_SearchBanner ui;
50 |
51 | private slots:
52 | void frameChanged(int frame);
53 |
54 | private:
55 | void initializeSearchWidget();
56 | QObject *m_object;
57 | QWidget *m_widget;
58 | QTimeLine *m_timeLine;
59 | };
60 |
61 | #endif
62 |
63 |
--------------------------------------------------------------------------------
/src/htmls/dirlist.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %1
5 |
74 |
80 |
81 |
82 |
83 |
%2
84 |
85 | %5
86 |
87 |
88 | %4
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/src/src.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 |
3 | TARGET = endorphin
4 | mac {
5 | TARGET = Endorphin
6 | QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
7 | }
8 |
9 | DEFINES += \
10 | QT_STRICT_ITERATORS \
11 |
12 | include(../install.pri)
13 |
14 | include(src.pri)
15 |
16 | SOURCES += main.cpp
17 |
18 | DESTDIR = ../
19 |
20 | include(locale/locale.pri)
21 |
22 | !mac {
23 | unix {
24 | INSTALLS += translations desktop iconxpm iconsvg icon16 icon32 icon128 man man-compress
25 |
26 | translations.path = $$PKGDATADIR
27 | translations.files += .qm/locale
28 |
29 | desktop.path = $$DATADIR/applications
30 | desktop.files += endorphin.desktop
31 |
32 | iconxpm.path = $$DATADIR/pixmaps
33 | iconxpm.files += data/endorphin.xpm
34 |
35 | iconsvg.path = $$DATADIR/icons/hicolor/scalable/apps
36 | iconsvg.files += data/endorphin.svg
37 |
38 | icon16.path = $$DATADIR/icons/hicolor/16x16/apps
39 | icon16.files += data/16x16/endorphin.png
40 |
41 | icon32.path = $$DATADIR/icons/hicolor/32x32/apps
42 | icon32.files += data/32x32/endorphin.png
43 |
44 | icon128.path = $$DATADIR/icons/hicolor/128x128/apps
45 | icon128.files += data/128x128/endorphin.png
46 |
47 | man.path = $$DATADIR/man/man1
48 | man.files += data/endorphin.1
49 |
50 | man-compress.path = $$DATADIR/man/man1
51 | man-compress.extra = "" "gzip -9 -f \$(INSTALL_ROOT)/$$DATADIR/man/man1/endorphin.1" ""
52 | man-compress.depends = install_man
53 |
54 | GNOME_DEFAULT_APPS_PATH = $$system(pkg-config --variable=defappsdir gnome-default-applications)
55 |
56 | !isEmpty(GNOME_DEFAULT_APPS_PATH) {
57 | INSTALLS += gnome-default-app
58 |
59 | gnome-default-app.path = $$GNOME_DEFAULT_APPS_PATH
60 | gnome-default-app.files = data/endorphin.xml
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/manualtests/utils/treesortfilterproxymodel/main_treesortfilterproxymodel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "treesortfilterproxymodel.h"
21 | #include "ui_treesortfilterproxymodeldialog.h"
22 |
23 | #include
24 | #include
25 | #include
26 |
27 | int main(int argc, char **argv)
28 | {
29 | QApplication application(argc, argv);
30 |
31 | QDialog dialog;
32 | Ui_TreeSortFilterProxyModelDialog ui;
33 | ui.setupUi(&dialog);
34 |
35 | TreeSortFilterProxyModel *proxy = new TreeSortFilterProxyModel(&dialog);
36 | dialog.connect(ui.search, SIGNAL(textChanged(const QString &)),
37 | proxy, SLOT(setFilterRegExp(const QString &)));
38 | QDirModel *dirModel = new QDirModel(&dialog);
39 | proxy->setSourceModel(dirModel);
40 | ui.treeView->setModel(proxy);
41 | ui.treeView->setRootIndex(proxy->mapFromSource(dirModel->index(QDir::homePath())));
42 | dialog.show();
43 |
44 | return application.exec();
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/src/sourceviewer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Christian Franke
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef SOURCEVIEWER_H
21 | #define SOURCEVIEWER_H
22 |
23 | #include
24 |
25 | class QVBoxLayout;
26 | class SourceHighlighter;
27 | class PlainTextEditSearch;
28 | class QPlainTextEdit;
29 | class QMenuBar;
30 | class QMenu;
31 | class QUrl;
32 | class QAction;
33 | class QNetworkReply;
34 | class SourceViewer : public QDialog
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | SourceViewer(const QString &source, const QString &title,
40 | const QUrl &url, QWidget *parent = 0);
41 | ~SourceViewer();
42 |
43 | private:
44 | QPlainTextEdit *m_edit;
45 | SourceHighlighter *m_highlighter;
46 | PlainTextEditSearch *m_plainTextEditSearch;
47 | QVBoxLayout *m_layout;
48 | QMenuBar *m_menuBar;
49 | QMenu *m_editMenu;
50 | QAction *m_findAction;
51 | QMenu *m_viewMenu;
52 | QNetworkReply *m_reply;
53 | QString m_source;
54 |
55 | private slots:
56 | void loadingFinished();
57 | };
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/src/data/endorphin.1:
--------------------------------------------------------------------------------
1 | .TH ENDORPHIN "1" "May 2008"
2 |
3 | .SH NAME
4 | Endorphin - Lightweight web browser based on Qt and WebKit
5 |
6 | .SH SYNOPSIS
7 | .B endorphin [Qt options] [url]
8 |
9 | .SH DESCRIPTION
10 | .B Endorphin
11 | is a lightweight, cross-platform web browser using the Qt 5.x port of the WebKit
12 | layout engine. It is based on the demo browser application shipped with Qt
13 | demos.
14 |
15 | .SH OPTIONS
16 | .SS Common Qt Options
17 | .TP
18 | .B -style style, -style=style
19 | Specify the Qt widget style to use (examples: plastique, cleanlooks).
20 | .TP
21 | .B -stylesheet stylesheet, -stylesheet=stylesheet
22 | Specify the user stylesheet to use when rendering widgets.
23 | .TP
24 | .B -session session, -session=session
25 | Restore the application from an earlier \fBsession\fR.
26 | .TP
27 | .B -widgetcount
28 | Print a debug message at the end about the number of widgets left undestroyed
29 | and the maximum number of widgets that existed at the same time.
30 | .TP
31 | .B -reverse
32 | Sets the application's layout direction to right-to-left.
33 |
34 | .SS Options Specific to Endorphin
35 | .TP
36 | .B url
37 | The URL address to open in the browser.
38 |
39 | .SH BUGS
40 | Please report bugs to \fIhttps://github.com/AaronDewes/endorphin-browser/issues\fR.
41 |
42 | .SH AUTHOR
43 | The author of Endorphin is Aaron Dewes .
44 | Endorphin is based on Arora by Aaron Dewes .
45 | .PP
46 | This manual page was written by Matvey Kozhev .
47 | .PP
48 | Permission is granted to copy, distribute and/or modify this document under the
49 | terms of the
50 | GNU General Public License, Version 2 or any later version published by the Free
51 | Software Foundation.
52 | .PP
53 | On Debian systems, the complete text of the GNU General Public License can be
54 | found in /usr/share/common-licenses/GPL.
55 |
--------------------------------------------------------------------------------
/src/Info_mac.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIconFile
6 | @ICON@
7 | CFBundlePackageType
8 | APPL
9 | CFBundleGetInfoString
10 | Created by Qt/QMake
11 | CFBundleIdentifier
12 | com.endorphin.Endorphin
13 | CFBundleSignature
14 | ttxt
15 | CFBundleExecutable
16 | @EXECUTABLE@
17 | CFBundleDocumentTypes
18 |
19 |
20 | CFBundleTypeExtensions
21 |
22 | html
23 | htm
24 | shtml
25 | xht
26 | xhtml
27 |
28 | CFBundleTypeIconFile
29 | @ICON@
30 | CFBundleTypeName
31 | HTML Document
32 | CFBundleTypeOSTypes
33 |
34 | HTML
35 |
36 | CFBundleTypeRole
37 | Viewer
38 |
39 |
40 | NOTE
41 | Endorphin Browser by the Endorphin team
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/locationbar/locationbar.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef LOCATIONBAR_H
21 | #define LOCATIONBAR_H
22 |
23 | #include "lineedit.h"
24 |
25 | #include
26 | #include
27 |
28 | class WebView;
29 | class LocationBarSiteIcon;
30 | class PrivacyIndicator;
31 | class LocationBar : public LineEdit
32 | {
33 | Q_OBJECT
34 |
35 | public:
36 | LocationBar(QWidget *parent = 0);
37 | void setWebView(WebView *webView);
38 | WebView *webView() const;
39 |
40 | protected:
41 | void paintEvent(QPaintEvent *event);
42 | void focusOutEvent(QFocusEvent *event);
43 | void mouseDoubleClickEvent(QMouseEvent *event);
44 | void keyPressEvent(QKeyEvent *event);
45 | void dragEnterEvent(QDragEnterEvent *event);
46 | void dropEvent(QDropEvent *event);
47 |
48 | private slots:
49 | void webViewUrlChanged(const QUrl &url);
50 |
51 | private:
52 | QPointer m_webView;
53 |
54 | LocationBarSiteIcon *m_siteIcon;
55 | PrivacyIndicator *m_privacyIndicator;
56 | };
57 |
58 | #endif // LOCATIONBAR_H
59 |
60 |
--------------------------------------------------------------------------------
/src/network/fileaccesshandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jonas Gehring
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef FILEACCESSHANDLER_H
21 | #define FILEACCESSHANDLER_H
22 |
23 | #include "schemeaccesshandler.h"
24 |
25 | #include
26 | #include
27 |
28 | class FileAccessHandler : public SchemeAccessHandler
29 | {
30 | public:
31 | FileAccessHandler(QObject *parent = 0);
32 |
33 | virtual QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0);
34 | };
35 |
36 | class FileAccessReply : public QNetworkReply
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | FileAccessReply(const QNetworkRequest &request, QObject *parent = 0);
42 | ~FileAccessReply();
43 |
44 | virtual qint64 bytesAvailable() const;
45 | virtual void abort() { };
46 | virtual void close();
47 |
48 | protected:
49 | virtual qint64 readData(char *data, qint64 maxSize);
50 |
51 | private slots:
52 | void listDirectory();
53 |
54 | private:
55 | QBuffer buffer;
56 | };
57 |
58 | #endif // FILEACCESSHANDLER_H
59 |
--------------------------------------------------------------------------------
/src/acceptlanguagedialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef ACCEPTLANGUAGEDIALOG_H
21 | #define ACCEPTLANGUAGEDIALOG_H
22 |
23 | #include
24 | #include "ui_acceptlanguagedialog.h"
25 |
26 | #include
27 |
28 | class AcceptLanguageDialog : public QDialog, public Ui_AcceptLanguage
29 | {
30 | Q_OBJECT
31 |
32 | public:
33 | AcceptLanguageDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
34 | void accept();
35 | static QByteArray httpString(const QStringList &list);
36 | static QStringList defaultAcceptList();
37 |
38 | private slots:
39 | void load();
40 | void save();
41 |
42 | void currentChanged(const QModelIndex ¤t, const QModelIndex &previous);
43 | void moveLanguageUp();
44 | void moveLanguageDown();
45 | void removeLanguage();
46 | void addLanguage();
47 |
48 | private:
49 | static QStringList expand(const QLocale::Language language);
50 | QStringListModel m_allLanguagesModel;
51 | QStringListModel m_model;
52 |
53 | };
54 |
55 | #endif // ACCEPTLANGUAGEDIALOG_H
56 |
57 |
--------------------------------------------------------------------------------
/src/qwebplugins/endorphinwebplugin.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include "endorphinwebplugin.h"
30 |
31 | EndorphinWebPlugin::EndorphinWebPlugin()
32 | {
33 | }
34 |
35 | EndorphinWebPlugin::~EndorphinWebPlugin()
36 | {
37 | }
38 |
39 | bool EndorphinWebPlugin::isAnonymous() const
40 | {
41 | return false;
42 | }
43 |
--------------------------------------------------------------------------------
/tools/htmlToXBel/mainapp.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include "mainapp.h"
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | MainApp::MainApp(QObject *parent) : QObject(parent)
28 | {
29 | }
30 |
31 | QString result;
32 |
33 | QString MainApp::get(QString &input)
34 | {
35 | QWebEnginePage webPage;
36 | QEventLoop loop;
37 | connect(&webPage, &QWebEnginePage::loadFinished, &loop, &QEventLoop::quit);
38 | webPage.setHtml(input);
39 | loop.exec();
40 | QEventLoop loop2;
41 | QObject::connect(this, SIGNAL(notifyRanJavaScript()), &loop2, SLOT(quit()));
42 | QFile jsFile(":/extract.js");
43 | if (!jsFile.open(QFile::ReadOnly)) {
44 | qWarning() << "Unable to load javascript to extract bookmarks.";
45 | exit(1);
46 | }
47 | webPage.runJavaScript(jsFile.readAll(), [this](const QVariant &v)
48 | {
49 | QString tmp = v.toString();
50 | this->ranJavaScript(tmp);
51 | });
52 | loop2.exec();
53 | return result;
54 | }
55 |
56 | void MainApp::ranJavaScript(QString &value)
57 | {
58 | result = value;
59 | emit notifyRanJavaScript();
60 | }
--------------------------------------------------------------------------------
/manualtests/adblock/adblockdialog/main_adblockdialog.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include
30 | #include
31 |
32 | #include "adblockdialog.h"
33 | #include "modeltest.h"
34 |
35 | int main(int argc, char **argv)
36 | {
37 | QApplication app(argc, argv);
38 |
39 | AdBlockDialog dialog;
40 | new ModelTest(dialog.treeView->model());
41 | dialog.show();
42 | return app.exec();
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/src/utils/lineedit_p.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2008 - 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef LINEEDIT_P_H
30 | #define LINEEDIT_P_H
31 |
32 | #include
33 |
34 | class SideWidget : public QWidget
35 | {
36 | Q_OBJECT
37 |
38 | signals:
39 | void sizeHintChanged();
40 |
41 | public:
42 | SideWidget(QWidget *parent = 0);
43 |
44 | protected:
45 | bool event(QEvent *event);
46 |
47 | };
48 |
49 | #endif // LINEEDIT_P_H
50 |
51 |
--------------------------------------------------------------------------------
/manualtests/bookmarks/main_bookmarks.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include
21 |
22 | #include "addbookmarkdialog.h"
23 | #include "bookmarksdialog.h"
24 | #include "bookmarksmanager.h"
25 | #include "bookmarksmodel.h"
26 | #include "browserapplication.h"
27 | #include "modeltest.h"
28 |
29 | int main(int argc, char *argv[])
30 | {
31 | QApplication app(argc, argv);
32 |
33 | QCoreApplication::setApplicationName(QLatin1String("endorphin"));
34 | QCoreApplication::setApplicationVersion(QLatin1String("0.1"));
35 |
36 | new ModelTest(BrowserApplication::bookmarksManager()->bookmarksModel());
37 | BookmarksDialog *dialog = new BookmarksDialog;
38 | dialog->show();
39 |
40 | QString url("http://www.reddit.com");
41 | AddBookmarkDialog adddialog;
42 | adddialog.setTitle(QString("Reddit.com: a time drain"));
43 | adddialog.setUrl(url);
44 | //adddialog.show();
45 |
46 | QMenuBar bar;
47 | QMenu *edit = bar.addMenu(("&Edit"));
48 | edit->addAction(BrowserApplication::bookmarksManager()->undoRedoStack()->createUndoAction(edit));
49 | edit->addAction(BrowserApplication::bookmarksManager()->undoRedoStack()->createRedoAction(edit));
50 | return app.exec();
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/src/utils/editlistview.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Jakub Wieczorek
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef EDITLISTVIEW_H
30 | #define EDITLISTVIEW_H
31 |
32 | #include
33 |
34 | class EditListView : public QListView
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | EditListView(QWidget *parent = 0);
40 | void keyPressEvent(QKeyEvent *event);
41 |
42 | public slots:
43 | void removeSelected();
44 | void removeAll();
45 | };
46 |
47 | #endif // EDITLISTVIEW_H
48 |
49 |
--------------------------------------------------------------------------------
/src/adblock/adblocknetwork.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef ADBLOCKNETWORK_H
30 | #define ADBLOCKNETWORK_H
31 |
32 | #include
33 |
34 | class QNetworkRequest;
35 | class QNetworkReply;
36 | class AdBlockNetwork : public QObject
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | AdBlockNetwork(QObject *parent = 0);
42 |
43 | QNetworkReply *block(const QNetworkRequest &request);
44 |
45 | };
46 |
47 | #endif // ADBLOCKNETWORK_H
48 |
49 |
--------------------------------------------------------------------------------
/manualtests/searchlineedit/main_searchlineedit.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008-2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | #include "searchlineedit.h"
28 | #include "searchbutton.h"
29 |
30 | int main(int argc, char **argv)
31 | {
32 | QApplication application(argc, argv);
33 |
34 | QDialog window;
35 | QPushButton *button1 = new QPushButton("One");
36 | SearchLineEdit *s1 = new SearchLineEdit(&window);
37 | SearchLineEdit *s2 = new SearchLineEdit(&window);
38 | QCompleter *completer = new QCompleter(&window);
39 | s2->setCompleter(completer);
40 | s2->searchButton()->setShowMenuTriangle(true);
41 | QObject::connect(s2->searchButton(), SIGNAL(clicked()),
42 | completer, SLOT(complete()));
43 | QStringList list;
44 | list << "a" << "b" << "c";
45 | s2->completer()->setModel(new QStringListModel(list));
46 |
47 | QVBoxLayout *layout = new QVBoxLayout;
48 | layout->addWidget(s1);
49 | layout->addWidget(s2);
50 | layout->addWidget(button1);
51 |
52 | window.setLayout(layout);
53 | window.show();
54 | return application.exec();
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/manualtests/adblock/adblockmodel/main_adblockmodel.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include
30 | #include
31 |
32 | #include "adblockmodel.h"
33 | #include "modeltest.h"
34 |
35 | int main(int argc, char **argv)
36 | {
37 | QApplication app(argc, argv);
38 |
39 | QTreeView view;
40 | AdBlockModel *model = new AdBlockModel;
41 | new ModelTest(model);
42 | view.setModel(model);
43 | view.show();
44 | return app.exec();
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/src/bookmarks/bookmarkstoolbar.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008-2009 Aaron Dewes
3 | * Copyright 2009 Jakub Wieczorek
4 | *
5 | * This program is free software; you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation; either version 2 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 | * Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef BOOKMARKSTOOLBAR_H
22 | #define BOOKMARKSTOOLBAR_H
23 |
24 | #include "modeltoolbar.h"
25 |
26 | #include "tabwidget.h"
27 |
28 | #include
29 | #include
30 | #include
31 |
32 | class BookmarksModel;
33 | class BookmarksToolBar : public ModelToolBar
34 | {
35 | Q_OBJECT
36 |
37 | signals:
38 | void openUrl(const QUrl &url, const QString &title);
39 | void openUrl(const QUrl &url, TabWidget::OpenUrlIn tab, const QString &title);
40 |
41 | public:
42 | BookmarksToolBar(BookmarksModel *model, QWidget *parent = 0);
43 |
44 | protected:
45 | virtual ModelMenu *createMenu();
46 |
47 | private slots:
48 | void contextMenuRequested(const QPoint &position);
49 |
50 | protected slots:
51 | void openBookmark();
52 | void openBookmarkInCurrentTab();
53 | void openBookmarkInNewTab();
54 | void removeBookmark();
55 | void newBookmark();
56 | void newFolder();
57 | void bookmarkActivated(const QModelIndex &);
58 |
59 | private:
60 | BookmarksModel *m_bookmarksModel;
61 |
62 | QPoint m_dragStartPosition;
63 | };
64 |
65 | #endif // BOOKMARKSTOOLBAR_H
66 |
--------------------------------------------------------------------------------
/src/opensearch/opensearchenginemodel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Christian Franke
3 | * Copyright 2009 Jakub Wieczorek
4 | * Copyright 2009 Christopher Eby
5 | *
6 | * This program is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 | * Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef OPENSEARCHENGINEMODEL_H
23 | #define OPENSEARCHENGINEMODEL_H
24 |
25 | #include
26 |
27 | class OpenSearchEngine;
28 | class OpenSearchManager;
29 |
30 | class OpenSearchEngineModel : public QAbstractTableModel
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | OpenSearchEngineModel(OpenSearchManager *manager, QObject *parent = 0);
36 | bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
37 | int rowCount(const QModelIndex &parent = QModelIndex()) const;
38 | int columnCount(const QModelIndex &parent = QModelIndex()) const;
39 | Qt::ItemFlags flags(const QModelIndex &index) const;
40 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
41 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
42 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
43 |
44 | protected slots:
45 | void enginesChanged();
46 |
47 | private:
48 | OpenSearchManager *m_manager;
49 | };
50 |
51 | #endif //OPENSEARCHENGINEMODEL_H
52 |
53 |
--------------------------------------------------------------------------------
/src/clearbutton.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef CLEARBUTTON_H
30 | #define CLEARBUTTON_H
31 |
32 | #include
33 |
34 | class ClearButton : public QAbstractButton
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | ClearButton(QWidget *parent = 0);
40 |
41 | public slots:
42 | void textChanged(const QString &text);
43 |
44 | protected:
45 | void paintEvent(QPaintEvent *event);
46 |
47 | private:
48 | QImage m_styleImage;
49 | };
50 |
51 | #endif // CLEARBUTTON_H
52 |
53 |
--------------------------------------------------------------------------------
/src/adblock/adblockpage.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef ADBLOCKPAGE_H
30 | #define ADBLOCKPAGE_H
31 |
32 | #include
33 |
34 | class AdBlockRule;
35 | class QWebPage;
36 | class AdBlockPage : public QObject
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | AdBlockPage(QObject *parent = 0);
42 |
43 | void applyRulesToPage(QWebPage *page);
44 |
45 | private:
46 | void checkRule(const AdBlockRule *rule, QWebPage *page, const QString &host);
47 | };
48 |
49 | #endif // ADBLOCKPAGE_H
50 |
51 |
--------------------------------------------------------------------------------
/src/utils/edittreeview.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2008, Aaron Dewes
3 | * Copyright (c) 2009, Jakub Wieczorek
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
14 | * may be used to endorse or promote products derived from this software
15 | * without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 | * SUCH DAMAGE.
28 | */
29 |
30 | #ifndef EDITTREEVIEW_H
31 | #define EDITTREEVIEW_H
32 |
33 | #include
34 |
35 | class EditTreeView : public QTreeView
36 | {
37 | Q_OBJECT
38 |
39 | public:
40 | EditTreeView(QWidget *parent = 0);
41 | void keyPressEvent(QKeyEvent *event);
42 |
43 | public slots:
44 | void removeSelected();
45 | void removeAll();
46 |
47 | };
48 |
49 | #endif // EDITTREEVIEW_H
50 |
51 |
--------------------------------------------------------------------------------
/src/utils/edittableview.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2008, Aaron Dewes
3 | * Copyright (c) 2009, Jakub Wieczorek
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
14 | * may be used to endorse or promote products derived from this software
15 | * without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 | * SUCH DAMAGE.
28 | */
29 |
30 | #ifndef EDITTABLEVIEW_H
31 | #define EDITTABLEVIEW_H
32 |
33 | #include
34 |
35 | class EditTableView : public QTableView
36 | {
37 | Q_OBJECT
38 |
39 | public:
40 | EditTableView(QWidget *parent = 0);
41 | void keyPressEvent(QKeyEvent *event);
42 |
43 | public slots:
44 | void removeSelected();
45 | void removeAll();
46 | };
47 |
48 | #endif // EDITTABLEVIEW_H
49 |
50 |
--------------------------------------------------------------------------------
/src/utils/treesortfilterproxymodel.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef TREESORTFILTERPROXYMODEL_H
30 | #define TREESORTFILTERPROXYMODEL_H
31 |
32 | #include
33 |
34 | class TreeSortFilterProxyModel : public QSortFilterProxyModel
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | TreeSortFilterProxyModel(QObject *parent = 0);
40 |
41 | protected:
42 | bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
43 |
44 | };
45 |
46 | #endif // TREESORTFILTERPROXYMODEL_H
47 |
48 |
--------------------------------------------------------------------------------
/src/adblock/adblockschemeaccesshandler.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef ADBLOCKSCHEMEACCESSHANDLER_H
30 | #define ADBLOCKSCHEMEACCESSHANDLER_H
31 |
32 | #include "schemeaccesshandler.h"
33 |
34 | class AdBlockSchemeAccessHandler : public SchemeAccessHandler
35 | {
36 | public:
37 | AdBlockSchemeAccessHandler(QObject *parent = 0);
38 |
39 | virtual QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0);
40 | };
41 |
42 | #endif // ADBLOCKSCHEMEACCESSHANDLER_H
43 |
--------------------------------------------------------------------------------
/src/utils/webpageproxy.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef WEBPAGEPROXY_H
30 | #define WEBPAGEPROXY_H
31 |
32 | #include
33 | #include
34 | #include
35 |
36 | class WebPageProxy : public QWebPage
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | WebPageProxy(QObject *parent = 0);
42 | static int pageAttributeId();
43 |
44 | protected:
45 | friend class NetworkAccessManagerProxy;
46 | virtual void populateNetworkRequest(QNetworkRequest &request);
47 | };
48 |
49 | #endif // WEBPAGEPROXY_H
50 |
--------------------------------------------------------------------------------
/src/modeltoolbar.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Jakub Wieczorek
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef MODELTOOLBAR_H
21 | #define MODELTOOLBAR_H
22 |
23 | #include
24 |
25 | #include
26 |
27 | Q_DECLARE_METATYPE(QModelIndex)
28 |
29 | class QEvent;
30 | class ModelMenu;
31 | class ModelToolBar : public QToolBar
32 | {
33 | Q_OBJECT
34 |
35 | signals:
36 | void activated(const QModelIndex &index);
37 |
38 | public:
39 | ModelToolBar(QWidget *parent = 0);
40 | ModelToolBar(const QString &title, QWidget *parent = 0);
41 |
42 | void setModel(QAbstractItemModel *model);
43 | QAbstractItemModel *model() const;
44 |
45 | void setRootIndex(const QModelIndex &index);
46 | QModelIndex rootIndex() const;
47 |
48 | static QModelIndex index(QAction *action);
49 |
50 | protected:
51 | virtual ModelMenu *createMenu();
52 |
53 | bool eventFilter(QObject *object, QEvent *event);
54 |
55 | void hideEvent(QHideEvent *event);
56 | void showEvent(QShowEvent *event);
57 | void dragEnterEvent(QDragEnterEvent *event);
58 | void dropEvent(QDropEvent *event);
59 | void mouseMoveEvent(QMouseEvent *event);
60 |
61 | protected slots:
62 | void build();
63 |
64 | private:
65 | QAbstractItemModel *m_model;
66 | QPersistentModelIndex m_rootIndex;
67 | QPoint m_dragStartPos;
68 | };
69 |
70 | #endif // MODELTOOLBAR_H
71 |
--------------------------------------------------------------------------------
/src/searchlineedit.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef SEARCHLINEEDIT_H
30 | #define SEARCHLINEEDIT_H
31 |
32 | #include "lineedit.h"
33 |
34 | class ClearButton;
35 | class SearchButton;
36 | class SearchLineEdit : public LineEdit
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | SearchLineEdit(QWidget *parent = 0);
42 |
43 | ClearButton *clearButton() const;
44 | SearchButton *searchButton() const;
45 |
46 | private:
47 | void init();
48 | ClearButton *m_clearButton;
49 | SearchButton *m_searchButton;
50 |
51 | };
52 |
53 | #endif // SEARCHLINEEDIT_H
54 |
55 |
--------------------------------------------------------------------------------
/git_hooks/pre-commit/compile:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (c) 2010, Aaron Dewes
4 | # All rights reserved.
5 | #
6 | # Redistribution and use in source and binary forms, with or without
7 | # modification, are permitted provided that the following conditions are met:
8 | # 1. Redistributions of source code must retain the above copyright
9 | # notice, this list of conditions and the following disclaimer.
10 | # 2. Redistributions in binary form must reproduce the above copyright
11 | # notice, this list of conditions and the following disclaimer in the
12 | # documentation and/or other materials provided with the distribution.
13 | # 3. Neither the name of the project nor the
14 | # names of its contributors may be used to endorse or promote products
15 | # derived from this software without specific prior written permission.
16 | #
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY
18 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | function compile {
30 | unset GIT_DIR
31 | echo "--Attempting to build in $PWD--"
32 | if [ -f Makefile ] ; then
33 | make --quiet
34 | if [ $? != 0 ] ; then
35 | echo "--Build failed, fix failure before commiting--";
36 | exit 1
37 | fi
38 | fi
39 | echo "--Attempting to build pass--"
40 | }
41 |
42 | case "${1}" in
43 | --about )
44 | echo "Wherever you are make sure something compiles".
45 | ;;
46 | * )
47 | compile
48 | ;;
49 | esac
50 |
--------------------------------------------------------------------------------
/src/network/networkdiskcache.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef NETWORKDISKCACHE_H
30 | #define NETWORKDISKCACHE_H
31 |
32 | #include
33 |
34 | class NetworkDiskCache : public QNetworkDiskCache
35 | {
36 | Q_OBJECT
37 |
38 | public:
39 | NetworkDiskCache(QObject *parent = 0);
40 |
41 | void loadSettings();
42 |
43 | QIODevice *prepare(const QNetworkCacheMetaData &metaData);
44 |
45 | private slots:
46 | void privacyChanged(bool isPrivate);
47 |
48 | private:
49 | bool m_private;
50 | };
51 |
52 | #endif // NETWORKDISKCACHE_H
53 |
54 |
--------------------------------------------------------------------------------
/src/utils/squeezelabel.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef SQUEEZELABEL_H
30 | #define SQUEEZELABEL_H
31 |
32 | #include
33 |
34 | /*
35 | A label that will squeeze the set text to fit within the size of the
36 | widget. The text will be elided in the middle.
37 | */
38 | class SqueezeLabel : public QLabel
39 | {
40 | Q_OBJECT
41 |
42 | public:
43 | SqueezeLabel(QWidget *parent = 0);
44 |
45 | protected:
46 | void paintEvent(QPaintEvent *event);
47 |
48 | private:
49 | QString m_SqueezedTextCache;
50 | };
51 |
52 | #endif // SQUEEZELABEL_H
53 |
54 |
--------------------------------------------------------------------------------
/src/useragent/useragentmenu.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010, William C. Witt
3 | * Copyright (c) 2010, Aaron Dewes
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * 3. Neither the name of the Endorphin nor the names of its contributors
14 | * may be used to endorse or promote products derived from this software
15 | * without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 | * SUCH DAMAGE.
28 | */
29 |
30 | #ifndef USERAGENTMENU_H
31 | #define USERAGENTMENU_H
32 |
33 | #include
34 |
35 | class UserAgentMenu : public QMenu
36 | {
37 | Q_OBJECT
38 |
39 | public:
40 | UserAgentMenu(QWidget *parent = 0);
41 |
42 | private slots:
43 | void populateMenu();
44 | void changeUserAgent();
45 | void switchToDefaultUserAgent();
46 | void switchToOtherUserAgent();
47 |
48 | private:
49 | void addActionsFromFile(const QString &fileName);
50 |
51 | };
52 |
53 | #endif // USERAGENTMENU_H
54 |
--------------------------------------------------------------------------------
/src/utils/webpageproxy.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include "webpageproxy.h"
30 |
31 | #include
32 | #include
33 |
34 | #define ATTRIBUTE_ID QNetworkRequest::User + 100
35 |
36 | WebPageProxy::WebPageProxy(QObject *parent)
37 | : QWebPage(parent)
38 | {
39 | }
40 |
41 | int WebPageProxy::pageAttributeId()
42 | {
43 | return ATTRIBUTE_ID;
44 | }
45 |
46 | void WebPageProxy::populateNetworkRequest(QNetworkRequest &request)
47 | {
48 | QVariant variant = QVariant::fromValue((void *) this);
49 | request.setAttribute((QNetworkRequest::Attribute)(pageAttributeId()), variant);
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/src/utils/squeezelabel.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include "squeezelabel.h"
30 |
31 | SqueezeLabel::SqueezeLabel(QWidget *parent)
32 | : QLabel(parent)
33 | {
34 | }
35 |
36 | void SqueezeLabel::paintEvent(QPaintEvent *event)
37 | {
38 | if (m_SqueezedTextCache != text()) {
39 | m_SqueezedTextCache = text();
40 | QFontMetrics fm = fontMetrics();
41 | if (fm.horizontalAdvance(m_SqueezedTextCache) > contentsRect().width()) {
42 | QString elided = fm.elidedText(text(), Qt::ElideMiddle, width());
43 | setText(elided);
44 | }
45 | }
46 | QLabel::paintEvent(event);
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/src/utils/treesortfilterproxymodel.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #include "treesortfilterproxymodel.h"
30 |
31 | TreeSortFilterProxyModel::TreeSortFilterProxyModel(QObject *parent)
32 | : QSortFilterProxyModel(parent)
33 | {
34 | setFilterCaseSensitivity(Qt::CaseInsensitive);
35 | }
36 |
37 | bool TreeSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
38 | {
39 | QModelIndex idx = sourceModel()->index(source_row, 0, source_parent);
40 | if (sourceModel()->hasChildren(idx))
41 | return true;
42 | return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/src/adblock/adblockblockednetworkreply.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef ADBLOCKBLOCKEDNETWORKREPLY_H
30 | #define ADBLOCKBLOCKEDNETWORKREPLY_H
31 |
32 | #include
33 |
34 | class AdBlockRule;
35 | class AdBlockBlockedNetworkReply : public QNetworkReply
36 | {
37 | Q_OBJECT
38 |
39 | public:
40 | AdBlockBlockedNetworkReply(const QNetworkRequest &request, const AdBlockRule *rule, QObject *parent = 0);
41 | void abort() {};
42 |
43 | protected:
44 | qint64 readData(char *data, qint64 maxSize);
45 |
46 | private slots:
47 | void delayedFinished();
48 |
49 | };
50 |
51 | #endif // ADBLOCKBLOCKEDNETWORKREPLY_H
52 |
53 |
--------------------------------------------------------------------------------
/src/qwebplugins/endorphinwebplugin.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2009, Aaron Dewes
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | * 1. Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * 2. Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * 3. Neither the name of the Aaron Dewes nor the names of its contributors
13 | * may be used to endorse or promote products derived from this software
14 | * without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 | * SUCH DAMAGE.
27 | */
28 |
29 | #ifndef ENDORPHINWEBPLUGIN_H
30 | #define ENDORPHINWEBPLUGIN_H
31 |
32 | #include
33 |
34 | class EndorphinWebPlugin
35 | {
36 |
37 | public:
38 | EndorphinWebPlugin();
39 | virtual ~EndorphinWebPlugin();
40 |
41 | virtual QWebPluginFactory::Plugin metaPlugin() = 0;
42 | virtual QWidget *create(const QString &mimeType, const QUrl &url,
43 | const QStringList &argumentNames, const QStringList &argumentValues) = 0;
44 | virtual void configure() = 0;
45 | virtual bool isAnonymous() const;
46 | };
47 |
48 | #endif // ENDORPHINWEBPLUGIN_H
49 |
50 |
--------------------------------------------------------------------------------
/autotests/searchlineedit/tst_searchlineedit.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 Aaron Dewes
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | #include
21 | #include
22 |
23 | class tst_SearchLineEdit : public QObject
24 | {
25 | Q_OBJECT
26 |
27 | public slots:
28 | void initTestCase();
29 | void cleanupTestCase();
30 | void init();
31 | void cleanup();
32 |
33 | private slots:
34 | void searchlineedit_data();
35 | void searchlineedit();
36 | };
37 |
38 | // Subclass that exposes the protected functions.
39 | class SubSearchLineEdit : public SearchLineEdit
40 | {
41 | public:};
42 |
43 | // This will be called before the first test function is executed.
44 | // It is only called once.
45 | void tst_SearchLineEdit::initTestCase()
46 | {
47 | }
48 |
49 | // This will be called after the last test function is executed.
50 | // It is only called once.
51 | void tst_SearchLineEdit::cleanupTestCase()
52 | {
53 | }
54 |
55 | // This will be called before each test function is executed.
56 | void tst_SearchLineEdit::init()
57 | {
58 | }
59 |
60 | // This will be called after every test function.
61 | void tst_SearchLineEdit::cleanup()
62 | {
63 | }
64 |
65 | void tst_SearchLineEdit::searchlineedit_data()
66 | {
67 | }
68 |
69 | void tst_SearchLineEdit::searchlineedit()
70 | {
71 | SubSearchLineEdit edit;
72 | QVERIFY(edit.clearButton() != 0);
73 | QVERIFY(edit.searchButton() != 0);
74 | }
75 |
76 | QTEST_MAIN(tst_SearchLineEdit)
77 | #include "tst_searchlineedit.moc"
78 |
79 |
--------------------------------------------------------------------------------