<?xml version="1.0" encoding="UTF-8"?> <!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" lang="en_US" xml:lang="en_US"> <head> <title>kaddressbook: cardview.h Source File (kaddressbook)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> <style type="text/css"> <!-- hr { display: none; } #content h2 { margin-left: 0px; } table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; } td.mdRow { padding: 8px 20px; } td.md { font-weight: bold; } td.mdname1 { font-weight: bold; color: #602020; } td.mdname { font-weight: bold; color: #602020; } --> </style> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <img id="nav_header_logo_right" alt="" align="right" src="../../pimlogo.png" border="0" /> <div id="nav_header_title" align="left">KDE PIM API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_left" style="text-align: left;"> / <a href="../../">API Reference</a> / <a href=".">kaddressbook</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <h2><a name="content"></a>kaddressbook</h2> <!-- Generated by Doxygen 1.5.5 --> <h1>cardview.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> This file is part of KAddressBook.</span> <a name="l00003"></a>00003 <span class="comment"> Copyright (c) 2002 Mike Pilone <mpilone@slac.com></span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> This program is free software; you can redistribute it and/or modify</span> <a name="l00006"></a>00006 <span class="comment"> it under the terms of the GNU General Public License as published by</span> <a name="l00007"></a>00007 <span class="comment"> the Free Software 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 <span class="comment"> This program is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00013"></a>00013 <span class="comment"> GNU General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"></span> <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU General Public License</span> <a name="l00016"></a>00016 <span class="comment"> along with this program; if not, write to the Free Software</span> <a name="l00017"></a>00017 <span class="comment"> Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</span> <a name="l00018"></a>00018 <span class="comment"></span> <a name="l00019"></a>00019 <span class="comment"> As a special exception, permission is given to link this program</span> <a name="l00020"></a>00020 <span class="comment"> with any edition of Qt, and distribute the resulting executable,</span> <a name="l00021"></a>00021 <span class="comment"> without including the source code for Qt in the source distribution.</span> <a name="l00022"></a>00022 <span class="comment">*/</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#ifndef CARDVIEW_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define CARDVIEW_H</span> <a name="l00026"></a>00026 <span class="preprocessor"></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <qpair.h></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <qpoint.h></span> <a name="l00029"></a>00029 <span class="preprocessor">#include <qptrlist.h></span> <a name="l00030"></a>00030 <span class="preprocessor">#include <qrect.h></span> <a name="l00031"></a>00031 <span class="preprocessor">#include <qscrollview.h></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <qstring.h></span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="keyword">class </span>QLabel; <a name="l00035"></a>00035 <span class="keyword">class </span>QMouseEvent; <a name="l00036"></a>00036 <span class="keyword">class </span>QPainter; <a name="l00037"></a>00037 <span class="keyword">class </span>QResizeEvent; <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a>; <a name="l00040"></a>00040 <span class="keyword">class </span>CardViewItemPrivate; <a name="l00041"></a>00041 <span class="keyword">class </span>CardViewPrivate; <a name="l00042"></a>00042 <span class="keyword">class </span>CardViewTip; <a name="l00043"></a>00043 <a name="l00049"></a><a class="code" href="classCardViewItem.html">00049</a> <span class="keyword">class </span><a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> <a name="l00050"></a>00050 { <a name="l00051"></a>00051 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a>; <a name="l00052"></a>00052 <a name="l00053"></a>00053 <span class="keyword">public</span>: <a name="l00058"></a><a class="code" href="classCardViewItem.html#64edc13a210195015b47cc0a75d952a3">00058</a> <span class="keyword">typedef</span> QPair<QString, QString> <a class="code" href="classCardViewItem.html#64edc13a210195015b47cc0a75d952a3" title="A single field in the card view.">Field</a>; <a name="l00059"></a>00059 <a name="l00068"></a>00068 <a class="code" href="classCardViewItem.html#398692c20979732eb1bff3727d5dce18" title="Constructor.">CardViewItem</a>( <a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a> *parent, <span class="keyword">const</span> QString &<a class="code" href="classCardViewItem.html#0371565b6a017b095de97c647a6395f3">caption</a> = QString() ); <a name="l00069"></a>00069 <span class="keyword">virtual</span> ~<a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>(); <a name="l00070"></a>00070 <a name="l00074"></a>00074 <span class="keyword">const</span> QString &<a class="code" href="classCardViewItem.html#0371565b6a017b095de97c647a6395f3">caption</a>() <span class="keyword">const</span>; <a name="l00075"></a>00075 <a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#028494c622b5ea9c313fc23aded286c3" title="Sets the caption of the card.">setCaption</a>( <span class="keyword">const</span> QString &<a class="code" href="classCardViewItem.html#0371565b6a017b095de97c647a6395f3">caption</a> ); <a name="l00082"></a>00082 <a name="l00087"></a>00087 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#29cdded8fac77fe6e05fcd1414ed1806" title="Paints the card using the given painter and color group.">paintCard</a>( QPainter *p, QColorGroup &cg ); <a name="l00088"></a>00088 <a name="l00093"></a>00093 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#b164214eda619037be346c793a5f3e59" title="Repaints the card.">repaintCard</a>(); <a name="l00094"></a>00094 <a name="l00102"></a>00102 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#aba1c512f7d37344837853eebc148d9b" title="Adds a field to the card.">insertField</a>( <span class="keyword">const</span> QString &label, <span class="keyword">const</span> QString &value ); <a name="l00103"></a>00103 <a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#432b161dc06ef6c8a070ace5cb942bdd" title="Removes the field with label label from the card.">removeField</a>( <span class="keyword">const</span> QString &label ); <a name="l00108"></a>00108 <a name="l00112"></a>00112 QString <a class="code" href="classCardViewItem.html#95d836dca6fe2f67801ff99742edd5f3">fieldValue</a>( <span class="keyword">const</span> QString &label ) <span class="keyword">const</span>; <a name="l00113"></a>00113 <a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#5072007830e5ac381196316e26842083" title="Removes all the fields from this card.">clearFields</a>(); <a name="l00118"></a>00118 <a name="l00124"></a>00124 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardViewItem.html#0f7608325b216600e73665da5c54bae1">nextItem</a>() <span class="keyword">const</span>; <a name="l00125"></a>00125 <a name="l00129"></a>00129 <span class="keywordtype">bool</span> <a class="code" href="classCardViewItem.html#25e672791e143a906955fdb41726e41d">isSelected</a>() <span class="keyword">const</span>; <a name="l00130"></a>00130 <a name="l00136"></a>00136 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#c4014dce8e9f1d6214c79248d4ccc33e" title="Called by the parent card view when the mouse has been resting for a certain amount...">showFullString</a>( <span class="keyword">const</span> QPoint &pos, CardViewTip *tip ); <a name="l00137"></a>00137 <a name="l00143"></a>00143 <a class="code" href="classCardViewItem.html#64edc13a210195015b47cc0a75d952a3" title="A single field in the card view.">Field</a> *<a class="code" href="classCardViewItem.html#9f238dd80f7e449e2ab532bf2ee67a33">fieldAt</a>( <span class="keyword">const</span> QPoint &itempos ) <span class="keyword">const</span>; <a name="l00144"></a>00144 <a name="l00145"></a>00145 <a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a> *cardView()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mView; }; <a name="l00146"></a>00146 <a name="l00155"></a>00155 <span class="keywordtype">int</span> <a class="code" href="classCardViewItem.html#9b09c9e28c08daaef572e43cc3f3aa82">height</a>( <span class="keywordtype">bool</span> allowCache = <span class="keyword">true</span> ) <span class="keyword">const</span>; <a name="l00156"></a>00156 <a name="l00157"></a>00157 <span class="keyword">protected</span>: <a name="l00162"></a>00162 <span class="keywordtype">void</span> <a class="code" href="classCardViewItem.html#7ced93bc42ccd33d38560a9c84ff32a1" title="Sets the card as selected.">setSelected</a>( <span class="keywordtype">bool</span> selected ); <a name="l00163"></a>00163 <a name="l00164"></a>00164 <span class="keyword">private</span>: <a name="l00168"></a>00168 <span class="keywordtype">void</span> initialize(); <a name="l00169"></a>00169 <a name="l00176"></a>00176 QString trimString( <span class="keyword">const</span> QString &text, <span class="keywordtype">int</span> width, QFontMetrics &fm ) <span class="keyword">const</span>; <a name="l00177"></a>00177 <a name="l00178"></a>00178 CardViewItemPrivate *d; <a name="l00179"></a>00179 <a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a> *mView; <a name="l00180"></a>00180 }; <a name="l00181"></a>00181 <a name="l00194"></a><a class="code" href="classCardView.html">00194</a> <span class="keyword">class </span><a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a> : <span class="keyword">public</span> QScrollView <a name="l00195"></a>00195 { <a name="l00196"></a>00196 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>; <a name="l00197"></a>00197 <a name="l00198"></a>00198 Q_OBJECT <a name="l00199"></a>00199 <a name="l00200"></a>00200 <span class="keyword">public</span>: <a name="l00204"></a>00204 <a class="code" href="classCardView.html#933786f5b27e41523af8f9008bebb63d" title="Constructor.">CardView</a>( QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name ); <a name="l00205"></a>00205 <span class="keyword">virtual</span> ~<a class="code" href="classCardView.html" title="The CardView is a method of displaying data in cards.">CardView</a>(); <a name="l00206"></a>00206 <a name="l00212"></a>00212 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#bbe967566eed569899c510bfd5842ae8" title="Inserts the item into the card view.">insertItem</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ); <a name="l00213"></a>00213 <a name="l00218"></a>00218 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#9cdc6c5f34ca0484ed0afaa03b5d84c9" title="Takes the item from the view.">takeItem</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ); <a name="l00219"></a>00219 <a name="l00223"></a>00223 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#3452f30980688c339f9ff7177b2629c0" title="Clears the view and deletes all card view items.">clear</a>(); <a name="l00224"></a>00224 <a name="l00231"></a>00231 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#2c22f3dd12392c1be3f98bb85943247c">currentItem</a>() <span class="keyword">const</span>; <a name="l00232"></a>00232 <a name="l00236"></a>00236 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#58054f1d4d44c5fd5a0f3b069103173f" title="Sets the CardViewItem item to the current item in the view.">setCurrentItem</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ); <a name="l00237"></a>00237 <a name="l00242"></a>00242 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#6dd0a7e93a9664e3e340ef1f40789b24">itemAt</a>( <span class="keyword">const</span> QPoint &viewPos ) <span class="keyword">const</span>; <a name="l00243"></a>00243 <a name="l00247"></a>00247 QRect <a class="code" href="classCardView.html#105a30989da31632dda1b7f850d3e20a">itemRect</a>( <span class="keyword">const</span> <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ) <span class="keyword">const</span>; <a name="l00248"></a>00248 <a name="l00252"></a>00252 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#39b429a5dc4e6d8ab518d61411ca9505" title="Ensures that the given item is in the viewable area of the widget.">ensureItemVisible</a>( <span class="keyword">const</span> <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ); <a name="l00253"></a>00253 <a name="l00257"></a>00257 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#c91d140c9c5fb5e8540f149297debdcd" title="Repaints the given item.">repaintItem</a>( <span class="keyword">const</span> <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ); <a name="l00258"></a>00258 <a name="l00259"></a>00259 <span class="keyword">enum</span> SelectionMode { Single, Multi, Extended, NoSelection }; <a name="l00260"></a>00260 <a name="l00266"></a>00266 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#3cec31b27f9f0d744a4e75b056b4eb68" title="Sets the selection mode.">setSelectionMode</a>( SelectionMode mode ); <a name="l00267"></a>00267 <a name="l00271"></a>00271 SelectionMode <a class="code" href="classCardView.html#3bffb6eabb8b78c6982b853f966c128e">selectionMode</a>() <span class="keyword">const</span>; <a name="l00272"></a>00272 <a name="l00277"></a>00277 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#e3f1ec18cb8ea4eb6edc410f35150992" title="Selects or deselects the given item.">setSelected</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item, <span class="keywordtype">bool</span> selected ); <a name="l00278"></a>00278 <a name="l00282"></a>00282 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#af5389ae0583b606a8713afc3d2650b9" title="Selects or deselects all items.">selectAll</a>( <span class="keywordtype">bool</span> state ); <a name="l00283"></a>00283 <a name="l00287"></a>00287 <span class="keywordtype">bool</span> <a class="code" href="classCardView.html#1e6aa5285afcd2cfebd4206443314264">isSelected</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ) <span class="keyword">const</span>; <a name="l00288"></a>00288 <a name="l00294"></a>00294 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#810184e9ce06b2aa36e604a96b3dd4d5">selectedItem</a>() <span class="keyword">const</span>; <a name="l00295"></a>00295 <a name="l00301"></a>00301 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#e1cb8468fd93b84300e213760ead6208">firstItem</a>() <span class="keyword">const</span>; <a name="l00302"></a>00302 <a name="l00307"></a>00307 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#abdd5a7bac44718ac828480af3b93b0f">itemAfter</a>( <span class="keyword">const</span> <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *item ) <span class="keyword">const</span>; <a name="l00308"></a>00308 <a name="l00312"></a>00312 <span class="keywordtype">int</span> <a class="code" href="classCardView.html#bdbcc6316bd41a3761ebeaf05461fb66">childCount</a>() <span class="keyword">const</span>; <a name="l00313"></a>00313 <a name="l00323"></a>00323 <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a> *<a class="code" href="classCardView.html#4f73ad19c88c3a9d8ed8018c8c667257" title="Attempts to find the first item matching the params.">findItem</a>( <span class="keyword">const</span> QString &text, <span class="keyword">const</span> QString &label, <a name="l00324"></a>00324 Qt::StringComparisonMode compare = Qt::BeginsWith ) <span class="keyword">const</span>; <a name="l00325"></a>00325 <a name="l00333"></a>00333 uint <a class="code" href="classCardView.html#7e7fca339e4598c554d1885b31173785" title="Returns the amounts of pixels required for one column.">columnWidth</a>() <span class="keyword">const</span>; <a name="l00334"></a>00334 <a name="l00340"></a>00340 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#0a6b4fa770ead7a1ecd96a14db4f689d" title="Sets if the border around a card should be draw.">setDrawCardBorder</a>( <span class="keywordtype">bool</span> enabled ); <a name="l00341"></a>00341 <a name="l00345"></a>00345 <span class="keywordtype">bool</span> <a class="code" href="classCardView.html#c12d48ebb8c6bf0a96bcb490d80e34ee">drawCardBorder</a>() <span class="keyword">const</span>; <a name="l00346"></a>00346 <a name="l00353"></a>00353 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#05649a994b6531198935fe5142909ca5" title="Sets if the column separator should be drawn.">setDrawColSeparators</a>( <span class="keywordtype">bool</span> enabled ); <a name="l00354"></a>00354 <a name="l00358"></a>00358 <span class="keywordtype">bool</span> <a class="code" href="classCardView.html#8c9dad23a944b815ef8c2210f829eb53">drawColSeparators</a>() <span class="keyword">const</span>; <a name="l00359"></a>00359 <a name="l00366"></a>00366 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#ab0c1413c99ff2642681ed02dd396388" title="Sets if the field labels should be drawn.">setDrawFieldLabels</a>( <span class="keywordtype">bool</span> enabled ); <a name="l00367"></a>00367 <a name="l00371"></a>00371 <span class="keywordtype">bool</span> <a class="code" href="classCardView.html#5c00f680b19431240f8903969b20d0d7">drawFieldLabels</a>() <span class="keyword">const</span>; <a name="l00372"></a>00372 <a name="l00377"></a>00377 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#0d7bfc94a5d597d73846731826ee77bd" title="Sets if fields with no value should be drawn (of cause the label only, but it allows...">setShowEmptyFields</a>( <span class="keywordtype">bool</span> show ); <a name="l00378"></a>00378 <a name="l00382"></a>00382 <span class="keywordtype">bool</span> <a class="code" href="classCardView.html#f738784fb9b7ff1ea24660f26074df87">showEmptyFields</a>() <span class="keyword">const</span>; <a name="l00383"></a>00383 <a name="l00393"></a>00393 <span class="comment">// Note: I looked for a value in QStyle::PixelMetric to use, but I could</span> <a name="l00394"></a>00394 <span class="comment">// not see a useful one. One may turn up in a future version of Qt.</span> <a name="l00395"></a>00395 uint <a class="code" href="classCardView.html#bd9be4c85053fb8cae4ff262aa879137">itemMargin</a>() <span class="keyword">const</span>; <a name="l00396"></a>00396 <a name="l00400"></a>00400 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#a019a95522e6e27f83e5694be7cf5b99" title="Sets the internal item margin.">setItemMargin</a>( uint margin ); <a name="l00401"></a>00401 <a name="l00408"></a>00408 <span class="comment">// Note: There is no useful QStyle::PixelMetric to use for this atm.</span> <a name="l00409"></a>00409 <span class="comment">// An option would be using KDialog::spacingHint().</span> <a name="l00410"></a>00410 uint <a class="code" href="classCardView.html#077b6ec372d7cf0706f056d67d6c9f28">itemSpacing</a>() <span class="keyword">const</span>; <a name="l00411"></a>00411 <a name="l00416"></a>00416 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#2088587dac0249f933f7276cec225cc8" title="Sets the item spacing.">setItemSpacing</a>( uint spacing ); <a name="l00417"></a>00417 <a name="l00421"></a>00421 <span class="keywordtype">int</span> <a class="code" href="classCardView.html#1b9560c747315521b08c11a346fb6b60">itemWidth</a>() <span class="keyword">const</span>; <a name="l00422"></a>00422 <a name="l00426"></a>00426 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#c9dde4dc1c02e1001484251c8a0ccd45" title="Sets the width made available to card items.">setItemWidth</a>( <span class="keywordtype">int</span> width ); <a name="l00427"></a>00427 <a name="l00431"></a>00431 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#3a55fc60da85c5c8b0d38d1b2137893a" title="Sets the header font.">setHeaderFont</a>( <span class="keyword">const</span> QFont &fnt ); <a name="l00432"></a>00432 <a name="l00436"></a>00436 QFont <a class="code" href="classCardView.html#5238d51661390411f33bc03d7e884617">headerFont</a>() <span class="keyword">const</span>; <a name="l00437"></a>00437 <a name="l00441"></a>00441 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#c84b2e7d2dd63fa9efd0778f17906f82" title="Reimplementation from QWidget.">setFont</a>( <span class="keyword">const</span> QFont &fnt ); <a name="l00442"></a>00442 <a name="l00446"></a>00446 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#8d414938ccbe056c93947fd50f66a29c" title="Sets the column separator width.">setSeparatorWidth</a>( <span class="keywordtype">int</span> width ); <a name="l00447"></a>00447 <a name="l00451"></a>00451 <span class="keywordtype">int</span> <a class="code" href="classCardView.html#78b8e1271205f5d1438f405a4e2e7027">separatorWidth</a>() <span class="keyword">const</span>; <a name="l00452"></a>00452 <a name="l00457"></a>00457 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#375acddf0650535bdf745227098048fc" title="Sets the maximum number of lines to display pr field.">setMaxFieldLines</a>( <span class="keywordtype">int</span> howmany ); <a name="l00458"></a>00458 <a name="l00462"></a>00462 <span class="keywordtype">int</span> <a class="code" href="classCardView.html#be8ab51e96e5b36412b92db52df7a1f6">maxFieldLines</a>() <span class="keyword">const</span>; <a name="l00463"></a>00463 <a name="l00464"></a>00464 signals: <a name="l00469"></a>00469 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#bd7b7e28115979603ec526fec0769dff" title="Emitted whenever the selection changes.">selectionChanged</a>(); <a name="l00470"></a>00470 <a name="l00476"></a>00476 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#bd7b7e28115979603ec526fec0769dff" title="Emitted whenever the selection changes.">selectionChanged</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00477"></a>00477 <a name="l00481"></a>00481 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#c8a17c2f8d918370cdc3fd73b1665ee5" title="This method is emitted whenever an item is clicked.">clicked</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00482"></a>00482 <a name="l00488"></a>00488 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#6e85d31b7662315cf748d5d9158a1cef" title="Emitted whenever the user &#39;executes&#39; an item.">executed</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00489"></a>00489 <a name="l00493"></a>00493 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#6b1de93272a369b29c86ea9b580b803c" title="Emitted whenever the user double clicks on an item.">doubleClicked</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00494"></a>00494 <a name="l00498"></a>00498 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#2580cef48769536ca161ad35c977352e" title="Emitted when the current item changes.">currentChanged</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00499"></a>00499 <a name="l00503"></a>00503 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#02943e60c1d2006ecfe4c5c7ff752c93" title="Emitted when the return key is pressed in an item.">returnPressed</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>* ); <a name="l00504"></a>00504 <a name="l00508"></a>00508 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#ca0525a029b0816d83cc3d5f9fca838d" title="Emitted when the context menu is requested in some way.">contextMenuRequested</a>( <a class="code" href="classCardViewItem.html" title="Represents a single card (item) in the card view.">CardViewItem</a>*, <span class="keyword">const</span> QPoint& ); <a name="l00509"></a>00509 <a name="l00510"></a>00510 <span class="keyword">protected</span>: <a name="l00515"></a>00515 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#9538ed84df3a88ba094d0b584aad349f" title="Determines which cards intersect that region and tells them to paint themselves.">drawContents</a>( QPainter *p, <span class="keywordtype">int</span> clipx, <span class="keywordtype">int</span> clipy, <span class="keywordtype">int</span> clipw, <span class="keywordtype">int</span> cliph ); <a name="l00516"></a>00516 <a name="l00520"></a>00520 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#d4454695066322c5cfb336157f41f7b1" title="Sets the layout to dirty and repaints.">resizeEvent</a>( QResizeEvent* ); <a name="l00521"></a>00521 <a name="l00525"></a>00525 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#f48479e394200743c5e37e04eaeef56b" title="Changes the direction the canvas scolls.">contentsWheelEvent</a>( QWheelEvent* ); <a name="l00526"></a>00526 <a name="l00530"></a>00530 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#b9c0e3520b62830c594f09855c56c9d3" title="Sets the layout to dirty and calls for a repaint.">setLayoutDirty</a>( <span class="keywordtype">bool</span> dirty ); <a name="l00531"></a>00531 <a name="l00537"></a>00537 <span class="keywordtype">void</span> <a class="code" href="classCardView.html#73b3ca4524bbf4234c696f02c053b273" title="Does the math based on the bounding rect of the cards to properly lay the cards out...">calcLayout</a>(); <a name="l00538"></a>00538 <a name="l00539"></a>00539 <span class="keyword">virtual</span> <span class="keywordtype">void</span> contentsMousePressEvent( QMouseEvent* ); <a name="l00540"></a>00540 <span class="keyword">virtual</span> <span class="keywordtype">void</span> contentsMouseMoveEvent( QMouseEvent* ); <a name="l00541"></a>00541 <span class="keyword">virtual</span> <span class="keywordtype">void</span> contentsMouseReleaseEvent( QMouseEvent* ); <a name="l00542"></a>00542 <span class="keyword">virtual</span> <span class="keywordtype">void</span> contentsMouseDoubleClickEvent( QMouseEvent* ); <a name="l00543"></a>00543 <a name="l00544"></a>00544 <span class="keyword">virtual</span> <span class="keywordtype">void</span> enterEvent( QEvent* ); <a name="l00545"></a>00545 <span class="keyword">virtual</span> <span class="keywordtype">void</span> leaveEvent( QEvent* ); <a name="l00546"></a>00546 <a name="l00547"></a>00547 <span class="keyword">virtual</span> <span class="keywordtype">void</span> focusInEvent( QFocusEvent* ); <a name="l00548"></a>00548 <span class="keyword">virtual</span> <span class="keywordtype">void</span> focusOutEvent( QFocusEvent* ); <a name="l00549"></a>00549 <a name="l00550"></a>00550 <span class="keyword">virtual</span> <span class="keywordtype">void</span> keyPressEvent( QKeyEvent* ); <a name="l00551"></a>00551 <a name="l00557"></a>00557 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCardView.html#f97168b938e95736df57dbd61baaf38f" title="Overload this method to be told when a drag should be started.">startDrag</a>(); <a name="l00558"></a>00558 <a name="l00559"></a>00559 <span class="keyword">private</span> slots: <a name="l00565"></a>00565 <span class="keywordtype">void</span> tryShowFullText(); <a name="l00566"></a>00566 <a name="l00567"></a>00567 <span class="keyword">private</span>: <a name="l00574"></a>00574 <span class="keywordtype">void</span> drawRubberBands( <span class="keywordtype">int</span> pos ); <a name="l00575"></a>00575 <a name="l00576"></a>00576 CardViewPrivate *d; <a name="l00577"></a>00577 }; <a name="l00578"></a>00578 <a name="l00579"></a>00579 <span class="preprocessor">#endif</span> </pre></div></div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>kaddressbook</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classAddressEditDialog.html">addresseditdialog</option>, <option value="classAddressEditWidget.html">addresseditwidget</option>, <option value="classAddresseeUtil.html">addresseeutil</option>, <option value="classAddressTypeDialog.html">addresstypedialog</option>, <option value="classAddViewDialog.html">addviewdialog</option>, <option value="classCardView.html">cardview</option>, <option value="classCardViewItem.html">cardviewitem</option>, <option value="classCardViewLookNFeelPage.html">cardviewlooknfeelpage</option>, <option value="classConfigureCardViewWidget.html">configurecardviewwidget</option>, <option value="classConfigureTableViewWidget.html">configuretableviewwidget</option>, <option value="classDateParser.html">dateparser</option>, <option value="classDistributionListView.html">distributionlistview</option>, <option value="classDynamicTip.html">dynamictip</option>, <option value="classEmailEditWidget.html">emaileditwidget</option>, <option value="classEmailSelector.html">emailselector</option>, <option value="classFilter.html">filter</option>, <option value="classFilterSelectionWidget.html">filterselectionwidget</option>, <option value="classIMAddressLVI.html">imaddresslvi</option>, <option value="classIMAddressWidget.html">imaddresswidget</option>, <option value="classImageButton.html">imagebutton</option>, <option value="classImageLoader.html">imageloader</option>, <option value="classIMEditorWidget.html">imeditorwidget</option>, <option value="classIMEditWidget.html">imeditwidget</option>, <option value="classJumpButtonBar.html">jumpbuttonbar</option>, <option value="classKABPrinting_1_1PrintingWizard.html">kabprinting::printingwizard</option>, <option value="classKABPrinting_1_1PrintProgress.html">kabprinting::printprogress</option>, <option value="classKABPrinting_1_1PrintStyle.html">kabprinting::printstyle</option>, <option value="classKABPrinting_1_1PrintStyleFactory.html">kabprinting::printstylefactory</option>, <option value="classKAddressBookCardView.html">kaddressbookcardview</option>, <option value="classKAddressBookIconView.html">kaddressbookiconview</option>, <option value="classKAddressBookMain.html">kaddressbookmain</option>, <option value="classKAddressBookTableView.html">kaddressbooktableview</option>, <option value="classKAddressBookView.html">kaddressbookview</option>, <option value="classLookAndFeelPage.html">lookandfeelpage</option>, <option value="classNameEditDialog.html">nameeditdialog</option>, <option value="classPhoneEditWidget.html">phoneeditwidget</option>, <option value="classPhoneTypeDialog.html">phonetypedialog</option>, <option value="classTypeCombo.html">typecombo</option>, <option value="classViewConfigureWidget.html">viewconfigurewidget</option>, <option value="classViewManager.html">viewmanager</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../akregator/html/index.html">akregator</a></li><li> <a href="../../akregator/src/html/index.html">src</a></li><li> <a href="../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../certmanager/html/index.html">certmanager</a></li><li> <a href="../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../kalarm/html/index.html">kalarm</a></li><li> <a href="../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../kandy/html/index.html">kandy</a></li><li><a href="../../karm/html/index.html">karm</a></li><li><a href="../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../kgantt/html/index.html">kgantt</a></li><li><a href="../../kioslaves/html/index.html">kioslaves</a></li><li> <a href="../../kioslaves/imap4/html/index.html">imap4</a></li><li> <a href="../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../kmail/html/index.html">kmail</a></li><li><a href="../../knotes/html/index.html">knotes</a></li><li><a href="../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../kontact/html/index.html">kontact</a></li><li><a href="../../korganizer/html/index.html">korganizer</a></li><li><a href="../../kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/kpilot/html/index.html">kpilot</a></li><li> <a href="../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../libkcal/html/index.html">libkcal</a></li><li><a href="../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../libkmime/html/index.html">libkmime</a></li><li><a href="../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../libkpimidentities/html/index.html">libkpimidentities</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>