File: testkhtml.h

package info (click to toggle)
khtml 5.103.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 38,192 kB
  • sloc: cpp: 202,858; ansic: 2,829; perl: 2,317; yacc: 1,497; python: 339; sh: 108; makefile: 7
file content (62 lines) | stat: -rw-r--r-- 1,222 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef TESTKHTML_H
#define TESTKHTML_H

#include <QDebug>
#include <khtml_part.h>
#include <QList>
#include <QMap>
#include <QElapsedTimer>

/**
 * @internal
 */
class Dummy : public QObject
{
    Q_OBJECT
public:
    Dummy(KHTMLPart *part) : QObject(part)
    {
        m_part = part;
    }

private Q_SLOTS:
    void slotOpenURL(const QUrl &url, const KParts::OpenUrlArguments &args, const KParts::BrowserArguments &browserArgs)
    {
        m_part->setArguments(args);
        m_part->browserExtension()->setBrowserArguments(browserArgs);
        m_part->openUrl(url);
    }
    void reload()
    {
        KParts::OpenUrlArguments args;
        args.setReload(true);
        m_part->setArguments(args);
        m_part->openUrl(m_part->url());
    }

    void toggleNavigable(bool s)
    {
        m_part->setCaretMode(s);
    }

    void toggleEditable(bool s)
    {
        qDebug() << "editable: " << s;
        m_part->setEditable(s);
    }

    void doBenchmark();

    void handleDone();

    void nextRun();
private:
    KHTMLPart *m_part;
    QList<QString> filesToBenchmark;
    QMap<QString, QList<int> > results;
    int                 benchmarkRun;
    QElapsedTimer               loadTimer;

};

#endif