summaryrefslogtreecommitdiffstats
path: root/khtml/testkhtml.h
blob: 09718fdbab6b48076e52bd426f8383eab3942933 (plain)
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
#ifndef TESTKHTML_H
#define TESTKHTML_H

#include <kdebug.h>
#include <qvaluelist.h>
#include <qdatetime.h>

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

private slots:
  void slotOpenURL( const KURL &url, const KParts::URLArgs &args )
  {
    m_part->browserExtension()->setURLArgs( args );
    m_part->openURL( url );
  }
  void reload()
  {
      KParts::URLArgs args; args.reload = true;
      m_part->browserExtension()->setURLArgs( args );
      m_part->openURL( m_part->url() );
  }
  
  void toggleNavigable(bool s)
  {
      m_part->setCaretMode(s);
  }

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

  void doBenchmark();

  void handleDone();

private:
  KHTMLPart *m_part;
  QValueList<QString> filesToBenchmark;
  QMap<QString, QValueList<int> > results;
  int                 benchmarkRun;
  QTime               loadTimer;

  void nextRun();
};

#endif