1 /* 2 dspdfviewer - Dual Screen PDF Viewer for LaTeX-Beamer 3 Copyright (C) 2012 Danny Edel <mail@danny-edel.de> 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License along 16 with this program; if not, write to the Free Software Foundation, Inc., 17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 */ 19 20 21 #ifndef RENDERINGIDENTIFIER_H 22 #define RENDERINGIDENTIFIER_H 23 #include "pagepart.h" 24 #include <qglobal.h> 25 #include <qsize.h> 26 #include <QString> 27 28 class RenderingIdentifier 29 { 30 private: 31 unsigned thePageNumber; 32 PagePart thePagePart; 33 QSize theRequestedPageSize; 34 35 public: 36 /* 37 * 38 * This will be set and checked by PDFRenderFactory 39 */ 40 quint64 theVersion; 41 42 RenderingIdentifier(unsigned pagenum, PagePart pagepart, QSize requestedPageSize); 43 unsigned pageNumber() const; 44 PagePart pagePart() const; 45 QSize requestedPageSize() const; 46 47 bool operator == (const RenderingIdentifier& other) const; 48 49 #if 0 50 /** Cast to a string that is usable as a hash identifier **/ 51 operator QString() const; 52 #endif 53 }; 54 55 /** Hashes this object to something useable in the cache */ 56 uint qHash(const RenderingIdentifier& ri); 57 58 /** allow outputting a rendering identifier */ 59 QDebug operator << ( QDebug, const RenderingIdentifier&); 60 61 #endif // RENDERINGIDENTIFIER_H 62