Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 6282078ae76a671f49c6af38c67b1a07 > files > 1337

kdelibs-devel-2.2.2-49.2mdk.i586.rpm

<HTML>
<HEAD>
<TITLE>class KURLComboBox</TITLE>

<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
	<TABLE BORDER="0">
		<TR><TD valign="top" align="left" cellspacing="10">
		<h1>class KURLComboBox</h1>
		</TD>
		<TD valign="top" align="right" colspan="1">A ComboBox showing a number of recent URLs/directories. <small><A HREF="#longdesc">More...</A></small></TD></TR>
	</TABLE>
	<HR>
	<TABLE BORDER="0">
		<TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="kurlcombobox_h.html">kurlcombobox.h</A>&gt;</code></TD></TR>
<TR><TH>Inherits</TH><TD><A HREF="../kdeui/KComboBox.html">KComboBox</A> <small>(kdeui)</small> <small>[public ]</small></TD></TR>
<TR><TH><A HREF="full-list-KURLComboBox.html">List of all Methods</A></TH></TR>
	</TABLE>
	</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Types</h4><ul><LI>enum <A HREF="#ref1">Mode</A> { Files = -1, Directories = 1, Both = 0 }
</LI>
<LI>enum <A HREF="#ref2">OverLoadResolving</A> { RemoveTop, RemoveBottom }
</LI>
</ul><h4>Public Methods</h4><ul><LI>&nbsp;<b><A HREF="#ref3">KURLComboBox</A></b> ( Mode mode, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const char *name=0 ) 
</LI>
<LI>&nbsp;<b><A HREF="#ref4">KURLComboBox</A></b> ( Mode mode, bool rw, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const char *name=0 ) 
</LI>
<LI>&nbsp;<b><A HREF="#ref5">~KURLComboBox</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref6">setURL</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref7">setURLs</A></b> ( <A HREF="#QStringList">QStringList</A> urls ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref8">setURLs</A></b> ( <A HREF="#QStringList">QStringList</A> urls, OverLoadResolving remove ) 
</LI>
<LI><A HREF="#QStringList">QStringList</A> &nbsp;<b><A HREF="#ref9">urls</A></b> ()  const
</LI>
<LI>void &nbsp;<b><A HREF="#ref10">setMaxItems</A></b> ( int ) 
</LI>
<LI>int &nbsp;<b><A HREF="#ref11">maxItems</A></b> ()  const
</LI>
<LI>void &nbsp;<b><A HREF="#ref12">addDefaultURL</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& text = QString::null ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref13">addDefaultURL</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pix,
			const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& text = QString::null ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref14">setDefaults</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref15">removeURL</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, bool checkDefaultURLs = true ) 
</LI>
</ul><h4>Signals</h4><ul><LI>void &nbsp;<b><A HREF="#ref16">urlActivated</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url ) 
</LI>
</ul><h4>Protected Types</h4><ul><LI>struct <A HREF="KURLComboBox___KURLComboItem.html">_KURLComboItem</A>
</LI>
<LI>typedef _KURLComboItem  <A HREF="#ref19">KURLComboItem</A>
</LI>
</ul><h4>Protected Methods</h4><ul><LI>void &nbsp;<b><A HREF="#ref23">init</A></b> ( Mode mode ) 
</LI>
<LI>void &nbsp;<b><A HREF="#ref24">insertURLItem</A></b> ( const KURLComboItem * ) 
</LI>
<LI><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A> &nbsp;<b><A HREF="#ref25">getPixmap</A></b> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url )  const
</LI>
<LI>void &nbsp;<b><A HREF="#ref26">updateItem</A></b> ( const KURLComboItem *item, int index, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pix) 
</LI>
</ul><h4>Protected Slots</h4><ul><LI>void &nbsp;<b><A HREF="#ref17">slotActivated</A></b> ( int ) 
</LI>
</ul><h4>Protected Members</h4><ul><LI>QList<KURLComboItem> <b><A HREF="#ref20">itemList</A></b></LI>
<LI>QList<KURLComboItem> <b><A HREF="#ref21">defaultList</A></b></LI>
<LI>QMap<int,const KURLComboItem*> <b><A HREF="#ref22">itemMapper</A></b></LI>
<LI>QPixmap <b><A HREF="#ref27">opendirPix</A></b></LI>
<LI>int <b><A HREF="#ref28">firstItemIndex</A></b></LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
 This combobox shows a number of recent URLs/directories, as well as some
 default directories.
 It will manage the default dirs root-directory, home-directory and
 Desktop-directory, as well as a number of URLs set via <A HREF="KURLComboBox.html#setURLs">setURLs</A>()
 and one additional entry to be set via <A HREF="KURLComboBox.html#setURL">setURL</A>().
