Changeset 2007
- Timestamp:
- 05/18/07 02:35:04
- Files:
-
- trunk/libtinymail-camel/tny-camel-account.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-account.h (modified) (1 diff)
- trunk/libtinymail/tny-account.c (modified) (2 diffs)
- trunk/libtinymail/tny-folder-store.c (modified) (1 diff)
- trunk/libtinymail/tny-folder.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/tny-camel-account.c
r1997 r2007 1314 1314 */ 1315 1315 1316 /* tny_camel_account_get_supported_secure_authentication: 1316 /** 1317 * TnyCamelGetSupportedSecureAuthCallback: 1318 * @self: The TnyCamelAccount on which tny_camel_account_get_supported_secure_authentication() was called. 1319 * @cancelled: Whether the operation was cancelled. 1320 * @auth_types: A TnyList of TnyPair objects. Each TnyPair in the list has a supported secure authentication method name as its name. This list must be freed with g_object_unref(). 1321 * @err: A GError if an error occurred, or NULL. This must be freed with g_error_free(). 1322 * @user_data: The user data that was provided to tny_camel_account_get_supported_secure_authentication(). 1323 * 1324 * The callback for tny_camel_account_get_supported_secure_authentication(). 1325 **/ 1326 1327 /** 1328 * tny_camel_account_get_supported_secure_authentication: 1317 1329 * @self: a #TnyCamelAccount object. 1318 1330 * @callback: A function to be called when the operation is complete. 1319 * @status_callback: A function to be called one or more times while the 1320 * operation is in progress. 1331 * @status_callback: A function to be called one or more times while the operation is in progress. 1321 1332 * @user_data: Data to be passed to the callback and status callback. 1322 1333 * … … 1326 1337 * The returned strings may be used as parameters to 1327 1338 * tny_account_set_secure_auth_mech(). 1328 */ 1329 void tny_camel_account_get_supported_secure_authentication ( 1330 TnyCamelAccount *self, 1331 TnyCamelGetSupportedSecureAuthCallback callback, 1332 TnyStatusCallback status_callback, 1333 gpointer user_data) 1339 **/ 1340 void 1341 tny_camel_account_get_supported_secure_authentication (TnyCamelAccount *self, TnyCamelGetSupportedSecureAuthCallback callback, TnyStatusCallback status_callback, gpointer user_data) 1334 1342 { 1335 1343 TnyCamelAccountPriv *priv = TNY_CAMEL_ACCOUNT_GET_PRIVATE (self); 1336 1344 g_return_if_fail (callback); 1337 1345 g_return_if_fail (priv->session); 1338 1339 1346 1340 1347 /* Store all the interesting info in a struct 1341 1348 * launch a thread and keep that struct-instance around. trunk/libtinymail-camel/tny-camel-account.h
r1965 r2007 90 90 91 91 92 /** TnyCamelGetSupportedSecureAuthCallback: 93 * 94 * @self: The TnyCamelAccount on which 95 * tny_camel_account_get_supported_secure_authentication() was called. 96 * @cancelled: Whether the operation was cancelled. 97 * @auth_types: A TnyList of TnyPair objects. Each TnyPair in the list has a 98 * supported secure authentication method name as its name. This list must 99 * be freed with g_object_unref(). 100 * @err: A GError if an error occurred, or NULL. This must be freed with 101 * g_error_free(). 102 * @user_data: The user data that was provided to 103 * tny_camel_account_get_supported_secure_authentication(). 104 * 105 * The callback for tny_camel_account_get_supported_secure_authentication(). 106 **/ 107 typedef void (*TnyCamelGetSupportedSecureAuthCallback) ( 108 TnyCamelAccount *self, gboolean cancelled, 109 TnyList *auth_types, GError **err, 110 gpointer user_data); 111 112 void tny_camel_account_get_supported_secure_authentication( 113 TnyCamelAccount *self, 114 TnyCamelGetSupportedSecureAuthCallback callback, 115 TnyStatusCallback status_callback, 116 gpointer user_data); 92 typedef void (*TnyCamelGetSupportedSecureAuthCallback) (TnyCamelAccount *self, gboolean cancelled, TnyList *auth_types, GError **err, gpointer user_data); 93 void tny_camel_account_get_supported_secure_authentication(TnyCamelAccount *self, TnyCamelGetSupportedSecureAuthCallback callback, TnyStatusCallback status_callback, gpointer user_data); 117 94 118 95 G_END_DECLS trunk/libtinymail/tny-account.c
r1947 r2007 38 38 * An example url_string can be imap://user:password@server/INBOX/005. Only 39 39 * "imap://user@server" is significant when searching. Also take a look at 40 * RFC 1808 for more information on url_string formatting.40 * RFC 1808 and RFC 4467 for more information on url_string formatting. 41 41 * 42 42 * This method must be usable with and will be used for … … 68 68 * tny_account_cancel: 69 69 * @self: a #TnyAccount object 70 * 71 * Forcefully cancels the current operation that is happening on @self.72 * 70 * 71 * Try to cancel the current operation that is happening. This API, though, 72 * guarantees nothing about any cancelations. 73 73 **/ 74 74 void trunk/libtinymail/tny-folder-store.c
r1879 r2007 113 113 * Removes a folder represented by @folder from the folder store @self. You are 114 114 * responsible for unreferencing the @folder instance yourself. This method will 115 * not do this for you, leaving the @folder instance in an unusable state. The 116 * id of the @folder instance will be blanked once really deleted from the 117 * service. All the #TnyFolderObservers and #TnyFolderStoreObservers of @folder, 118 * but of course not of @self, will automatically be unsubscribed. 119 * 120 * API question and TODO (undetermined): what about recursive deleting? 115 * not do this for you, leaving the @folder instance in an unusable state. 116 * 117 * All the #TnyFolderObservers and #TnyFolderStoreObservers of @folder, but of 118 * course not of @self, will automatically be unsubscribed. 119 * 120 * This method will always recursively delete all child folders of @self. While 121 * deleting folders, the folders will also always get unsubscribed (for example 122 * in case of IMAP, which means that the folder wont be in LSUB either anymore). 123 * 124 * Observers of @self and of any the child folders of @self will receive delete 125 * observer events in deletion order (childs first, parents after that). Types 126 * like the #TnyGtkFolderStoreListModel know about this and act on folder 127 * deletions by automatically updating themselves. 121 128 * 122 129 * Example: trunk/libtinymail/tny-folder.c
r1989 r2007 39 39 * @self: a #TnyFolder object 40 40 * 41 * Get thecapabilities of @self.41 * Get a few relevant capabilities of @self. 42 42 * 43 43 * Return value: The capabilities of the folder 44 44 **/ 45 46 45 TnyFolderCaps 47 46 tny_folder_get_caps (TnyFolder *self) … … 62 61 * string of @self. If not NULL, the returned value must be freed after use. 63 62 * 64 * The url string is specified in RFC 1808 and looks like this:65 * imap://user@hostname/INBOX/folder. Note that it doesn't necessarily contain63 * The url string is specified in RFC 1808 and / or RFC 4467 and looks like 64 * this: imap://server/INBOX/folder. Note that it doesn't necessarily contain 66 65 * the password of the IMAP account but can contain it. 67 66 * … … 130 129 * After this, @observer will start receiving notification of changes about @self. 131 130 * 132 * You must use tny_folder_remove_observer ,in for example the finalization of131 * You must use tny_folder_remove_observer in for example the finalization of 133 132 * your type if you used this method. Adding an observer to @self, changes 134 133 * reference counting of the objects involved. Removing the observer will undo 135 134 * those reference counting changes. Therefore if you don't, you will introduce 136 135 * memory leaks. 137 *138 136 **/ 139 137 void … … 163 161 * After this, @observer will no longer receive notification of changes about @self. 164 162 * 165 * You must use this method, in for example the finalization of your type 166 * if you used tny_folder_add_observer. Adding an observer to @self, changes 167 * reference counting of the objects involved. Removing the observer will undo 168 * those reference counting changes. Therefore if you don't, you will introduce 169 * memory leaks. 170 * 163 * You must use this method in for example the finalization of your type if you 164 * used tny_folder_add_observer. Adding an observer to @self, changes reference 165 * counting of the objects involved. Removing the observer will undo those 166 * reference counting changes. Therefore if you don't, you will introduce memory 167 * leaks. 171 168 **/ 172 169 void … … 191 188 * Poke for the status, this will invoke the event of sending a #TnyFolderChange 192 189 * to the observers. The change will always at least contain the unread and total 193 * folder count. It will also invoke if the unread and total didn't change at 194 * all. This makes it possible for a model or view that shows folders to get the 195 * initial folder unread and total counts (the #TnyGtkFolderListModel uses this 196 * method internally, for example). 197 * 190 * folder count, also if the unread and total didn't change at all. This makes 191 * it possible for a model or view that shows folders to get the initial folder 192 * unread and total counts (the #TnyGtkFolderStoreListModel uses this method 193 * internally, for example). 198 194 **/ 199 195 void … … 217 213 * must be unreferenced after use. 218 214 * 219 * Implementors: This method must return the strategy for receiving a message.220 * being the implementer, you must add a reference before returning the instance.221 *222 215 * Return value: the strategy for receiving a message 223 216 **/ … … 247 240 * 248 241 * Set the strategy for receiving a message 249 *250 * Implementors: This method must set (store) the strategy for receiving a251 * message.252 242 * 253 243 * The idea is that devices can have a specific such strategy. For example a … … 294 284 * 295 285 * Copies @self to @into giving the new folder the name @new_name. Returns the 296 * newly created folder in @into, which will carry the name @new_name. 297 * 298 * Very important note: 299 * When you are moving @self to @into by setting @del to true, you MUST make 300 * sure that @self is not used anymore. For example if you have gotten its 301 * headers using tny_folder_get_headers, you need to get rid of those first. 302 * In case you used a default component like the TnyGtkHeaderListModel or 303 * TnyGtkHeaderListTree as TnyList for storing the headers in, you can easily 304 * get rid if your headers by setting the model of the GtkTreeView to an empty 305 * one. You MUST NOT try to keep using it further (as the original folder, its 306 * memory caches and it's offline on-disk cache will have been removed 307 * permanently behind your back). Especially the memory caches will get you in 308 * severe problems, like segmentation errors when trying to access the now 309 * invalid TnyHeader's properties. This is a design decision and can't be fixed 310 * (it's not a bug): a removed folder is permanently destroyed. Moving a folder 311 * is the same as removing it and creating a new one. 312 * 313 * Note, though, that you need to give a @self with one reference count. And get 314 * rid of that reference once you are done. 315 * 316 * Implementors: The return value must be the new folder in @into carrying the 317 * name @new_name. Invoking the tny_folder_get_folder_store API on the return 318 * value must return the @into instance. The implementation must copy all 319 * messages from @self to @into. In case @del was TRUE, the messages that got 320 * successfully copied must be removed from @self. If @new_name already exists 321 * in @into and @err is not NULL, then an error must be set in @err and no 322 * further action may be performed. 286 * newly created folder in @into, which will carry the name @new_name. For some 287 * remote services this functionality is implemented as a rename operation. 288 * 289 * It will do both copying and in case of @del being TRUE, removing too, 290 * recursively. If you don't want it to be recursive, you should in stead create 291 * the folder @new_name in @into manually using tny_folder_store_create_folder 292 * and then use the tny_folder_transfer_msgs API. 293 * 294 * This method will always result in create observer events being throw for each 295 * subfolder of @self that is copied or moved to @new_name in creation order 296 * (parents first, childs after that). 297 * 298 * In case of @del being TRUE it will on top of that and before those create 299 * events also result in remove observer events being throw for each subfolder 300 * of @self in deletion order (the exact reversed order: childs first, parents 301 * after that) 302 * 303 * Standard folder models like the #TnyGtkFolderStoreListModel know about this 304 * behavior and will act by updating themselves automatically. 305 * 306 * When you are moving @self to @into with @del set to TRUE (moving @self), you 307 * MUST make sure that @self nor any of its sub folders are used anymore. For 308 * example if you have gotten headers using tny_folder_get_headers, you MUST get 309 * rid of those first. In case you used a default component like the 310 * TnyGtkHeaderListModel or any other TnyList for storing the headers, you can 311 * easily get rid if your headers by setting the model of the GtkTreeView to 312 * an empty one or unreferencing the list. You MUST NOT try to keep using it nor 313 * any of its headers. These instances will be invalid and in a destroyed state. 314 * 315 * If @new_name already exists in @into and @err is not NULL, then an error will 316 * be set in @err and no further action will be performed. 323 317 * 324 318 * Return value: a new folder instance to whom was copied … … 362 356 * 363 357 * Copies @self to @into giving the new folder the name @new_name. Returns the 364 * newly created folder in @into, which will carry the name @new_name. 365 * 366 * After the method's callback happened, tny_folder_get_all_count and 367 * tny_folder_get_unread_count are guaranteed to be correct. 358 * newly created folder in @into, which will carry the name @new_name. For some 359 * remote services this functionality is implemented as a rename operation. 360 * 361 * It will do both copying and in case of @del being TRUE, removing too, 362 * recursively. If you don't want it to be recursive, you should in stead create 363 * the folder @new_name in @into manually using tny_folder_store_create_folder 364 * and then use the tny_folder_transfer_msgs API. 365 * 366 * This method will always result in create observer events being throw for each 367 * subfolder of @self that is copied or moved to @new_name in creation order 368 * (parents first, childs after that). 369 * 370 * In case of @del being TRUE it will on top of that and before those create 371 * events also result in remove observer events being throw for each subfolder 372 * of @self in deletion order (the exact reversed order: childs first, parents 373 * after that) 374 * 375 * Standard folder models like the #TnyGtkFolderStoreListModel know about this 376 * behavior and will act by updating themselves automatically. 377 * 378 * When you are moving @self to @into with @del set to TRUE (moving @self), you 379 * MUST make sure that @self nor any of its sub folders are used anymore. For 380 * example if you have gotten headers using tny_folder_get_headers, you MUST get 381 * rid of those first. In case you used a default component like the 382 * TnyGtkHeaderListModel or any other TnyList for storing the headers, you can 383 * easily get rid if your headers by setting the model of the GtkTreeView to 384 * an empty one or unreferencing the list. You MUST NOT try to keep using it nor 385 * any of its headers. These instances will be invalid and in a destroyed state. 386 * 387 * If @new_name already exists in @into and @err is not NULL, then an error will 388 * be set in @err and no further action will be performed. 368 389 * 369 390 * If you want to use this method, it's advised to let your application … … 419 440 tny_folder_copy_async (TnyFolder *self, TnyFolderStore *into, const gchar *new_name, gboolean del, TnyCopyFolderCallback callback, TnyStatusCallback status_callback, gpointer user_data) 420 441 { 421 TnyFolder *retval;422 442 423 443 #ifdef DBC /* require */ … … 1071 1091 * about tny_folder_refresh. 1072 1092 * 1093 * API warning: it's possible that between the @refresh and @err, a pointer to 1094 * a query object will be placed. This will introduce both an API and ABI 1095 * breakage. 1096 * 1073 1097 * Example: 1074 1098 * <informalexample><programlisting> … … 1177 1201 * 1178 1202 * Return value: The folder type as a #TnyFolderType enum 1179 *1180 1203 **/ 1181 1204 TnyFolderType
