node-pdfutils
PdfController.h
1 /*
2  * PdfController.h
3  * Copyright (C) 2014 tox <tox@rootkit>
4  *
5  * Distributed under terms of the MIT license.
6  */
7 
8 #ifndef PDFCONTROLLER_H
9 #define PDFCONTROLLER_H
10 
11 #include "PdfEngine.h"
12 #include <node.h>
13 #include <nan.h>
14 #include <v8.h>
15 #include "PdfDocument.h"
16 
17 class PdfEngine;
23 class PdfController : public node::ObjectWrap {
24 protected:
29  _engine = NULL;
30  }
31  ~PdfController();
32 
33  void set(v8::Handle<v8::Object> obj, const char key[], const char* value);
34  void set(v8::Handle<v8::Object> obj, const char key[], const int value);
35  void set(v8::Handle<v8::Object> obj, const char key[], const double value);
36  void set(v8::Handle<v8::Object> obj, const char key[], const bool value);
37 
38 private:
39  PdfEngine *_engine;
40 
41 public:
45  virtual void toJs() = 0;
49  virtual void fromJs() = 0;
53  PdfEngine *engine();
54 
58  void setEngine(PdfEngine *engine);
59 };
60 
61 #endif /* !PDFCONTROLLER_H */
virtual void toJs()=0
writes state of this object to a JS-Object
virtual void fromJs()=0
reads state of this object from a JS-Object
PdfController()
Constructor for v8.
Definition: PdfController.h:28
void setEngine(PdfEngine *engine)
sets engine which is used for this document
Definition: PdfController.cpp:19
PdfEngine * engine()
engine which is used for this document
Definition: PdfController.cpp:15
Base Class for interaction with a PDF-Engine such as Poppler.
Definition: PdfEngine.h:38
Class representation of a PDF-Controller.
Definition: PdfController.h:23