</p>
<p></p>
<A NAME="Mode"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>Mode</strong> { Files = -1, Directories = 1, Both = 0 }
</td><td align="right"><h3><strong>Mode</strong></h3></td></tr></table><p></p><A NAME="OverLoadResolving"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>OverLoadResolving</strong> { RemoveTop, RemoveBottom }
</td><td align="right"><h3><strong>OverLoadResolving</strong></h3></td></tr></table><p></p><p>
 This Enumeration is used in <A HREF="KURLComboBox.html#setURL">setURL</A>() to determine which items
 will be removed when the given list is larger than <A HREF="KURLComboBox.html#maxItems">maxItems</A>().
</p>
<p></p>

<ul>
<li>RemoveTop means that items will be removed from top
</li>
<li>RemoveBottom means, that items will be removed from the bottom
     </li>
</ul>

<p>
</p>
<A NAME="KURLComboBox"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KURLComboBox</strong> ( Mode mode, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const char *name=0 )
<br></td><td align="right"><h3><strong>KURLComboBox</strong></h3></td></tr></table><p></p><p>
 Constructs a KURLComboBox.
</p>

<ul>
<li>Files  all inserted URLs will be treated as files, therefore the
            url shown in the combo will never show a trailing /
            the icon will be the one associated with the file's mimetype.
</li>
<li>Directories  all inserted URLs will be treated as directories, will
                  have a trailing slash in the combobox. The current
                  directory will show the "open folder" icon, other
                  directories the "folder" icon.
</li>
<li>Both  Don't mess with anything, just show the url as given.
     </li>
</ul>

<p>
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>mode</i></TD><TD align="left" valign="top">is either Files, Directories or Both and controls the
 following behavior:
</TD></TR>
</TABLE></P>
<A NAME="KURLComboBox"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KURLComboBox</strong> ( Mode mode, bool rw, <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const char *name=0 )
<br></td><td align="right"><h3><strong>KURLComboBox</strong></h3></td></tr></table><p></p><A NAME="~KURLComboBox"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>~KURLComboBox</strong> ()
<br></td><td align="right"><h3><strong>~KURLComboBox</strong></h3></td></tr></table><p></p><A NAME="setURL"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>setURL</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url )
<br></td><td align="right"><h3><strong>setURL</strong></h3></td></tr></table><p></p><p>
 Sets the current url. This combo handles exactly one url additionally
 to the default items and those set via <A HREF="KURLComboBox.html#setURLs">setURLs</A>(). So you can call
 setURL() as often as you want, it will always replace the previous one
 set via setURL().
 If <code>url</code> is already in the combo, the last item will stay there
 and the existing item becomes the current item.
 The current item will always have the open-directory-pixmap as icon.
</p>
<p> Note that you won't receive any signals, e.g. textChanged(),
 returnPressed() or activated() upon calling this method.
     </p>
<A NAME="setURLs"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>setURLs</strong> ( <A HREF="#QStringList">QStringList</A> urls )
<br></td><td align="right"><h3><strong>setURLs</strong></h3></td></tr></table><p></p><p>
 Inserts <code>urls</code> into the combobox below the "default urls" (see
 <A HREF="KURLComboBox.html#addDefaultURL">addDefaultURL</A>).
