Changeset 1198
- Timestamp:
- 11/21/06 14:57:12
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-folder.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-header.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-camel-msg-remove-strategy.c (modified) (2 diffs)
- trunk/libtinymail/tny-account-store.c (modified) (11 diffs)
- trunk/libtinymail/tny-account.c (modified) (15 diffs)
- trunk/libtinymail/tny-folder-store-query.c (modified) (7 diffs)
- trunk/libtinymail/tny-folder-store.c (modified) (5 diffs)
- trunk/libtinymail/tny-folder.c (modified) (9 diffs)
- trunk/libtinymail/tny-folder.h (modified) (2 diffs)
- trunk/libtinymail/tny-msg-remove-strategy.c (modified) (2 diffs)
- trunk/libtinymail/tny-msg-remove-strategy.h (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-header-list-model.c (modified) (4 diffs)
- trunk/libtinymailui-gtk/tny-gtk-header-view.c (modified) (1 diff)
- trunk/libtinymailui/tny-account-store-view.c (modified) (1 diff)
- trunk/libtinymailui/tny-header-view.c (modified) (2 diffs)
- trunk/libtinymailui/tny-mime-part-save-strategy.c (modified) (4 diffs)
- trunk/libtinymailui/tny-mime-part-saver.c (modified) (5 diffs)
- trunk/libtinymailui/tny-mime-part-view.c (modified) (4 diffs)
- trunk/libtinymailui/tny-msg-view.c (modified) (7 diffs)
- trunk/libtinymailui/tny-platform-factory.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r1194 r1198 3 3 * Major changes in TnyMsg and TnyMimePart 4 4 * First support for message/rfc822 messages 5 5 * API documentation enhancements 6 * Date fixes in TnyCamelHeader 7 6 8 * This was a major API change in all libraries 7 9 trunk/libtinymail-camel/tny-camel-folder.c
r1192 r1198 300 300 } 301 301 302 tny_msg_remove_strategy_ remove (priv->remove_strat, self, header);302 tny_msg_remove_strategy_perform_remove (priv->remove_strat, self, header); 303 303 304 304 g_mutex_unlock (priv->folder_lock); … … 941 941 942 942 static void 943 tny_camel_folder_transfer_msgs (TnyFolder * folder_src,943 tny_camel_folder_transfer_msgs (TnyFolder *self, 944 944 TnyList *headers, 945 945 TnyFolder *folder_dst, 946 946 gboolean delete_originals) 947 947 { 948 TNY_CAMEL_FOLDER_GET_CLASS (folder_src)->transfer_msgs_func (folder_src, headers, folder_dst, delete_originals); 949 } 950 951 static void 952 tny_camel_folder_transfer_msgs_default (TnyFolder *folder_src, 953 TnyList *headers, 954 TnyFolder *folder_dst, 955 gboolean delete_originals) 956 { 948 TNY_CAMEL_FOLDER_GET_CLASS (self)->transfer_msgs_func (self, headers, folder_dst, delete_originals); 949 } 950 951 static void 952 tny_camel_folder_transfer_msgs_default (TnyFolder *self, TnyList *headers, TnyFolder *folder_dst, gboolean delete_originals) 953 { 954 TnyFolder *folder_src = self; 957 955 TnyCamelFolderPriv *priv_src, *priv_dst; 958 956 TnyIterator *iter; trunk/libtinymail-camel/tny-camel-folder.h
r1179 r1198 68 68 void (*refresh_async_func) (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 69 69 void (*refresh_func) (TnyFolder *self); 70 void (*transfer_msgs_func) (TnyFolder * folder_src, TnyList *headers, TnyFolder *folder_dst, gboolean delete_originals);70 void (*transfer_msgs_func) (TnyFolder *self, TnyList *headers, TnyFolder *folder_dst, gboolean delete_originals); 71 71 72 72 void (*get_folders_async_func) (TnyFolderStore *self, TnyList *list, TnyGetFoldersCallback callback, TnyFolderStoreQuery *query, gpointer user_data); trunk/libtinymail-camel/tny-camel-header.c
r1197 r1198 394 394 } 395 395 else 396 retval = camel_message_info_date_ received((CamelMessageInfo*)me->info);396 retval = camel_message_info_date_sent ((CamelMessageInfo*)me->info); 397 397 398 398 return retval; trunk/libtinymail-camel/tny-camel-msg-remove-strategy.c
r1148 r1198 38 38 39 39 static void 40 tny_camel_msg_remove_strategy_ remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header)40 tny_camel_msg_remove_strategy_perform_remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header) 41 41 { 42 42 const gchar *id; … … 88 88 TnyMsgRemoveStrategyIface *klass = (TnyMsgRemoveStrategyIface *)g; 89 89 90 klass-> remove_func = tny_camel_msg_remove_strategy_remove;90 klass->perform_remove_func = tny_camel_msg_remove_strategy_perform_remove; 91 91 92 92 return; trunk/libtinymail/tny-account-store.c
r1010 r1198 31 31 * @prompt: the prompt 32 32 * 33 * This jump-to-the-ui method implements showing a message dialog with prompt 34 * as prompt. It will return TRUE if the reply was affirmative or FALSE if not. 33 * This jump-to-the-ui method implements showing a message dialog with @prompt 34 * as prompt and @type as message type. It will return TRUE if the reply was 35 * affirmative or FALSE if not. 35 36 * 36 37 * Implementors: when implementing a platform-specific library, you must 37 * implement this method. For example in Gtk+ by using the #GtkDialog API. 38 * implement this method. For example in Gtk+ by using the #GtkDialog API. The 39 * implementation will for example be used to ask the user about accepting SSL 40 * certificates. The two possible answers that must be supported are 41 * "Yes" and "No" which must result in a TRUE or a FALSE return value. 38 42 * 39 43 * Example implementation for Gtk+: … … 42 46 * tny_gnome_account_store_alert (TnyAccountStore *self, TnyAlertType type, const gchar *prompt) 43 47 * { 44 * GtkMessageType gtktype;45 * gboolean retval = FALSE;46 * GtkWidget *dialog;47 * switch (type)48 * {49 * case TNY_ALERT_TYPE_INFO:50 * gtktype = GTK_MESSAGE_INFO;51 * break;52 * case TNY_ALERT_TYPE_WARNING:53 * gtktype = GTK_MESSAGE_WARNING;54 * break;55 * case TNY_ALERT_TYPE_ERROR:56 * default:57 * gtktype = GTK_MESSAGE_ERROR;58 * break;59 * }60 * dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,61 * gtktype, GTK_BUTTONS_YES_NO, prompt);62 * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)63 * retval = TRUE;64 * gtk_widget_destroy (dialog);65 * return retval;48 * GtkMessageType gtktype; 49 * gboolean retval = FALSE; 50 * GtkWidget *dialog; 51 * switch (type) 52 * { 53 * case TNY_ALERT_TYPE_INFO: 54 * gtktype = GTK_MESSAGE_INFO; 55 * break; 56 * case TNY_ALERT_TYPE_WARNING: 57 * gtktype = GTK_MESSAGE_WARNING; 58 * break; 59 * case TNY_ALERT_TYPE_ERROR: 60 * default: 61 * gtktype = GTK_MESSAGE_ERROR; 62 * break; 63 * } 64 * dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, 65 * gtktype, GTK_BUTTONS_YES_NO, prompt); 66 * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) 67 * retval = TRUE; 68 * gtk_widget_destroy (dialog); 69 * return retval; 66 70 * } 67 71 * </programlisting></informalexample> 68 72 * 69 * The @prompt will be a message like a question to the user whether or not he70 * accepts the SSL certificate of the service.71 *72 73 * Return value: Whether the user pressed Ok/Yes (TRUE) or Cancel/No (FALSE) 73 74 * … … 91 92 * 92 93 * Implementors: when implementing a platform-specific library, you must 93 * implement this method and a #TnyDevice implementation. 94 95 * As the implementor of this method, you must add a reference count before 96 * returning. 94 * implement this method by letting it return a #TnyDevice instance. You must 95 * add a reference count before returning. 97 96 * 98 97 * Return value: the device attached to this account store … … 120 119 * 121 120 * Note that the callers of this method will not free the result. The 122 * implementor of a #TnyAccountStore is responsible offreeing it up. For123 * example when destroying the instance.121 * implementor of a #TnyAccountStore is responsible for freeing it up. For 122 * example when destroying @self (in its finalize method). 124 123 * 125 124 * Return value: the local path that will be used for storing the disk cache … … 143 142 * @types: a #TnyGetAccountsRequestType that describes which account types are needed 144 143 * 145 * Get a read-only list of accounts in the store 144 * Get a read-only list of accounts in the store. You must not change @list 145 * except for referencing and unreferencing. 146 146 * 147 147 * Example: … … 163 163 * Implementors: when implementing a platform-specific library, you must 164 164 * implement this method. 165 * 165 * 166 166 * It is allowed to cache the list (but not required). If you are implementing 167 167 * an account store for account implementations from libtinymail-camel, you must … … 169 169 * libtinymail-camel specific tny_session_camel_set_current_accounts API. 170 170 * 171 * The implementation must obviously fillup @list with available accounts.172 * Note that if you cache the list, you must add a reference to each account173 * added to the list (else they will be unreferenced and if the reference count174 * would reachzero, an account would no longer be cached).171 * The implementation must fillup @list with available accounts. Note that if 172 * you cache the list, you must add a reference to each account added to the 173 * list (else they will be unreferenced and if the reference count would reach 174 * zero, an account would no longer be cached). 175 175 * 176 176 * With libtinymail-camel each created account must also be informed about the … … 303 303 * @user_data: user data set when the signal handler was connected 304 304 * 305 * API WARNING: This API might change 306 * 305 307 * Emitted when an account in the store changed 306 308 */ … … 320 322 * @user_data: user data set when the signal handler was connected. 321 323 * 324 * API WARNING: This API might change 325 * 322 326 * Emitted when an account is added to the store 323 327 */ 324 325 326 328 tny_account_store_signals[TNY_ACCOUNT_STORE_ACCOUNT_INSERTED] = 327 329 g_signal_new ("account_inserted", … … 338 340 * @arg1: the #TnyAccount of the account that got removed 339 341 * @user_data: user data set when the signal handler was connected. 342 * 343 * API WARNING: This API might change 340 344 * 341 345 * Emitted when an account is removed from the store … … 353 357 * TnyAccountStore::accounts-reloaded 354 358 * @self: the object on which the signal is emitted 359 * 360 * API WARNING: This API might change 355 361 * 356 362 * Emitted when the store reloads the accounts trunk/libtinymail/tny-account.c
r927 r1198 27 27 * @self: a #TnyAccount object 28 28 * 29 * Get the account type . There are two account types: a store and a transport30 * account type.31 * 32 * A store account will implement the #TnyFolderStore33 * interfaces which means that the type can contain folders.29 * Get the account type of @self. There are two account types: a store and 30 * transport account type. 31 * 32 * A store account typically contains folders and messages. Examples are NNTP, 33 * IMAP and POP accounts. 34 34 * 35 35 * A transport account has a send method for sending #TnyMsg instances 36 * using the transport protocol ofthe account (for example SMTP).36 * using the transport implemented by the account (for example SMTP). 37 37 * 38 38 * Return value: The account type … … 54 54 * @self: a #TnyAccount object 55 55 * 56 * Get the connection status of an account56 * Get the connection status of @self 57 57 * 58 58 * Return value: whether or not the account is connected … … 74 74 * @self: a #TnyAccount object 75 75 * 76 * Get the unique id of the account. The only certainty you have is that the 77 * id is unique. The format of the id isn't specified. The implementor of the 78 * #TnyAccountStore must set this id using tny_account_set_id. 76 * Get the unique id of @self 77 * 78 * The only certainty you have is that the id is unique in the #TnyAccountStore. 79 * The format of the id isn't specified. The implementor of the #TnyAccountStore 80 * must set this id using tny_account_set_id. 79 81 * 80 82 * Return value: Unique id … … 117 119 * 118 120 * Set the unique id of the account. You need to set this property before you 119 * can start using the account. The id must be unique and is typically set in the120 * i mplementation of a #TnyAccountStore.121 * can start using the account. The id must be unique in a #TnyAccountStore and 122 * is typically set in the implementation of a #TnyAccountStore. 121 123 * 122 124 **/ … … 139 141 * 140 142 * Set the function that will be called in case the password was wrong and 141 * therefore can be forgotten by thepassword store.143 * therefore can, for example, be forgotten by a password store. 142 144 * 143 145 * You need to set this property before you can start using the account. This … … 182 184 * @url_string: the url string (ex. mbox://path) 183 185 * 184 * Set the url string of an account. You don't need to use this for imap and pop186 * Set the url string of @self. You don't need to use this for imap and pop 185 187 * where you can use the simplified API (set_proto, set_hostname, etc). This 186 188 * property is typically set in the implementation of a #TnyAccountStore. … … 204 206 * @proto: the protocol (ex. "imap") 205 207 * 206 * Set the protocol of an account. You need to set this property before you can207 * startusing the account. This property is typically set in the implementation208 * Set the protocol of @self. You need to set this property before you can start 209 * using the account. This property is typically set in the implementation 208 210 * of a #TnyAccountStore. 209 211 * … … 226 228 * @user: the username 227 229 * 228 * Set the user or login of an account. You need to set this property before you230 * Set the user or login of @self. You need to set this property before you 229 231 * can start using the account. This property is typically set in the 230 232 * implementation of a #TnyAccountStore. … … 248 250 * @host: the hostname 249 251 * 250 * Set the hostname of an account. You need to set this property before you can251 * start using the account. This property is typically set in the implementation252 * of a#TnyAccountStore.252 * Set the hostname of @self. You need to set this property before you can start 253 * using the account. This property is typically set in the implementation of a 254 * #TnyAccountStore. 253 255 * 254 256 **/ … … 272 274 * 273 275 * Set the function that will be called when the password is needed. The 274 * function should return the password for a specific account. 276 * function should return the password for a specific account. The password 277 * itself is usually stored in a secured password store. 275 278 * 276 279 * You need to set this property before you can start using the account. This … … 296 299 * @self: a #TnyAccount object 297 300 * 298 * Get the protocol of an account. The returned value should not be freed.301 * Get the protocol of @self. The returned value should not be freed. 299 302 * 300 303 * Return value: the protocol as a read-only string … … 318 321 * @self: a #TnyAccount object 319 322 * 320 * Get the url string of an account. The returned value should not be freed.323 * Get the url string of @self. The returned value should not be freed. 321 324 * 322 325 * Return value: the url string as a read-only string … … 338 341 * @self: a #TnyAccount object 339 342 * 340 * Get the user or login of an account. The returned value should not be freed.343 * Get the user or login of @self. The returned value should not be freed. 341 344 * 342 345 * Return value: the user as a read-only string … … 358 361 * @self: a #TnyAccount object 359 362 * 360 * Get the human readable name of an account. The returned value should not363 * Get the human readable name of @self. The returned value should not 361 364 * be freed. 362 365 * … … 379 382 * @self: a #TnyAccount object 380 383 * 381 * Get the hostname of an account. The returned value should not be freed.384 * Get the hostname of @self. The returned value should not be freed. 382 385 * 383 386 * Return value: the hostname as a read-only string trunk/libtinymail/tny-folder-store-query.c
r1173 r1198 38 38 tny_folder_store_query_new (void) 39 39 { 40 TnyFolderStoreQuery *self = g_object_new (TNY_TYPE_FOLDER_STORE_QUERY, NULL); 41 42 return self; 40 TnyFolderStoreQuery *self = g_object_new (TNY_TYPE_FOLDER_STORE_QUERY, NULL); 41 return self; 43 42 } 44 43 … … 173 172 * TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_ID then @pattern will be used as 174 173 * regular expression for matching the property of the folders. What the 175 * properties tny_folder_get_name and tny_folder_get_id would contain will176 * be used in this case.174 * properties tny_folder_get_name and tny_folder_get_id would contain, will 175 * be used while matching. 177 176 * 178 177 * Example: … … 186 185 * while (!tny_iterator_is_done (iter)) 187 186 * { 188 * TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter));189 * g_print ("%s\n", tny_folder_get_name (folder));190 * g_object_unref (G_OBJECT (folder));191 * tny_iterator_next (iter);187 * TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter)); 188 * g_print ("%s\n", tny_folder_get_name (folder)); 189 * g_object_unref (G_OBJECT (folder)); 190 * tny_iterator_next (iter); 192 191 * } 193 192 * g_object_unref (G_OBJECT (iter)); … … 210 209 * while (!tny_iterator_is_done (iter)) 211 210 * { 212 * TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter));213 * g_print ("%s\n", tny_folder_get_name (folder));214 * g_object_unref (G_OBJECT (folder));215 * tny_iterator_next (iter);211 * TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter)); 212 * g_print ("%s\n", tny_folder_get_name (folder)); 213 * g_object_unref (G_OBJECT (folder)); 214 * tny_iterator_next (iter); 216 215 * } 217 216 * g_object_unref (G_OBJECT (iter)); … … 260 259 * @query: a #TnyFolderStoreQuery object 261 260 * 262 * Get a list of query items 261 * Get a list of query items in @query. The return value must be unreferenced 262 * after use. 263 263 * 264 264 * Return value: a list of query items … … 267 267 tny_folder_store_query_get_items (TnyFolderStoreQuery *query) 268 268 { 269 return g_object_ref (G_OBJECT (query->items));269 return TNY_LIST (g_object_ref (G_OBJECT (query->items))); 270 270 } 271 271 … … 275 275 * @item: a #TnyFolderStoreQueryItem object 276 276 * 277 * Get the options of @item 277 * Get the options of @item as a #TnyFolderStoreQueryOption enum. 278 278 * 279 279 * Return value: the options of a query item trunk/libtinymail/tny-folder-store.c
r1187 r1198 30 30 * Removes a folder represented by @folder from the folder store @self. You are 31 31 * responsible for unreferencing the @folder instance yourself. This method will 32 * not do this for you, leaving the instance in an unusable state. The id of the 33 * @folder instance will be blanked once really deleted from the service. 34 * 35 * Example: 36 * <informalexample><programlisting> 37 * TnyFolderStore *store = ... 38 * TnyFolder *remfol; 39 * TnyIterator *iter; 40 * TnyList *folders = tny_simple_list_new (); 41 * tny_folder_store_get_folders (store, folders, NULL); 42 * iter = tny_list_create_iterator (folders); 43 * tny_iterator_first (iter); 44 * remfol = TNY_FOLDER (tny_iterator_get_current (iter)); 45 * g_object_unref (G_OBJECT (iter)); 46 * g_object_unref (G_OBJECT (folders)); 47 * tny_folder_store_remove_folder (store, remfol); 48 * g_object_unref (G_OBJECT (remfol)); 32 * not do this for you, leaving the @folder instance in an unusable state. The 33 * id of the @folder instance will be blanked once really deleted from the 34 * service. 35 * 36 * Example: 37 * <informalexample><programlisting> 38 * static void 39 * my_remove_a_folder (TnyFolderStore *store, TnyFolder *remfol) 40 * { 41 * tny_folder_store_remove_folder (store, remfol); 42 * g_object_unref (G_OBJECT (remfol)); 43 * } 49 44 * </programlisting></informalexample> 50 45 * … … 67 62 * @name: The folder name to create 68 63 * 69 * Creates a new folder in folder store @self. The value returned is the newly70 * created folderand must be unreferenced after use.64 * Creates a new folder in @self. The value returned is the newly created folder 65 * instance and must be unreferenced after use. 71 66 * 72 67 * Example: … … 98 93 * @query: A #TnyFolderStoreQuery object or NULL 99 94 * 100 * Get a list of child folders from the folder store @self. You can use @query 101 * to limit the list of folders with only folders that match the query. 102 * 95 * Get a list of child folders from @self. You can use @query to limit the list 96 * of folders with only folders that match a query or NULL if you don't want 97 * to limit the list at all. 98 * 103 99 * Example: 104 100 * <informalexample><programlisting> … … 140 136 * 141 137 * Get a list of child folders from the folder store @self and call back when 142 * finished. 138 * finished. You can use @query to limit the list of folders with only folders 139 * that match a query or NULL if you don't want to limit the list at all. 143 140 * 144 141 * Example: … … 172 169 * 173 170 * If you want to use this functionality, you are advised to let your application 174 * use the #GMainLoop. All Gtk+ applications have this once gtk_main () is 175 * called. 171 * use a #GMainLoop. All Gtk+ applications have this once gtk_main () is called. 176 172 * 177 173 * When using a #GMainLoop, this method will callback using g_idle_add_full. trunk/libtinymail/tny-folder.c
r1188 r1198 33 33 * Get the strategy for removing a message. The return value of this method 34 34 * must be unreferenced after use. 35 * 35 * 36 * Implementors: This method must return the strategy for removing a message. 37 * being the implementer, you must add a reference before returning the instance. 38 * 36 39 * Return value: the strategy for removing a message 37 40 **/ … … 52 55 * 53 56 * Set the strategy for removing a message 54 * 57 * 58 * Implementors: This method must set (store) the strategy for removing a 59 * message. 60 * 61 * The idea is that devices can have a specific such strategy. For example a 62 * strategy that removes it immediately from both local cache and a service 63 * or a strategy that does nothing but flag the message for removal upon next 64 * expunge or a strategy that does nothing. 65 * 66 * For more information take a look at tny_msg_remove_strategy_peform_remove 67 * of #TnyMsgRemoveStrategy. 68 * 55 69 **/ 56 70 void … … 120 134 * Remove a message from a folder. It will use a #TnyMsgRemoveStrategy to 121 135 * perform the removal itself. For more details, check out the documentation 122 * of the #TnyMsgRemoveStrategy type. 136 * of the #TnyMsgRemoveStrategy type and the implementation that you activated 137 * using tny_folder_set_msg_remove_strategy. The default implementation for 138 * libtinymail-camel is the #TnyCamelMsgRemoveStrategy. 123 139 * 124 140 * Example: … … 170 186 * @user_data: user data for the callback 171 187 * 172 * Refresh the folder and call back when finished. This gets the summary173 * information from the E-Mail service and writes it to the the on-disk cache174 * and/or updatesit.188 * Refresh @self and call back when finished. This gets the summary information 189 * from the E-Mail service, writes it to the the on-disk cache and/or updates 190 * it. 175 191 * 176 192 * After this method, tny_folder_get_all_count and … … 242 258 * @self: a TnyFolder object 243 259 * 244 * Refresh the folder. This gets the summary information from the E-Mail service245 * andwrites it to the the on-disk cache and/or updates it.260 * Refresh the folder. This gets the summary information from the E-Mail 261 * service, writes it to the the on-disk cache and/or updates it. 246 262 * 247 263 * After this method, tny_folder_get_all_count and … … 268 284 * @self: a TnyFolder object 269 285 * 270 * 271 * Get the subscribed status of this folder. 286 * Get the subscribtion status of this folder. 272 287 * 273 288 * Return value: subscribe status … … 289 304 * 290 305 * Get the amount of unread messages in this folder. The value is only 291 * garuanteed to be correct after tny_folder_refresh. 306 * garuanteed to be correct after tny_folder_refresh or after the callback of 307 * a tny_folder_refresh_async happened. 292 308 * 293 309 * Return value: amount of unread messages … … 309 325 * @self: a TnyFolder object 310 326 * 311 * Get the amount of messages in this folder. The value is only 312 * garuanteed to be correct after tny_folder_refresh. 327 * Get the amount of messages in this folder. The value is only garuanteed to be 328 * correct after tny_folder_refresh or after the callback of a 329 * tny_folder_refresh_async happened. 313 330 * 314 331 * Return value: amount of messages … … 349 366 /** 350 367 * tny_folder_transfer_msgs: 351 * @ folder_src: the TnyFolder where the headers are stored368 * @self: the TnyFolder where the headers are stored 352 369 * @header_list: a list of TnyHeader objects 353 370 * @folder_dst: the TnyFolder where the msgs will be transfered 354 371 * @delete_originals: if TRUE then move msgs, else copy them 355 372 * 356 * Transfers messages from a folder to another. They could be moved or 357 * just copied depending on the value of the delete_originals argument 373 * Transfers messages of which the headers are in @header_list from @self to 374 * @folder_dst. They could be moved or just copied depending on the value of 375 * the @delete_originals argument 376 * 358 377 **/ 359 378 void 360 tny_folder_transfer_msgs (TnyFolder *folder_src, 361 TnyList *headers, 362 TnyFolder *folder_dst, 363 gboolean delete_originals) 364 { 365 #ifdef DEBUG 366 if (!TNY_FOLDER_GET_IFACE (folder_src)->transfer_msgs_func) 379 tny_folder_transfer_msgs (TnyFolder *self, TnyList *headers, TnyFolder *folder_dst, gboolean delete_originals) 380 { 381 #ifdef DEBUG 382 if (!TNY_FOLDER_GET_IFACE (self)->transfer_msgs_func) 367 383 g_critical ("You must implement tny_folder_transfer_msgs\n"); 368 384 #endif 369 385 370 return TNY_FOLDER_GET_IFACE ( folder_src)->transfer_msgs_func (folder_src, headers, folder_dst, delete_originals);386 return TNY_FOLDER_GET_IFACE (self)->transfer_msgs_func (self, headers, folder_dst, delete_originals); 371 387 } 372 388 trunk/libtinymail/tny-folder.h
r1188 r1198 65 65 TNY_FOLDER_TYPE_ROOT 66 66 }; 67 68 /* TODO: Moving messages */69 67 70 68 struct _TnyFolderIface … … 90 88 void (*refresh_async_func) (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 91 89 void (*refresh_func) (TnyFolder *self); 92 void (*transfer_msgs_func) (TnyFolder * folder_src, TnyList *header_list, TnyFolder *folder_dst, gboolean delete_originals);90 void (*transfer_msgs_func) (TnyFolder *self, TnyList *header_list, TnyFolder *folder_dst, gboolean delete_originals); 93 91 }; 94 92 trunk/libtinymail/tny-msg-remove-strategy.c
r1117 r1198 23 23 24 24 /** 25 * tny_msg_remove_strategy_ remove:25 * tny_msg_remove_strategy_peform_remove: 26 26 * @self: A #TnyMsgRemoveStrategy instance 27 27 * @folder: The #TnyFolder instance from which the message will be removed … … 59 59 **/ 60 60 void 61 tny_msg_remove_strategy_ remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header)61 tny_msg_remove_strategy_perform_remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header) 62 62 { 63 63 #ifdef DEBUG 64 if (!TNY_MSG_REMOVE_STRATEGY_GET_IFACE (self)-> remove_func)64 if (!TNY_MSG_REMOVE_STRATEGY_GET_IFACE (self)->perform_remove_func) 65 65 g_critical ("You must implement tny_msg_remove_strategy_remove\n"); 66 66 #endif 67 67 68 TNY_MSG_REMOVE_STRATEGY_GET_IFACE (self)-> remove_func (self, folder, header);68 TNY_MSG_REMOVE_STRATEGY_GET_IFACE (self)->perform_remove_func (self, folder, header); 69 69 return; 70 70 } trunk/libtinymail/tny-msg-remove-strategy.h
r1092 r1198 41 41 GTypeInterface parent; 42 42 43 void (* remove_func) (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header);43 void (*perform_remove_func) (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header); 44 44 }; 45 45 46 46 GType tny_msg_remove_strategy_get_type (void); 47 void tny_msg_remove_strategy_ remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header);47 void tny_msg_remove_strategy_perform_remove (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header); 48 48 49 49 G_END_DECLS trunk/libtinymailui-gtk/tny-gtk-header-list-model.c
r1197 r1198 492 492 493 493 static void 494 tny_gtk_header_list_model_unref_node (GtkTreeModel *self, GtkTreeIter *iter)495 {496 return;497 }498 /*499 TnyHeader *header = NULL;500 TnyGtkHeaderListModel *list_model = TNY_GTK_HEADER_LIST_MODEL (self);501 502 g_return_if_fail (self);503 g_return_if_fail (iter->stamp == TNY_GTK_HEADER_LIST_MODEL (self)->stamp);504 505 * Unref node happens when the GtkTreeView no longer needs the506 reference to the GtkTreeIter (nor its user_data) *507 508 if (!iter->user_data);509 return;510 511 g_mutex_lock (list_model->folder_lock);512 g_mutex_lock (list_model->iterator_lock);513 514 header = iter->user_data;515 516 * We can use the knowledge that it no longer needs the reference,517 to uncache the instance. Uncached instances are instances that518 typically no longer have their real subject inmem. Next time they'll519 get a property-request, they'll create a new real subject (which520 takes a certain amount of time) and will cache that before replying521 the request using the real subject. *522 523 if (G_LIKELY (header))524 tny_header_uncache (header);525 526 g_mutex_unlock (list_model->iterator_lock);527 g_mutex_unlock (list_model->folder_lock);528 529 return;530 }531 */532 533 static void534 tny_gtk_header_list_model_ref_node (GtkTreeModel *self, GtkTreeIter *iter)535 {536 return;537 }538 539 static void540 494 tny_gtk_header_list_model_tree_model_init (GtkTreeModelIface *iface) 541 495 { … … 550 504 iface->iter_n_children = tny_gtk_header_list_model_iter_n_children; 551 505 iface->iter_nth_child = tny_gtk_header_list_model_iter_nth_child; 552 iface->ref_node = tny_gtk_header_list_model_ref_node;553 iface->unref_node = tny_gtk_header_list_model_unref_node;554 506 555 507 return; … … 814 766 d->list = g_list_copy (self->first); 815 767 d->final_func = final_func; 816 d->ffdata = ffdata;817 d->ffudata = ffudata;818 768 d->ffdata = ffdata; 769 d->ffudata = ffudata; 770 819 771 g_idle_add_full (G_PRIORITY_LOW, tny_gtk_header_list_model_relaxed_performer, 820 772 d, tny_gtk_header_list_model_relaxed_data_destroyer); … … 1071 1023 1072 1024 g_type_add_interface_static (object_type, GTK_TYPE_TREE_MODEL, 1073 &tree_model_info);1025 &tree_model_info); 1074 1026 1075 1027 g_type_add_interface_static (object_type, TNY_TYPE_LIST, 1076 &tny_list_info);1028 &tny_list_info); 1077 1029 1078 1030 } trunk/libtinymailui-gtk/tny-gtk-header-view.c
r1197 r1198 43 43 44 44 45 /* TODO: refactor */46 45 static gchar * 47 46 _get_readable_date (time_t file_time_raw) trunk/libtinymailui/tny-account-store-view.c
r1002 r1198 30 30 * Set the account store of the view. 31 31 * 32 * Implementors: This should let the account store view @self display the 33 * account store @account_store. 32 * Implementors: This should let @self display @account_store. 34 33 **/ 35 34 void trunk/libtinymailui/tny-header-view.c
r1002 r1198 26 26 * @self: A #TnyHeaderView instance 27 27 * 28 * Clear the view@self (show nothing)28 * Clear @self (show nothing) 29 29 * 30 30 * Implementors: this method should clear view @self (display nothing and … … 50 50 * @header: A #TnyHeader instace 51 51 * 52 * Set header of the view @self52 * Set @self to display @header 53 53 * 54 * Implementors: this method should cause the view @self to show the header 55 * @header to the user. This typically means showing the from, to, subject, date 56 * and cc labels. 54 * Implementors: this method should cause @self to show @header to the user. 55 * This typically means showing the from, to, subject, date and cc labels. 57 56 * 58 * #TnyHeaderViewis often used in a composition with a #TnyMsgView57 * The #TnyHeaderView type is often used in a composition with a #TnyMsgView 59 58 * type (the #TnyMsgView implementation contains or aggregates a #TnyHeaderView). 60 59 * trunk/libtinymailui/tny-mime-part-save-strategy.c
r1136 r1198 27 27 * @part: The #TnyMimePart instance that must be saved 28 28 * 29 * Performs the saving of a mime part 29 * With @self being a delegate of a #TnyMimePartSaver, this method performs the 30 * saving of @part. 30 31 * 31 32 * A save strategy for a mime part is used with a type that implements the 32 33 * #TnyMimePartSaver interface. Types that do, will often also implement the 33 * #TnyMsgView interface (it's not a requirement). In this case they say that34 * the view has functionality for saving mime parts.34 * #TnyMsgView or #TnyMimePartView interface (it's not a requirement). In this 35 * case they say that the view has functionality for saving mime parts. 35 36 * 36 37 * You can for example inherit an implementation of a #TnyMsgView, like the 37 38 * #TnyGtkMsgView one, and let yours also implement #TnyMimePartSaver. The 38 * example shown here is such a situation39 * example shown here is for example such a situation. 39 40 * 40 41 * Example: … … 48 49 * </programlisting></informalexample> 49 50 * 50 * Implementors: The idea is that devices can have specific such strategies. 51 * Implementors: The idea is that devices can have specific strategies that can 52 * be changed at runtime. 53 * 51 54 * For example a strategy that sends it to another computer and/or a strategy 52 55 * that saves it to a flash disk. Configurable at runtime by simply switching 53 56 * the strategy property of a #TnyMimePartSaver. 54 57 * 55 * The implementation shown in the example implements it using the gtk+ toolkit. 56 * Saving a mime part can also be doing nothing, if your device doesn't support 57 * it. Maybe you will implement it by letting it contact a service and sending 58 * the mime part to it? It's up to you. 58 * The implementation shown in this example implements it using the gtk+ toolkit. 59 * If your device doesn't support saving mime parts, saving a mime part can also 60 * be implemented by doing nothing. For example a #TnyMyDoNothingSaveStrategy. 61 * Maybe you will implement it by letting it contact a service and sending the 62 * mime part to it? It's up to you. 59 63 * 60 64 * Example: … … 70 74 * GTK_RESPONSE_ACCEPT, NULL)); 71 75 * gtk_file_chooser_set_current_name (dialog, 72 * tny_mime_part_get_filename (part)); 73 * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { 76 * tny_mime_part_get_filename (part)); 77 * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) 78 * { 74 79 * gchar *uri; int fd; 75 80 * uri = gtk_file_chooser_get_filename (dialog); … … 86 91 * 87 92 * The method is typically called by the implementation of a #TnyMsgView. 88 * For example a clicked handler of a popup menu of a attachment view in the93 * For example a clicked handler of a popup menu of a attachment view in your 89 94 * #TnyMsgView implementation. 90 95 * 91 * Note that a mime can mean both the entire message (without its headers) and 92 * one individual
