• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
scripter.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008 by Pino Toscano <pino@kde.org> *
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 
10 #include "scripter.h"
11 
12 #include <kdebug.h>
13 
14 #include "debug_p.h"
15 #include "script/executor_kjs_p.h"
16 
17 using namespace Okular;
18 
19 class Okular::ScripterPrivate
20 {
21  public:
22  ScripterPrivate( DocumentPrivate *doc )
23  : m_doc( doc ), m_kjs( 0 )
24  {
25  }
26 
27  ~ScripterPrivate()
28  {
29  delete m_kjs;
30  }
31 
32  DocumentPrivate *m_doc;
33  ExecutorKJS *m_kjs;
34 };
35 
36 Scripter::Scripter( DocumentPrivate *doc )
37  : d( new ScripterPrivate( doc ) )
38 {
39 }
40 
41 Scripter::~Scripter()
42 {
43  delete d;
44 }
45 
46 QString Scripter::execute( ScriptType type, const QString &script )
47 {
48  kDebug(OkularDebug) << "executing the script:";
49 #if 0
50  if ( script.length() < 1000 )
51  qDebug() << script;
52  else
53  qDebug() << script.left( 1000 ) << "[...]";
54 #endif
55  switch ( type )
56  {
57  case JavaScript:
58  if ( !d->m_kjs )
59  {
60  d->m_kjs = new ExecutorKJS( d->m_doc );
61  }
62  d->m_kjs->execute( script );
63  break;
64  }
65  return QString();
66 }
Okular::Scripter::execute
QString execute(ScriptType type, const QString &script)
Definition: scripter.cpp:46
debug_p.h
Okular::JavaScript
JavaScript code.
Definition: global.h:78
executor_kjs_p.h
Okular::ScriptType
ScriptType
Describes the possible script types.
Definition: global.h:76
OkularDebug
#define OkularDebug
Definition: debug_p.h:13
Okular::DocumentPrivate
Definition: document_p.h:83
Okular::Scripter::~Scripter
~Scripter()
Definition: scripter.cpp:41
Okular::ExecutorKJS
Definition: executor_kjs_p.h:20
scripter.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal