plugininterface.html

来自「qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人」· HTML 代码 · 共 326 行 · 第 1/2 页

HTML
326
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/edba/dist/qtopia/main-Sunday/qtopia/src/qtopiadesktop/doc/plugin.doc:1 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>PluginInterface Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="200" align="left" valign="top"><a href="index.html"><img height="27" width="472" src="dochead.png" border="0"></a><br><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qtopia</font>   <a href="index.html">Home</a> - <a href="qtopiaclasses.html">Classes</a> - <a href="qtopiaannotated.html">Annotated</a> - <a href="qtopiafunctions.html">Functions</a> - <a href="qtindex.html">Qt Embedded</a></td><td align="right" valign="top">  <table border="0" cellpadding="0" cellspacing="0" width="137">  <tr>  <td><a href="http://www.trolltech.com/company/about/trolls.html"><img height="100" width="100" src="face.png" border="0"></a></td>  <td><img height="100" width="100" src="qtlogo.png" align="top" border="0"></td>  </tr>  </table></td></tr></table><h1 align=center>PluginInterface Class Reference</h1><p>The PluginInterface class provides an interface for QtopiaDesktop's GUI plugins.<a href="#details">More...</a><p><tt>#include &lt;<a href="plugin-h.html">interfaces/plugin.h</a>&gt;</tt><p><a href="plugininterface-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn>virtual void <a href="#init"><b>init</b></a> ( CenterInterface&nbsp;*&nbsp;iface, QMainWindow&nbsp;*&nbsp;mainwindow ) = 0</div></li><li><div class=fn>virtual void <a href="#cleanup"><b>cleanup</b></a> () = 0</div></li><li><div class=fn>enum <a href="#Section-enum"><b>Section</b></a> { Applications, Games, Settings, Documents }</div></li><li><div class=fn>virtual int <a href="#section"><b>section</b></a> () = 0</div></li><li><div class=fn>virtual QPixmap <a href="#icon"><b>icon</b></a> () = 0</div></li><li><div class=fn>virtual QWidget * <a href="#view"><b>view</b></a> ( QWidget&nbsp;*&nbsp;parent ) = 0</div></li><li><div class=fn>virtual SettingsWidget * <a href="#settings"><b>settings</b></a> ( QWidget&nbsp;*&nbsp;parent ) = 0</div></li><li><div class=fn>virtual QPtrList&lt;Action&gt; <a href="#actionList"><b>actionList</b></a> () = 0</div></li><li><div class=fn>virtual QString <a href="#uiDescription"><b>uiDescription</b></a> () = 0</div></li><li><div class=fn>virtual QString <b>picsPathName</b> () const = 0</div></li><li><div class=fn>virtual MergeInterface * <a href="#mergeInterface"><b>mergeInterface</b></a> () = 0</div></li><li><div class=fn>virtual void <a href="#receivedQCopMessage"><b>receivedQCopMessage</b></a> ( const QString &amp;, const QByteArray &amp; ) = 0</div></li><li><div class=fn>virtual void <a href="#connected"><b>connected</b></a> ( int&nbsp;pdaMajorVersion, int&nbsp;pdaMinorVersion, const&nbsp;QString&nbsp;&amp;&nbsp;arch ) = 0</div></li><li><div class=fn>virtual void <a href="#disconnected"><b>disconnected</b></a> () = 0</div></li><li><div class=fn>virtual void <a href="#categoriesChanged"><b>categoriesChanged</b></a> () = 0</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2> The PluginInterface class provides an interface for QtopiaDesktop's GUI plugins.<p> A PluginInterface is usually implemented when the user needs tointeract with a widget in Qtopia Desktop. Often, widgets are createdto view or enter information for a particular data set or totransfer files between the desktop the palmtop.<p> A standard set of PluginInterface plugins is supplied with QtopiaDesktop. These include Contacts (called <tt>addressbook</tt> in thesource), <a href="calendar.html">Calendar</a> (<tt>datebook</tt>), Todo List (<tt>todo</tt>), Documents (<tt>fileinstaller</tt>) and Packages (<tt>packageinstaller</tt>).<p> In many cases, there is a data set associated with a particularplugin. For example, Contacts has an associated addressbook file.This data set can easily be made syncable by using a <a href="mergeinterface.html">MergeInterface</a>and a <a href="syncappinterface.html">SyncAppInterface</a>. If the PluginInterface supports a syncabledata set the mergeInterface() function must return an appropriateMergeInterface.<p> The PluginInterface has several methods for integrating the plugininto the Qtopia Desktop user interface. For example, the <a href="#view">view</a>()function returns the viewable widget. The plugin can also supply an<a href="#icon">icon</a>(), a <a href="#settings">settings</a>() widget (which will appear on a tab in theQtopia Desktop settings dialog), and a list of actions to beintegrated into the menu bar and toolbar.<p> This interface also defines some state change methods that QtopiaDesktop uses to communicate with the plugins. The plugins get informedabout the connection state and about changes to categories with the<a href="#connected">connected</a>(), <a href="#disconnected">disconnected</a>() and <a href="#categoriesChanged">categoriesChanged</a>() functions.<p> The PluginInterface inherits from QComponentInformationInterfacewhich defines some pure virtual methods that are also used by QtopiaDesktop. Most notably, the name() function should return the namethat is associated with the plugin in the plugin selector. This isalso the display name that is used in the menu bar and toolbar forsyncing and in the sync dialog, showing that the plugin is syncing.<p> Writing an input interface plugin is achieved by subclassing thisbase class, reimplementing the pure virtual functions <a href="#init">init</a>(),<a href="#cleanup">cleanup</a>(), <a href="#icon">icon</a>(), <a href="#view">view</a>(), <a href="#settings">settings</a>(), <a href="#actionList">actionList</a>(),<a href="#uiDescription">uiDescription</a>(), <a href="#mergeInterface">mergeInterface</a>(), <a href="#receivedQCopMessage">receivedQCopMessage</a>(),<a href="#connected">connected</a>(), <a href="#disconnected">disconnected</a>() and <a href="#categoriesChanged">categoriesChanged</a>() and exportingthe class with the <tt>Q_EXPORT_PLUGIN</tt> macro. See the Plugins documentation for details.<p> <p> <p>See also <a href="mergeinterface.html">MergeInterface</a>, <a href="syncappinterface.html">SyncAppInterface</a>, <a href="importinterface.html">ImportInterface</a>, <a href="exportinterface.html">ExportInterface</a> and <a href="qtopiadesktop.html">Qtopia Desktop Classes</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="Section-enum"></a>PluginInterface::Section</h3> <p> This enum describes the different sections available on a Qtopia device.<ul><li><tt>PluginInterface::Applications</tt> - represents the appliation tab.<li><tt>PluginInterface::Games</tt> - represents the games tab.<li><tt>PluginInterface::Settings</tt> - represents the settings tab.<li><tt>PluginInterface::Documents</tt> - represents the documents tab.</ul><hr><h2>Member Function Documentation</h2><h3 class=fn>QPtrList&lt;Action&gt; <a name="actionList"></a>PluginInterface::actionList ()<tt> [pure virtual]</tt></h3> <p> Returns a list of menu and toolbar <a href="action.html">Action</a>s. This function isused in conjunction with the <a href="#uiDescription">uiDescription</a>() function.<p> This function is called whenever a plugin is selected. We recommendinitializing the list once internally (e.g. in the plugin's <a href="#init">init</a>()function), and then returning it from this function.<p> Example -- actions that might be used with a Contacts application.(See also the uiDescription() function.)<p> <pre>  editCopy = new <a href="action.html">Action</a>(                "copy", tr( "Copy" ),                IconLoader::loadIcon( "editcopy" ), tr( "&amp;Copy" ),                QAccel::stringToKey( tr("Ctrl+C") ), mainwindow );  editCut = new <a href="action.html">Action</a>(                "cut", tr( "Cut" ),                IconLoader::loadIcon( "editcut" ), tr( "&amp;Cut" ),                QAccel::stringToKey( tr("Ctrl+X") ), mainwindow );  editPaste = new <a href="action.html">Action</a>(                "paste", tr( "Paste" ),                IconLoader::loadIcon( "editpaste" ), tr( "&amp;Paste" ),                QAccel::stringToKey( tr("Ctrl+V") ), mainwindow );  editSelectAll = new <a href="action.html">Action</a>(                "selectall", tr( "Select All" ),                tr( "&amp;Select All" ),                QAccel::stringToKey( tr("Ctrl+A") ), mainwindow );  connect( editCopy, SIGNAL( activated() ), SLOT( slotCopy() ) );  connect( editCut, SIGNAL( activated() ), SLOT( slotCut() ) );  connect( editPaste, SIGNAL( activated() ), SLOT( slotPaste() ) );  connect( editSelectAll, SIGNAL( activated() ), SLOT( slotSelectAll() ) );  actions.append( editCopy );  actions.append( editCut );  actions.append( editPaste );  actions.append( editSelectAll );  </pre> <p> <h3 class=fn>void <a name="categoriesChanged"></a>PluginInterface::categoriesChanged ()<tt> [pure virtual]</tt></h3> <p> This function is called if any of the categories have been changed.Such changes can occur due to synchronization or because they havebeen edited in Qtopia Desktop.<p> <a href="categories.html">Categories</a> are used extensively within the Qtopia environment as ameans by which users can filter their views. If there is a categorychange and the plugin makes use of categories, any relevant updatingshould occur here.<h3 class=fn>void <a name="cleanup"></a>PluginInterface::cleanup ()<tt> [pure virtual]</tt></h3> <p> This function is called whenever the plugin is destroyed, e.g. when

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?