<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>AlbumShaper: photo.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>photo.h</h1><a href="photo_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==============================================</span> <a name="l00002"></a>00002 <span class="comment">// copyright : (C) 2003-2005 by Will Stokes</span> <a name="l00003"></a>00003 <span class="comment">//==============================================</span> <a name="l00004"></a>00004 <span class="comment">// This program is free software; you can redistribute it </span> <a name="l00005"></a>00005 <span class="comment">// and/or modify it under the terms of the GNU General </span> <a name="l00006"></a>00006 <span class="comment">// Public License as published by the Free Software </span> <a name="l00007"></a>00007 <span class="comment">// Foundation; either version 2 of the License, or </span> <a name="l00008"></a>00008 <span class="comment">// (at your option) any later version. </span> <a name="l00009"></a>00009 <span class="comment">//==============================================</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="preprocessor">#ifndef BACKEND_PHOTO_H</span> <a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define BACKEND_PHOTO_H</span> <a name="l00013"></a>00013 <span class="preprocessor"></span> <a name="l00014"></a>00014 <span class="comment">//define image sizes</span> <a name="l00015"></a><a class="code" href="photo_8h.html#a1259ae2a7668f5c45cf9e24c3c56753f">00015</a> <span class="preprocessor">#define THUMBNAIL 1</span> <a name="l00016"></a><a class="code" href="photo_8h.html#ad20c60d32b71736c1b8f53462ddffaa0">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define SLIDESHOW 2</span> <a name="l00017"></a><a class="code" href="photo_8h.html#a017d6ce632ee1f531f9dbb5b55ee0492">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define IMAGE 3</span> <a name="l00018"></a>00018 <span class="preprocessor"></span> <a name="l00019"></a>00019 <span class="comment">//TODO: remove this include</span> <a name="l00020"></a>00020 <span class="comment">//this is a temporary hack, I the enum for photo transofmrations need to be revealed</span> <a name="l00021"></a>00021 <span class="comment">//to all classes that include photo.h becaue one private function uses thsi enum, DAMN</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="imageTools_8h.html">tools/imageTools.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="comment">//--------------------</span> <a name="l00025"></a>00025 <span class="comment">//forward declarations</span> <a name="l00026"></a>00026 <span class="keyword">class </span>QString; <a name="l00027"></a>00027 <span class="keyword">class </span>QPixmap; <a name="l00028"></a>00028 <span class="keyword">class </span>QImage; <a name="l00029"></a>00029 <span class="keyword">class </span>QDomNode; <a name="l00030"></a>00030 <span class="keyword">class </span>QDateTime; <a name="l00031"></a>00031 <span class="keyword">class </span><a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>; <a name="l00032"></a>00032 <span class="comment">//--------------------</span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="comment">//=====================================</span> <a name="l00039"></a>00039 <span class="comment"></span><span class="comment">//=====================================</span> <a name="l00040"></a>00040 <a name="l00041"></a><a class="code" href="classPhoto.html">00041</a> <span class="keyword">class </span><a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a> <a name="l00042"></a>00042 { <a name="l00043"></a>00043 <span class="comment">//------------------------------------------------------</span> <a name="l00044"></a>00044 <span class="keyword">public</span>: <a name="l00046"></a>00046 <a class="code" href="classPhoto.html#a33eea102dcc5f39222ea11618f9b93c1" title="Sets default information.">Photo</a>(<a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* <a class="code" href="classPhoto.html#a1274dccc0e1deef5dcb25b45a4bda5d1" title="Subalbum photo is in.">subalbum</a>, <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classPhoto.html#a6d8d3898cc546889f7c0213b8bc3051a" title="Pointer to prev photo.">prev</a>, <span class="keywordtype">int</span> photoNumber); <a name="l00047"></a>00047 <a name="l00048"></a>00048 <a class="code" href="classPhoto.html#adc366234be6226600360c7cbba8e7fcf">~Photo</a>(); <a name="l00049"></a>00049 <span class="comment">//----------------------------</span> <a name="l00051"></a>00051 <span class="comment"></span> QImage* <a class="code" href="classPhoto.html#a96dcf5c6210ca39c534ae2287be1df90" title="Gets thumbnail image.">getThumbnailImage</a>(); <a name="l00052"></a>00052 <a name="l00056"></a>00056 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#af4d602874536f89799f828abd2a34848" title="Construct thumbnail and slideshow images, load up thumbnail image, and set photo...">constructSmallerImages</a>(); <a name="l00057"></a>00057 <a name="l00060"></a>00060 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a29e2aae62991d904c3cb763ec838d9bd" title="Setup photo using preexisting full size, slideshow, and thumbnail images.">setImage</a>(QString imageName, <a name="l00061"></a>00061 QString slideshowName, <a name="l00062"></a>00062 QString thumbnailName); <a name="l00063"></a>00063 <a name="l00065"></a>00065 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a29e2aae62991d904c3cb763ec838d9bd" title="Setup photo using preexisting full size, slideshow, and thumbnail images.">setImage</a>(QString imageName, <span class="keywordtype">int</span> uniqueID); <a name="l00066"></a>00066 <a name="l00069"></a>00069 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a29e2aae62991d904c3cb763ec838d9bd" title="Setup photo using preexisting full size, slideshow, and thumbnail images.">setImage</a>(QString editedImageFilename); <a name="l00070"></a>00070 <span class="comment">//------------------------------------------</span> <a name="l00072"></a>00072 <span class="comment"></span> QString <a class="code" href="classPhoto.html#a5ebb6fccddd609df5d407498957e1089" title="Gets the image filename.">getImageFilename</a>(); <a name="l00073"></a>00073 <a name="l00075"></a>00075 QString <a class="code" href="classPhoto.html#ad16ff6833a7ddc4340d7c296e2eeac99" title="Gets the slideshow filename.">getSlideshowFilename</a>(); <a name="l00076"></a>00076 <a name="l00078"></a>00078 QString <a class="code" href="classPhoto.html#a937a069696ef937d5ddd030b16946ded" title="Gets the thumbnail filename.">getThumbnailFilename</a>(); <a name="l00079"></a>00079 <span class="comment">//---------------------------- </span> <a name="l00081"></a>00081 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#ace2956fdb7c227242265e30fca8247e2" title="Sets the image filename.">setImageFilename</a>(QString val); <a name="l00082"></a>00082 <a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#ab583bd230c73111707224cbe973263b7" title="Sets the slideshow filename.">setSlideshowFilename</a>(QString val); <a name="l00085"></a>00085 <a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a8c9ab31a5158bb44e9d8b972c12ff0f9" title="Sets the thumbnail filename.">setThumbnailFilename</a>(QString val); <a name="l00088"></a>00088 <span class="comment">//---------------------------- </span> <a name="l00090"></a>00090 <span class="comment"></span> QString <a class="code" href="classPhoto.html#abc9851216524158d20580556219424a7" title="Get image checksum.">getImageChecksum</a>(); <a name="l00091"></a>00091 <a name="l00093"></a>00093 QString <a class="code" href="classPhoto.html#a580439da79d239dba26e6f21abadbaf4" title="Get thumbanil checksum.">getThumbnailChecksum</a>(); <a name="l00094"></a>00094 <a name="l00096"></a>00096 QString <a class="code" href="classPhoto.html#ab4adadc959070279d7ab7dfc1a030c23" title="Get thumbanil checksum.">getSlideshowChecksum</a>(); <a name="l00097"></a>00097 <a name="l00099"></a>00099 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#ae79da2eb5300276a3b1d7f5649316f7a" title="Update image checksum.">setImageChecksum</a>(QString val); <a name="l00100"></a>00100 <a name="l00102"></a>00102 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a191bff87fa41c0f77409a0a5e25c8d1e" title="Update thumbnail checksum.">setThumbnailChecksum</a>(QString val); <a name="l00103"></a>00103 <a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a054e5a51249e511536d6549099c617bf" title="Update slideshow checksum.">setSlideshowChecksum</a>(QString val); <a name="l00106"></a>00106 <span class="comment">//------------------------------------------</span> <a name="l00108"></a>00108 <span class="comment"></span> QString <a class="code" href="classPhoto.html#adb7ed08547098feeaff5753f2600f4bc" title="Gets the description.">getDescription</a>(); <a name="l00109"></a>00109 <a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#ab9460c196309be9f0084bbeb91ac04c6" title="Sets the description.">setDescription</a>(QString val); <a name="l00112"></a>00112 <span class="comment">//---------------------------- </span> <a name="l00114"></a>00114 <span class="comment"></span> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classPhoto.html#a9740a1e6a5ad83534e1c3b2b2622cf7a" title="Returns the previous photo pointer.">getPrev</a>(); <a name="l00115"></a>00115 <a name="l00117"></a>00117 <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classPhoto.html#a357f9d79451532a37f41142d3aaba9f9" title="Returns next photo pointer.">getNext</a>(); <a name="l00118"></a>00118 <a name="l00120"></a>00120 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a7ee24d63bde8307b79829737dfa2cd8f" title="Sets prev photo pointer.">setPrev</a>(<a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* val); <a name="l00121"></a>00121 <a name="l00123"></a>00123 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a6f4cb7532382e6d58daeb0163166e1e4" title="Sets next photo pointer.">setNext</a>(<a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* val); <a name="l00124"></a>00124 <span class="comment">//---------------------------- </span> <a name="l00126"></a>00126 <span class="comment"></span> QDateTime* <a class="code" href="classPhoto.html#a175031feb8124b3aa22d6145cd45cf4f" title="Builds photo from XML DOM node, returns date modified info from xml.">importFromDisk</a>(QDomNode* root); <a name="l00127"></a>00127 <a name="l00129"></a>00129 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a32cb80c04e59656420094311ad6d9c20" title="Exports photo to xml.">exportToXML</a>(QTextStream& stream); <a name="l00130"></a>00130 <span class="comment">//------------------------------------------</span> <a name="l00132"></a>00132 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a39ddcbbd8582b87b505f83826f03597c" title="Rotates image clockwise 90 degrees.">rotate90</a>(); <a name="l00133"></a>00133 <a name="l00135"></a>00135 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a0150c65533eb7ef04412ab7aed2b3c7b" title="Rotates image clockwise 270 degrees.">rotate270</a>(); <a name="l00136"></a>00136 <a name="l00138"></a>00138 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#abb2cdbd79d85cc30ffc22af5eaf9796c" title="Flips image about horizontal axis.">flipHorizontally</a>(); <a name="l00139"></a>00139 <a name="l00141"></a>00141 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a8db049b5515cd7364742905ead2e60a5" title="Flips image about vertical axis.">flipVertically</a>(); <a name="l00142"></a>00142 <a name="l00144"></a>00144 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a37663feecba1823f08b177fd6c9fdf9d" title="Apply transformation.">applyTransformation</a>(<a class="code" href="imageTools_8h.html#ad6b8916a355278afb7cd35f14afc9288">TRANSFORM_CODE</a> transformation); <a name="l00145"></a>00145 <span class="comment">//------------------------------------------</span> <a name="l00147"></a>00147 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a25ceab66d0421b4305c0475372140d81" title="Returns if the image needs to be saved to its permament location.">getNeedsSavingVal</a>(); <a name="l00148"></a>00148 <a name="l00150"></a>00150 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a869d215db9d16aad336e2823927c3e84" title="Sets if the image needs to be saved to its permanent location.">setNeedsSavingVal</a>(<span class="keywordtype">bool</span> val); <a name="l00151"></a>00151 <span class="comment">//------------------------------------------</span> <a name="l00153"></a>00153 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a6626ec8af77a3804f1127ab85295e9e8" title="Returns if the image has ever been saved to a permanant location.">getEverSaved</a>(); <a name="l00154"></a>00154 <a name="l00156"></a>00156 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a60408934b0cb03ad0ad359ab1b5393a3" title="sets everSaved">setEverSaved</a>(<span class="keywordtype">bool</span> val); <a name="l00157"></a>00157 <span class="comment">//------------------------------------------</span> <a name="l00159"></a>00159 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#ae50ed3a18f16735fcdade8f6f3f35488" title="revert photo to original form">revertPhoto</a>(); <a name="l00160"></a>00160 <a name="l00162"></a>00162 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#acf93c6065bb708320e7c675068e0b3d0" title="can photo be reverted to a differnt original form">revertPossible</a>(); <a name="l00163"></a>00163 <a name="l00165"></a>00165 <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a03dbeca8e03ab6e7d37d5b015e173bd3" title="was the photo recently reverted? if so ignore the presence of orig files on disk">getRecentlyReverted</a>(); <a name="l00166"></a>00166 <a name="l00168"></a>00168 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a313c0cdae1171955581fb976609014bd" title="reset the recently reverted value to val">setRecentlyReverted</a>(<span class="keywordtype">bool</span> val); <a name="l00169"></a>00169 <a name="l00171"></a>00171 QString <a class="code" href="classPhoto.html#a6a4cd6dfc1b78fa3b1c1661a59f71162" title="orig filename">originalImageFilename</a>(); <a name="l00172"></a>00172 <span class="comment">//------------------------------------------</span> <a name="l00174"></a>00174 <span class="comment"></span> <span class="keywordtype">int</span> <a class="code" href="classPhoto.html#a9c95d4244d694b03981ca4fce6f9e95f" title="Returns initial photo number.">getInitialPhotoNumber</a>(); <a name="l00175"></a>00175 <a name="l00177"></a>00177 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a8d404398640e4db5545f6a81af5b8e46" title="Sets initial photo number.">setInitialPhotoNumber</a>(<span class="keywordtype">int</span> val); <a name="l00178"></a>00178 <a name="l00180"></a>00180 <span class="keywordtype">int</span> <a class="code" href="classPhoto.html#a8801fb425f8dea9372fd95b875043186" title="Returns initial subalbum number.">getInitialSubalbumNumber</a>(); <a name="l00181"></a>00181 <a name="l00183"></a>00183 <span class="keywordtype">void</span> <a class="code" href="classPhoto.html#a5e68573a73d1b2315db2c3cc2b53b2f1" title="Sets initial subalbum number.">setInitialSubalbumNumber</a>(<span class="keywordtype">int</span> val); <a name="l00184"></a>00184 <span class="comment">//------------------------------------------------------</span> <a name="l00185"></a>00185 <span class="keyword">private</span>: <a name="l00187"></a><a class="code" href="classPhoto.html#a1274dccc0e1deef5dcb25b45a4bda5d1">00187</a> <a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* subalbum; <a name="l00188"></a>00188 <a name="l00190"></a><a class="code" href="classPhoto.html#a6d8d3898cc546889f7c0213b8bc3051a">00190</a> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* prev; <a name="l00191"></a>00191 <a name="l00193"></a><a class="code" href="classPhoto.html#a8fd5de011a756f9974e9cd1f458e2678">00193</a> <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* <a class="code" href="classPhoto.html#a8fd5de011a756f9974e9cd1f458e2678" title="Pointer to next photo.">next</a>; <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="comment">//Initial photo number</span> <a name="l00196"></a><a class="code" href="classPhoto.html#ac12f1ae514759507c64feba1a918ac36">00196</a> <span class="keywordtype">int</span> <a class="code" href="classPhoto.html#ac12f1ae514759507c64feba1a918ac36">initialPhotoNumber</a>; <a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="comment">//Initial subalbum number</span> <a name="l00199"></a><a class="code" href="classPhoto.html#aaa2e2bea26ea53212d76ec17dc4e04bc">00199</a> <span class="keywordtype">int</span> <a class="code" href="classPhoto.html#aaa2e2bea26ea53212d76ec17dc4e04bc">initialSubalbumNumber</a>; <a name="l00200"></a>00200 <a name="l00202"></a><a class="code" href="classPhoto.html#a6fe05dc549b7caf2ee3232476d41e760">00202</a> QString <a class="code" href="classPhoto.html#a6fe05dc549b7caf2ee3232476d41e760" title="Photo description.">description</a>; <a name="l00203"></a>00203 <a name="l00205"></a><a class="code" href="classPhoto.html#adee2a5bb92cbc903f3574d952c622867">00205</a> QImage* <a class="code" href="classPhoto.html#adee2a5bb92cbc903f3574d952c622867" title="Thumbnail Image.">thumbnailImage</a>; <a name="l00206"></a>00206 <a name="l00208"></a><a class="code" href="classPhoto.html#aae2a02758b56abaa759057e7ee21f9b5">00208</a> QString <a class="code" href="classPhoto.html#aae2a02758b56abaa759057e7ee21f9b5" title="Filenames.">imageLocation</a>; <a name="l00209"></a><a class="code" href="classPhoto.html#acfe4c2b45cf6b5b5a24cbbc85ea609ed">00209</a> QString <a class="code" href="classPhoto.html#acfe4c2b45cf6b5b5a24cbbc85ea609ed">slideshowLocation</a>; <a name="l00210"></a><a class="code" href="classPhoto.html#a875ec0737b03198d51dc2e47380dd213">00210</a> QString <a class="code" href="classPhoto.html#a875ec0737b03198d51dc2e47380dd213">thumbnailLocation</a>; <a name="l00211"></a>00211 <a name="l00213"></a><a class="code" href="classPhoto.html#aa3f68b264dc2e072e651331b9de6aed0">00213</a> QString <a class="code" href="classPhoto.html#aa3f68b264dc2e072e651331b9de6aed0" title="MD5 checksums, used to determine if image/thumbnail have been changed.">imageChecksum</a>; <a name="l00214"></a><a class="code" href="classPhoto.html#a8cb3aa1eaaf8f0f14d626b475b21f465">00214</a> QString <a class="code" href="classPhoto.html#a8cb3aa1eaaf8f0f14d626b475b21f465">slideshowChecksum</a>; <a name="l00215"></a><a class="code" href="classPhoto.html#a4c418b827ae16ec1e96a6f1d0f1c84dd">00215</a> QString <a class="code" href="classPhoto.html#a4c418b827ae16ec1e96a6f1d0f1c84dd">thumbnailChecksum</a>; <a name="l00216"></a>00216 <a name="l00218"></a><a class="code" href="classPhoto.html#ac53f4bdf11a948daef3c1a300668d331">00218</a> <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#ac53f4bdf11a948daef3c1a300668d331" title="Unsaved modifications?">needsSaving</a>; <a name="l00219"></a>00219 <a name="l00221"></a><a class="code" href="classPhoto.html#a441a3e1ea66da5e86fa02ecf7d41c09d">00221</a> <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#a441a3e1ea66da5e86fa02ecf7d41c09d" title="Has the photo ever been saved?">everSaved</a>; <a name="l00222"></a>00222 <a name="l00225"></a><a class="code" href="classPhoto.html#ab0cffd8b36cb5a5b18d4543dfe69046b">00225</a> <span class="keywordtype">bool</span> <a class="code" href="classPhoto.html#ab0cffd8b36cb5a5b18d4543dfe69046b" title="Has the photo recently been reverted to it&#39;s original form? If so during the...">recentlyReverted</a>; <a name="l00226"></a>00226 <span class="comment">//------------------------------------------------------</span> <a name="l00227"></a>00227 }; <a name="l00228"></a>00228 <a name="l00229"></a>00229 <span class="preprocessor">#endif //BACKEND_PHOTO_H</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>