API Guide Home (Online version only) |

# PalmVMPlugin.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * Copyright (c) 2005 palmOne, Inc. or its subsidiaries.
    00003  * All rights reserved.
    00004  *****************************************************************************/
    00005 /**
    00006  * @ingroup Versamail
    00007  *
    00008  */
    00009
    00010 /**
    00011  * @file    PalmVMPlugin.h
    00012  * @version 1.0
    00013  *
    00014  * @brief  Defines APIs and structures for the VersaMail Plugin Service which
    00015  *     lets users write plugins to view/send attachments
    00016  *
    00017  *
    00018  * <hr>
    00019  */
    00020
    00021
    00022 #ifndef __PALMVMPLUGIN_H__
    00023 #define __PALMVMPLUGIN_H__
    00024
    00025
    00026 #include <PalmCompatibility.h>
    00027
    00028
    00029 /**
    00030  * @name Application Launch Codes
    00031  *
    00032  */
    00033 /*@{*/
    00034 #define MMPRO_PLUGIN_LAUNCHCODE         (sysAppLaunchCmdCustomBase + 2)     /**< Plugin receives data from VersaMail and do whatever it deems appropriate with it. */
    00035 #define MMPRO_PLUGIN_RECEIVE_LAUNCHCODE     MMPRO_PLUGIN_LAUNCHCODE         /**<        */
    00036
    00037 #define MMPRO_PLUGIN_QUERY_LAUNCHCODE       (sysAppLaunchCmdCustomBase + 3)     /**< Plugin should return a list of attachments for the user to select from. */
    00038 #define MMPRO_PLUGIN_SEND_LAUNCHCODE        (sysAppLaunchCmdCustomBase + 4)     /**< The plugin should return the name of ? selected attachment for sending */
    00039 #define MMPRO_PLUGIN_EXTENDED_QUERY_LAUNCHCODE  (sysAppLaunchCmdCustomBase + 5)     /**< Plugin should support selection of attachment and should return */
    00040 #define MMPRO_PLUGIN_GET_INFO_LAUNCHCODE    (sysAppLaunchCmdCustomBase + 8)     /**< VersaMail queries the plugin to get the details of Plugin information */
    00041
    00042 /*@}*/
    00043
    00044
    00045 #define ATTYPE_MAX_NAME_LEN 32  /**< Maximum array size for name of an attachment in listSendNames pointer */
    00046
    00047
    00048
    00049 /**
    00050  * @brief PluginInfo is specifies what plugin information is needed.
    00051  */
    00052 typedef enum {
    00053
    00054     plugin_sendInfo,    /**< Provides info about what can be passed as an email attachment. */
    00055     plugin_receiveInfo,     /**< Provides info about what file types can be viewed. */
    00056     plugin_allInfo      /**< Provides sendInfo and receiveInfo. */
    00057
    00058 } PluginInfo;
    00059
    00060 /**
    00061  * @brief Structure used for launch code MMPRO_PLUGIN_GET_INFO_LAUNCHCODE.
    00062  */
    00063 typedef struct _pluginGetInfoParams
    00064 {
    00065     PluginInfo  getInfo;        /**< [in]  what plugin information needed. */
    00066
    00067     UInt32      version;        /**< [out] plugin version. */
    00068     Boolean     supportsSending;    /**< [out] can provide data to be passed as an email attachment.*/
    00069     Boolean     supportsReceiving;  /**< [out] can view files passed to it.*/
    00070
    00071     char**      listSendNames;      /**< [out] list of names of the types. (suitable for listing in popup)*/
    00072
    00073     UInt16      numSendTypes;       /**< [out] the number of types it can send (each one should appear in popup)*/
    00074     Int16       numReceiveTypes;    /**< [out] the number of types it can receive */
    00075
    00076     char**      listSendFileExt;    /**< [out] list of supported file extensions to Send.*/
    00077     char**      listReceiveFileExt; /**< [out] list of supported file extensions it can read. */
    00078     UInt32*     listMaxSizeExt;     /**< lout] list of max file size supported for each file ext. */
    00079
    00080     char**      listSendMIMEtypes;  /**< [out] list of supported MIME types to Send. */
    00081     char**      listReceiveMIMEtypes;   /**< [out] list of supported MIME types it can read. */
    00082     UInt32*     listMaxSizeMime;    /**< lout] list of max file size supported for each MIME type. */
    00083     UInt32      ret;                /**< [out] return code for error handling and special cases; */
    00084     Char Unused[50];                /**< unused space for future releases */
    00085
    00086 } pluginGetInfoParams;
    00087
    00088
    00089 /**
    00090  * @brief Structure used for datalinks while sending /rcving data.
    00091  */
    00092 typedef struct _dataLinks
    00093 {
    00094     CharPtr data;       /**< pointer to data */
    00095     ULong size;         /**< size of data */
    00096
    00097 } dataLinks;
    00098
    00099
    00100 /**
    00101  * @brief Structure used for launch code MMPRO_PLUGIN_RECEIVE_LAUNCHCODE.
    00102  */
    00103 typedef struct _pluginParams
    00104 {
    00105     ULong version;          /**< [in] plugin version */
    00106     Char *MIMEtype;         /**< [in] attachment MIME type */
    00107     Char *fileExt;          /**< [in] attachment file extention */
    00108     ULong size;         /**< [in] size of data */
    00109     CharPtr fname;          /**< [in] filename of attachment */
    00110     CharPtr data;           /**< [in] the data */
    00111     DmOpenRef db;           /**< [in] reference to open database for large memory allocations */
    00112     UInt numDataLinks;          /**< [in] number of data links */
    00113     dataLinks *moreData;        /**< [in] ptr to data links */
    00114     UInt32 ret;                 /**< [out] return code for error handling and special cases;*/
    00115     Char Unused[50];            /**< unused space for future releases */
    00116
    00117 }pluginParams;
    00118
    00119
    00120
    00121 /**
    00122  * @brief Structure used for launch code MMPRO_PLUGIN_QUERY_LAUNCHCODE.
    00123  */
    00124 typedef struct _pluginQueryParams
    00125 {
    00126     Char *fileExt;              /**< [in] file extention of list of files requested */
    00127     Char *MIMEtype;         /**< [in] MIME type of list of files requested */
    00128     DmOpenRef db;           /**< [in]reference to open database for large memory allocations */
    00129     int numItems;           /**< [out] number of items of this type */
    00130     UInt32 *itemSizes;      /**< [out] size of items */
    00131     char** listItems;       /**< [out] the items */
    00132     void**  itemDescriptors;    /**< [out] private descriptors defined/recognized by plugin. This memory will be freed by VersaMail  */
    00133     UInt32 ret;             /**< [out] return code for error handling and special cases; */
    00134     Char Unused[50];            /**< unused space for future releases */
    00135
    00136 }pluginQueryParams;
    00137
    00138
    00139 /**
    00140  * @brief Structure used for launch code MMPRO_PLUGIN_SEND_LAUNCHCODE.
    00141  */
    00142 typedef struct _pluginSendParams
    00143 {
    00144     Char *MIMEtype;             /**< [in] attachment MIME type */
    00145     Char *fileExt;              /**< [in] attachment file extention */
    00146
    00147     DmOpenRef db;           /**< [in]reference to open database for large memory allocations */
    00148     int selectedItem;       /**< [in] item number that was selected */
    00149     void *selectedDescriptor;   /**< [in] descriptor of item that was selected */
    00150     char* item;         /**< [in] the item selected */
    00151     char* name;         /**< [out] name of the attachment file */
    00152     char* ptr;          /**< [out] attachment rendered and ready to send! */
    00153                     /**< this memory will be freed by MMPRO */
    00154     ULong size;         /**< [out] size of attachment above */
    00155
    00156     UInt numDataLinks;      /**< [out] number of data links */
    00157     dataLinks *moreData;        /**< [out] ptr to data links */
    00158     UInt32 ret;                 /**< [out] return code for error handling and special cases; */
    00159     Char Unused[50];            /**< unused space for future releases */
    00160
    00161 }pluginSendParams;
    00162
    00163
    00164 /**
    00165  * @brief Structure used for launch code MMPRO_PLUGIN_EXTENDED_QUERY_LAUNCHCODE.
    00166  */
    00167 typedef struct _pluginExtendedQueryParams
    00168 {
    00169     int type;           /**< [in] attachment type  */
    00170     Char *MIMEtype;         /**< [in] attachment MIME type */
    00171     Char *fileExt;          /**< [in] attachment file extention */
    00172
    00173     DmOpenRef db;           /**< [in]reference to open database for large memory allocations */
    00174     Boolean supported;          /**< [out] we support this extension */
    00175     int numItems;           /**< [out] number of items selected */
    00176     char** listNames;       /**< [out] name of the attachment files */
    00177     char** listPtrs;        /**< [out] attachments renders and ready to send */
    00178     ULong** size;           /**< [out] size for each attachment */
    00179     UInt32 ret;                 /**< [out] return code for error handling and special cases; */
    00180     Char Unused[50];            /**< unused space for future releases */
    00181
    00182 }pluginExtendedQueryParams;
    00183
    00184 #endif // PALMVMPLUGIN_H_

Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:55 2008 for Palm API Guide