<?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" xml:lang="en"> <head> <title>Akonadi.Entity</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="../common/doxygen.css" /> <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" /> </head> <body> <div id="container"> <div id="header"> <div id="header_top"> <div> <div> <img alt ="" src="../common/top-kde.jpg"/> KDE 4.4 PyKDE API Reference </div> </div> </div> <div id="header_bottom"> <div id="location"> <ul> <li>KDE's Python API</li> </ul> </div> <div id="menu"> <ul> <li><a href="../modules.html">Overview</a></li> <li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li> <li><a href="http://kde.org/family/">Sitemap</a></li> <li><a href="http://kde.org/contact/">Contact Us</a></li> </ul> </div> </div> </div> <div id="body_wrapper"> <div id="body"> <div id="right"> <div class="content"> <div id="main"> <div class="clearer"> </div> <h1>Entity Class Reference</h1> <code>from PyKDE4.akonadi import *</code> <p> Subclasses: <a href="../akonadi/Akonadi.Collection.html">Akonadi.Collection</a>, <a href="../akonadi/Akonadi.Item.html">Akonadi.Item</a><br /> Namespace: Akonadi.Entity<br /> <h2>Detailed Description</h2> <p>The base class for Item and Collection. </p> <p> Entity is the common base class for Item and Collection that provides unique IDs and attributes handling. </p> <p> This class is not meant to be used directly, use Item or Collection instead. </p> <p> <dl class="author" compact><dt><b>Author:</b></dt><dd> Tobias Koenig <tokoe@kde.org> </dd></dl> </p> <table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#CreateOption">CreateOption</a> </td><td class="memItemRight" valign="bottom">{ AddIfMissing }</td></tr> <tr><td colspan="2"><br><h2>Methods</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#Entity">__init__</a> (self, <a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> other)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#addAttribute">addAttribute</a> (self, <a href="../akonadi/Akonadi.Attribute.html">Akonadi.Attribute</a> attribute)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../akonadi/Akonadi.Attribute.html">Akonadi.Attribute</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#attribute">attribute</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../akonadi/Akonadi.Attribute.List.html">Akonadi.Attribute.List</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#attributes">attributes</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#clearAttributes">clearAttributes</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#hasAttribute">hasAttribute</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../akonadi/Akonadi.Entity.Id.html">Akonadi.Entity.Id</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#id">id</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isValid">isValid</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator !=">operator !=</a> (self, <a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> other)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#operator ==">operator ==</a> (self, <a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> other)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../akonadi/Akonadi.Collection.html">Akonadi.Collection</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#parentCollection">parentCollection</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#remoteId">remoteId</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeAttribute">removeAttribute</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setId">setId</a> (self, <a href="../akonadi/Akonadi.Entity.Id.html">Akonadi.Entity.Id</a> identifier)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setParentCollection">setParentCollection</a> (self, <a href="../akonadi/Akonadi.Collection.html">Akonadi.Collection</a> parent)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setRemoteId">setRemoteId</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> id)</td></tr> </table> <hr><h2>Method Documentation</h2><a class="anchor" name="Entity"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> </td> <td class="paramname"><em>other</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Creates an entity from an <b>other</b> entity. </p></div></div><a class="anchor" name="addAttribute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> addAttribute</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Attribute.html">Akonadi.Attribute</a> </td> <td class="paramname"><em>attribute</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Adds an attribute to the entity. </p> <p> If an attribute of the same type name already exists, it is deleted and replaced with the new one. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>attribute</em> </td><td> The new attribute. </td></tr> </table></dl> <p> <dl class="note" compact><dt><b>Note:</b></dt><dd> The entity takes the ownership of the attribute. </dd></dl> </p></div></div><a class="anchor" name="attribute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../akonadi/Akonadi.Attribute.html">Akonadi.Attribute</a> attribute</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Returns the attribute of the requested type or 0 if it is not available. </p></div></div><a class="anchor" name="attributes"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../akonadi/Akonadi.Attribute.List.html">Akonadi.Attribute.List</a> attributes</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns a list of all attributes of the entity. </p></div></div><a class="anchor" name="clearAttributes"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> clearAttributes</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Removes and deletes all attributes of the entity. </p></div></div><a class="anchor" name="hasAttribute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool hasAttribute</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Returns whether the entity has an attribute of the requested type. </p></div></div><a class="anchor" name="id"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../akonadi/Akonadi.Entity.Id.html">Akonadi.Entity.Id</a> id</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns the unique identifier of the entity. </p></div></div><a class="anchor" name="isValid"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool isValid</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns whether the entity is valid. </p></div></div><a class="anchor" name="operator !="></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool operator !=</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> </td> <td class="paramname"><em>other</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Returns whether the entity's id does not equal the id of the <b>other</b> entity. </p></div></div><a class="anchor" name="operator =="></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool operator ==</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Entity.html">Akonadi.Entity</a> </td> <td class="paramname"><em>other</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Returns whether the entity's id equals the id of the <b>other</b> entity. </p></div></div><a class="anchor" name="parentCollection"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../akonadi/Akonadi.Collection.html">Akonadi.Collection</a> parentCollection</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns a reference to the parent collection of this object. <dl class="note" compact><dt><b>Note:</b></dt><dd> This will of course only return a useful value if it was explictly retrieved from the Akonadi server. </dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.4 </dd></dl> </p></div></div><a class="anchor" name="remoteId"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> remoteId</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>Returns the remote id of the entity. </p></div></div><a class="anchor" name="removeAttribute"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> removeAttribute</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qbytearray.html">QByteArray</a> </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Removes and deletes the attribute of the requested type. </p></div></div><a class="anchor" name="setId"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setId</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Entity.Id.html">Akonadi.Entity.Id</a> </td> <td class="paramname"><em>identifier</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the unique <b>identifier</b> of the entity. </p></div></div><a class="anchor" name="setParentCollection"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setParentCollection</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../akonadi/Akonadi.Collection.html">Akonadi.Collection</a> </td> <td class="paramname"><em>parent</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Set the parent collection of this object. <dl class="note" compact><dt><b>Note:</b></dt><dd> Calling this method has no immediate effect for the object itself, such as being moved to another collection. It is mainly relevant to provide a context for RID-based operations inside resources. </dd></dl> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>parent</em> </td><td> The parent collection. </td></tr> </table></dl> <p> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.4 </dd></dl> </p></div></div><a class="anchor" name="setRemoteId"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"> setRemoteId</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td> <td class="paramname"><em>id</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Sets the remote <b>id</b> of the entity. </p></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="CreateOption"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr><td class="memname">CreateOption</td> </tr> </table> </div> <div class="memdoc"><p>Describes the options that can be passed to access attributes. </p><dl compact><dt><b>Enumerator: </b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>AddIfMissing</em> </td><td></table> </dl> </div></div><p> </div> </div> </div> <div id="left"> <div class="menu_box"> <div class="nav_list"> <ul> <li><a href="../allclasses.html">Full Index</a></li> </ul> </div> <a name="cp-menu" /><div class="menutitle"><div> <h2 id="cp-menu-project">Modules</h2> </div></div> <div class="nav_list"> <ul><li><a href="../akonadi/index.html">akonadi</a></li> <li><a href="../dnssd/index.html">dnssd</a></li> <li><a href="../kdecore/index.html">kdecore</a></li> <li><a href="../kdeui/index.html">kdeui</a></li> <li><a href="../khtml/index.html">khtml</a></li> <li><a href="../kio/index.html">kio</a></li> <li><a href="../knewstuff/index.html">knewstuff</a></li> <li><a href="../kparts/index.html">kparts</a></li> <li><a href="../kutils/index.html">kutils</a></li> <li><a href="../nepomuk/index.html">nepomuk</a></li> <li><a href="../phonon/index.html">phonon</a></li> <li><a href="../plasma/index.html">plasma</a></li> <li><a href="../polkitqt/index.html">polkitqt</a></li> <li><a href="../solid/index.html">solid</a></li> <li><a href="../soprano/index.html">soprano</a></li> </ul></div></div> </div> </div> <div class="clearer"/> </div> <div id="end_body"></div> </div> <div id="footer"><div id="footer_text"> This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br /> KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" 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> </body> </html>