]> www.fi.muni.cz Git - evince.git/blobdiff - pdf/xpdf/PDFDoc.h
Synched with Xpdf 0.92
[evince.git] / pdf / xpdf / PDFDoc.h
index b978bc7df1ed373d8c8b9e28532ed8ce600da537..e679db9795edec920d234882c4ce902da48b732f 100644 (file)
 
 #include <stdio.h>
 #include "Link.h"
+#include "Catalog.h"
+#include "Page.h"
 
 class GString;
 class BaseStream;
 class XRef;
-class Catalog;
 class OutputDev;
 class Links;
 class LinkAction;
@@ -32,8 +33,8 @@ class LinkDest;
 class PDFDoc {
 public:
 
-  PDFDoc(GString *fileName1);
-  PDFDoc(BaseStream *str);
+  PDFDoc(GString *fileName1, GString *userPassword = NULL);
+  PDFDoc(BaseStream *str, GString *userPassword = NULL);
   ~PDFDoc();
 
   // Was PDF document successfully opened?
@@ -45,6 +46,9 @@ public:
   // Get catalog.
   Catalog *getCatalog() { return catalog; }
 
+  // Get base stream.
+  BaseStream *getBaseStream() { return str; }
+
   // Get page parameters.
   double getPageWidth(int page)
     { return catalog->getPage(page)->getWidth(); }
@@ -57,12 +61,12 @@ public:
   int getNumPages() { return catalog->getNumPages(); }
 
   // Display a page.
-  void displayPage(OutputDev *out, int page, int zoom, int rotate,
-                  GBool doLinks);
+  void displayPage(OutputDev *out, int page, double zoom,
+                  int rotate, GBool doLinks);
 
   // Display a range of pages.
   void displayPages(OutputDev *out, int firstPage, int lastPage,
-                   int zoom, int rotate);
+                   int zoom, int rotate, GBool doLinks);
 
   // Find a page, given its object ID.  Returns page number, or 0 if
   // not found.
@@ -83,25 +87,34 @@ public:
   // Is the file encrypted?
   GBool isEncrypted() { return xref->isEncrypted(); }
 
-  // Are printing and copying allowed?  If not, print an error message.
+  // Check various permissions.
   GBool okToPrint() { return xref->okToPrint(); }
+  GBool okToChange() { return xref->okToChange(); }
   GBool okToCopy() { return xref->okToCopy(); }
+  GBool okToAddNotes() { return xref->okToAddNotes(); }
+
+  // Is this document linearized?
+  GBool isLinearized();
 
   // Return the document's Info dictionary (if any).
   Object *getDocInfo(Object *obj) { return xref->getDocInfo(obj); }
 
+  // Return the PDF version specified by the file.
+  double getPDFVersion() { return pdfVersion; }
+
   // Save this file with another name.
   GBool saveAs(GString *name);
 
 private:
 
-  GBool setup();
+  GBool setup(GString *userPassword);
   void checkHeader();
-  void getLinks(int page);
+  void getLinks(Page *page);
 
   GString *fileName;
   FILE *file;
   BaseStream *str;
+  double pdfVersion;
   XRef *xref;
   Catalog *catalog;
   Links *links;