</p>
<p> If the list of urls contains more items than maxItems, the first items
 will be stripped.
     </p>
<A NAME="setURLs"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>setURLs</strong> ( <A HREF="#QStringList">QStringList</A> urls, OverLoadResolving remove )
<br></td><td align="right"><h3><strong>setURLs</strong></h3></td></tr></table><p></p><p>
 Inserts <code>urls</code> into the combobox below the "default urls" (see
 <A HREF="KURLComboBox.html#addDefaultURL">addDefaultURL</A>).
</p>
<p> If the list of urls contains more items than maxItems, the <code>remove</code>
 parameter determines whether the first or last items will be stripped.
     </p>
<A NAME="urls"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="#QStringList">QStringList</A> &nbsp;<strong>urls</strong> ()
<br></td><td align="right"><h3><strong>urls</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
</p>
<p><b>Returns</b>: a list of all urls currently handled. The list contains at most
 <A HREF="KURLComboBox.html#maxItems">maxItems</A>() items.
 Use this to save the list of urls in a config-file and reinsert them
 via <A HREF="KURLComboBox.html#setURLs">setURLs</A>() next time.
 Note that all default urls set via <A HREF="KURLComboBox.html#addDefaultURL">addDefaultURL</A>() are not
 returned, they will automatically be set via setURLs() or setURL().
 You will always get fully qualified urls, i.e. with protocol like
 file:/
     </p>
<A NAME="setMaxItems"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>setMaxItems</strong> ( int )
<br></td><td align="right"><h3><strong>setMaxItems</strong></h3></td></tr></table><p></p><p>
 Sets how many items should be handled and displayed by the combobox.
</p>
<p><b>See also</b>: <A HREF="KURLComboBox.html#maxItems">maxItems</A></p>
<A NAME="maxItems"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>int &nbsp;<strong>maxItems</strong> ()
<br></td><td align="right"><h3><strong>maxItems</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
</p>
<p><b>Returns</b>: the maximum of items the combobox handles.
</p>
<p><b>See also</b>: <A HREF="KURLComboBox.html#setMaxItems">setMaxItems</A></p>
<A NAME="addDefaultURL"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>addDefaultURL</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& text = QString::null )
<br></td><td align="right"><h3><strong>addDefaultURL</strong></h3></td></tr></table><p></p><p>
 Adds a url that will always be shown in the combobox, it can't be
 "rotated away". Default urls won't be returned in <A HREF="KURLComboBox.html#urls">urls</A>() and don't
 have to be set via <A HREF="KURLComboBox.html#setURLs">setURLs</A>().
 If you want to specify a special pixmap, use the overloaded method with
 the pixmap parameter.
 Default URLs will be inserted into the combobox by <A HREF="KURLComboBox.html#setDefaults">setDefaults</A>()
     </p>
<A NAME="addDefaultURL"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>addDefaultURL</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pix,
			const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A>& text = QString::null )
<br></td><td align="right"><h3><strong>addDefaultURL</strong></h3></td></tr></table><p></p><p>
 Adds a url that will always be shown in the combobox, it can't be
 "rotated away". Default urls won't be returned in <A HREF="KURLComboBox.html#urls">urls</A>() and don't
 have to be set via <A HREF="KURLComboBox.html#setURLs">setURLs</A>().
 If you don't need to specify a pixmap, use the overloaded method without
 the pixmap parameter.
 Default URLs will be inserted into the combobox by <A HREF="KURLComboBox.html#setDefaults">setDefaults</A>()
     </p>
<A NAME="setDefaults"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>setDefaults</strong> ()
<br></td><td align="right"><h3><strong>setDefaults</strong></h3></td></tr></table><p></p><p>
 Clears all items and inserts the default urls into the combo. Will be
 called implicitly upon the first call to <A HREF="KURLComboBox.html#setURLs">setURLs</A>() or <A HREF="KURLComboBox.html#setURL">setURL</A>()
