From cd391684b9e177e208e90bcd53da83e871e06de5 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 27 Nov 2006 10:12:31 +0000 Subject: [PATCH] * A lot of changes in the documentation, now it's generated correctly * Modified some enum type definitions to fit well with gtk-doc * Added msg-actions and folder-actions stuff to ModestMailOperation * Added the key options to the account namespace * Added a new method to retrieve lists to ModestConf * Changed the constructor of the MailOperation * Added some test code to the widget factory * Added a new tests/ directory to place functional tests * Added a new test to transfer folders pmo-trunk-r492 --- Makefile.am | 6 +- configure.ac | 1 + docs/reference/Makefile.am | 35 +- docs/reference/modest-sections.txt | 1465 +++++++++++++++++++-- docs/reference/tmpl/modest-account-keys.sgml | 64 +- docs/reference/tmpl/modest-account-mgr.sgml | 231 +++- docs/reference/tmpl/modest-conf-keys.sgml | 163 +++ docs/reference/tmpl/modest-conf.sgml | 95 +- docs/reference/tmpl/modest-main-window.sgml | 5 +- docs/reference/tmpl/modest-proto.sgml | 136 ++ docs/reference/tmpl/modest-tny-account-store.sgml | 45 +- docs/reference/tmpl/modest-ui.sgml | 111 +- docs/reference/tmpl/modest-unused.sgml | 264 +++- src/Makefile.am | 19 +- src/gtk/modest-edit-msg-window.c | 3 +- src/gtk/modest-edit-msg-window.h | 6 +- src/gtk/modest-main-window.c | 11 +- src/modest-account-keys.h | 1 + src/modest-account-mgr.c | 27 + src/modest-account-mgr.h | 8 + src/modest-conf.c | 31 + src/modest-conf.h | 15 +- src/modest-mail-operation.c | 390 ++++-- src/modest-mail-operation.h | 102 +- src/modest-main.c | 3 +- src/modest-presets.h | 6 +- src/modest-protocol-mgr.h | 10 +- src/modest-tny-account-store.c | 52 +- src/modest-tny-msg-actions.c | 55 - src/modest-tny-msg-actions.h | 6 - src/modest-widget-factory.c | 55 +- src/modest-widget-factory.h | 6 +- src/widgets/Makefile.am | 28 +- src/widgets/modest-header-view.h | 55 +- src/widgets/modest-toolbar.h | 27 +- tests/Makefile.am | 31 + tests/folder-transfer.c | 185 +++ 37 files changed, 3298 insertions(+), 455 deletions(-) create mode 100644 tests/Makefile.am create mode 100644 tests/folder-transfer.c diff --git a/Makefile.am b/Makefile.am index 3704ae9..d1bcb0f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,13 +3,11 @@ # Time-stamp: <2006-04-22 16:29:00 (djcb)> # -SUBDIRS= docs src po +SUBDIRS= src tests po docs -EXTRA_DIST= config.rpath config.rpath mkinstalldirs m4/ChangeLog \ +EXTRA_DIST= config.rpath config.rpath mkinstalldirs \ autogen.sh TODO COPYING intltool-extract.in intltool-merge.in \ intltool-update.in CFLAGS=\ -Wall - -ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index fb8b657..b2c1766 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,7 @@ src/gtk/Makefile src/widgets/Makefile docs/Makefile docs/reference/Makefile +tests/Makefile ]) echo diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index 31703d1..e02b510 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -22,7 +22,10 @@ SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= +SCAN_OPTIONS=\ + --source-dir=$(top_srcdir)/src \ + --source-dir=$(top_srcdir)/src/gtk \ + --source-dir=$(top_srcdir)/src/widgets # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml @@ -64,8 +67,34 @@ expand_content_files= # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES=-I$(top_srcdir)/src $(MODEST_GSTUFF_CFLAGS) -GTKDOC_LIBS=$(MODEST_GSTUFF_LIBS) +INCLUDES= \ + -I$(top_srcdir)/src $(MODEST_GSTUFF_CFLAGS) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/gtk \ + -I$(top_srcdir)/src/widgets + + +GTKDOC_LIBS=\ + $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ + $(MODEST_LIBTINYMAIL_MAEMO_LIBS) \ + $(MODEST_GSTUFF_LIBS) \ + $(top_builddir)/src/gtk/libmodest-ui.la \ + $(top_builddir)/src/widgets/libmodest-widgets.la\ + ${top_builddir}/src/modest-conf.o \ + ${top_builddir}/src/modest-account-mgr.o \ + ${top_builddir}/src/modest-tny-platform-factory.o \ + ${top_builddir}/src/modest-protocol-mgr.o \ + ${top_builddir}/src/modest-pair.o \ + ${top_builddir}/src/modest-marshal.o \ + ${top_builddir}/src/modest-tny-account-store.o \ + ${top_builddir}/src/modest-mail-operation.o \ + ${top_builddir}/src/modest-tny-msg-actions.o \ + ${top_builddir}/src/modest-tny-attachment.o \ + ${top_builddir}/src/modest-tny-stream-gtkhtml.o \ + ${top_builddir}/src/modest-widget-factory.o \ + ${top_builddir}/src/modest-widget-memory.o \ + ${top_builddir}/src/modest-icon-factory.o \ + ${top_builddir}/src/modest-text-utils.o # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make diff --git a/docs/reference/modest-sections.txt b/docs/reference/modest-sections.txt index 8ac5e91..7135841 100644 --- a/docs/reference/modest-sections.txt +++ b/docs/reference/modest-sections.txt @@ -1,10 +1,43 @@
+modest-tny-attachment +ModestTnyAttachment +ModestTnyAttachment +modest_tny_attachment_new +modest_tny_attachment_set_name +modest_tny_attachment_get_name +modest_tny_attachment_set_filename +modest_tny_attachment_get_filename +modest_tny_attachment_set_mime_type +modest_tny_attachment_get_mime_type +modest_tny_attachment_guess_mime_type +modest_tny_attachment_get_stream +modest_tny_attachment_free_list + +MODEST_TNY_ATTACHMENT +MODEST_IS_TNY_ATTACHMENT +MODEST_TYPE_TNY_ATTACHMENT +modest_tny_attachment_get_type +MODEST_TNY_ATTACHMENT_CLASS +MODEST_IS_TNY_ATTACHMENT_CLASS +MODEST_TNY_ATTACHMENT_GET_CLASS +
+ +
modest-ui ModestUI ModestUI modest_ui_new modest_ui_show_main_window -modest_ui_show_edit_window +modest_ui_new_edit_window +modest_ui_new_editor_window +modest_ui_editor_window_set_to_header +modest_ui_editor_window_set_cc_header +modest_ui_editor_window_set_bcc_header +modest_ui_editor_window_set_subject_header +modest_ui_editor_window_set_body +modest_ui_editor_window_update_attachments +modest_ui_new_viewer_window +modest_ui_main_window MODEST_UI MODEST_IS_UI @@ -16,62 +49,491 @@ MODEST_UI_GET_CLASS
-modest-tny-header-tree-view -ModestTnyHeaderTreeView -ModestTnyHeaderTreeView -modest_tny_header_tree_view_new -modest_tny_header_tree_view_set_folder +modest-account-mgr +ModestAccountMgr +ModestAccountMgr +ModestServerAccountData +ModestAccountData +modest_account_mgr_new +modest_account_mgr_add_account +modest_account_mgr_add_server_account +modest_account_mgr_remove_account +modest_account_mgr_account_names +modest_account_mgr_search_server_accounts +modest_account_mgr_account_exists +modest_account_mgr_get_account_data +modest_account_mgr_free_account_data +modest_account_mgr_account_set_enabled +modest_account_mgr_account_get_enabled +modest_account_mgr_get_string +modest_account_mgr_get_int +modest_account_mgr_get_bool +modest_account_mgr_set_string +modest_account_mgr_set_int +modest_account_mgr_set_bool +modest_account_mgr_get_list + +MODEST_ACCOUNT_MGR +MODEST_IS_ACCOUNT_MGR +MODEST_TYPE_ACCOUNT_MGR +modest_account_mgr_get_type +MODEST_ACCOUNT_MGR_CLASS +MODEST_IS_ACCOUNT_MGR_CLASS +MODEST_ACCOUNT_MGR_GET_CLASS +
+ +
+modest-protocol-mgr +ModestProtocolMgr +ModestProtocolMgr +MODEST_PROTOCOL_TRANSPORT_SENDMAIL +MODEST_PROTOCOL_TRANSPORT_SMTP +MODEST_PROTOCOL_STORE_NONE +MODEST_PROTOCOL_STORE_POP +MODEST_PROTOCOL_STORE_IMAP +MODEST_PROTOCOL_STORE_MAILDIR +MODEST_PROTOCOL_STORE_MBOX +MODEST_PROTOCOL_SECURITY_NONE +MODEST_PROTOCOL_SECURITY_SSL +MODEST_PROTOCOL_SECURITY_TLS +MODEST_PROTOCOL_AUTH_NONE +MODEST_PROTOCOL_AUTH_PASSWORD +ModestProtocolType +modest_protocol_mgr_new +modest_protocol_mgr_get_transport_protocols +modest_protocol_mgr_get_store_protocols +modest_protocol_mgr_get_security_protocols +modest_protocol_mgr_get_auth_protocols +modest_protocol_mgr_protocol_is_valid -MODEST_TNY_HEADER_TREE_VIEW -MODEST_IS_TNY_HEADER_TREE_VIEW -MODEST_TYPE_TNY_HEADER_TREE_VIEW -modest_tny_header_tree_view_get_type -MODEST_TNY_HEADER_TREE_VIEW_CLASS -MODEST_IS_TNY_HEADER_TREE_VIEW_CLASS -MODEST_TNY_HEADER_TREE_VIEW_GET_CLASS +MODEST_PROTOCOL_MGR +MODEST_IS_PROTOCOL_MGR +MODEST_TYPE_PROTOCOL_MGR +modest_protocol_mgr_get_type +MODEST_PROTOCOL_MGR_CLASS +MODEST_IS_PROTOCOL_MGR_CLASS +MODEST_PROTOCOL_MGR_GET_CLASS
-modest-tny-msg-view -ModestTnyMsgView -ModestTnyMsgView -modest_tny_msg_view_new -modest_tny_msg_view_set_message +modest-conf +ModestConfValueType +ModestConfEvent +ModestConf +ModestConf +modest_conf_new +modest_conf_get_string +modest_conf_get_int +modest_conf_get_bool +modest_conf_get_string_or_default +modest_conf_get_int_or_default +modest_conf_set_string +modest_conf_set_int +modest_conf_set_bool +modest_conf_list_subkeys +modest_conf_remove_key +modest_conf_key_exists +modest_conf_key_escape +modest_conf_key_unescape +modest_conf_get_list -MODEST_TNY_MSG_VIEW -MODEST_IS_TNY_MSG_VIEW -MODEST_TYPE_TNY_MSG_VIEW -modest_tny_msg_view_get_type -MODEST_TNY_MSG_VIEW_CLASS -MODEST_IS_TNY_MSG_VIEW_CLASS -MODEST_TNY_MSG_VIEW_GET_CLASS +MODEST_CONF +MODEST_IS_CONF +MODEST_TYPE_CONF +modest_conf_get_type +MODEST_CONF_CLASS +MODEST_IS_CONF_CLASS +MODEST_CONF_GET_CLASS +
+ +
+modest-tny-platform-factory +ModestTnyPlatformFactory +ModestTnyPlatformFactory +modest_tny_platform_factory_get_instance +modest_tny_platform_factory_get_modest_account_mgr_instance +modest_tny_platform_factory_get_modest_conf_instance + +MODEST_TNY_PLATFORM_FACTORY +MODEST_IS_TNY_PLATFORM_FACTORY +MODEST_TYPE_TNY_PLATFORM_FACTORY +modest_tny_platform_factory_get_type +MODEST_TNY_PLATFORM_FACTORY_CLASS +MODEST_IS_TNY_PLATFORM_FACTORY_CLASS +MODEST_TNY_PLATFORM_FACTORY_GET_CLASS +
+ +
+modest-tny-stream-gtkhtml +ModestTnyStreamGtkhtml +ModestTnyStreamGtkhtml +modest_tny_stream_gtkhtml_new + +MODEST_TNY_STREAM_GTKHTML +MODEST_IS_TNY_STREAM_GTKHTML +MODEST_TYPE_TNY_STREAM_GTKHTML +modest_tny_stream_gtkhtml_get_type +MODEST_TNY_STREAM_GTKHTML_CLASS +MODEST_IS_TNY_STREAM_GTKHTML_CLASS +MODEST_TNY_STREAM_GTKHTML_GET_CLASS +
+ +
+modest-mail-operation +ModestMailOperationForwardType +ModestMailOperationReplyType +ModestMailOperationReplyMode +ModestMailOperationStatus +ModestMailOperation +ModestMailOperation +modest_mail_operation_new +modest_mail_operation_send_mail +modest_mail_operation_send_new_mail +modest_mail_operation_create_forward_mail +modest_mail_operation_create_reply_mail +modest_mail_operation_update_account +modest_mail_operation_create_folder +modest_mail_operation_remove_folder +modest_mail_operation_rename_folder +modest_mail_operation_move_folder +modest_mail_operation_copy_folder +modest_mail_operation_move_folder_to_trash +modest_mail_operation_get_status +modest_mail_operation_get_error +modest_mail_operation_cancel + +MODEST_MAIL_OPERATION +MODEST_IS_MAIL_OPERATION +MODEST_TYPE_MAIL_OPERATION +modest_mail_operation_get_type +MODEST_MAIL_OPERATION_CLASS +MODEST_IS_MAIL_OPERATION_CLASS +MODEST_MAIL_OPERATION_GET_CLASS +
+ +
+modest-tny-account-store +ModestTnyGetPassFunc +ModestTnyAccountStore +ModestTnyAccountStore +modest_tny_account_store_new +tny_account_store_get_session + +MODEST_TNY_ACCOUNT_STORE +MODEST_IS_TNY_ACCOUNT_STORE +MODEST_TYPE_TNY_ACCOUNT_STORE +modest_tny_account_store_get_type +MODEST_TNY_ACCOUNT_STORE_CLASS +MODEST_IS_TNY_ACCOUNT_STORE_CLASS +MODEST_TNY_ACCOUNT_STORE_GET_CLASS +
+ +
+modest-widget-factory +ModestWidgetFactory +ModestWidgetFactory +ModestComboBoxType +modest_widget_factory_new +modest_widget_factory_get_folder_view +modest_widget_factory_get_header_view +modest_widget_factory_get_msg_preview +modest_widget_factory_get_account_view +modest_widget_factory_get_progress_bar +modest_widget_factory_get_status_bar +modest_widget_factory_get_combo_box +modest_widget_factory_get_online_toggle +modest_widget_factory_get_folder_info_label +modest_widget_factory_get_main_toolbar +modest_widget_factory_get_edit_toolbar + +MODEST_WIDGET_FACTORY +MODEST_IS_WIDGET_FACTORY +MODEST_TYPE_WIDGET_FACTORY +modest_widget_factory_get_type +MODEST_WIDGET_FACTORY_CLASS +MODEST_IS_WIDGET_FACTORY_CLASS +MODEST_WIDGET_FACTORY_GET_CLASS +
+ +
+modest-account-assistant +ModestAccountAssistant +ModestAccountAssistant +modest_account_assistant_new + +MODEST_ACCOUNT_ASSISTANT +MODEST_IS_ACCOUNT_ASSISTANT +MODEST_TYPE_ACCOUNT_ASSISTANT +modest_account_assistant_get_type +MODEST_ACCOUNT_ASSISTANT_CLASS +MODEST_IS_ACCOUNT_ASSISTANT_CLASS +MODEST_ACCOUNT_ASSISTANT_GET_CLASS +
+ +
+modest-account-view-window +ModestAccountViewWindow +ModestAccountViewWindow +modest_account_view_window_new + +MODEST_ACCOUNT_VIEW_WINDOW +MODEST_IS_ACCOUNT_VIEW_WINDOW +MODEST_TYPE_ACCOUNT_VIEW_WINDOW +modest_account_view_window_get_type +MODEST_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_IS_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_ACCOUNT_VIEW_WINDOW_GET_CLASS +
+ +
+modest-transport-widget +ModestTransportWidget +ModestTransportWidget +modest_transport_widget_new +modest_transport_widget_get_remember_password +modest_transport_widget_get_username +modest_transport_widget_get_servername +modest_transport_widget_get_proto + +MODEST_TRANSPORT_WIDGET +MODEST_IS_TRANSPORT_WIDGET +MODEST_TYPE_TRANSPORT_WIDGET +modest_transport_widget_get_type +MODEST_TRANSPORT_WIDGET_CLASS +MODEST_IS_TRANSPORT_WIDGET_CLASS +MODEST_TRANSPORT_WIDGET_GET_CLASS +
+ +
+modest-store-widget +ModestStoreWidget +ModestStoreWidget +modest_store_widget_new +modest_store_widget_get_remember_password +modest_store_widget_get_username +modest_store_widget_get_servername +modest_store_widget_get_proto + +MODEST_STORE_WIDGET +MODEST_IS_STORE_WIDGET +MODEST_TYPE_STORE_WIDGET +modest_store_widget_get_type +MODEST_STORE_WIDGET_CLASS +MODEST_IS_STORE_WIDGET_CLASS +MODEST_STORE_WIDGET_GET_CLASS +
+ +
+modest-edit-msg-window +ModestEditMsgWindow +ModestEditMsgWindow +ModestEditType +modest_edit_msg_window_new + +MODEST_EDIT_MSG_WINDOW +MODEST_IS_EDIT_MSG_WINDOW +MODEST_TYPE_EDIT_MSG_WINDOW +modest_edit_msg_window_get_type +MODEST_EDIT_MSG_WINDOW_CLASS +MODEST_IS_EDIT_MSG_WINDOW_CLASS +MODEST_EDIT_MSG_WINDOW_GET_CLASS +
+ +
+modest-main-window +ModestMainWindow +ModestMainWindow +modest_main_window_new + +MODEST_MAIN_WINDOW +MODEST_IS_MAIN_WINDOW +MODEST_TYPE_MAIN_WINDOW +modest_main_window_get_type +MODEST_MAIN_WINDOW_CLASS +MODEST_IS_MAIN_WINDOW_CLASS +MODEST_MAIN_WINDOW_GET_CLASS +
+ +
+modest-account-view +ModestAccountView +ModestAccountView +modest_account_view_new + +MODEST_ACCOUNT_VIEW +MODEST_IS_ACCOUNT_VIEW +MODEST_TYPE_ACCOUNT_VIEW +modest_account_view_get_type +MODEST_ACCOUNT_VIEW_CLASS +MODEST_IS_ACCOUNT_VIEW_CLASS +MODEST_ACCOUNT_VIEW_GET_CLASS +
+ +
+modest-header-view +ModestHeaderView +ModestHeaderView +ModestHeaderViewColumn +ModestHeaderViewStyle +ModestItemType +modest_header_view_new +modest_header_view_set_folder +modest_header_view_set_columns +modest_header_view_get_columns +modest_header_view_set_style +modest_header_view_get_style +modest_header_view_get_selected_headers + +MODEST_HEADER_VIEW +MODEST_IS_HEADER_VIEW +MODEST_TYPE_HEADER_VIEW +modest_header_view_get_type +MODEST_HEADER_VIEW_CLASS +MODEST_IS_HEADER_VIEW_CLASS +MODEST_HEADER_VIEW_GET_CLASS +
+ +
+modest-toolbar +ModestToolbar +ModestToolbar +ModestToolbarButton +modest_toolbar_new + +MODEST_TOOLBAR +MODEST_IS_TOOLBAR +MODEST_TYPE_TOOLBAR +modest_toolbar_get_type +MODEST_TOOLBAR_CLASS +MODEST_IS_TOOLBAR_CLASS +MODEST_TOOLBAR_GET_CLASS +
+ +
+modest-folder-view +ModestFolderView +ModestFolderView +modest_folder_view_new +modest_folder_view_is_empty +modest_folder_view_get_selected_account + +MODEST_FOLDER_VIEW +MODEST_IS_FOLDER_VIEW +MODEST_TYPE_FOLDER_VIEW +modest_folder_view_get_type +MODEST_FOLDER_VIEW_CLASS +MODEST_IS_FOLDER_VIEW_CLASS +MODEST_FOLDER_VIEW_GET_CLASS +
+ +
+modest-combo-box +ModestComboBox +ModestComboBox +modest_combo_box_new +modest_combo_box_get_active_id +modest_combo_box_get_active_display_name + +MODEST_COMBO_BOX +MODEST_IS_COMBO_BOX +MODEST_TYPE_COMBO_BOX +modest_combo_box_get_type +MODEST_COMBO_BOX_CLASS +MODEST_IS_COMBO_BOX_CLASS +MODEST_COMBO_BOX_GET_CLASS +
+ +
+modest-msg-view +ModestMsgView +ModestMsgView +modest_msg_view_new +modest_msg_view_set_message +modest_msg_view_get_selected_text + +MODEST_MSG_VIEW +MODEST_IS_MSG_VIEW +MODEST_TYPE_MSG_VIEW +modest_msg_view_get_type +MODEST_MSG_VIEW_CLASS +MODEST_IS_MSG_VIEW_CLASS +MODEST_MSG_VIEW_GET_CLASS +
+ +
+modest-tny-attachment +ModestTnyAttachment +ModestTnyAttachment +modest_tny_attachment_new +modest_tny_attachment_set_name +modest_tny_attachment_get_name +modest_tny_attachment_set_filename +modest_tny_attachment_get_filename +modest_tny_attachment_set_mime_type +modest_tny_attachment_get_mime_type +modest_tny_attachment_guess_mime_type +modest_tny_attachment_get_stream +modest_tny_attachment_free_list + +MODEST_TNY_ATTACHMENT +MODEST_IS_TNY_ATTACHMENT +MODEST_TYPE_TNY_ATTACHMENT +modest_tny_attachment_get_type +MODEST_TNY_ATTACHMENT_CLASS +MODEST_IS_TNY_ATTACHMENT_CLASS +MODEST_TNY_ATTACHMENT_GET_CLASS +
+ +
+modest-ui +ModestUI +ModestUI +modest_ui_new +modest_ui_show_main_window +modest_ui_new_edit_window +modest_ui_new_editor_window +modest_ui_editor_window_set_to_header +modest_ui_editor_window_set_cc_header +modest_ui_editor_window_set_bcc_header +modest_ui_editor_window_set_subject_header +modest_ui_editor_window_set_body +modest_ui_editor_window_update_attachments +modest_ui_new_viewer_window +modest_ui_main_window + +MODEST_UI +MODEST_IS_UI +MODEST_TYPE_UI +modest_ui_get_type +MODEST_UI_CLASS +MODEST_IS_UI_CLASS +MODEST_UI_GET_CLASS
modest-account-mgr ModestAccountMgr ModestAccountMgr +ModestServerAccountData +ModestAccountData modest_account_mgr_new modest_account_mgr_add_account -modest_account_mgr_remove_account modest_account_mgr_add_server_account -modest_account_mgr_remove_server_account +modest_account_mgr_remove_account modest_account_mgr_account_names -modest_account_mgr_server_account_names +modest_account_mgr_search_server_accounts modest_account_mgr_account_exists -modest_account_mgr_server_account_exists -modest_account_mgr_get_account_string -modest_account_mgr_get_server_account_string -modest_account_mgr_get_account_int -modest_account_mgr_get_server_account_int -modest_account_mgr_get_account_bool -modest_account_mgr_get_server_account_bool -modest_account_mgr_set_account_string -modest_account_mgr_set_server_account_string -modest_account_mgr_set_account_int -modest_account_mgr_set_server_account_int -modest_account_mgr_set_account_bool -modest_account_mgr_set_server_account_bool +modest_account_mgr_get_account_data +modest_account_mgr_free_account_data +modest_account_mgr_account_set_enabled +modest_account_mgr_account_get_enabled +modest_account_mgr_get_string +modest_account_mgr_get_int +modest_account_mgr_get_bool +modest_account_mgr_set_string +modest_account_mgr_set_int +modest_account_mgr_set_bool +modest_account_mgr_get_list MODEST_ACCOUNT_MGR MODEST_IS_ACCOUNT_MGR @@ -83,19 +545,59 @@ MODEST_ACCOUNT_MGR_GET_CLASS
+modest-protocol-mgr +ModestProtocolMgr +ModestProtocolMgr +MODEST_PROTOCOL_TRANSPORT_SENDMAIL +MODEST_PROTOCOL_TRANSPORT_SMTP +MODEST_PROTOCOL_STORE_NONE +MODEST_PROTOCOL_STORE_POP +MODEST_PROTOCOL_STORE_IMAP +MODEST_PROTOCOL_STORE_MAILDIR +MODEST_PROTOCOL_STORE_MBOX +MODEST_PROTOCOL_SECURITY_NONE +MODEST_PROTOCOL_SECURITY_SSL +MODEST_PROTOCOL_SECURITY_TLS +MODEST_PROTOCOL_AUTH_NONE +MODEST_PROTOCOL_AUTH_PASSWORD +ModestProtocolType +modest_protocol_mgr_new +modest_protocol_mgr_get_transport_protocols +modest_protocol_mgr_get_store_protocols +modest_protocol_mgr_get_security_protocols +modest_protocol_mgr_get_auth_protocols +modest_protocol_mgr_protocol_is_valid + +MODEST_PROTOCOL_MGR +MODEST_IS_PROTOCOL_MGR +MODEST_TYPE_PROTOCOL_MGR +modest_protocol_mgr_get_type +MODEST_PROTOCOL_MGR_CLASS +MODEST_IS_PROTOCOL_MGR_CLASS +MODEST_PROTOCOL_MGR_GET_CLASS +
+ +
modest-conf +ModestConfValueType +ModestConfEvent ModestConf ModestConf modest_conf_new modest_conf_get_string modest_conf_get_int modest_conf_get_bool +modest_conf_get_string_or_default +modest_conf_get_int_or_default modest_conf_set_string modest_conf_set_int modest_conf_set_bool modest_conf_list_subkeys modest_conf_remove_key modest_conf_key_exists +modest_conf_key_escape +modest_conf_key_unescape +modest_conf_get_list MODEST_CONF MODEST_IS_CONF @@ -107,44 +609,73 @@ MODEST_CONF_GET_CLASS
-modest-window-mgr -ModestWindowType -ModestOpenWindow -ModestWindowMgr -ModestWindowMgr -modest_window_mgr_new -modest_window_mgr_register -modest_window_mgr_unregister -modest_window_mgr_find_by_type -modest_window_mgr_find_by_id +modest-tny-platform-factory +ModestTnyPlatformFactory +ModestTnyPlatformFactory +modest_tny_platform_factory_get_instance +modest_tny_platform_factory_get_modest_account_mgr_instance +modest_tny_platform_factory_get_modest_conf_instance -MODEST_WINDOW_MGR -MODEST_IS_WINDOW_MGR -MODEST_TYPE_WINDOW_MGR -modest_window_mgr_get_type -MODEST_WINDOW_MGR_CLASS -MODEST_IS_WINDOW_MGR_CLASS -MODEST_WINDOW_MGR_GET_CLASS +MODEST_TNY_PLATFORM_FACTORY +MODEST_IS_TNY_PLATFORM_FACTORY +MODEST_TYPE_TNY_PLATFORM_FACTORY +modest_tny_platform_factory_get_type +MODEST_TNY_PLATFORM_FACTORY_CLASS +MODEST_IS_TNY_PLATFORM_FACTORY_CLASS +MODEST_TNY_PLATFORM_FACTORY_GET_CLASS
-modest-tny-folder-tree-view -ModestTnyFolderTreeView -ModestTnyFolderTreeView -modest_tny_folder_tree_view_new -modest_tny_folder_tree_view_is_empty +modest-tny-stream-gtkhtml +ModestTnyStreamGtkhtml +ModestTnyStreamGtkhtml +modest_tny_stream_gtkhtml_new -MODEST_TNY_FOLDER_TREE_VIEW -MODEST_IS_TNY_FOLDER_TREE_VIEW -MODEST_TYPE_TNY_FOLDER_TREE_VIEW -modest_tny_folder_tree_view_get_type -MODEST_TNY_FOLDER_TREE_VIEW_CLASS -MODEST_IS_TNY_FOLDER_TREE_VIEW_CLASS -MODEST_TNY_FOLDER_TREE_VIEW_GET_CLASS +MODEST_TNY_STREAM_GTKHTML +MODEST_IS_TNY_STREAM_GTKHTML +MODEST_TYPE_TNY_STREAM_GTKHTML +modest_tny_stream_gtkhtml_get_type +MODEST_TNY_STREAM_GTKHTML_CLASS +MODEST_IS_TNY_STREAM_GTKHTML_CLASS +MODEST_TNY_STREAM_GTKHTML_GET_CLASS +
+ +
+modest-mail-operation +ModestMailOperationForwardType +ModestMailOperationReplyType +ModestMailOperationReplyMode +ModestMailOperationStatus +ModestMailOperation +ModestMailOperation +modest_mail_operation_new +modest_mail_operation_send_mail +modest_mail_operation_send_new_mail +modest_mail_operation_create_forward_mail +modest_mail_operation_create_reply_mail +modest_mail_operation_update_account +modest_mail_operation_create_folder +modest_mail_operation_remove_folder +modest_mail_operation_rename_folder +modest_mail_operation_move_folder +modest_mail_operation_copy_folder +modest_mail_operation_move_folder_to_trash +modest_mail_operation_get_status +modest_mail_operation_get_error +modest_mail_operation_cancel + +MODEST_MAIL_OPERATION +MODEST_IS_MAIL_OPERATION +MODEST_TYPE_MAIL_OPERATION +modest_mail_operation_get_type +MODEST_MAIL_OPERATION_CLASS +MODEST_IS_MAIL_OPERATION_CLASS +MODEST_MAIL_OPERATION_GET_CLASS
modest-tny-account-store +ModestTnyGetPassFunc ModestTnyAccountStore ModestTnyAccountStore modest_tny_account_store_new @@ -160,19 +691,319 @@ MODEST_TNY_ACCOUNT_STORE_GET_CLASS
-modest-tny-transport-actions -ModestTnyTransportActions -ModestTnyTransportActions -modest_tny_transport_actions_new -modest_tny_transport_actions_send_message +modest-widget-factory +ModestWidgetFactory +ModestWidgetFactory +ModestComboBoxType +modest_widget_factory_new +modest_widget_factory_get_folder_view +modest_widget_factory_get_header_view +modest_widget_factory_get_msg_preview +modest_widget_factory_get_account_view +modest_widget_factory_get_progress_bar +modest_widget_factory_get_status_bar +modest_widget_factory_get_combo_box +modest_widget_factory_get_online_toggle +modest_widget_factory_get_folder_info_label +modest_widget_factory_get_main_toolbar +modest_widget_factory_get_edit_toolbar + +MODEST_WIDGET_FACTORY +MODEST_IS_WIDGET_FACTORY +MODEST_TYPE_WIDGET_FACTORY +modest_widget_factory_get_type +MODEST_WIDGET_FACTORY_CLASS +MODEST_IS_WIDGET_FACTORY_CLASS +MODEST_WIDGET_FACTORY_GET_CLASS +
+ +
+modest-account-assistant +ModestAccountAssistant +ModestAccountAssistant +modest_account_assistant_new + +MODEST_ACCOUNT_ASSISTANT +MODEST_IS_ACCOUNT_ASSISTANT +MODEST_TYPE_ACCOUNT_ASSISTANT +modest_account_assistant_get_type +MODEST_ACCOUNT_ASSISTANT_CLASS +MODEST_IS_ACCOUNT_ASSISTANT_CLASS +MODEST_ACCOUNT_ASSISTANT_GET_CLASS +
+ +
+modest-account-view-window +ModestAccountViewWindow +ModestAccountViewWindow +modest_account_view_window_new -MODEST_TNY_TRANSPORT_ACTIONS -MODEST_IS_TNY_TRANSPORT_ACTIONS -MODEST_TYPE_TNY_TRANSPORT_ACTIONS -modest_tny_transport_actions_get_type -MODEST_TNY_TRANSPORT_ACTIONS_CLASS -MODEST_IS_TNY_TRANSPORT_ACTIONS_CLASS -MODEST_TNY_TRANSPORT_ACTIONS_GET_CLASS +MODEST_ACCOUNT_VIEW_WINDOW +MODEST_IS_ACCOUNT_VIEW_WINDOW +MODEST_TYPE_ACCOUNT_VIEW_WINDOW +modest_account_view_window_get_type +MODEST_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_IS_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_ACCOUNT_VIEW_WINDOW_GET_CLASS +
+ +
+modest-transport-widget +ModestTransportWidget +ModestTransportWidget +modest_transport_widget_new +modest_transport_widget_get_remember_password +modest_transport_widget_get_username +modest_transport_widget_get_servername +modest_transport_widget_get_proto + +MODEST_TRANSPORT_WIDGET +MODEST_IS_TRANSPORT_WIDGET +MODEST_TYPE_TRANSPORT_WIDGET +modest_transport_widget_get_type +MODEST_TRANSPORT_WIDGET_CLASS +MODEST_IS_TRANSPORT_WIDGET_CLASS +MODEST_TRANSPORT_WIDGET_GET_CLASS +
+ +
+modest-store-widget +ModestStoreWidget +ModestStoreWidget +modest_store_widget_new +modest_store_widget_get_remember_password +modest_store_widget_get_username +modest_store_widget_get_servername +modest_store_widget_get_proto + +MODEST_STORE_WIDGET +MODEST_IS_STORE_WIDGET +MODEST_TYPE_STORE_WIDGET +modest_store_widget_get_type +MODEST_STORE_WIDGET_CLASS +MODEST_IS_STORE_WIDGET_CLASS +MODEST_STORE_WIDGET_GET_CLASS +
+ +
+modest-edit-msg-window +ModestEditMsgWindow +ModestEditMsgWindow +ModestEditType +modest_edit_msg_window_new + +MODEST_EDIT_MSG_WINDOW +MODEST_IS_EDIT_MSG_WINDOW +MODEST_TYPE_EDIT_MSG_WINDOW +modest_edit_msg_window_get_type +MODEST_EDIT_MSG_WINDOW_CLASS +MODEST_IS_EDIT_MSG_WINDOW_CLASS +MODEST_EDIT_MSG_WINDOW_GET_CLASS +
+ +
+modest-main-window +ModestMainWindow +ModestMainWindow +modest_main_window_new + +MODEST_MAIN_WINDOW +MODEST_IS_MAIN_WINDOW +MODEST_TYPE_MAIN_WINDOW +modest_main_window_get_type +MODEST_MAIN_WINDOW_CLASS +MODEST_IS_MAIN_WINDOW_CLASS +MODEST_MAIN_WINDOW_GET_CLASS +
+ +
+modest-account-view +ModestAccountView +ModestAccountView +modest_account_view_new + +MODEST_ACCOUNT_VIEW +MODEST_IS_ACCOUNT_VIEW +MODEST_TYPE_ACCOUNT_VIEW +modest_account_view_get_type +MODEST_ACCOUNT_VIEW_CLASS +MODEST_IS_ACCOUNT_VIEW_CLASS +MODEST_ACCOUNT_VIEW_GET_CLASS +
+ +
+modest-header-view +ModestHeaderView +ModestHeaderView +ModestHeaderViewColumn +ModestHeaderViewStyle +ModestItemType +modest_header_view_new +modest_header_view_set_folder +modest_header_view_set_columns +modest_header_view_get_columns +modest_header_view_set_style +modest_header_view_get_style +modest_header_view_get_selected_headers + +MODEST_HEADER_VIEW +MODEST_IS_HEADER_VIEW +MODEST_TYPE_HEADER_VIEW +modest_header_view_get_type +MODEST_HEADER_VIEW_CLASS +MODEST_IS_HEADER_VIEW_CLASS +MODEST_HEADER_VIEW_GET_CLASS +
+ +
+modest-toolbar +ModestToolbar +ModestToolbar +ModestToolbarButton +modest_toolbar_new + +MODEST_TOOLBAR +MODEST_IS_TOOLBAR +MODEST_TYPE_TOOLBAR +modest_toolbar_get_type +MODEST_TOOLBAR_CLASS +MODEST_IS_TOOLBAR_CLASS +MODEST_TOOLBAR_GET_CLASS +
+ +
+modest-folder-view +ModestFolderView +ModestFolderView +modest_folder_view_new +modest_folder_view_is_empty +modest_folder_view_get_selected_account + +MODEST_FOLDER_VIEW +MODEST_IS_FOLDER_VIEW +MODEST_TYPE_FOLDER_VIEW +modest_folder_view_get_type +MODEST_FOLDER_VIEW_CLASS +MODEST_IS_FOLDER_VIEW_CLASS +MODEST_FOLDER_VIEW_GET_CLASS +
+ +
+modest-combo-box +ModestComboBox +ModestComboBox +modest_combo_box_new +modest_combo_box_get_active_id +modest_combo_box_get_active_display_name + +MODEST_COMBO_BOX +MODEST_IS_COMBO_BOX +MODEST_TYPE_COMBO_BOX +modest_combo_box_get_type +MODEST_COMBO_BOX_CLASS +MODEST_IS_COMBO_BOX_CLASS +MODEST_COMBO_BOX_GET_CLASS +
+ +
+modest-msg-view +ModestMsgView +ModestMsgView +modest_msg_view_new +modest_msg_view_set_message +modest_msg_view_get_selected_text + +MODEST_MSG_VIEW +MODEST_IS_MSG_VIEW +MODEST_TYPE_MSG_VIEW +modest_msg_view_get_type +MODEST_MSG_VIEW_CLASS +MODEST_IS_MSG_VIEW_CLASS +MODEST_MSG_VIEW_GET_CLASS +
+ +
+modest-account-assistant +ModestAccountAssistant +ModestAccountAssistant +modest_account_assistant_new + +MODEST_ACCOUNT_ASSISTANT +MODEST_IS_ACCOUNT_ASSISTANT +MODEST_TYPE_ACCOUNT_ASSISTANT +modest_account_assistant_get_type +MODEST_ACCOUNT_ASSISTANT_CLASS +MODEST_IS_ACCOUNT_ASSISTANT_CLASS +MODEST_ACCOUNT_ASSISTANT_GET_CLASS +
+ +
+modest-account-view-window +ModestAccountViewWindow +ModestAccountViewWindow +modest_account_view_window_new + +MODEST_ACCOUNT_VIEW_WINDOW +MODEST_IS_ACCOUNT_VIEW_WINDOW +MODEST_TYPE_ACCOUNT_VIEW_WINDOW +modest_account_view_window_get_type +MODEST_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_IS_ACCOUNT_VIEW_WINDOW_CLASS +MODEST_ACCOUNT_VIEW_WINDOW_GET_CLASS +
+ +
+modest-transport-widget +ModestTransportWidget +ModestTransportWidget +modest_transport_widget_new +modest_transport_widget_get_remember_password +modest_transport_widget_get_username +modest_transport_widget_get_servername +modest_transport_widget_get_proto + +MODEST_TRANSPORT_WIDGET +MODEST_IS_TRANSPORT_WIDGET +MODEST_TYPE_TRANSPORT_WIDGET +modest_transport_widget_get_type +MODEST_TRANSPORT_WIDGET_CLASS +MODEST_IS_TRANSPORT_WIDGET_CLASS +MODEST_TRANSPORT_WIDGET_GET_CLASS +
+ +
+modest-store-widget +ModestStoreWidget +ModestStoreWidget +modest_store_widget_new +modest_store_widget_get_remember_password +modest_store_widget_get_username +modest_store_widget_get_servername +modest_store_widget_get_proto + +MODEST_STORE_WIDGET +MODEST_IS_STORE_WIDGET +MODEST_TYPE_STORE_WIDGET +modest_store_widget_get_type +MODEST_STORE_WIDGET_CLASS +MODEST_IS_STORE_WIDGET_CLASS +MODEST_STORE_WIDGET_GET_CLASS +
+ +
+modest-edit-msg-window +ModestEditMsgWindow +ModestEditMsgWindow +ModestEditType +modest_edit_msg_window_new + +MODEST_EDIT_MSG_WINDOW +MODEST_IS_EDIT_MSG_WINDOW +MODEST_TYPE_EDIT_MSG_WINDOW +modest_edit_msg_window_get_type +MODEST_EDIT_MSG_WINDOW_CLASS +MODEST_IS_EDIT_MSG_WINDOW_CLASS +MODEST_EDIT_MSG_WINDOW_GET_CLASS
@@ -191,62 +1022,486 @@ MODEST_MAIN_WINDOW_GET_CLASS
-modest-edit-window -ModestEditWindow -ModestEditWindow -modest_edit_window_new +modest-account-view +ModestAccountView +ModestAccountView +modest_account_view_new + +MODEST_ACCOUNT_VIEW +MODEST_IS_ACCOUNT_VIEW +MODEST_TYPE_ACCOUNT_VIEW +modest_account_view_get_type +MODEST_ACCOUNT_VIEW_CLASS +MODEST_IS_ACCOUNT_VIEW_CLASS +MODEST_ACCOUNT_VIEW_GET_CLASS +
+ +
+modest-header-view +ModestHeaderView +ModestHeaderView +ModestHeaderViewColumn +ModestHeaderViewStyle +ModestItemType +modest_header_view_new +modest_header_view_set_folder +modest_header_view_set_columns +modest_header_view_get_columns +modest_header_view_set_style +modest_header_view_get_style +modest_header_view_get_selected_headers + +MODEST_HEADER_VIEW +MODEST_IS_HEADER_VIEW +MODEST_TYPE_HEADER_VIEW +modest_header_view_get_type +MODEST_HEADER_VIEW_CLASS +MODEST_IS_HEADER_VIEW_CLASS +MODEST_HEADER_VIEW_GET_CLASS +
+ +
+modest-toolbar +ModestToolbar +ModestToolbar +ModestToolbarButton +modest_toolbar_new + +MODEST_TOOLBAR +MODEST_IS_TOOLBAR +MODEST_TYPE_TOOLBAR +modest_toolbar_get_type +MODEST_TOOLBAR_CLASS +MODEST_IS_TOOLBAR_CLASS +MODEST_TOOLBAR_GET_CLASS +
+ +
+modest-folder-view +ModestFolderView +ModestFolderView +modest_folder_view_new +modest_folder_view_is_empty +modest_folder_view_get_selected_account + +MODEST_FOLDER_VIEW +MODEST_IS_FOLDER_VIEW +MODEST_TYPE_FOLDER_VIEW +modest_folder_view_get_type +MODEST_FOLDER_VIEW_CLASS +MODEST_IS_FOLDER_VIEW_CLASS +MODEST_FOLDER_VIEW_GET_CLASS +
+ +
+modest-combo-box +ModestComboBox +ModestComboBox +modest_combo_box_new +modest_combo_box_get_active_id +modest_combo_box_get_active_display_name + +MODEST_COMBO_BOX +MODEST_IS_COMBO_BOX +MODEST_TYPE_COMBO_BOX +modest_combo_box_get_type +MODEST_COMBO_BOX_CLASS +MODEST_IS_COMBO_BOX_CLASS +MODEST_COMBO_BOX_GET_CLASS +
+ +
+modest-msg-view +ModestMsgView +ModestMsgView +modest_msg_view_new +modest_msg_view_set_message +modest_msg_view_get_selected_text -MODEST_EDIT_WINDOW -MODEST_IS_EDIT_WINDOW -MODEST_TYPE_EDIT_WINDOW -modest_edit_window_get_type -MODEST_EDIT_WINDOW_CLASS -MODEST_IS_EDIT_WINDOW_CLASS -MODEST_EDIT_WINDOW_GET_CLASS +MODEST_MSG_VIEW +MODEST_IS_MSG_VIEW +MODEST_TYPE_MSG_VIEW +modest_msg_view_get_type +MODEST_MSG_VIEW_CLASS +MODEST_IS_MSG_VIEW_CLASS +MODEST_MSG_VIEW_GET_CLASS +
+ +
+modest-account-keys +MODEST_CONF_DEFAULT_ACCOUNT +MODEST_ACCOUNT_NAMESPACE +MODEST_SERVER_ACCOUNT_NAMESPACE +MODEST_CONF_REPLY_TYPE +MODEST_CONF_FORWARD_TYPE +MODEST_ACCOUNT_DISPLAY_NAME +MODEST_ACCOUNT_STORE_ACCOUNT +MODEST_ACCOUNT_TRANSPORT_ACCOUNT +MODEST_ACCOUNT_FULLNAME +MODEST_ACCOUNT_EMAIL +MODEST_ACCOUNT_PASSWORD +MDOEST_ACCOUNT_REMEMBER_PWD +MODEST_ACCOUNT_HOSTNAME +MODEST_ACCOUNT_USERNAME +MODEST_ACCOUNT_PROTO +MODEST_ACCOUNT_ENABLED +MODEST_ACCOUNT_LEAVE_ON_SERVER +MODEST_ACCOUNT_PREFERRED_CNX +MODEST_ACCOUNT_OPTIONS +
+ +
+modest-text-utils +modest_text_utils_quote +modest_text_utils_create_reply_subject +modest_text_utils_create_forward_subject +modest_text_utils_create_cited_text +modest_text_utils_create_inlined_text +modest_text_utils_remove_mail_from_mail_list +
+ +
+modest-presets +ModestPresets +ModestPresetsInfo +modest_presets_new +modest_presets_get_providers +modest_presets_get_server +modest_presets_get_info +modest_presets_destroy +
+ +
+modest-pair +ModestPair +modest_pair_new +modest_pair_destroy +modest_pair_gslist_destroy +
+ +
+modest-icon-factory +modest_icon_factory_init +modest_icon_factory_uninit +modest_icon_factory_get_icon +modest_icon_factory_get_icon_at_size +modest_icon_factory_get_small_icon +modest_icon_factory_get_big_icon +
+ +
+modest-conf-keys +MODEST_CONF_NAMESPACE +MODEST_CONF_WIDGET_NAMESPACE +MODEST_MAIN_WINDOW_HEIGHT +MODEST_MAIN_WINDOW_HEIGHT_DEFAULT +MODEST_MAIN_WINDOW_WIDTH +MODEST_MAIN_WINDOW_WIDTH_DEFAULT +MODEST_MAIN_PANED_HEIGHT +MODEST_MAIN_PANED_HEIGHT_DEFAULT +MODEST_FOLDER_PANED_WIDTH +MODEST_FOLDER_PANED_WIDTH_DEFAULT +MODEST_FOLDER_PANED_DIVIDER_POS +MODEST_FOLDER_PANED_DIVIDER_POS_DEFAULT +MODEST_MSG_PANED_WIDTH +MODEST_MSG_PANED_WIDTH_DEFAULT +MODEST_MSG_PANED_DIVIDER_POS +MODEST_MSG_PANED_DIVIDER_POS_DEFAULT +MODEST_ACCOUNT_VIEW_WINDOW_HEIGHT_DEFAULT +MODEST_ACCOUNT_VIEW_WINDOW_WIDTH_DEFAULT +MODEST_EDIT_WINDOW_HEIGHT +MODEST_EDIT_WINDOW_HEIGHT_DEFAULT +MODEST_EDIT_WINDOW_WIDTH +MODEST_EDIT_WINDOW_WIDTH_DEFAULT +MODEST_MSG_VIEW_NAMESPACE +MODEST_MSG_VIEW_SHOW_ATTACHMENTS_INLINE
modest-proto MODEST_PROTO_SENDMAIL MODEST_PROTO_SMTP +MODEST_PROTO_NONE MODEST_PROTO_POP MODEST_PROTO_IMAP +MODEST_PROTO_MAILDIR +MODEST_PROTO_MBOX +MODEST_SECURITY_PROTO_NONE +MODEST_SECURITY_PROTO_SSL +MODEST_SECURITY_PROTO_TLS +MODEST_AUTH_PROTO_PASSWORD ModestProtoType modest_proto_is_valid modest_proto_type +modest_proto_store_protos +modest_proto_transport_protos +modest_proto_security_protos +modest_proto_auth_protos +
+ +
+modest-widget-memory +modest_widget_memory_save_settings +modest_widget_memory_restore_settings +
+ +
+modest-tny-msg-actions +modest_tny_msg_actions_quote +modest_tny_msg_actions_find_body_part +modest_tny_msg_actions_find_nth_part +modest_tny_msg_actions_find_body +modest_tny_msg_actions_copy +modest_tny_msg_actions_move +modest_tny_msg_actions_remove +
+ +
+modest-marshal +modest_marshal_VOID__POINTER_POINTER +modest_marshal_VOID__POINTER_POINTER_POINTER +modest_marshal_VOID__STRING_INT +modest_marshal_VOID__STRING_BOOLEAN +modest_marshal_VOID__STRING_BOOL +modest_marshal_VOID__STRING_STRING_BOOLEAN +modest_marshal_VOID__STRING_STRING_BOOL +modest_marshal_VOID__STRING_POINTER_POINTER +
+ +
+modest-icon-names +PIXMAP_PREFIX +MODEST_APP_ICON +MODEST_HEADER_ICON_READ +MODEST_HEADER_ICON_UNREAD +MODEST_HEADER_ICON_DELETED +MODEST_HEADER_ICON_ATTACH +MODEST_FOLDER_ICON_OPEN +MODEST_FOLDER_ICON_CLOSED +MODEST_FOLDER_ICON_INBOX +MODEST_FOLDER_ICON_OUTBOX +MODEST_FOLDER_ICON_SENT +MODEST_FOLDER_ICON_TRASH +MODEST_FOLDER_ICON_JUNK +MODEST_FOLDER_ICON_DRAFTS +MODEST_FOLDER_ICON_NORMAL +MODEST_FOLDER_ICON_CONTACTS +MODEST_FOLDER_ICON_NOTES +MODEST_FOLDER_ICON_CALENDAR +MODEST_TOOLBAR_ICON_MAIL_SEND +MODEST_TOOLBAR_ICON_NEW_MAIL +MODEST_TOOLBAR_ICON_SEND_RECEIVE +MODEST_TOOLBAR_ICON_REPLY +MODEST_TOOLBAR_ICON_REPLY_ALL +MODEST_TOOLBAR_ICON_FORWARD +MODEST_TOOLBAR_ICON_DELETE +MODEST_TOOLBAR_ICON_NEXT +MODEST_TOOLBAR_ICON_PREV +MODEST_TOOLBAR_ICON_STOP
modest-account-keys MODEST_CONF_DEFAULT_ACCOUNT -MODEST_SERVER_ACCOUNT_NAMESPACE MODEST_ACCOUNT_NAMESPACE +MODEST_SERVER_ACCOUNT_NAMESPACE +MODEST_CONF_REPLY_TYPE +MODEST_CONF_FORWARD_TYPE MODEST_ACCOUNT_DISPLAY_NAME MODEST_ACCOUNT_STORE_ACCOUNT MODEST_ACCOUNT_TRANSPORT_ACCOUNT +MODEST_ACCOUNT_FULLNAME +MODEST_ACCOUNT_EMAIL MODEST_ACCOUNT_PASSWORD +MDOEST_ACCOUNT_REMEMBER_PWD MODEST_ACCOUNT_HOSTNAME MODEST_ACCOUNT_USERNAME MODEST_ACCOUNT_PROTO +MODEST_ACCOUNT_ENABLED MODEST_ACCOUNT_LEAVE_ON_SERVER +MODEST_ACCOUNT_PREFERRED_CNX +MODEST_ACCOUNT_OPTIONS +
+ +
+modest-text-utils +modest_text_utils_quote +modest_text_utils_create_reply_subject +modest_text_utils_create_forward_subject +modest_text_utils_create_cited_text +modest_text_utils_create_inlined_text +modest_text_utils_remove_mail_from_mail_list +
+ +
+modest-presets +ModestPresets +ModestPresetsInfo +modest_presets_new +modest_presets_get_providers +modest_presets_get_server +modest_presets_get_info +modest_presets_destroy +
+ +
+modest-pair +ModestPair +modest_pair_new +modest_pair_destroy +modest_pair_gslist_destroy +
+ +
+modest-icon-factory +modest_icon_factory_init +modest_icon_factory_uninit +modest_icon_factory_get_icon +modest_icon_factory_get_icon_at_size +modest_icon_factory_get_small_icon +modest_icon_factory_get_big_icon
modest-conf-keys MODEST_CONF_NAMESPACE -MODEST_CONF_USE_EXT_EDITOR -MODEST_CONF_EXT_EDITOR -MODEST_CONF_MAIN_WINDOW_HEIGHT -MODEST_CONF_MAIN_WINDOW_HEIGHT_DEFAULT -MODEST_CONF_MAIN_WINDOW_WIDTH -MODEST_CONF_MAIN_WINDOW_WIDTH_DEFAULT -MODEST_CONF_EDIT_WINDOW_HEIGHT -MODEST_CONF_EDIT_WINDOW_HEIGHT_DEFAULT -MODEST_CONF_EDIT_WINDOW_WIDTH -MODEST_CONF_EDIT_WINDOW_WIDTH_DEFAULT +MODEST_CONF_WIDGET_NAMESPACE +MODEST_MAIN_WINDOW_HEIGHT +MODEST_MAIN_WINDOW_HEIGHT_DEFAULT +MODEST_MAIN_WINDOW_WIDTH +MODEST_MAIN_WINDOW_WIDTH_DEFAULT +MODEST_MAIN_PANED_HEIGHT +MODEST_MAIN_PANED_HEIGHT_DEFAULT +MODEST_FOLDER_PANED_WIDTH +MODEST_FOLDER_PANED_WIDTH_DEFAULT +MODEST_FOLDER_PANED_DIVIDER_POS +MODEST_FOLDER_PANED_DIVIDER_POS_DEFAULT +MODEST_MSG_PANED_WIDTH +MODEST_MSG_PANED_WIDTH_DEFAULT +MODEST_MSG_PANED_DIVIDER_POS +MODEST_MSG_PANED_DIVIDER_POS_DEFAULT +MODEST_ACCOUNT_VIEW_WINDOW_HEIGHT_DEFAULT +MODEST_ACCOUNT_VIEW_WINDOW_WIDTH_DEFAULT +MODEST_EDIT_WINDOW_HEIGHT +MODEST_EDIT_WINDOW_HEIGHT_DEFAULT +MODEST_EDIT_WINDOW_WIDTH +MODEST_EDIT_WINDOW_WIDTH_DEFAULT +MODEST_MSG_VIEW_NAMESPACE +MODEST_MSG_VIEW_SHOW_ATTACHMENTS_INLINE +
+ +
+modest-proto +MODEST_PROTO_SENDMAIL +MODEST_PROTO_SMTP +MODEST_PROTO_NONE +MODEST_PROTO_POP +MODEST_PROTO_IMAP +MODEST_PROTO_MAILDIR +MODEST_PROTO_MBOX +MODEST_SECURITY_PROTO_NONE +MODEST_SECURITY_PROTO_SSL +MODEST_SECURITY_PROTO_TLS +MODEST_AUTH_PROTO_PASSWORD +ModestProtoType +modest_proto_is_valid +modest_proto_type +modest_proto_store_protos +modest_proto_transport_protos +modest_proto_security_protos +modest_proto_auth_protos +
+ +
+modest-widget-memory +modest_widget_memory_save_settings +modest_widget_memory_restore_settings +
+ +
+modest-tny-msg-actions +modest_tny_msg_actions_quote +modest_tny_msg_actions_find_body_part +modest_tny_msg_actions_find_nth_part +modest_tny_msg_actions_find_body +modest_tny_msg_actions_copy +modest_tny_msg_actions_move +modest_tny_msg_actions_remove +
+ +
+modest-marshal +modest_marshal_VOID__POINTER_POINTER +modest_marshal_VOID__POINTER_POINTER_POINTER +modest_marshal_VOID__STRING_INT +modest_marshal_VOID__STRING_BOOLEAN +modest_marshal_VOID__STRING_BOOL +modest_marshal_VOID__STRING_STRING_BOOLEAN +modest_marshal_VOID__STRING_STRING_BOOL +modest_marshal_VOID__STRING_POINTER_POINTER +
+ +
+modest-icon-names +PIXMAP_PREFIX +MODEST_APP_ICON +MODEST_HEADER_ICON_READ +MODEST_HEADER_ICON_UNREAD +MODEST_HEADER_ICON_DELETED +MODEST_HEADER_ICON_ATTACH +MODEST_FOLDER_ICON_OPEN +MODEST_FOLDER_ICON_CLOSED +MODEST_FOLDER_ICON_INBOX +MODEST_FOLDER_ICON_OUTBOX +MODEST_FOLDER_ICON_SENT +MODEST_FOLDER_ICON_TRASH +MODEST_FOLDER_ICON_JUNK +MODEST_FOLDER_ICON_DRAFTS +MODEST_FOLDER_ICON_NORMAL +MODEST_FOLDER_ICON_CONTACTS +MODEST_FOLDER_ICON_NOTES +MODEST_FOLDER_ICON_CALENDAR +MODEST_TOOLBAR_ICON_MAIL_SEND +MODEST_TOOLBAR_ICON_NEW_MAIL +MODEST_TOOLBAR_ICON_SEND_RECEIVE +MODEST_TOOLBAR_ICON_REPLY +MODEST_TOOLBAR_ICON_REPLY_ALL +MODEST_TOOLBAR_ICON_FORWARD +MODEST_TOOLBAR_ICON_DELETE +MODEST_TOOLBAR_ICON_NEXT +MODEST_TOOLBAR_ICON_PREV +MODEST_TOOLBAR_ICON_STOP
-modest.glade +modest-icon-names +PIXMAP_PREFIX +MODEST_APP_ICON +MODEST_HEADER_ICON_READ +MODEST_HEADER_ICON_UNREAD +MODEST_HEADER_ICON_DELETED +MODEST_HEADER_ICON_ATTACH +MODEST_FOLDER_ICON_OPEN +MODEST_FOLDER_ICON_CLOSED +MODEST_FOLDER_ICON_INBOX +MODEST_FOLDER_ICON_OUTBOX +MODEST_FOLDER_ICON_SENT +MODEST_FOLDER_ICON_TRASH +MODEST_FOLDER_ICON_JUNK +MODEST_FOLDER_ICON_DRAFTS +MODEST_FOLDER_ICON_NORMAL +MODEST_FOLDER_ICON_CONTACTS +MODEST_FOLDER_ICON_NOTES +MODEST_FOLDER_ICON_CALENDAR +MODEST_TOOLBAR_ICON_MAIL_SEND +MODEST_TOOLBAR_ICON_NEW_MAIL +MODEST_TOOLBAR_ICON_SEND_RECEIVE +MODEST_TOOLBAR_ICON_REPLY +MODEST_TOOLBAR_ICON_REPLY_ALL +MODEST_TOOLBAR_ICON_FORWARD +MODEST_TOOLBAR_ICON_DELETE +MODEST_TOOLBAR_ICON_NEXT +MODEST_TOOLBAR_ICON_PREV +MODEST_TOOLBAR_ICON_STOP
diff --git a/docs/reference/tmpl/modest-account-keys.sgml b/docs/reference/tmpl/modest-account-keys.sgml index e4fa39a..1e4a518 100644 --- a/docs/reference/tmpl/modest-account-keys.sgml +++ b/docs/reference/tmpl/modest-account-keys.sgml @@ -2,18 +2,20 @@ modest-account-keys -Configuration key definitions + -Definition of keys used to access account properties from the account store. + + + @@ -24,6 +26,13 @@ Definition of keys used to access account properties from the account store. + + + + + + + @@ -31,7 +40,14 @@ Definition of keys used to access account properties from the account store. - + + + + + + + + @@ -59,6 +75,20 @@ Definition of keys used to access account properties from the account store. + + + + + + + + + + + + + + @@ -66,6 +96,13 @@ Definition of keys used to access account properties from the account store. + + + + + + + @@ -87,6 +124,13 @@ Definition of keys used to access account properties from the account store. + + + + + + + @@ -94,3 +138,17 @@ Definition of keys used to access account properties from the account store. + + + + + + + + + + + + + + diff --git a/docs/reference/tmpl/modest-account-mgr.sgml b/docs/reference/tmpl/modest-account-mgr.sgml index 8ff8f04..6d358b4 100644 --- a/docs/reference/tmpl/modest-account-mgr.sgml +++ b/docs/reference/tmpl/modest-account-mgr.sgml @@ -2,20 +2,20 @@ ModestAccountMgr -Manage user and server accounts + -This module is used to add/remove modest mail accounts and the server accounts -assigned to them. It is used to change account details and provides a complete -abstraction of the configuration backend used to store the account data. + + + @@ -24,7 +24,67 @@ abstraction of the configuration backend used to store the account data. -@parent: + + + + + + +@modestaccountmgr: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + +@modestaccountmgr: the object which received the signal. +@arg1: +@arg2: + + + + + + +@modestaccountmgr: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + +@modestaccountmgr: the object which received the signal. +@arg1: +@arg2: + + + + + + +@account_name: +@hostname: +@username: +@proto: +@password: + + + + + + +@account_name: +@full_name: +@email: +@enabled: +@transport_account: +@store_account: @@ -48,6 +108,20 @@ abstraction of the configuration backend used to store the account data. @Returns: + + + + + +@self: +@name: +@hostname: +@username: +@password: +@proto: +@Returns: + + @@ -60,37 +134,170 @@ abstraction of the configuration backend used to store the account data. @Returns: - + @self: -@name: -@hostname: -@username: -@password: +@err: +@Returns: + + + + + + + +@self: +@account_name: +@type: @proto: @Returns: - + @self: +@name: +@server_account: @err: @Returns: - + + + + + +@self: +@name: +@Returns: + + + + + + + +@self: +@data: + + + + + + + +@self: +@name: +@enabled: +@Returns: + + + + + + + +@self: +@name: +@Returns: + + + + + + + +@self: +@name: +@key: +@server_account: +@err: +@Returns: + + + + + + + +@self: +@name: +@key: +@server_account: +@err: +@Returns: + + + + + + + +@self: +@name: +@key: +@server_account: +@err: +@Returns: + + + + + + + +@self: +@name: +@key: +@val: +@server_account: +@err: +@Returns: + + + + + + + +@self: +@name: +@key: +@val: +@server_account: +@err: +@Returns: + + + + + + + +@self: +@name: +@key: +@val: +@server_account: +@err: +@Returns: + + + @self: @name: +@key: +@list_type: @server_account: @err: @Returns: diff --git a/docs/reference/tmpl/modest-conf-keys.sgml b/docs/reference/tmpl/modest-conf-keys.sgml index 321bdc1..642163d 100644 --- a/docs/reference/tmpl/modest-conf-keys.sgml +++ b/docs/reference/tmpl/modest-conf-keys.sgml @@ -9,11 +9,13 @@ modest-conf-keys + + @@ -24,3 +26,164 @@ modest-conf-keys + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/reference/tmpl/modest-conf.sgml b/docs/reference/tmpl/modest-conf.sgml index 108e495..9ff68a6 100644 --- a/docs/reference/tmpl/modest-conf.sgml +++ b/docs/reference/tmpl/modest-conf.sgml @@ -2,27 +2,64 @@ ModestConf -Configuration system + + + + + + + + +@MODEST_CONF_VALUE_INT: +@MODEST_CONF_VALUE_BOOL: +@MODEST_CONF_VALUE_FLOAT: +@MODEST_CONF_VALUE_STRING: + + + + + + +@MODEST_CONF_EVENT_KEY_CHANGED: +@MODEST_CONF_EVENT_KEY_UNSET: + -@parent: + + + + + + +@: +@: +@: + + + + + + +@: +@: +@: @@ -65,6 +102,28 @@ Configuration system @Returns: + + + + + +@self: +@key: +@defaultval: +@Returns: + + + + + + + +@self: +@key: +@defaultval: +@Returns: + + @@ -134,3 +193,35 @@ Configuration system @Returns: + + + + + +@self: +@str: +@Returns: + + + + + + + +@self: +@str: +@Returns: + + + + + + + +@self: +@key: +@list_type: +@err: +@Returns: + + diff --git a/docs/reference/tmpl/modest-main-window.sgml b/docs/reference/tmpl/modest-main-window.sgml index b489dec..45fea64 100644 --- a/docs/reference/tmpl/modest-main-window.sgml +++ b/docs/reference/tmpl/modest-main-window.sgml @@ -9,11 +9,13 @@ ModestMainWindow + + @@ -22,15 +24,12 @@ ModestMainWindow -@parent: -@conf: -@account_mgr: @factory: @Returns: diff --git a/docs/reference/tmpl/modest-proto.sgml b/docs/reference/tmpl/modest-proto.sgml index 221a4fc..6c2544d 100644 --- a/docs/reference/tmpl/modest-proto.sgml +++ b/docs/reference/tmpl/modest-proto.sgml @@ -9,11 +9,147 @@ modest-proto + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@proto: +@store_proto: +@Returns: + + + + + + + +@proto: +@Returns: + + + + + + + +@Returns: + + + + + + + +@Returns: + + + + + + + +@Returns: + + + + + + + +@Returns: + + diff --git a/docs/reference/tmpl/modest-tny-account-store.sgml b/docs/reference/tmpl/modest-tny-account-store.sgml index 940ec09..ce81cd2 100644 --- a/docs/reference/tmpl/modest-tny-account-store.sgml +++ b/docs/reference/tmpl/modest-tny-account-store.sgml @@ -9,20 +9,63 @@ ModestTnyAccountStore + + + + + + + + -@parent: + + + + + + +@modesttnyaccountstore: the object which received the signal. +@arg1: + + + + + + +@modesttnyaccountstore: the object which received the signal. +@arg1: +@arg2: +@arg3: + + + + + + +@modesttnyaccountstore: the object which received the signal. +@arg1: + + + + + + +@modesttnyaccountstore: the object which received the signal. +@arg1: +@arg2: +@arg3: diff --git a/docs/reference/tmpl/modest-ui.sgml b/docs/reference/tmpl/modest-ui.sgml index cde1434..b7c6913 100644 --- a/docs/reference/tmpl/modest-ui.sgml +++ b/docs/reference/tmpl/modest-ui.sgml @@ -2,18 +2,20 @@ ModestUI -Abstraction for Modest user interfaces (GTK, Hildon, ...) + + + @@ -22,14 +24,12 @@ Abstraction for Modest user interfaces (GTK, Hildon, ...) -@parent: -@modest_conf: @Returns: @@ -42,3 +42,108 @@ Abstraction for Modest user interfaces (GTK, Hildon, ...) @Returns: + + + + + +@ui: +@to: +@cc: +@bcc: +@subject: +@body: +@att: +@Returns: + + + + + + + +@modest_ui: +@user_data: +@Returns: + + + + + + + +@to: +@window_data: +@Returns: + + + + + + + +@cc: +@window_data: +@Returns: + + + + + + + +@bcc: +@window_data: +@Returns: + + + + + + + +@subject: +@window_data: +@Returns: + + + + + + + +@body: +@window_data: +@Returns: + + + + + + + +@window_data: +@Returns: + + + + + + + +@modest_ui: +@msg_view: +@msg: +@user_data: +@Returns: + + + + + + + +@modest_ui: +@Returns: + + diff --git a/docs/reference/tmpl/modest-unused.sgml b/docs/reference/tmpl/modest-unused.sgml index 8f82678..faf8a41 100644 --- a/docs/reference/tmpl/modest-unused.sgml +++ b/docs/reference/tmpl/modest-unused.sgml @@ -1,82 +1,226 @@ - + - + - + + + + + + + + + +ModestEditWindow + + + - + - + + + + + + + + + +ModestTnyFolderTreeView + + + - + - + + + + + + + + + +ModestTnyHeaderTreeView + + + - + - + + + + + + + + + +ModestTnyMsgView + + + - + - + + + + + + + + + +ModestTnyTransportActions + + + + + + + + + - + + + + + + + + + +ModestWindowMgr + + + - + - + + + + + + + + + +modest.glade + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -98,12 +242,6 @@ @type: @id: - - - - - - @@ -328,21 +466,59 @@ @attachments: @Returns: - + -@proto: -@store_proto: +@mail_operation: +@folder: + + + + + + +@from: +@sent_date: +@text: @Returns: - + -@proto: +@subject: +@Returns: + + + + + + +@from: +@sent_date: +@to: +@subject: +@text: +@Returns: + + + + + + +@subject: +@Returns: + + + + + + +@emails: +@email: @Returns: @@ -380,6 +556,29 @@ @folder: @Returns: + + + + + +@header: +@folder: + + + + + + +@header: +@folder: + + + + + + +@header: + @@ -403,6 +602,21 @@ @Returns: + + + + + +@transport_account: +@from: +@to: +@cc: +@bcc: +@subject: +@body: +@attachments_list: +@Returns: + diff --git a/src/Makefile.am b/src/Makefile.am index c9dfe013..c79b320 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,8 +31,8 @@ modest_SOURCES=\ modest-conf.c\ modest-pair.h\ modest-pair.c\ - modest-widget-factory.h\ - modest-widget-factory.c\ + modest-widget-factory.h \ + modest-widget-factory.c \ modest-widget-memory.h\ modest-widget-memory.c\ modest-account-keys.h\ @@ -44,8 +44,6 @@ modest_SOURCES=\ modest-tny-account-store.c\ modest-tny-msg-actions.h\ modest-tny-msg-actions.c\ - modest-tny-store-actions.c\ - modest-tny-store-actions.h\ modest-protocol-mgr.h\ modest-protocol-mgr.c\ modest-ui.h\ @@ -62,12 +60,11 @@ modest_SOURCES=\ modest-tny-platform-factory.c \ modest-tny-platform-factory.h -modest_LDADD = \ - $(MODEST_GSTUFF_LIBS) \ - $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ - $(MODEST_LIBTINYMAIL_MAEMO_LIBS) \ - $(MODEST_PLATFORM_DIR)/libmodest-ui.la \ - widgets/libmodest-widgets.la - +modest_LDADD = \ + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ + $(MODEST_LIBTINYMAIL_MAEMO_LIBS) \ + $(MODEST_PLATFORM_DIR)/libmodest-ui.la \ + widgets/libmodest-widgets.la EXTRA_DIST=modest-marshal.list diff --git a/src/gtk/modest-edit-msg-window.c b/src/gtk/modest-edit-msg-window.c index d6baa82..3c287f9 100644 --- a/src/gtk/modest-edit-msg-window.c +++ b/src/gtk/modest-edit-msg-window.c @@ -293,9 +293,10 @@ send_mail (ModestEditMsgWindow *self) transport_account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter)); } - mail_operation = modest_mail_operation_new (TNY_ACCOUNT (transport_account)); + mail_operation = modest_mail_operation_new (); modest_mail_operation_send_new_mail (mail_operation, + transport_account, from, to, cc, bcc, subject, body, NULL); /* Clean up */ diff --git a/src/gtk/modest-edit-msg-window.h b/src/gtk/modest-edit-msg-window.h index 8e5002d..1aa27c2 100644 --- a/src/gtk/modest-edit-msg-window.h +++ b/src/gtk/modest-edit-msg-window.h @@ -60,15 +60,15 @@ struct _ModestEditMsgWindowClass { }; -enum _ModestEditType { +typedef enum _ModestEditType { MODEST_EDIT_TYPE_NEW, MODEST_EDIT_TYPE_REPLY, MODEST_EDIT_TYPE_FORWARD, MODEST_EDIT_TYPE_VIEW, MODEST_EDIT_TYPE_NUM -}; -typedef enum _ModestEditType ModestEditType; +} ModestEditType; +/* typedef enum _ModestEditType ModestEditType; */ /* member functions */ diff --git a/src/gtk/modest-main-window.c b/src/gtk/modest-main-window.c index 60ffaea..422e9ca 100644 --- a/src/gtk/modest-main-window.c +++ b/src/gtk/modest-main-window.c @@ -344,15 +344,20 @@ on_menu_delete (ModestMainWindow *self, guint action, GtkWidget *widget) model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model)); do { TnyHeader *header; + ModestMailOperation *mail_op; header = TNY_HEADER (tny_iterator_get_current (iter)); + /* TODO: thick grain mail operation involving + a list of objects. Composite pattern ??? */ + mail_op = modest_mail_operation_new (); + + /* Move to trash */ + modest_mail_operation_remove_msg (mail_op, header, TRUE); /* Remove from tree model */ tny_list_remove (TNY_LIST (model), G_OBJECT (header)); - /* Remove from server */ - modest_tny_msg_actions_remove (header); - + g_object_unref (G_OBJECT (mail_op)); g_object_unref (header); tny_iterator_next (iter); diff --git a/src/modest-account-keys.h b/src/modest-account-keys.h index d12c729..ab3c8ce 100644 --- a/src/modest-account-keys.h +++ b/src/modest-account-keys.h @@ -59,5 +59,6 @@ #define MODEST_ACCOUNT_LEAVE_ON_SERVER "leave_on_server" /* boolean */ #define MODEST_ACCOUNT_PREFERRED_CNX "preferred_cnx" /* string */ +#define MODEST_ACCOUNT_OPTIONS "options" /* list */ #endif /*__MODEST_CONF_KEYS_H__*/ diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c index 02db2d0..28a3a1b 100644 --- a/src/modest-account-mgr.c +++ b/src/modest-account-mgr.c @@ -803,6 +803,33 @@ modest_account_mgr_account_exists (ModestAccountMgr * self, const gchar * name, return retval; } + +GSList * +modest_account_mgr_get_list (ModestAccountMgr *self, + const gchar *name, + const gchar *key, + ModestConfValueType list_type, + gboolean server_account, + GError **err) +{ + ModestAccountMgrPrivate *priv; + + gchar *keyname; + GSList *retval; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (name, NULL); + g_return_val_if_fail (key, NULL); + + keyname = get_account_keyname (name, key, server_account); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); + retval = modest_conf_get_list (priv->modest_conf, keyname, list_type, err); + g_free (keyname); + + return retval; +} + /* must be freed by caller */ static gchar * get_account_keyname (const gchar * accname, const gchar * name, gboolean server_account) diff --git a/src/modest-account-mgr.h b/src/modest-account-mgr.h index c03894a..c0bc632 100644 --- a/src/modest-account-mgr.h +++ b/src/modest-account-mgr.h @@ -386,6 +386,14 @@ gboolean modest_account_mgr_set_bool (ModestAccountMgr *self, const gchar *key, gboolean val, gboolean server_account, GError **err); + + +GSList* modest_account_mgr_get_list (ModestAccountMgr *self, + const gchar *name, + const gchar *key, + ModestConfValueType list_type, + gboolean server_account, + GError **err); G_END_DECLS #endif /* __MODEST_ACCOUNT_MGR_H__ */ diff --git a/src/modest-conf.c b/src/modest-conf.c index 5e47643..2f7c15a 100644 --- a/src/modest-conf.c +++ b/src/modest-conf.c @@ -418,3 +418,34 @@ modest_conf_on_change (GConfClient *client, guint conn_id, GConfEntry *entry, signals[KEY_CHANGED_SIGNAL], 0, key, event); } + +GSList * +modest_conf_get_list (ModestConf* self, const gchar* key, ModestConfValueType list_type, GError **err) +{ + ModestConfPrivate *priv; + GConfValueType gconf_type; + + g_return_val_if_fail (self, NULL); + g_return_val_if_fail (key, NULL); + + priv = MODEST_CONF_GET_PRIVATE(self); + + switch (list_type) { + case MODEST_CONF_VALUE_INT: + gconf_type = GCONF_VALUE_INT; + break; + case MODEST_CONF_VALUE_BOOL: + gconf_type = GCONF_VALUE_BOOL; + break; + case MODEST_CONF_VALUE_FLOAT: + gconf_type = GCONF_VALUE_FLOAT; + break; + case MODEST_CONF_VALUE_STRING: + gconf_type = GCONF_VALUE_STRING; + break; + default: + return NULL; + } + + return gconf_client_get_list (priv->gconf_client, key, gconf_type, err); +} diff --git a/src/modest-conf.h b/src/modest-conf.h index e451a4b..40cf511 100644 --- a/src/modest-conf.h +++ b/src/modest-conf.h @@ -45,12 +45,20 @@ G_BEGIN_DECLS typedef struct _ModestConf ModestConf; typedef struct _ModestConfClass ModestConfClass; -typedef enum _ModestConfEvent ModestConfEvent; +/* typedef enum _ModestConfEvent ModestConfEvent; */ +/* typedef enum _ModestConfValueType ModestConfValueType; */ -enum _ModestConfEvent { +typedef enum _ModestConfValueType { + MODEST_CONF_VALUE_INT, + MODEST_CONF_VALUE_BOOL, + MODEST_CONF_VALUE_FLOAT, + MODEST_CONF_VALUE_STRING +} ModestConfValueType; + +typedef enum _ModestConfEvent { MODEST_CONF_EVENT_KEY_CHANGED, MODEST_CONF_EVENT_KEY_UNSET -}; +} ModestConfEvent; struct _ModestConf { GObject parent; @@ -273,6 +281,7 @@ gchar* modest_conf_key_escape (ModestConf *self, const gchar* str); gchar* modest_conf_key_unescape (ModestConf *self, const gchar* str); +GSList* modest_conf_get_list (ModestConf* self, const gchar* key, ModestConfValueType list_type, GError **err); G_END_DECLS diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index c2b3c67..a13f5d7 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -82,6 +82,20 @@ static TnyMimePart * add_body_part (TnyMsg *msg, gboolean has_attachments); +static void modest_mail_operation_xfer_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent, + gboolean delete_original); + +static void modest_mail_operation_xfer_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder, + gboolean delete_original); + +static TnyFolder * modest_mail_operation_find_trash_folder (ModestMailOperation *mail_op, + TnyStoreAccount *store_account); + + /* list my signals */ enum { /* MY_SIGNAL_1, */ @@ -91,7 +105,6 @@ enum { typedef struct _ModestMailOperationPrivate ModestMailOperationPrivate; struct _ModestMailOperationPrivate { - TnyAccount *account; ModestMailOperationStatus status; GError *error; }; @@ -159,7 +172,6 @@ modest_mail_operation_init (ModestMailOperation *obj) priv = MODEST_MAIL_OPERATION_GET_PRIVATE(obj); - priv->account = NULL; priv->status = MODEST_MAIL_OPERATION_STATUS_INVALID; priv->error = NULL; } @@ -171,10 +183,6 @@ modest_mail_operation_finalize (GObject *obj) priv = MODEST_MAIL_OPERATION_GET_PRIVATE(obj); - if (priv->account) { - g_object_unref (priv->account); - priv->account = NULL; - } if (priv->error) { g_error_free (priv->error); priv->error = NULL; @@ -184,44 +192,26 @@ modest_mail_operation_finalize (GObject *obj) } ModestMailOperation* -modest_mail_operation_new (TnyAccount *account) +modest_mail_operation_new (void) { - ModestMailOperation *mail_operation; - ModestMailOperationPrivate *priv; - - mail_operation = - MODEST_MAIL_OPERATION(g_object_new(MODEST_TYPE_MAIL_OPERATION, NULL)); - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); - - priv->account = g_object_ref (account); - - return mail_operation; + return MODEST_MAIL_OPERATION(g_object_new(MODEST_TYPE_MAIL_OPERATION, NULL)); } void -modest_mail_operation_send_mail (ModestMailOperation *mail_operation, +modest_mail_operation_send_mail (ModestMailOperation *mail_op, + TnyTransportAccount *transport_account, TnyMsg* msg) { - ModestMailOperationPrivate *priv; - TnyTransportAccount *transport_account; - - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); - - if (!TNY_IS_TRANSPORT_ACCOUNT (priv->account)) { - set_error (mail_operation, - MODEST_MAIL_OPERATION_ERROR_BAD_ACCOUNT, - _("Error trying to send a mail. Use a transport account")); - } - - transport_account = TNY_TRANSPORT_ACCOUNT (priv->account); + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_TRANSPORT_ACCOUNT (transport_account)); - mail_operation = modest_mail_operation_new (NULL); tny_transport_account_send (transport_account, msg); } void -modest_mail_operation_send_new_mail (ModestMailOperation *mail_operation, +modest_mail_operation_send_new_mail (ModestMailOperation *mail_op, + TnyTransportAccount *transport_account, const gchar *from, const gchar *to, const gchar *cc, @@ -232,32 +222,20 @@ modest_mail_operation_send_new_mail (ModestMailOperation *mail_operation, { TnyMsg *new_msg; TnyHeader *header; - TnyTransportAccount *transport_account; - ModestMailOperationPrivate *priv; gchar *content_type; - g_return_if_fail (mail_operation); + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_TRANSPORT_ACCOUNT (transport_account)); /* Check parametters */ if (to == NULL) { - set_error (mail_operation, + set_error (mail_op, MODEST_MAIL_OPERATION_ERROR_MISSING_PARAMETER, _("Error trying to send a mail. You need to set almost one a recipient")); return; } - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); - - if (!TNY_IS_TRANSPORT_ACCOUNT (priv->account)) { - set_error (mail_operation, - MODEST_MAIL_OPERATION_ERROR_BAD_ACCOUNT, - _("Error trying to send a mail. Use a transport account")); - return; - } - /* Create new msg */ - transport_account = TNY_TRANSPORT_ACCOUNT (priv->account); - new_msg = TNY_MSG (tny_camel_msg_new ()); header = TNY_HEADER (tny_camel_header_new ()); @@ -505,7 +483,8 @@ modest_mail_operation_create_reply_mail (TnyMsg *msg, } void -modest_mail_operation_update_account (ModestMailOperation *mail_operation) +modest_mail_operation_update_account (ModestMailOperation *mail_op, + TnyStoreAccount *store_account) { TnyStoreAccount *storage_account; ModestMailOperationPrivate *priv; @@ -514,19 +493,10 @@ modest_mail_operation_update_account (ModestMailOperation *mail_operation) TnyFolder *cur_folder; TnyFolderStoreQuery *query; - g_return_if_fail (mail_operation); - g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_operation)); + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_STORE_ACCOUNT(store_account)); - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); - - /* Check that it is a store account */ - if (!TNY_IS_STORE_ACCOUNT (priv->account)) { - set_error (mail_operation, - MODEST_MAIL_OPERATION_ERROR_BAD_ACCOUNT, - _("Error trying to update an account. Use a store account")); - return; - } - storage_account = TNY_STORE_ACCOUNT (priv->account); + priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_op); /* Get subscribed folders */ folders = TNY_LIST (tny_simple_list_new ()); @@ -545,43 +515,313 @@ modest_mail_operation_update_account (ModestMailOperation *mail_operation) cur_folder = TNY_FOLDER (tny_iterator_get_current (ifolders)); tny_folder_refresh_async (cur_folder, folder_refresh_cb, - status_update_cb, mail_operation); + status_update_cb, mail_op); } g_object_unref (ifolders); } ModestMailOperationStatus -modest_mail_operation_get_status (ModestMailOperation *mail_operation) +modest_mail_operation_get_status (ModestMailOperation *mail_op) { ModestMailOperationPrivate *priv; -/* g_return_val_if_fail (mail_operation, MODEST_MAIL_OPERATION_STATUS_INVALID); */ -/* g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (mail_operation), */ +/* g_return_val_if_fail (mail_op, MODEST_MAIL_OPERATION_STATUS_INVALID); */ +/* g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (mail_op), */ /* MODEST_MAIL_OPERATION_STATUS_INVALID); */ - priv = MODEST_MAIL_OPERATION_GET_PRIVATE (mail_operation); + priv = MODEST_MAIL_OPERATION_GET_PRIVATE (mail_op); return priv->status; } const GError * -modest_mail_operation_get_error (ModestMailOperation *mail_operation) +modest_mail_operation_get_error (ModestMailOperation *mail_op) { ModestMailOperationPrivate *priv; -/* g_return_val_if_fail (mail_operation, NULL); */ -/* g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (mail_operation), NULL); */ +/* g_return_val_if_fail (mail_op, NULL); */ +/* g_return_val_if_fail (MODEST_IS_MAIL_OPERATION (mail_op), NULL); */ - priv = MODEST_MAIL_OPERATION_GET_PRIVATE (mail_operation); + priv = MODEST_MAIL_OPERATION_GET_PRIVATE (mail_op); return priv->error; } void -modest_mail_operation_cancel (ModestMailOperation *mail_operation) +modest_mail_operation_cancel (ModestMailOperation *mail_op) { /* TODO */ } +/* ******************************************************************* */ +/* ************************** STORE ACTIONS ************************* */ +/* ******************************************************************* */ + + +TnyFolder * +modest_mail_operation_create_folder (ModestMailOperation *mail_op, + TnyFolderStore *parent, + const gchar *name) +{ + g_return_val_if_fail (TNY_IS_FOLDER_STORE (parent), NULL); + g_return_val_if_fail (name, NULL); + + TnyFolder *new_folder = NULL; + TnyStoreAccount *store_account; + + /* Create the folder */ + new_folder = tny_folder_store_create_folder (parent, name); + if (!new_folder) + return NULL; + + /* Subscribe to folder */ + if (!tny_folder_is_subscribed (new_folder)) { + store_account = tny_folder_get_account (TNY_FOLDER (parent)); + tny_store_account_subscribe (store_account, new_folder); + g_object_unref (G_OBJECT (store_account)); + } + + return new_folder; +} + +void +modest_mail_operation_remove_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + gboolean remove_to_trash) +{ + TnyFolderStore *folder_store; + + g_return_if_fail (TNY_IS_FOLDER (folder)); + + /* Get folder store */ + folder_store = TNY_FOLDER_STORE (tny_folder_get_account (folder)); + + /* Delete folder or move to trash */ + if (remove_to_trash) { + TnyFolder *trash_folder; + + trash_folder = modest_mail_operation_find_trash_folder (mail_op, + TNY_STORE_ACCOUNT (folder_store)); + + /* TODO: error_handling */ + modest_mail_operation_move_folder (mail_op, + folder, + TNY_FOLDER_STORE (trash_folder)); + } else { + tny_folder_store_remove_folder (folder_store, folder); + g_object_unref (G_OBJECT (folder)); + } + + /* Free instances */ + g_object_unref (G_OBJECT (folder_store)); +} + +void +modest_mail_operation_rename_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + const gchar *name) +{ + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_FOLDER_STORE (folder)); + + /* FIXME: better error handling */ + if (strrchr (name, '/') != NULL) + return; + + /* Rename. Camel handles folder subscription/unsubscription */ + tny_folder_set_name (folder, name); +} + +void +modest_mail_operation_move_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent) +{ + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_FOLDER_STORE (parent)); + g_return_if_fail (TNY_IS_FOLDER (folder)); + + modest_mail_operation_xfer_folder (mail_op, folder, parent, TRUE); +} + +void +modest_mail_operation_copy_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent) +{ + g_return_if_fail (MODEST_IS_MAIL_OPERATION (mail_op)); + g_return_if_fail (TNY_IS_FOLDER_STORE (parent)); + g_return_if_fail (TNY_IS_FOLDER (folder)); + + modest_mail_operation_xfer_folder (mail_op, folder, parent, FALSE); +} + +static void +modest_mail_operation_xfer_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent, + gboolean delete_original) +{ + const gchar *folder_name; + TnyFolder *dest_folder, *child; + TnyIterator *iter; + TnyList *folders, *headers; + + g_return_if_fail (TNY_IS_FOLDER (folder)); + g_return_if_fail (TNY_IS_FOLDER_STORE (parent)); + + /* Create the destination folder */ + folder_name = tny_folder_get_name (folder); + dest_folder = modest_mail_operation_create_folder (mail_op, + parent, folder_name); + + /* Transfer messages */ + headers = TNY_LIST (tny_simple_list_new ()); + tny_folder_get_headers (folder, headers, FALSE); + tny_folder_transfer_msgs (folder, headers, dest_folder, delete_original); + + /* Recurse children */ + folders = TNY_LIST (tny_simple_list_new ()); + tny_folder_store_get_folders (TNY_FOLDER_STORE (folder), folders, NULL); + iter = tny_list_create_iterator (folders); + + while (!tny_iterator_is_done (iter)) { + + child = TNY_FOLDER (tny_iterator_get_current (iter)); + modest_mail_operation_xfer_folder (mail_op, child, + TNY_FOLDER_STORE (dest_folder), + delete_original); + tny_iterator_next (iter); + } + + /* Delete source folder (if needed) */ + if (delete_original) + modest_mail_operation_remove_folder (mail_op, folder, FALSE); + + /* Clean up */ + g_object_unref (G_OBJECT (dest_folder)); + g_object_unref (G_OBJECT (headers)); + g_object_unref (G_OBJECT (folders)); + g_object_unref (G_OBJECT (iter)); +} + +static TnyFolder * +modest_mail_operation_find_trash_folder (ModestMailOperation *mail_op, + TnyStoreAccount *store_account) +{ + TnyList *folders; + TnyIterator *iter; + gboolean found; + TnyFolderStoreQuery *query; + TnyFolder *trash_folder; + + /* Look for Trash folder */ + folders = TNY_LIST (tny_simple_list_new ()); + tny_folder_store_get_folders (TNY_FOLDER_STORE (store_account), folders, NULL); + iter = tny_list_create_iterator (folders); + + found = FALSE; + while (!tny_iterator_is_done (iter) && !found) { + + trash_folder = TNY_FOLDER (tny_iterator_get_current (iter)); + if (tny_folder_get_folder_type (trash_folder) == TNY_FOLDER_TYPE_TRASH) + found = TRUE; + else + tny_iterator_next (iter); + } + + /* Clean up */ + g_object_unref (G_OBJECT (folders)); + g_object_unref (G_OBJECT (iter)); + + /* TODO: better error handling management */ + if (!found) + return NULL; + else + return trash_folder; +} + +/* ******************************************************************* */ +/* ************************** MSG ACTIONS ************************* */ +/* ******************************************************************* */ + +void +modest_mail_operation_copy_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder) +{ + g_return_if_fail (TNY_IS_HEADER (header)); + g_return_if_fail (TNY_IS_FOLDER (folder)); + + modest_mail_operation_xfer_msg (mail_op, header, folder, FALSE); +} + +void +modest_mail_operation_move_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder) +{ + g_return_if_fail (TNY_IS_HEADER (header)); + g_return_if_fail (TNY_IS_FOLDER (folder)); + + modest_mail_operation_xfer_msg (mail_op, header, folder, TRUE); +} + +void +modest_mail_operation_remove_msg (ModestMailOperation *mail_op, + TnyHeader *header, + gboolean remove_to_trash) +{ + TnyFolder *folder; + + g_return_if_fail (TNY_IS_HEADER (header)); + + folder = tny_header_get_folder (header); + + /* Delete or move to trash */ + if (remove_to_trash) { + TnyFolder *trash_folder; + TnyStoreAccount *store_account; + + store_account = TNY_STORE_ACCOUNT (tny_folder_get_account (folder)); + trash_folder = modest_mail_operation_find_trash_folder (mail_op, store_account); + + modest_mail_operation_move_msg (mail_op, header, trash_folder); + + g_object_unref (G_OBJECT (store_account)); + } else { + tny_folder_remove_msg (folder, header); + tny_folder_expunge (folder); + } + + /* Free */ + g_object_unref (folder); +} + +static void +modest_mail_operation_xfer_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder, + gboolean delete_original) +{ + TnyFolder *src_folder; + TnyList *headers; + + src_folder = tny_header_get_folder (header); + headers = tny_simple_list_new (); + + /* Move */ + tny_list_prepend (headers, G_OBJECT (header)); + tny_folder_transfer_msgs (src_folder, headers, folder, delete_original); + + /* Free */ + g_object_unref (headers); + g_object_unref (folder); +} + + +/* ******************************************************************* */ +/* ************************* UTILIY FUNCTIONS ************************ */ +/* ******************************************************************* */ static gboolean is_ascii(const gchar *s) { @@ -624,7 +864,7 @@ modest_error_quark (void) static void -set_error (ModestMailOperation *mail_operation, +set_error (ModestMailOperation *mail_op, ModestMailOperationErrorCode error_code, const gchar *fmt, ...) { @@ -633,7 +873,7 @@ set_error (ModestMailOperation *mail_operation, va_list args; gchar* orig; - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); + priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_op); va_start (args, fmt); @@ -659,11 +899,11 @@ static void folder_refresh_cb (TnyFolder *folder, gboolean cancelled, gpointer user_data) { if (cancelled) { - ModestMailOperation *mail_operation; + ModestMailOperation *mail_op; ModestMailOperationPrivate *priv; - mail_operation = MODEST_MAIL_OPERATION (user_data); - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_operation); + mail_op = MODEST_MAIL_OPERATION (user_data); + priv = MODEST_MAIL_OPERATION_GET_PRIVATE(mail_op); priv->status = MODEST_MAIL_OPERATION_STATUS_CANCELLED; } diff --git a/src/modest-mail-operation.h b/src/modest-mail-operation.h index 444bed5..8f0baa7 100644 --- a/src/modest-mail-operation.h +++ b/src/modest-mail-operation.h @@ -47,34 +47,34 @@ G_BEGIN_DECLS typedef struct _ModestMailOperation ModestMailOperation; typedef struct _ModestMailOperationClass ModestMailOperationClass; -typedef enum _ModestMailOperationForwardType ModestMailOperationForwardType; -typedef enum _ModestMailOperationReplyType ModestMailOperationReplyType; -typedef enum _ModestMailOperationReplyMode ModestMailOperationReplyMode; -typedef enum _ModestMailOperationStatus ModestMailOperationStatus; +/* typedef enum _ModestMailOperationForwardType ModestMailOperationForwardType; */ +/* typedef enum _ModestMailOperationReplyType ModestMailOperationReplyType; */ +/* typedef enum _ModestMailOperationReplyMode ModestMailOperationReplyMode; */ +/* typedef enum _ModestMailOperationStatus ModestMailOperationStatus; */ -enum _ModestMailOperationForwardType { +typedef enum _ModestMailOperationForwardType { MODEST_MAIL_OPERATION_FORWARD_TYPE_INLINE = 1, MODEST_MAIL_OPERATION_FORWARD_TYPE_ATTACHMENT -}; +} ModestMailOperationForwardType; -enum _ModestMailOperationReplyType { +typedef enum _ModestMailOperationReplyType { MODEST_MAIL_OPERATION_REPLY_TYPE_CITE = 1, MODEST_MAIL_OPERATION_REPLY_TYPE_QUOTE -}; +} ModestMailOperationReplyType; -enum _ModestMailOperationReplyMode { +typedef enum _ModestMailOperationReplyMode { MODEST_MAIL_OPERATION_REPLY_MODE_SENDER, MODEST_MAIL_OPERATION_REPLY_MODE_LIST, MODEST_MAIL_OPERATION_REPLY_MODE_ALL -}; +} ModestMailOperationReplyMode; -enum _ModestMailOperationStatus { +typedef enum _ModestMailOperationStatus { MODEST_MAIL_OPERATION_STATUS_INVALID, MODEST_MAIL_OPERATION_STATUS_SUCCESS, MODEST_MAIL_OPERATION_STATUS_FAILED, MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS, MODEST_MAIL_OPERATION_STATUS_CANCELLED -}; +} ModestMailOperationStatus; struct _ModestMailOperation { GObject parent; @@ -91,38 +91,76 @@ struct _ModestMailOperationClass { GType modest_mail_operation_get_type (void) G_GNUC_CONST; /* typical parameter-less _new function */ -ModestMailOperation* modest_mail_operation_new (TnyAccount *account); +ModestMailOperation* modest_mail_operation_new (void); /* fill in other public functions, eg.: */ -void modest_mail_operation_send_mail (ModestMailOperation *mail_operation, - TnyMsg* msg); - -void modest_mail_operation_send_new_mail (ModestMailOperation *mail_operation, - const gchar *from, - const gchar *to, - const gchar *cc, - const gchar *bcc, - const gchar *subject, - const gchar *body, - const GList *attachments_list); +void modest_mail_operation_send_mail (ModestMailOperation *mail_op, + TnyTransportAccount *transport_account, + TnyMsg* msg); + +void modest_mail_operation_send_new_mail (ModestMailOperation *mail_op, + TnyTransportAccount *transport_account, + const gchar *from, + const gchar *to, + const gchar *cc, + const gchar *bcc, + const gchar *subject, + const gchar *body, + const GList *attachments_list); TnyMsg* modest_mail_operation_create_forward_mail (TnyMsg *msg, const gchar *from, ModestMailOperationForwardType forward_type); -TnyMsg* modest_mail_operation_create_reply_mail (TnyMsg *msg, - const gchar *from, - ModestMailOperationReplyType reply_type, - ModestMailOperationReplyMode reply_mode); +TnyMsg* modest_mail_operation_create_reply_mail (TnyMsg *msg, + const gchar *from, + ModestMailOperationReplyType reply_type, + ModestMailOperationReplyMode reply_mode); + +void modest_mail_operation_update_account (ModestMailOperation *mail_op, + TnyStoreAccount *store_account); + +/* Functions that perform store operations */ +TnyFolder* modest_mail_operation_create_folder (ModestMailOperation *mail_op, + TnyFolderStore *parent, + const gchar *name); + +void modest_mail_operation_remove_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + gboolean remove_to_trash); + +void modest_mail_operation_rename_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + const gchar *name); + +void modest_mail_operation_move_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent); + +void modest_mail_operation_copy_folder (ModestMailOperation *mail_op, + TnyFolder *folder, + TnyFolderStore *parent); + +/* Functions that performs msg operations */ + +void modest_mail_operation_copy_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder); + +void modest_mail_operation_move_msg (ModestMailOperation *mail_op, + TnyHeader *header, + TnyFolder *folder); -void modest_mail_operation_update_account (ModestMailOperation *mail_operation); +void modest_mail_operation_remove_msg (ModestMailOperation *mail_op, + TnyHeader *header, + gboolean remove_to_trash); /* Functions to control mail operations */ -ModestMailOperationStatus modest_mail_operation_get_status (ModestMailOperation *mail_operation); +ModestMailOperationStatus modest_mail_operation_get_status (ModestMailOperation *mail_op); -const GError* modest_mail_operation_get_error (ModestMailOperation *mail_operation); +const GError* modest_mail_operation_get_error (ModestMailOperation *mail_op); -void modest_mail_operation_cancel (ModestMailOperation *mail_operation); +void modest_mail_operation_cancel (ModestMailOperation *mail_op); G_END_DECLS diff --git a/src/modest-main.c b/src/modest-main.c index 1491d7a..1107231 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -251,9 +251,10 @@ send_mail (const gchar* mailto, const gchar *cc, const gchar *bcc, account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter)); - mail_operation = modest_mail_operation_new (TNY_ACCOUNT (account)); + mail_operation = modest_mail_operation_new (); modest_mail_operation_send_new_mail (mail_operation, + account, "djcb@djcbsoftware.nl", mailto, cc, bcc, subject, body, NULL); diff --git a/src/modest-presets.h b/src/modest-presets.h index b542fdf..307d9f0 100644 --- a/src/modest-presets.h +++ b/src/modest-presets.h @@ -38,7 +38,7 @@ struct _ModestPresets { }; typedef struct _ModestPresets ModestPresets; -enum _ModestPresetsInfo { +typedef enum _ModestPresetsInfo { /* two bits for the server type */ MODEST_PRESETS_INFO_NONE = 0x0000, MODEST_PRESETS_INFO_IMAP = 0x0001, @@ -49,9 +49,9 @@ enum _ModestPresetsInfo { MODEST_PRESETS_INFO_APOP = 0x0004, MODEST_PRESETS_INFO_SECURE_SMTP = 0x0008, MODEST_PRESETS_INFO_SECURE_INCOMING = 0x000f -}; +} ModestPresetsInfo; -typedef enum _ModestPresetsInfo ModestPresetsInfo; +/* typedef enum _ModestPresetsInfo ModestPresetsInfo; */ /** diff --git a/src/modest-protocol-mgr.h b/src/modest-protocol-mgr.h index d5ca7d1..96a2352 100644 --- a/src/modest-protocol-mgr.h +++ b/src/modest-protocol-mgr.h @@ -77,17 +77,15 @@ struct _ModestProtocolMgrClass { #define MODEST_PROTOCOL_AUTH_NONE "none" #define MODEST_PROTOCOL_AUTH_PASSWORD "password" - -enum _ModestProtocolType { +typedef enum _ModestProtocolType { MODEST_PROTOCOL_TYPE_TRANSPORT, MODEST_PROTOCOL_TYPE_STORE, MODEST_PROTOCOL_TYPE_SECURITY, MODEST_PROTOCOL_TYPE_AUTH, - MODEST_PROTOCOL_TYPE_ANY, - + MODEST_PROTOCOL_TYPE_ANY, MODEST_PROTOCOL_TYPE_NUM -}; -typedef enum _ModestProtocolType ModestProtocolType; +} ModestProtocolType; +/* typedef enum _ModestProtocolType ModestProtocolType; */ /* member functions */ GType modest_protocol_mgr_get_type (void) G_GNUC_CONST; diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index f488124..f7e73cc 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -280,7 +280,9 @@ tny_account_from_name (ModestTnyAccountStore *self, const gchar *account, TnyAccount *tny_account; ModestTnyAccountStorePrivate *priv; gchar *val; - + GSList *options = NULL; + GError *error = NULL; + g_return_val_if_fail (self, NULL); g_return_val_if_fail (account, NULL); g_return_val_if_fail (server_account, NULL); @@ -324,6 +326,28 @@ tny_account_from_name (ModestTnyAccountStore *self, const gchar *account, return NULL; } + /* Options */ + options = modest_account_mgr_get_list (priv->account_mgr, + tny_account_get_id (tny_account), + MODEST_ACCOUNT_OPTIONS, + MODEST_CONF_VALUE_STRING, + TRUE, + &error); + + if (error) { + g_warning ("Error retrieving account %s options: %s", + tny_account_get_id (tny_account), error->message); + g_error_free (error); + } else { + GSList *tmp = options; + while (options) { + tny_camel_account_add_option (TNY_CAMEL_ACCOUNT (tny_account), options->data); + g_free (options->data); + options = g_slist_next (options); + } + g_slist_free (tmp); + } + /* hostname */ val = modest_account_mgr_get_string (priv->account_mgr, server_account, MODEST_ACCOUNT_HOSTNAME, TRUE, @@ -566,12 +590,14 @@ modest_tny_account_store_get_accounts (TnyAccountStore *iface, cursor = accounts = modest_account_mgr_account_names (priv->account_mgr, NULL); while (cursor) { - gchar *account_name; - gchar *server_account; - TnyAccount *account; - - account_name = (gchar*)cursor->data; - account = NULL; + gchar *account_name; + gchar *server_account; + TnyAccount *account; + gboolean is_server_account; + + account_name = (gchar*)cursor->data; + account = NULL; + is_server_account = FALSE; if (!modest_account_mgr_account_get_enabled (priv->account_mgr, account_name)) { g_free (account_name); @@ -582,10 +608,13 @@ modest_tny_account_store_get_accounts (TnyAccountStore *iface, if (modest_type == MODEST_PROTOCOL_TYPE_TRANSPORT || modest_type == MODEST_PROTOCOL_TYPE_ANY) { server_account = get_server_account_for_account (self, account_name, MODEST_PROTOCOL_TYPE_TRANSPORT); - if (server_account) + if (server_account) { account = tny_account_from_name (self, account_name, server_account, MODEST_PROTOCOL_TYPE_TRANSPORT); + is_server_account = TRUE; + } + if (!account) g_printerr ("modest: no transport account for '%s'\n", account_name); @@ -598,10 +627,13 @@ modest_tny_account_store_get_accounts (TnyAccountStore *iface, if (modest_type == MODEST_PROTOCOL_TYPE_STORE || modest_type == MODEST_PROTOCOL_TYPE_ANY) { server_account = get_server_account_for_account (self, account_name, MODEST_PROTOCOL_TYPE_STORE); - if (server_account) + if (server_account) { account = tny_account_from_name (self, account_name, server_account, MODEST_PROTOCOL_TYPE_STORE); + is_server_account = TRUE; + } + if (!account) g_printerr ("modest: no store account for '%s'\n", account_name); @@ -617,8 +649,6 @@ modest_tny_account_store_get_accounts (TnyAccountStore *iface, g_slist_free (accounts); tny_session_camel_set_account_store (priv->tny_session_camel, iface); -/* tny_session_camel_set_current_accounts (priv->tny_session_camel, */ -/* list); */ } diff --git a/src/modest-tny-msg-actions.c b/src/modest-tny-msg-actions.c index f05abcc..710e242 100644 --- a/src/modest-tny-msg-actions.c +++ b/src/modest-tny-msg-actions.c @@ -184,58 +184,3 @@ modest_tny_msg_actions_find_body (TnyMsg *msg, gboolean want_html) else return NULL; } - - -static void -modest_tny_msg_actions_xfer (TnyHeader *header, TnyFolder *folder, - gboolean delete_original) -{ - TnyFolder *src_folder; - TnyList *headers; - - src_folder = tny_header_get_folder (header); - headers = tny_simple_list_new (); - - /* Move */ - tny_list_prepend (headers, G_OBJECT (header)); - tny_folder_transfer_msgs (src_folder, headers, folder, delete_original); - - /* Free */ - g_object_unref (headers); - g_object_unref (folder); -} - -void -modest_tny_msg_actions_copy (TnyHeader *header, TnyFolder *folder) -{ - g_return_if_fail (TNY_IS_HEADER (header)); - g_return_if_fail (TNY_IS_FOLDER (folder)); - - modest_tny_msg_actions_xfer (header, folder, FALSE); -} - -void -modest_tny_msg_actions_move (TnyHeader *header, TnyFolder *folder) -{ - g_return_if_fail (TNY_IS_HEADER (header)); - g_return_if_fail (TNY_IS_FOLDER (folder)); - - modest_tny_msg_actions_xfer (header, folder, TRUE); -} - -void -modest_tny_msg_actions_remove (TnyHeader *header) -{ - TnyFolder *folder; - - g_return_if_fail (TNY_IS_HEADER (header)); - - folder = tny_header_get_folder (header); - - /* Remove */ - tny_folder_remove_msg (folder, header); - tny_folder_expunge (folder); - - /* Free */ - g_object_unref (folder); -} diff --git a/src/modest-tny-msg-actions.h b/src/modest-tny-msg-actions.h index 9e4bb23..bed606a 100644 --- a/src/modest-tny-msg-actions.h +++ b/src/modest-tny-msg-actions.h @@ -75,10 +75,4 @@ TnyMimePart* modest_tny_msg_actions_find_nth_part (TnyMsg *msg, gint index); gchar* modest_tny_msg_actions_find_body (TnyMsg *self, gboolean want_html); -void modest_tny_msg_actions_copy (TnyHeader *header, TnyFolder *folder); - -void modest_tny_msg_actions_move (TnyHeader *header, TnyFolder *folder); - -void modest_tny_msg_actions_remove (TnyHeader *header); - #endif /* __MODEST_TNY_MSG_ACTIONS_H__ */ diff --git a/src/modest-widget-factory.c b/src/modest-widget-factory.c index ee5c052..0a00921 100644 --- a/src/modest-widget-factory.c +++ b/src/modest-widget-factory.c @@ -35,8 +35,7 @@ #include #include "modest-tny-platform-factory.h" #include "modest-account-mgr.h" -/* Test: REMOVE */ -#include +#include "modest-mail-operation.h" /* 'private'/'protected' functions */ static void modest_widget_factory_class_init (ModestWidgetFactoryClass *klass); static void modest_widget_factory_init (ModestWidgetFactory *obj); @@ -501,30 +500,38 @@ on_folder_selected (ModestFolderView *folder_view, TnyFolder *folder, static void on_folder_key_press_event (ModestFolderView *folder_view, GdkEventKey *event, gpointer user_data) { + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + TnyFolderStore *folder; + gint type; + ModestMailOperation *mail_op; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_view)); + gtk_tree_selection_get_selected (selection, &model, &iter); + + gtk_tree_model_get (model, &iter, + TNY_GTK_ACCOUNT_TREE_MODEL_TYPE_COLUMN, &type, + TNY_GTK_ACCOUNT_TREE_MODEL_INSTANCE_COLUMN, &folder, + -1); + + mail_op = modest_mail_operation_new (); + if (event->keyval == GDK_C || event->keyval == GDK_c) { - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - const gchar *name; - TnyFolderStore *folder; - gint type; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_view)); - gtk_tree_selection_get_selected (selection, &model, &iter); - - gtk_tree_model_get (model, &iter, - TNY_GTK_ACCOUNT_TREE_MODEL_TYPE_COLUMN, &type, - TNY_GTK_ACCOUNT_TREE_MODEL_INSTANCE_COLUMN, &folder, - -1); - - if (type == TNY_FOLDER_TYPE_ROOT) { - name = tny_account_get_name (TNY_ACCOUNT (folder)); - } else { - name = tny_folder_get_name (TNY_FOLDER (folder)); - modest_tny_store_actions_create_folder (TNY_FOLDER_STORE (folder), - "New"); - } + if (type != TNY_FOLDER_TYPE_ROOT) + modest_mail_operation_create_folder (mail_op, folder, "New"); + } else if (event->keyval == GDK_D || event->keyval == GDK_d) { + if (type != TNY_FOLDER_TYPE_ROOT) + modest_mail_operation_remove_folder (mail_op, TNY_FOLDER (folder), FALSE); + } else if (event->keyval == GDK_N || event->keyval == GDK_n) { + if (type != TNY_FOLDER_TYPE_ROOT) + modest_mail_operation_rename_folder (mail_op, TNY_FOLDER (folder), "New Name"); + } else if (event->keyval == GDK_T || event->keyval == GDK_t) { + if (type != TNY_FOLDER_TYPE_ROOT) + modest_mail_operation_remove_folder (mail_op, TNY_FOLDER (folder), TRUE); } + + g_object_unref (G_OBJECT (mail_op)); } /****************************************************/ diff --git a/src/modest-widget-factory.h b/src/modest-widget-factory.h index eb9083a..694f0ee 100644 --- a/src/modest-widget-factory.h +++ b/src/modest-widget-factory.h @@ -64,14 +64,14 @@ struct _ModestWidgetFactoryClass { }; -enum _ModestComboBoxType { +typedef enum _ModestComboBoxType { MODEST_COMBO_BOX_TYPE_STORE_PROTOS, MODEST_COMBO_BOX_TYPE_TRANSPORT_PROTOS, MODEST_COMBO_BOX_TYPE_SECURITY_PROTOS, MODEST_COMBO_BOX_TYPE_AUTH_PROTOS, MODEST_COMBO_BOX_TYPE_TRANSPORTS -}; -typedef enum _ModestComboBoxType ModestComboBoxType; +} ModestComboBoxType; +/* typedef enum _ModestComboBoxType ModestComboBoxType; */ /** diff --git a/src/widgets/Makefile.am b/src/widgets/Makefile.am index af48426..f817972 100644 --- a/src/widgets/Makefile.am +++ b/src/widgets/Makefile.am @@ -13,20 +13,20 @@ INCLUDES=\ noinst_LTLIBRARIES=\ libmodest-widgets.la -libmodest_widgets_la_SOURCES= \ - modest-account-view.c \ - modest-account-view.h \ - modest-folder-view.c \ - modest-folder-view.h \ - modest-header-view.c \ - modest-header-view.h \ - modest-msg-view.c \ - modest-msg-view.h \ - modest-toolbar.h \ - modest-toolbar.c \ - modest-combo-box.c \ +libmodest_widgets_la_SOURCES= \ + modest-account-view.c \ + modest-account-view.h \ + modest-folder-view.c \ + modest-folder-view.h \ + modest-header-view.c \ + modest-header-view.h \ + modest-msg-view.c \ + modest-msg-view.h \ + modest-toolbar.h \ + modest-toolbar.c \ + modest-combo-box.c \ modest-combo-box.h LDADD = \ - $(MODEST_GSTUFF_LIBS) \ - $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ No newline at end of file diff --git a/src/widgets/modest-header-view.h b/src/widgets/modest-header-view.h index ac01093..0bb9444 100644 --- a/src/widgets/modest-header-view.h +++ b/src/widgets/modest-header-view.h @@ -55,29 +55,10 @@ struct _ModestHeaderView { /* insert public members, if any */ }; -typedef enum _ModestItemType ModestItemType; +/* typedef enum _ModestItemType ModestItemType; */ -struct _ModestHeaderViewClass { - GtkTreeViewClass parent_class; - - void (*message_selected) (ModestHeaderView* self, - TnyMsg *msg, - gpointer user_data); - - void (*item_not_found) (ModestHeaderView* self, - ModestItemType type, - gpointer user_data); - - /* msg == NULL implies that the operation is finished, ie. - * the progress indictation can be hidden */ - void (*status_update) (ModestHeaderView* self, - const gchar* msg, - gint status, - gpointer user_data); -}; - -enum _ModestHeaderViewColumn { +typedef enum _ModestHeaderViewColumn { MODEST_HEADER_VIEW_COLUMN_FROM, MODEST_HEADER_VIEW_COLUMN_TO, MODEST_HEADER_VIEW_COLUMN_SUBJECT, @@ -88,22 +69,40 @@ enum _ModestHeaderViewColumn { MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER, MODEST_HEADER_VIEW_COLUMN_NUM -}; -typedef enum _ModestHeaderViewColumn ModestHeaderViewColumn; +} ModestHeaderViewColumn; +/* typedef enum _ModestHeaderViewColumn ModestHeaderViewColumn; */ -enum _ModestHeaderViewStyle { +typedef enum _ModestHeaderViewStyle { MODEST_HEADER_VIEW_STYLE_NORMAL, MODEST_HEADER_VIEW_STYLE_COMPACT, MODEST_HEADER_VIEW_STYLE_NUM -}; -typedef enum _ModestHeaderViewStyle ModestHeaderViewStyle; +} ModestHeaderViewStyle; +/* typedef enum _ModestHeaderViewStyle ModestHeaderViewStyle; */ -enum _ModestItemType { +typedef enum _ModestItemType { MODEST_ITEM_TYPE_MESSAGE, MODEST_ITEM_TYPE_FOLDER, MODEST_ITEM_TYPE_NUM -}; +} ModestItemType; + +struct _ModestHeaderViewClass { + GtkTreeViewClass parent_class; + void (*message_selected) (ModestHeaderView* self, + TnyMsg *msg, + gpointer user_data); + + void (*item_not_found) (ModestHeaderView* self, + ModestItemType type, + gpointer user_data); + + /* msg == NULL implies that the operation is finished, ie. + * the progress indictation can be hidden */ + void (*status_update) (ModestHeaderView* self, + const gchar* msg, + gint status, + gpointer user_data); +}; /** * modest_header_view_get_type: diff --git a/src/widgets/modest-toolbar.h b/src/widgets/modest-toolbar.h index dc37320..4c069c5 100644 --- a/src/widgets/modest-toolbar.h +++ b/src/widgets/modest-toolbar.h @@ -47,21 +47,8 @@ G_BEGIN_DECLS typedef struct _ModestToolbar ModestToolbar; typedef struct _ModestToolbarClass ModestToolbarClass; -typedef enum _ModestToolbarButton ModestToolbarButton; - - -struct _ModestToolbar { - GtkToolbar parent; - /* insert public members, if any */ -}; - -struct _ModestToolbarClass { - GtkToolbarClass parent_class; - - void (* button_clicked) (ModestToolbar* obj, ModestToolbarButton button_id); -}; - -enum _ModestToolbarButton { +/* typedef enum _ModestToolbarButton ModestToolbarButton; */ +typedef enum _ModestToolbarButton { MODEST_TOOLBAR_BUTTON_MAIL_SEND, MODEST_TOOLBAR_BUTTON_NEW_MAIL, MODEST_TOOLBAR_BUTTON_REPLY, @@ -76,8 +63,18 @@ enum _ModestToolbarButton { MODEST_TOOLBAR_SEPARATOR, MODEST_TOOLBAR_BUTTON_NUM +} ModestToolbarButton; + +struct _ModestToolbar { + GtkToolbar parent; + /* insert public members, if any */ }; +struct _ModestToolbarClass { + GtkToolbarClass parent_class; + + void (* button_clicked) (ModestToolbar* obj, ModestToolbarButton button_id); +}; /* member functions */ GType modest_toolbar_get_type (void) G_GNUC_CONST; diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..33d157d --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES=\ + $(MODEST_GSTUFF_CFLAGS)\ + $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS) \ + $(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) \ + -I$(MODEST_PLATFORM_DIR) \ + -I${top_srcdir}/src \ + -DPREFIX=\"@prefix@\" \ + -DMODESTLOCALEDIR=\""$(modestlocaledir)"\" + +bin_PROGRAMS=\ + folder-xfer + +folder_xfer_SOURCES=\ + folder-transfer.c + +folder_xfer_LDADD = \ + $(MODEST_GSTUFF_LIBS) \ + $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \ + $(MODEST_LIBTINYMAIL_MAEMO_LIBS) \ + ${top_srcdir}/src/$(MODEST_PLATFORM_DIR)/libmodest-ui.la \ + ${top_srcdir}/src/widgets/libmodest-widgets.la \ + ${top_srcdir}/src/modest-account-mgr.o \ + ${top_srcdir}/src/modest-tny-platform-factory.o \ + ${top_srcdir}/src/modest-conf.o \ + ${top_srcdir}/src/modest-protocol-mgr.o \ + ${top_srcdir}/src/modest-pair.o \ + ${top_srcdir}/src/modest-marshal.o \ + ${top_srcdir}/src/modest-tny-account-store.o \ + ${top_srcdir}/src/modest-mail-operation.o \ + ${top_srcdir}/src/modest-tny-msg-actions.o \ + ${top_srcdir}/src/modest-text-utils.o diff --git a/tests/folder-transfer.c b/tests/folder-transfer.c new file mode 100644 index 0000000..7b7f776 --- /dev/null +++ b/tests/folder-transfer.c @@ -0,0 +1,185 @@ +/* Copyright (c) 2006, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "modest-account-mgr.h" +#include "modest-mail-operation.h" + +static gchar *cachedir=NULL; +static gboolean move=FALSE; +static const gchar *src_name = NULL; +static const gchar *dst_name = NULL; + +static void +find_folders (TnyFolderStore *store, TnyFolderStoreQuery *query, + TnyFolder **folder_src, TnyFolder **folder_dst) +{ + TnyIterator *iter; + TnyList *folders; + + if ((*folder_src != NULL) && (*folder_dst != NULL)) + return; + + folders = tny_simple_list_new (); + tny_folder_store_get_folders (store, folders, query); + iter = tny_list_create_iterator (folders); + + while (!tny_iterator_is_done (iter) && (!*folder_src || !*folder_dst)) + { + TnyFolderStore *folder = (TnyFolderStore*) tny_iterator_get_current (iter); + gint i=0; + const gchar *folder_name = NULL; + + folder_name = tny_folder_get_name (TNY_FOLDER (folder)); + + if (!strcmp (folder_name, src_name)) + *folder_src = g_object_ref (folder); + + if (!strcmp (folder_name, dst_name)) + *folder_dst = g_object_ref (folder); + + find_folders (folder, query, folder_src, folder_dst); + + g_object_unref (G_OBJECT (folder)); + + tny_iterator_next (iter); + } + + g_object_unref (G_OBJECT (iter)); + g_object_unref (G_OBJECT (folders)); +} + +static const GOptionEntry options[] = { + { "from", 'f', 0, G_OPTION_ARG_STRING, &src_name, + "Source folder", NULL}, + { "to", 't', 0, G_OPTION_ARG_STRING, &dst_name, + "Destination folder", NULL}, + { "cachedir", 'c', 0, G_OPTION_ARG_STRING, &cachedir, + "Cache directory", NULL }, + { "move", 'm', 0, G_OPTION_ARG_NONE, &move, + "Move the messages instead of copy them", NULL }, + { NULL } +}; + +int +main (int argc, char **argv) +{ + GOptionContext *context; + TnyList *accounts, *src_headers, *dst_headers; + TnyStoreAccount *account; + TnyIterator *iter; + TnyFolder *folder_src = NULL, *folder_dst = NULL; + TnyPlatformFactory *fact = NULL; + ModestAccountMgr *acc_mgr = NULL; + ModestMailOperation *mail_op = NULL; + TnyAccountStore *account_store = NULL; + guint src_num_headers = 0, dst_num_headers = 0; + GError *err; + + g_type_init (); + + context = g_option_context_new ("Test"); + g_option_context_add_main_entries (context, options, "Modest"); + if (!g_option_context_parse (context, &argc, &argv, &err)) { + g_printerr ("Error in command line parameter(s): '%s', exiting\n", + err ? err->message : ""); + return 1; + } + g_option_context_free (context); + + fact = TNY_PLATFORM_FACTORY (modest_tny_platform_factory_get_instance ()); + acc_mgr = MODEST_ACCOUNT_MGR (modest_tny_platform_factory_get_modest_account_mgr_instance (fact)); + account_store = tny_platform_factory_new_account_store (fact); + + if (cachedir) + g_print ("Using %s as cache directory\n", cachedir); + + if (!src_name || !dst_name) { + g_printerr ("Error in command line parameter(s), specify source and target folders\n"); + return 1; + } + + /* Get accounts */ + accounts = tny_simple_list_new (); + + tny_account_store_get_accounts (account_store, accounts, + TNY_ACCOUNT_STORE_STORE_ACCOUNTS); + + iter = tny_list_create_iterator (accounts); + account = (TnyStoreAccount*) tny_iterator_get_current (iter); + + g_object_unref (G_OBJECT (iter)); + g_object_unref (G_OBJECT (accounts)); + + /* Find the two folders */ + find_folders (TNY_FOLDER_STORE (account), NULL, + &folder_src, &folder_dst); + + if (!folder_src || !folder_dst) + goto cleanup; + + /* Refresh folders */ + tny_folder_refresh (folder_src); + src_num_headers = tny_folder_get_all_count (folder_src); + + tny_folder_refresh (folder_dst); + dst_num_headers = tny_folder_get_all_count (folder_dst); + + /* Get all the headers of the source & target folder */ + src_headers = tny_simple_list_new (); + tny_folder_get_headers (folder_src, src_headers, TRUE); + + mail_op = modest_mail_operation_new (); + + if (move) + modest_mail_operation_move_folder (mail_op, + folder_src, + TNY_FOLDER_STORE (folder_dst)); + else + modest_mail_operation_copy_folder (mail_op, + folder_src, + TNY_FOLDER_STORE (folder_dst)); + + g_object_unref (G_OBJECT (src_headers)); + g_object_unref (G_OBJECT (mail_op)); + + cleanup: + g_object_unref (account); + + return 0; +} -- 1.7.9.5