API Guide Home (Online version only) |

# FileBrowserLib68K.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * Copyright (c) 2004 palmOne, Inc. or its subsidiaries.
    00003  * All rights reserved.
    00004  *****************************************************************************/
    00005 /**
    00006  * @ingroup FileBrowser
    00007  */
    00008
    00009 /**
    00010  * @file    FileBrowserLib68K.h
    00011  * @version 1.0
    00012  * @brief This file contains the FileBrowser Library APIs
    00013  *
    00014  */
    00015
    00016
    00017
    00018 #ifndef __FILE_BROWSER_LIB_68K_H__
    00019 #define __FILE_BROWSER_LIB_68K_H__
    00020
    00021
    00022 /***********************************************************************
    00023  *
    00024  *   Functions
    00025  *
    00026  ***********************************************************************/
    00027
    00028 #ifdef NO_FILE_BROWSER_TRAPS
    00029     #define FILE_BROWSER_LIB_TRAP(trapNum)
    00030 #else
    00031     #define FILE_BROWSER_LIB_TRAP(trapNum)  SYS_TRAP(trapNum)
    00032 #endif
    00033
    00034 /// Standard File Browser library open function
    00035 ///
    00036 /// @param refNum: IN: library reference number
    00037 /// @retval Err Error code
    00038 Err FileBrowserLibOpen(UInt16 refNum)
    00039     FILE_BROWSER_LIB_TRAP(sysLibTrapOpen);
    00040     // Call this before any other entry points.
    00041
    00042 /// Standard File Browser library close function
    00043 ///
    00044 /// @param refNum: IN: library reference number
    00045 /// @retval Err Error code
    00046 Err FileBrowserLibClose(UInt16 refNum)
    00047     FILE_BROWSER_LIB_TRAP(sysLibTrapClose);
    00048     // Call this when you're done.
    00049
    00050 /// Standard File Browser library sleep function
    00051 ///
    00052 /// @param refNum: IN: library reference number
    00053 /// @retval Err Error code
    00054 Err FileBrowserLibSleep(UInt16 refNum)
    00055     FILE_BROWSER_LIB_TRAP(sysLibTrapSleep);
    00056     // Called automatically when the device turns off.
    00057
    00058 /// Standard File Browser library wake function
    00059 ///
    00060 /// @param refNum: IN: library reference number
    00061 /// @retval Err Error code
    00062 Err FileBrowserLibWake(UInt16 refNum)
    00063     FILE_BROWSER_LIB_TRAP(sysLibTrapWake);
    00064     // Called automatically when the device turns on.
    00065
    00066 /// Entry point to handle an event
    00067 ///
    00068 /// @param refNum: IN: library reference number
    00069 /// @param eventP: IN: the event to handle
    00070 /// @retval Boolean True if the event was handled and should not be passed
    00071 ///                 to a higher level handler.
    00072 Boolean FileBrowserLibHandleEvent(UInt16 refNum, EventType *eventP)
    00073     FILE_BROWSER_LIB_TRAP(exgLibTrapHandleEvent);
    00074
    00075 /// Entry point to establish an exchange connection
    00076 ///
    00077 /// @param refNum:  IN: library reference number
    00078 /// @param socketP: IN: the exchange socket
    00079 /// @retval Err Error code.
    00080 Err FileBrowserLibConnect(UInt16 refNum, ExgSocketType *socketP)
    00081     FILE_BROWSER_LIB_TRAP(exgLibTrapConnect);
    00082
    00083 /// Entry point to accept an incoming connection
    00084 ///
    00085 /// @param refNum:  IN: library reference number
    00086 /// @param socketP: IN: the exchange socket
    00087 /// @retval Err Error code.
    00088 Err FileBrowserLibAccept(UInt16 refNum, ExgSocketType *socketP)
    00089     FILE_BROWSER_LIB_TRAP(exgLibTrapAccept);
    00090
    00091 /// Entry point to disconnect an outgoing or incoming
    00092 /// connection and clean up afterwards.
    00093 ///
    00094 /// @param refNum:  IN: library reference number
    00095 /// @param socketP: IN: the exchange socket
    00096 /// @param err:     IN: OS error code to report to user
    00097 /// @retval Err Error code.
    00098 Err FileBrowserLibDisconnect(UInt16 refNum, ExgSocketType *socketP,
    00099     Err err)
    00100     FILE_BROWSER_LIB_TRAP(exgLibTrapDisconnect);
    00101
    00102 /// Entry point to start a Put operation. Creates a
    00103 /// connection if one doesn't already exist.
    00104 ///
    00105 /// @param refNum:  IN: library reference number
    00106 /// @param socketP: IN: the exchange socket
    00107 /// @retval Err Error code.
    00108 Err FileBrowserLibPut(UInt16 refNum, ExgSocketType *socketP)
    00109     FILE_BROWSER_LIB_TRAP(exgLibTrapPut);
    00110
    00111 /// Entry point to start a Get operation
    00112 ///
    00113 /// @param refNum:  IN: library reference number
    00114 /// @param socketP: IN: the exchange socket
    00115 /// @retval Err Error code.
    00116 Err FileBrowserLibGet(UInt16 refNum, ExgSocketType *socketP)
    00117     FILE_BROWSER_LIB_TRAP(exgLibTrapGet);
    00118
    00119 /// Entry point to send data for an object
    00120 ///
    00121 /// @param refNum:  IN: library reference number
    00122 /// @param socketP: IN: the exchange socket
    00123 /// @param bufP:    IN: the buffer containing data to send
    00124 /// @param bufLen:  IN: bytes to send
    00125 /// @param errP:    OUT: passed back error code
    00126 /// @retval UInt32 number of bytes sent.
    00127 UInt32 FileBrowserLibSend(UInt16 refNum, ExgSocketType *socketP,
    00128     const void *bufP, UInt32 bufLen, Err *errP)
    00129     FILE_BROWSER_LIB_TRAP(exgLibTrapSend);
    00130
    00131 /// Entry point to receive data for an object
    00132 ///
    00133 /// @param refNum:  IN:  the library reference number
    00134 /// @param socketP: IN:  the exchange socket
    00135 /// @param bufP:    OUT: buffer to store received data
    00136 /// @param bufSize: IN:  size of buffer
    00137 /// @param errP:    OUT: passed back error code
    00138 /// @retval UInt32 number of bytes received.
    00139 UInt32 FileBrowserLibReceive(UInt16 refNum, ExgSocketType *socketP,
    00140     void *bufP, UInt32 bufSize, Err *errP)
    00141     FILE_BROWSER_LIB_TRAP(exgLibTrapReceive);
    00142
    00143 /// Entry point to execute various commands.
    00144 ///
    00145 /// @param refNum:      IN: the library reference number
    00146 /// @param op:          IN: command to execute
    00147 /// @param valueP:      IN,OUT: buffer with incoming or outgoing data
    00148 /// @param valueLenP:   IN,OUT: size of buffer and size of result (not used for some operations)
    00149 /// @retval Err Error code.
    00150 Err FileBrowserLibControl(UInt16 refNum, UInt16 op, void *valueP,
    00151     UInt16 *valueLenP)
    00152     FILE_BROWSER_LIB_TRAP(exgLibTrapControl);
    00153
    00154 /// Entry point to do a Request operation (Unimplemented)
    00155 ///
    00156 /// @param refNum:  IN: the library reference number
    00157 /// @param socketP: IN: the exchange socket
    00158 /// @retval Err Error code.
    00159 Err FileBrowserLibRequest(UInt16 refNum, ExgSocketType *socketP)
    00160     FILE_BROWSER_LIB_TRAP(exgLibTrapRequest);
    00161
    00162 /// Pop up an Open dialog
    00163 ///
    00164 /// @param refNum:          IN: library reference number
    00165 /// @param volRefNumP:      IN: the default volume and the result
    00166 /// @param path:            IN: the default path and the result (must be
    00167 ///                             at least kFileBrowserLibPathBufferSize bytes).
    00168 /// @param numExtensions:   IN: number of extensions to display
    00169 /// @param extensions:      IN: compatible extensions to display
    00170 /// @param fileType:        IN: optional MIME type or extension to get
    00171 ///                             default directory on each volume
    00172 /// @param title:           IN: open dialog title
    00173 /// @param flags:           IN: any combo of kOpenFlag* flags
    00174 /// @retval Boolean True if a file is selected
    00175 Boolean FileBrowserLibShowOpenDialog(UInt16 refNum,
    00176     UInt16 *volRefNumP, Char *path, UInt16 numExtensions,
    00177     const Char **extensions, const Char *fileType, const Char *title,
    00178     UInt32 flags)
    00179     FILE_BROWSER_LIB_TRAP(kFileBrowserLibTrapShowOpenDialog);
    00180
    00181 /// Pop up a Save dialog
    00182 ///
    00183 /// @param refNum:          IN: library reference number
    00184 /// @param volRefNumP:      IN: the default volume and the result
    00185 /// @param path:            IN: the default path and the result (must be at least
    00186 ///                             kFileBrowserLibPathBufferSize bytes)
    00187 /// @param numExtensions:   IN: number of extensions to display
    00188 /// @param extensions:      IN: valid extensions to display
    00189 /// @param defaultExtension     IN: default extension to display initially
    00190 /// @param fileType:        IN: optional MIME type or extension to get
    00191 ///                             default directory on each volume
    00192 /// @param title:           IN: open dialog title
    00193 /// @param flags:           IN: any combo of kSaveAsFlag* flags
    00194 /// @retval Boolean True if a file is saved
    00195 Boolean FileBrowserLibShowSaveAsDialog(UInt16 refNum, UInt16 *volRefNumP,
    00196     Char *path, UInt16 numExtensions, const Char **extensions,
    00197     const Char *defaultExtension, const Char *fileType,
    00198     const Char *title, UInt32 flags)
    00199     FILE_BROWSER_LIB_TRAP(kFileBrowserLibTrapShowSaveAsDialog);
    00200
    00201 /// Entry point to parse a URL (file:) received in a
    00202 /// sysAppLaunchCmdExgReceiveData launch resulting from the
    00203 /// open dialog.  Pass NULL for unwanted results. Caller must
    00204 /// free the others.
    00205 ///
    00206 /// @param refNum:      IN:  library reference number
    00207 /// @param urlP:        IN:  URL to be parsed
    00208 /// @param volRefNumP:  OUT: pass back the file's volume's volRefNum
    00209 /// @param filePathP:   OUT: pass back the file's path
    00210 /// @retval Err Error code
    00211 Err FileBrowserLibParseFileURL(UInt16 refNum,
    00212     const Char *urlP, UInt16 *volRefNumP, Char **filePathP)
    00213     FILE_BROWSER_LIB_TRAP(kFileBrowserLibTrapParseFileURL);
    00214
    00215 /// Entry point to pop up a dialog in which multiple files can be selected
    00216 ///
    00217 /// @param refNum:          IN: library reference number
    00218 /// @param volRefNumP:      IN: the default volume and the result
    00219 /// @param path:            IN: the default path
    00220 /// @param numFilesP        OUT: number of files selected
    00221 /// @param maxFiles         IN: maximum number of files allowed to select
    00222 /// @param filenames        OUT: names of files selected
    00223 /// @param numExtensions:   IN: number of extensions to display
    00224 /// @param extensions:      IN: compatible extensions to display
    00225 /// @param fileType:        IN: optional MIME type or extension to get
    00226 ///                             default directory on each volume
    00227 /// @param title:           IN: open dialog title
    00228 /// @param flags:           IN: any combo of kOpenFlag* flags
    00229 /// @retval Boolean True if one or more files are selected
    00230 Boolean FileBrowserLibShowMultiselectDialog(UInt16 refNum,
    00231     UInt16 *volRefNumP, Char *path, UInt16 *numFilesP,
    00232     UInt16 maxFiles, Char **filenames, UInt16 numExtensions,
    00233     const Char **extensions, const Char *fileType,
    00234     const Char *title, UInt32 flags)
    00235     FILE_BROWSER_LIB_TRAP(kFileBrowserLibTrapShowMultiselectDialog);
    00236
    00237 #undef FILE_BROWSER_LIB_TRAP
    00238
    00239 #endif // __FILE_BROWSER_LIB_68K_H__

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