</p>
<p><b>See also</b>: <A HREF="KURLComboBox.html#addDefaultURL">addDefaultURL</A></p>
<A NAME="removeURL"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>removeURL</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url, bool checkDefaultURLs = true )
<br></td><td align="right"><h3><strong>removeURL</strong></h3></td></tr></table><p></p><p>
 Removes any occurence of <code>url</code>. If <code>checkDefaultURLs</code> is false
 default-urls won't be removed.
     </p>
<A NAME="urlActivated"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>urlActivated</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url )
<br></td><td align="right"><h3><strong>urlActivated</strong></h3></td></tr></table><p> <small>[signal]</small></p><p>
 emitted when an item was clicked at
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>url</i></TD><TD align="left" valign="top">is the url of the now current item. If it is a local url,
 it won't have a protocol (file:/), otherwise it will.
     </TD></TR>
</TABLE></P>
<A NAME="slotActivated"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>slotActivated</strong> ( int )
<br></td><td align="right"><h3><strong>slotActivated</strong></h3></td></tr></table><p> <small>[protected slots slot]</small></p><A NAME="KURLComboBox___KURLComboItem.html"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>_KURLComboItem</strong> <small>(struct)</small></td><td align="right"><h3><strong>_KURLComboItem</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="KURLComboItem"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td>typedef _KURLComboItem  <strong>KURLComboItem</strong></td><td align="right"><h3><strong>KURLComboItem</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="itemList"></A><A NAME="ref20"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qlist.html">QList</A><KURLComboItem>  <strong>itemList</strong>
</td><td align="right"><h3><strong>itemList</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="defaultList"></A><A NAME="ref21"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qlist.html">QList</A><KURLComboItem>  <strong>defaultList</strong>
</td><td align="right"><h3><strong>defaultList</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="itemMapper"></A><A NAME="ref22"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qmap.html">QMap</A><int,const KURLComboItem*>  <strong>itemMapper</strong>
</td><td align="right"><h3><strong>itemMapper</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="init"></A><A NAME="ref23"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>init</strong> ( Mode mode )
<br></td><td align="right"><h3><strong>init</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="insertURLItem"></A><A NAME="ref24"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>insertURLItem</strong> ( const KURLComboItem * )
<br></td><td align="right"><h3><strong>insertURLItem</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="getPixmap"></A><A NAME="ref25"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A> &nbsp;<strong>getPixmap</strong> ( const <A HREF="../kdecore/KURL.html">KURL</A>& url )
<br></td><td align="right"><h3><strong>getPixmap</strong></h3></td></tr></table><p> <small>[protected const]</small></p><p>
 Uses KMimeType::pixmapForURL() to return a proper pixmap for <code>url</code>.
 In directory mode, a folder icon is always returned.
     </p>
<A NAME="updateItem"></A><A NAME="ref26"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>updateItem</strong> ( const KURLComboItem *item, int index, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>& pix)
<br></td><td align="right"><h3><strong>updateItem</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
 Updates <code>item</code> with <code>pixmap</code> and sets the url instead of the text
 of the KURLComboItem.
 Also works around a Qt bug.
     </p>
<A NAME="opendirPix"></A><A NAME="ref27"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qpixmap.html">QPixmap</A>  <strong>opendirPix</strong>
</td><td align="right"><h3><strong>opendirPix</strong></h3></td></tr></table><p> <small>[protected]</small></p><A NAME="firstItemIndex"></A><A NAME="ref28"></A><table width="100%"><tr bgcolor="#eeeeee"><td>int  <strong>firstItemIndex</strong>
</td><td align="right"><h3><strong>firstItemIndex</strong></h3></td></tr></table><p> <small>[protected]</small></p><HR><UL><LI><i>Author</i>: Carsten Pfeiffer <pfeiffer@kde.org>
 </LI><LI><i>Generated</i>: qateam on updates.mandrakesoft.com on Mon Dec 30 16:09:22 2002, using kdoc 2.0a53.</LI></UL></BODY></HTML>