[poppler] poppler/qt4/src: poppler-document.cc, 1.6,
1.7 poppler-qt4.h, 1.6, 1.7
Brad Hards
bradh at freedesktop.org
Fri Jul 8 07:15:14 EST 2005
Update of /cvs/poppler/poppler/qt4/src
In directory gabe:/tmp/cvs-serv17780/qt4/src
Modified Files:
poppler-document.cc poppler-qt4.h
Log Message:
Add support for page layout to the Qt4 bindings, plus
test cases.
Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-document.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- poppler-document.cc 7 Jul 2005 11:04:08 -0000 1.6
+++ poppler-document.cc 7 Jul 2005 21:15:09 -0000 1.7
@@ -112,6 +112,28 @@
}
}
+ Document::PageLayout Document::pageLayout(void) const
+ {
+ switch (m_doc->doc.getCatalog()->getPageLayout()) {
+ case Catalog::pageLayoutNone:
+ return NoLayout;
+ case Catalog::pageLayoutSinglePage:
+ return SinglePage;
+ case Catalog::pageLayoutOneColumn:
+ return OneColumn;
+ case Catalog::pageLayoutTwoColumnLeft:
+ return TwoColumnLeft;
+ case Catalog::pageLayoutTwoColumnRight:
+ return TwoColumnRight;
+ case Catalog::pageLayoutTwoPageLeft:
+ return TwoPageLeft;
+ case Catalog::pageLayoutTwoPageRight:
+ return TwoPageRight;
+ default:
+ return NoLayout;
+ }
+ }
+
int Document::numPages() const
{
return m_doc->doc.getNumPages();
Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- poppler-qt4.h 7 Jul 2005 11:04:08 -0000 1.6
+++ poppler-qt4.h 7 Jul 2005 21:15:09 -0000 1.7
@@ -176,7 +176,7 @@
public:
/**
- The mode
+ The page mode
*/
enum PageMode {
UseNone, ///< No mode - neither document outline nor thumbnail images are visible
@@ -188,6 +188,19 @@
};
/**
+ The page layout
+ */
+ enum PageLayout {
+ NoLayout, ///< Layout not specified
+ SinglePage, ///< Display a single page
+ OneColumn, ///< Display a single column of pages
+ TwoColumnLeft, ///< Display the pages in two columns, with odd-numbered pages on the left
+ TwoColumnRight, ///< Display the pages in two columns, with odd-numbered pages on the right
+ TwoPageLeft, ///< Display the pages two at a time, with odd-numbered pages on the left
+ TwoPageRight, ///< Display the pages two at a time, with odd-numbered pages on the right
+ };
+
+ /**
Load the document from a file on disk
\param filePath the name (and path, if required) of the file to load
@@ -223,11 +236,20 @@
int numPages() const;
/**
- The type of mode that is in use
+ The type of mode that should be used by the application
+ when the document is opened. Note that while this is
+ called page mode, it is really viewer application mode.
*/
PageMode pageMode() const;
/**
+ The layout that pages should be shown in when the document
+ is first opened. This basically describes how pages are
+ shown relative to each other.
+ */
+ PageLayout pageLayout() const;
+
+ /**
Provide the passwords required to unlock the document
*/
bool unlock(const QByteArray &ownerPassword, const QByteArray &userPassword);
More information about the poppler
mailing list