Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4f45e7bdfd4a5ff17f5f8eaab90d017f > files > 339

albumshaper-2.1-6mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AlbumShaper: ALabel.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.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>ALabel.h</h1><a href="ALabel_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 GUI_ALABEL_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define GUI_ALABEL_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a><a class="code" href="ALabel_8h.html#bbefd1951dab0ad20e6fccb31470ddb0">00014</a> <span class="preprocessor">#define APPEAR_IMMEDIATELY 1</span>
<a name="l00015"></a><a class="code" href="ALabel_8h.html#d44f3e0a4020316b55f6165febf83cec">00015</a> <span class="preprocessor"></span><span class="preprocessor">#define DISAPPEAR_IMMEDIATELY 2</span>
<a name="l00016"></a><a class="code" href="ALabel_8h.html#1673506dc1b356a6eb1842af95aec4de">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define SLIDE_IN_LEFT 3</span>
<a name="l00017"></a><a class="code" href="ALabel_8h.html#4dd1193478481952320d730df65bc522">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define SLIDE_OUT_LEFT 4</span>
<a name="l00018"></a><a class="code" href="ALabel_8h.html#c817a9654084a60cf41bfd57f1347ca3">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define SLIDE_IN_RIGHT 5</span>
<a name="l00019"></a><a class="code" href="ALabel_8h.html#896da3f3b99e5cebea0bbf01a6e0dd9c">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define SLIDE_OUT_RIGHT 6</span>
<a name="l00020"></a><a class="code" href="ALabel_8h.html#0a16979a9daa6a226072cdf1dd627172">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define FADE_TRANSITION 7</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="comment">//--------------------</span>
<a name="l00023"></a>00023 <span class="comment">//forward declarations</span>
<a name="l00024"></a>00024 <span class="keyword">class </span>QTimer;
<a name="l00025"></a>00025 <span class="keyword">class </span>QPixmap;
<a name="l00026"></a>00026 <span class="keyword">class </span>QPainter;
<a name="l00027"></a>00027 <span class="keyword">class </span>QImage;
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classAction.html">Action</a>;
<a name="l00029"></a>00029 <span class="comment">//--------------------</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;qlabel.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;qpixmap.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;qdatetime.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;qmutex.h&gt;</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">//=====================================</span>
<a name="l00037"></a><a class="code" href="classALabel.html">00037</a> <span class="keyword">class </span><a class="code" href="classALabel.html">ALabel</a> : <span class="keyword">public</span> <a class="code" href="classQLabel.html">QLabel</a>
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 Q_OBJECT
<a name="l00040"></a>00040 <span class="comment">//----------------------</span>
<a name="l00041"></a>00041 <span class="keyword">public</span>:
<a name="l00043"></a>00043   <a class="code" href="classALabel.html#21767cb3ac4a3fae8559bc6e9b422bb0" title="create the label, optionally set a hover-over image (only displayed when pixmap for...">ALabel</a>( <a class="code" href="classQWidget.html">QWidget</a> *parent=0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name=0,
<a name="l00044"></a>00044           QPixmap* <a class="code" href="classALabel.html#1afed3acdee78d6b9978b31eb6442eb0">hoverOverImage</a> = NULL,
<a name="l00045"></a>00045           <span class="keywordtype">int</span> <a class="code" href="classALabel.html#ddf78e2501ca692e462e1e0d48140cd3">setMethod</a> = <a class="code" href="ALabel_8h.html#bbefd1951dab0ad20e6fccb31470ddb0">APPEAR_IMMEDIATELY</a>,
<a name="l00046"></a>00046           <span class="keywordtype">int</span> <a class="code" href="classALabel.html#4b8b460321cfe40193bbefbe30d25773">removalMethod</a> = <a class="code" href="ALabel_8h.html#d44f3e0a4020316b55f6165febf83cec">DISAPPEAR_IMMEDIATELY</a>,
<a name="l00047"></a>00047           <span class="keywordtype">int</span> <a class="code" href="classALabel.html#fbe622a0a4835fc45b396fe13ca681c4">resetMethod</a> = <a class="code" href="ALabel_8h.html#bbefd1951dab0ad20e6fccb31470ddb0">APPEAR_IMMEDIATELY</a>,
<a name="l00048"></a>00048           <span class="keywordtype">int</span> <a class="code" href="classALabel.html#3e8967d82e7ae0333237010ebf9189ae">removalBeforeResetMethod</a> = <a class="code" href="ALabel_8h.html#d44f3e0a4020316b55f6165febf83cec">DISAPPEAR_IMMEDIATELY</a>,
<a name="l00049"></a>00049           <span class="keywordtype">int</span> <a class="code" href="classALabel.html#174267e28e6ed5203a7e4a2653b914a9">initDelay</a> = 130, <span class="keywordtype">int</span> <a class="code" href="classALabel.html#d85b7fdf8b4e8960d7fc28c42418c3b7">accel</a> = 50);
<a name="l00050"></a>00050 
<a name="l00052"></a>00052    <span class="keywordtype">void</span> <a class="code" href="classALabel.html#e28b036d2f9f34430c7935acb175f9b2" title="alter animation methods">setAnimationMethods</a>(<span class="keywordtype">int</span> <a class="code" href="classALabel.html#ddf78e2501ca692e462e1e0d48140cd3">setMethod</a> = <a class="code" href="ALabel_8h.html#bbefd1951dab0ad20e6fccb31470ddb0">APPEAR_IMMEDIATELY</a>,
<a name="l00053"></a>00053                                               <span class="keywordtype">int</span> <a class="code" href="classALabel.html#4b8b460321cfe40193bbefbe30d25773">removalMethod</a> = <a class="code" href="ALabel_8h.html#d44f3e0a4020316b55f6165febf83cec">DISAPPEAR_IMMEDIATELY</a>,
<a name="l00054"></a>00054                                               <span class="keywordtype">int</span> <a class="code" href="classALabel.html#fbe622a0a4835fc45b396fe13ca681c4">resetMethod</a> = <a class="code" href="ALabel_8h.html#bbefd1951dab0ad20e6fccb31470ddb0">APPEAR_IMMEDIATELY</a>,
<a name="l00055"></a>00055                                               <span class="keywordtype">int</span> <a class="code" href="classALabel.html#3e8967d82e7ae0333237010ebf9189ae">removalBeforeResetMethod</a> = <a class="code" href="ALabel_8h.html#d44f3e0a4020316b55f6165febf83cec">DISAPPEAR_IMMEDIATELY</a>);
<a name="l00056"></a>00056 
<a name="l00058"></a>00058   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#d513cece6e846f2bfa4261dafa270c25" title="animates setting an image">setPixmap</a> ( <span class="keyword">const</span> QPixmap &amp;p );
<a name="l00059"></a>00059 
<a name="l00061"></a>00061   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#e0b0ff246381ec3d2da4e1710ad885c1" title="animates removing an image">removePixmap</a>( <span class="keywordtype">bool</span> forceImmediate = <span class="keyword">false</span>);
<a name="l00062"></a>00062 <span class="keyword">protected</span>:
<a name="l00064"></a>00064   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#4b5e5342a755be4a087304d484668f59" title="begin animating the pixmap">animatePixmap</a>( );
<a name="l00065"></a>00065 
<a name="l00066"></a>00066   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#6b51cfa6932c782f4b8690de4820dfbe">drawContents</a>( QPainter* p);
<a name="l00067"></a>00067 
<a name="l00068"></a>00068   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#7c1865c86bd34018a58501e597ac65a3">enterEvent</a>( QEvent* e);
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#a71d088c4bf57438f5efce41b5dca09b">leaveEvent</a>( QEvent* e);
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#e4713099855cd8b881b49aa74a3a895e">mousePressEvent</a>( QMouseEvent* );
<a name="l00072"></a>00072   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#347331c6b81786c4aa8fc0d8ec6400eb">mouseReleaseEvent</a>( QMouseEvent* );
<a name="l00073"></a>00073   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#1041c132002fd39e3cae33243ee9ef4f">mouseDoubleClickEvent</a>( QMouseEvent* );
<a name="l00074"></a>00074   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#5fc6a57d365817841252737aaeb58187">mouseMoveEvent</a>( QMouseEvent* );
<a name="l00075"></a>00075 <span class="comment">//----------------------</span>
<a name="l00076"></a>00076 signals:
<a name="l00077"></a>00077   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#d8e9a088d765cd0891edbc76247ed23f">dropEventOccured</a>( QDropEvent* e);
<a name="l00078"></a>00078 
<a name="l00080"></a>00080   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#51572e5b031c5920bd51aa16078e479a" title="various mouse-click signals">mousePress</a>();
<a name="l00081"></a>00081   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#01fc3e29780921ac634a907109da9e1f">mouseRelease</a>();
<a name="l00082"></a>00082   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#20b6626110c8b117696aa2b9522baf89">mouseDoubleClick</a>();
<a name="l00083"></a>00083 
<a name="l00084"></a>00084   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#c8ff8b839e95bb6d65c42204111bc524">pixmapRemoved</a>();
<a name="l00085"></a>00085   <span class="comment">//----------------------</span>
<a name="l00086"></a>00086 <span class="keyword">private</span> slots:
<a name="l00087"></a>00087   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#60c582e9a1dc15ea5a7b90d8f0ee3a7e">animate</a>();
<a name="l00088"></a>00088 <span class="comment">//----------------------</span>
<a name="l00089"></a>00089 <span class="keyword">private</span>:
<a name="l00090"></a>00090   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#651c8d36299b54b8dfcf6f79e962c619">internalRemovePixmap</a>( <span class="keywordtype">bool</span> forceImmediate = <span class="keyword">false</span> );
<a name="l00091"></a>00091   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#c711e9c362e6238140901b2484af76c5">internalSetPixmap</a> ( <span class="keyword">const</span> QPixmap &amp;p );
<a name="l00092"></a>00092   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#bb3821f5ac45bbcc83de76917fa9aced">appendJob</a>(QPixmap* pix);
<a name="l00093"></a>00093   <span class="keywordtype">void</span> <a class="code" href="classALabel.html#0acc9eaa85ba021c4ec64643238248bc">cleanStack</a>();
<a name="l00094"></a>00094 
<a name="l00095"></a>00095   <span class="comment">//actual and reset images</span>
<a name="l00096"></a><a class="code" href="classALabel.html#c7b9a04391a84acca817821b5d7163c0">00096</a>   QImage *<a class="code" href="classALabel.html#8ccdcc503a0667059d1639e776a64bc3">pixStore</a>, *<a class="code" href="classALabel.html#c7b9a04391a84acca817821b5d7163c0">resetPixStore</a>;
<a name="l00097"></a>00097 
<a name="l00098"></a>00098   <span class="comment">//method for removing old images when doing a set</span>
<a name="l00099"></a><a class="code" href="classALabel.html#ddf78e2501ca692e462e1e0d48140cd3">00099</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#ddf78e2501ca692e462e1e0d48140cd3">setMethod</a>;
<a name="l00100"></a><a class="code" href="classALabel.html#4b8b460321cfe40193bbefbe30d25773">00100</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#4b8b460321cfe40193bbefbe30d25773">removalMethod</a>;
<a name="l00101"></a><a class="code" href="classALabel.html#3e8967d82e7ae0333237010ebf9189ae">00101</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#3e8967d82e7ae0333237010ebf9189ae">removalBeforeResetMethod</a>;
<a name="l00102"></a><a class="code" href="classALabel.html#fbe622a0a4835fc45b396fe13ca681c4">00102</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#fbe622a0a4835fc45b396fe13ca681c4">resetMethod</a>;
<a name="l00103"></a>00103 
<a name="l00104"></a>00104   <span class="comment">//specs for ongoing animation</span>
<a name="l00105"></a><a class="code" href="classALabel.html#9f010c671684da8df1f2067dde4dca58">00105</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#174267e28e6ed5203a7e4a2653b914a9">initDelay</a>, <a class="code" href="classALabel.html#d85b7fdf8b4e8960d7fc28c42418c3b7">accel</a>, <a class="code" href="classALabel.html#9f010c671684da8df1f2067dde4dca58">minDelay</a>, <a class="code" href="classALabel.html#84ad85c2db700e863a1e38fc4f37f2b0">delay</a>, <a class="code" href="classALabel.html#6af5eb58060fe9358077c9524e93c200">animationType</a>;
<a name="l00106"></a><a class="code" href="classALabel.html#dfcdcb6249b52d4deed81b6a0f7cfecc">00106</a>   <span class="keywordtype">int</span> <a class="code" href="classALabel.html#dfcdcb6249b52d4deed81b6a0f7cfecc">step</a>;
<a name="l00107"></a>00107 
<a name="l00108"></a>00108   <span class="comment">//timer and time variables for ongoing animation</span>
<a name="l00109"></a><a class="code" href="classALabel.html#ffc12f483c48df5442bd51a5c78211a0">00109</a>   QTimer* <a class="code" href="classALabel.html#ffc12f483c48df5442bd51a5c78211a0">timer</a>;
<a name="l00110"></a><a class="code" href="classALabel.html#3f864720636b3415e2528c006574ce58">00110</a>   QTime <a class="code" href="classALabel.html#3f864720636b3415e2528c006574ce58">lastTime</a>, <a class="code" href="classALabel.html#b0258575e0d934dc98fbab45dce79ded">currentTime</a>;
<a name="l00111"></a>00111 
<a name="l00112"></a>00112   <span class="comment">//should hover-over image be drawn on repaint?</span>
<a name="l00113"></a><a class="code" href="classALabel.html#f257a16dae693ae2a48bf38e45775db4">00113</a>   <span class="keywordtype">bool</span> <a class="code" href="classALabel.html#f257a16dae693ae2a48bf38e45775db4">drawHoverOverImage</a>;
<a name="l00114"></a><a class="code" href="classALabel.html#176f0374dab1b864c6c1c2000048d858">00114</a>   QRect <a class="code" href="classALabel.html#176f0374dab1b864c6c1c2000048d858">hoverOverRect</a>;
<a name="l00115"></a>00115 
<a name="l00116"></a>00116   <span class="comment">//hover-overimage</span>
<a name="l00117"></a><a class="code" href="classALabel.html#1afed3acdee78d6b9978b31eb6442eb0">00117</a>   QPixmap* <a class="code" href="classALabel.html#1afed3acdee78d6b9978b31eb6442eb0">hoverOverImage</a>;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119   <span class="comment">//is picture fully shown?</span>
<a name="l00120"></a><a class="code" href="classALabel.html#2c5ef597bba9b08e6da10120d1106901">00120</a>   <span class="keywordtype">bool</span> <a class="code" href="classALabel.html#2c5ef597bba9b08e6da10120d1106901">imageShown</a>;
<a name="l00121"></a>00121 
<a name="l00122"></a>00122   <span class="comment">//is hand cursor shown?</span>
<a name="l00123"></a><a class="code" href="classALabel.html#16f832228320a74807c86f5c7be61ef2">00123</a>   <span class="keywordtype">bool</span> <a class="code" href="classALabel.html#16f832228320a74807c86f5c7be61ef2">handCursorShown</a>;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <span class="comment">//are we animating?</span>
<a name="l00126"></a><a class="code" href="classALabel.html#3c55b4007622c20f83312cf6c6ea8b3d">00126</a>   <span class="keywordtype">bool</span> <a class="code" href="classALabel.html#3c55b4007622c20f83312cf6c6ea8b3d">animating</a>;
<a name="l00127"></a><a class="code" href="classALabel.html#7f1cd01fb7ff36446e39ad87a06d73d1">00127</a>   QMutex <a class="code" href="classALabel.html#7f1cd01fb7ff36446e39ad87a06d73d1">animatingBoolMutex</a>;
<a name="l00128"></a>00128 
<a name="l00129"></a>00129   <span class="comment">//are we preforming a reset action?</span>
<a name="l00130"></a><a class="code" href="classALabel.html#658b85e1fb54fa5a245fc0a5eaca7226">00130</a>   <span class="keywordtype">bool</span> <a class="code" href="classALabel.html#658b85e1fb54fa5a245fc0a5eaca7226">resettingImage</a>;
<a name="l00131"></a>00131 
<a name="l00132"></a>00132   <span class="comment">//queue of actions</span>
<a name="l00133"></a><a class="code" href="classALabel.html#09557139cb6c21aee817c225018c715d">00133</a>   <a class="code" href="classAction.html">Action</a>* <a class="code" href="classALabel.html#09557139cb6c21aee817c225018c715d">delayedActionHead</a>;
<a name="l00134"></a><a class="code" href="classALabel.html#64f79a789781472e8f36cd0f4f9e1b74">00134</a>   <a class="code" href="classAction.html">Action</a>* <a class="code" href="classALabel.html#64f79a789781472e8f36cd0f4f9e1b74">delayedActionTail</a>;
<a name="l00135"></a><a class="code" href="classALabel.html#b6943bc74f2ddea434043029b56762e3">00135</a>   QMutex <a class="code" href="classALabel.html#b6943bc74f2ddea434043029b56762e3">queueMutex</a>;
<a name="l00136"></a>00136 <span class="comment">//----------------------</span>
<a name="l00137"></a>00137 };
<a name="l00138"></a>00138 <span class="comment">//======================</span>
<a name="l00139"></a>00139 
<a name="l00140"></a>00140 
<a name="l00141"></a>00141 <span class="comment">//======================</span>
<a name="l00142"></a><a class="code" href="classAction.html">00142</a> <span class="keyword">class </span><a class="code" href="classAction.html">Action</a>
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144   <span class="keyword">public</span>:
<a name="l00145"></a>00145     <a class="code" href="classAction.html#1d160338dd9c97f6f6e490dba9ac1d29">Action</a>(QPixmap* <a class="code" href="classAction.html#826873c4a0a1e8b9fd6ba446172a99ca">image</a>);
<a name="l00146"></a>00146     <a class="code" href="classAction.html#cdb06775d157339256a8ecd55749226c">~Action</a>();
<a name="l00147"></a>00147     <a class="code" href="classAction.html">Action</a>* <a class="code" href="classAction.html#2e2a261f879932d799fb313293fc08c0">getNext</a>();
<a name="l00148"></a>00148     <span class="keywordtype">void</span> <a class="code" href="classAction.html#f8e93ae897472985d95cc7237416a378">setNext</a>( <a class="code" href="classAction.html">Action</a>* <a class="code" href="classAction.html#b8f3bf08dea3b7b2c1545d8ca073d221">next</a>);
<a name="l00149"></a>00149     QPixmap* <a class="code" href="classAction.html#fbdbfc210cdb86393fe71e398d428b80">getImage</a>();
<a name="l00150"></a>00150 
<a name="l00151"></a>00151   <span class="keyword">private</span>:
<a name="l00152"></a><a class="code" href="classAction.html#826873c4a0a1e8b9fd6ba446172a99ca">00152</a>     QPixmap* image;
<a name="l00153"></a><a class="code" href="classAction.html#b8f3bf08dea3b7b2c1545d8ca073d221">00153</a>     <a class="code" href="classAction.html">Action</a>* next;
<a name="l00154"></a>00154 };
<a name="l00155"></a>00155 <span class="comment">//======================</span>
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="preprocessor">#endif //GUI_ALABEL_H</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:24 2009 for AlbumShaper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>