}\
})
+/*
+ * Macros to parse R, G, B, A color components from
+ * compact unsigned int color representation
+ */
+#define R_MASKING(val) (((val) & 0xff000000) >> 24)
+#define G_MASKING(val) (((val) & 0x00ff0000) >> 16)
+#define B_MASKING(val) (((val) & 0x0000ff00) >> 8)
+#define A_MASKING(val) (((val) & 0x000000ff))
+
typedef enum {
EMAIL_FILE_TYPE_IMAGE,
EMAIL_FILE_TYPE_VIDEO,
#ifndef __EMAIL_ACCOUNT_FOLDER_MOVE_H__
#define __EMAIL_ACCOUNT_FOLDER_MOVE_H__
+/**
+ * @brief Create list of folders for choose destination folder
+ * when mail move operation performed
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_folder_list_for_mail_move(EmailAccountView *view);
+
+/**
+ * @brief Initialize genlist item class for folder move list
+ *
+ * Used in folder move list to display list of all mailboxes when mail
+ * move operation is performed. List item in this list has
+ * folder icon and folder name only.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_mail_move(EmailAccountView *view);
#endif /* __EMAIL_ACCOUNT_H__ */
#include "email-account.h"
+/**
+ * @brief Initialize genlist item class for combined folder list
+ *
+ * Used to display folders for combined account list
+ * List item in combined folder list has only folder icon and folder name.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_combined_folder_list(EmailAccountView *view);
+
+/**
+ * @brief Initialize genlist item class for single folder list
+ *
+ * Used in single folder list to display list of all mailboxes in single account.
+ * List item in single folder list has folder icon and folder name only.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_single_folder_list(EmailAccountView *view);
-void account_init_genlist_item_class_for_account_view_list(EmailAccountView *view);
-void account_create_folder_create_view(void *data);
-void account_delete_folder_view(void *data);
-void account_rename_folder_view(void *data);
+/**
+ * @brief Change list view to create folder view mode
+ *
+ * In this mode list of existing folders must be dimmed until new folder is created
+ *
+ * param[in] view @param[in] view Email account view data
+ */
+void account_change_view_to_folder_create_mode(EmailAccountView *view);
+
+/**
+ * @brief Change list view to delete folder mode
+ *
+ * In this mode folder items which can not be deleted must be dimmed
+ *
+ * param[in] view @param[in] view Email account view data
+ */
+void account_change_view_to_folder_delete_mode(EmailAccountView *view);
+
+/**
+ * @brief Change list view to rename folder mode
+ *
+ * In this mode folder items which can not be renamed must be dimmed
+ *
+ * param[in] view @param[in] view Email account view data
+ */
+void account_change_view_to_folder_rename_mode(EmailAccountView *view);
+/**
+ * @brief Create list of folders in combined account mode
+ *
+ * This list contains all possible combined folders. It is created for example when user select
+ * 'Show all folders' for combined accounts section
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_combined_folder_list(EmailAccountView *view);
+
+/**
+ * @brief Create list of folders for single account
+ *
+ * This list contains all folders for certain account.
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_single_account_folder_list(EmailAccountView *view);
-void account_folder_newfolder(void *data, Evas_Object *obj, void *event_info);
+/**
+ * @brief Create popup for folder create operation to input new folder name
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
+void account_create_new_folder_popup(EmailAccountView *view);
#endif /* __EMAIL_ACCOUNT_FOLDER_H_ */
#ifndef __EMAIL_ACCOUNT_LIST_VIEW_H__
#define __EMAIL_ACCOUNT_LIST_VIEW_H__
+/**
+ * @brief Create list of folders for combined account
+ *
+ * This list contains only important folders for combined account and all other accounts
+ * To go to folder list of some account or cmobined account show all folders item may be clicked
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_account_list_view(EmailAccountView *view);
+
+/**
+ * @brief Initialize genlist item class for account view list
+ *
+ * Used in account view list to display items in combined accounts list
+ * List items in account view list has folder icon folder name
+ * and account color label.
+ *
+ * @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_account_view_list(EmailAccountView *view);
#endif /* __EMAIL_ACCOUNT_H__ */
#include "email-account.h"
-#define R_MASKING(val) (((val) & 0xff000000) >> 24)
-#define G_MASKING(val) (((val) & 0x00ff0000) >> 16)
-#define B_MASKING(val) (((val) & 0x0000ff00) >> 8)
-#define A_MASKING(val) (((val) & 0x000000ff))
-
-
+/**
+ * @brief Stop currently running email service emf job by handle
+ *
+ * @param[in] view Email account view data
+ * @param[in] handle Job handle
+ */
void account_stop_emf_job(EmailAccountView *view, int handle);
+
+/**
+ * @brief Cancel all synchronization processes email service
+ *
+ * @param[in] view Email account view data
+ */
void account_sync_cancel_all(EmailAccountView *view);
+/**
+ * @brief Convert mailbox data into mailbox alias name
+ *
+ * @param[in] mlist Mailbox data
+ *
+ * @return Folder alias name on success, otherwise NULL
+ *
+ * @remarks Folder alias must be released after usage
+ */
char *account_convert_folder_alias_by_mailbox(email_mailbox_t *mlist);
+
+/**
+ * @brief Convert mailbox type into mailbox alias name
+ *
+ * @param[in] mailbox_type Mailbox type
+ *
+ * @return Folder alias name on success, otherwise NULL
+ *
+ * @remarks Folder alias must be released after usage
+ */
char *account_convert_folder_alias_by_mailbox_type(email_mailbox_type_e mailbox_type);
+/**
+ * @brief Update folder list item dim state when folder opetions rename/delete are performed
+ * If it is impossible to rename/delete folder it mudt be dimmed
+ *
+ * @param[in] view Email account view data
+ */
void account_update_folder_item_dim_state(EmailAccountView *view);
+
+/**
+ * @brief Update view title text
+ *
+ * @param[in] view Email account view data
+ */
void account_update_view_title(EmailAccountView *view);
+
+/**
+ * @brief Get user email address y account id
+ *
+ * @param[in] account_id Account id
+ *
+ * @return Email address on success, otherwise NULL
+ *
+ * @remarks Email address alias must be released after usage
+ */
char *account_get_user_email_address(int account_id);
+/**
+ * @brief Create popup with entry for text input
+ *
+ * Such popup is used for rename/create folder operations in account module
+ * It contains with title, editfield and two buttons in the bottom
+ *
+ * @param[in] view Email account view data
+ * @param[in] t_title Popup title
+ * @param[in] entry_text Text to be presetted as entry inpt text
+ * @param[in] _back_response_cb Click callback for hardware back button press
+ * @param[in] _done_key_cb Click callback for done SIP button
+ * @param[in] btn1_response_cb Click callback for left popup button
+ * @param[in] btn1_text Text for left popup button
+ * @param[in] btn2_response_cb Click callback for right popup button
+ * @param[in] btn2_text Text for right popup button
+ *
+ * @return Popup widget on success, otherwise NULL
+ */
Evas_Object *account_create_entry_popup(EmailAccountView *view, email_string_t t_title,
- const char *entry_text, const char *entry_selection_text,
- Evas_Smart_Cb _back_response_cb, Evas_Smart_Cb _done_key_cb,
+ const char *entry_text, Evas_Smart_Cb _back_response_cb, Evas_Smart_Cb _done_key_cb,
Evas_Smart_Cb btn1_response_cb, const char *btn1_text, Evas_Smart_Cb btn2_response_cb, const char *btn2_text);
-char *account_get_ellipsised_folder_name(EmailAccountView *view, char *org_filename);
+/**
+ * @brief Get ellipsised folder name text
+ *
+ * @param[in] view Email account view data
+ * @param[in] org_folder_name Original folder name
+ *
+ * @return ellipsised folder name
+ *
+ * @remarks Email address alias must be released after usage
+ */
+char *account_get_ellipsised_folder_name(EmailAccountView *view, char *org_folder_name);
+
+/**
+ * @brief Convert utf-7 mailbox name text to utf-8 text
+ *
+ * @param[in] mailbox_name utf-7 mailbox name
+ *
+ * @return utf-8 encoded mailbox name on success, otherwise NULL
+ *
+ * @remark When not used anymore, the returned value must be freed.
+ */
char *account_util_convert_mutf7_to_utf8(char *mailbox_name);
+
+/**
+ * @brief Get account color label by account id from local cache
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ *
+ * @return account color in compact mode as unsigned int value
+ *
+ * @see account_color_list_add, account_color_list_free, account_color_list_update
+ *
+ * @note to get R, G, B, A components need to use mask and offsets
+ */
int account_color_list_get_account_color(EmailAccountView *view, int account_id);
+
+/**
+ * @brief Release list of account colors
+ *
+ * @param[in] view Email account view data
+ *
+ * @see account_color_list_add, account_color_list_update, account_color_list_get_account_color
+ */
void account_color_list_free(EmailAccountView *view);
+
+/**
+ * @brief Add new account color to account color list
+ *
+ * This function used to cache account colors which belong to
+ * accounts. All account colors are cached in account_color_list.
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ * @param[in] account_color Account color
+ *
+ * @see account_color_list_update, account_color_list_free, account_color_list_get_account_color
+ */
void account_color_list_add(EmailAccountView *view, int account_id, int account_color);
+
+/**
+ * @brief Update cached account color value for certain account id
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ * @param[in] update_color New account color
+ *
+ * @see account_color_list_add, account_color_list_free, account_color_list_get_account_color
+ */
void account_color_list_update(EmailAccountView *view, int account_id, int update_color);
+/**
+ * @brief Get name of folder icon by mailbox type
+ *
+ * @param[in] mailbox_type Mailbox type
+ *
+ * @return Icon name which is located in image resources on success, otherwise NULL
+ */
char *account_get_folder_icon_name_by_mailbox_type(int mailbox_type);
+
+/**
+ * @brief Create folder icon widget
+ *
+ * @param[in] parent Icon widget parent
+ * @param[in] folder_image_name Name of folder icon image to be used for icon create
+ *
+ * @return Icon widget object on success, otherwise NULL
+ */
Evas_Object *account_create_folder_icon(Evas_Object *parent, const char *folder_image_name);
+/**
+ * @brief elm util function to get theme path
+ */
const char *email_get_account_theme_path();
#endif /* __EMAIL_ACCOUNT_UTIL_H__ */
#include "email-locale.h"
#include "email-module-dev.h"
-#define ACCOUNT_PACKAGE "email-account"
-
#define MAX_FOLDER_NAME_LEN 1024
-#define MAX_FOLDER_NAME_BUF_LEN 4096
-#define NUM_STR_LEN 20
-
#define EMAIL_HANDLE_INVALID 0
-#define SEARCH_TAG_LEN 50
+/**
+ * @brief Accounts module view types
+ */
typedef enum {
ACC_FOLDER_VIEW_MODE_UNKNOWN = -1,
ACC_FOLDER_COMBINED_VIEW_MODE,
ACC_FOLDER_VIEW_MODE_MAX,
} account_folder_view_mode;
+/**
+ * @brief Folder types which are disaplyed in Accounts module
+ */
typedef enum
{
ACC_MAILBOX_TYPE_ALL_ACCOUNT = -2,
ACC_MAILBOX_TYPE_SINGLE_ACCOUNT = -1,
- ACC_MAILBOX_TYPE_INBOX = 0, /**< Specified inbox type*/
- ACC_MAILBOX_TYPE_PRIORITY_INBOX, /**< Specified trash type*/
- ACC_MAILBOX_TYPE_FLAGGED, /**< Specified flagged mailbox type on gmail */
- ACC_MAILBOX_TYPE_DRAFT, /**< Specified draft box type*/
- ACC_MAILBOX_TYPE_OUTBOX, /**< Specified outbox type*/
- ACC_MAILBOX_TYPE_SENTBOX, /**< Specified sent box type*/
- ACC_MAILBOX_TYPE_SPAMBOX, /**< Specified spam box type*/
- ACC_MAILBOX_TYPE_TRASH, /**< Specified trash type*/
- ACC_MAILBOX_TYPE_MAX, /**< Specified all emails type of gmail*/
-}account_mailbox_type_e;
-
-typedef enum
-{
- ACC_FOLDER_VIEW_INBOX = 0, /**< Specified inbox type*/
- ACC_FOLDER_VIEW_DRAFT, /**< Specified draft box type*/
- ACC_FOLDER_VIEW_OUTBOX, /**< Specified outbox type*/
- ACC_FOLDER_VIEW_SENTBOX, /**< Specified sent box type*/
- ACC_FOLDER_VIEW_SPAMBOX, /**< Specified spam box type*/
- ACC_FOLDER_VIEW_TRASH, /**< Specified trash type*/
- ACC_FOLDER_VIEW_MAX,
-}account_folder_view_type; //folder position is decided by this value.
-
-typedef enum
-{
- ACC_FOLDER_ACTION_NONE = 0,
- ACC_FOLDER_ACTION_CREATE,
- ACC_FOLDER_ACTION_DELETE,
- ACC_FOLDER_ACTION_RENAME,
-}folder_action_type;
-
+ /**< Specified inbox type*/
+ ACC_MAILBOX_TYPE_INBOX = 0,
+ /**< Specified priority sender mailbox type*/
+ ACC_MAILBOX_TYPE_PRIORITY_INBOX,
+ /**< Specified flagged mailbox type on gmail */
+ ACC_MAILBOX_TYPE_FLAGGED,
+ /**< Specified draft box type*/
+ ACC_MAILBOX_TYPE_DRAFT,
+ /**< Specified outbox type*/
+ ACC_MAILBOX_TYPE_OUTBOX,
+ /**< Specified sent box type*/
+ ACC_MAILBOX_TYPE_SENTBOX,
+ /**< Specified spam box type*/
+ ACC_MAILBOX_TYPE_SPAMBOX,
+ /**< Specified trash type*/
+ ACC_MAILBOX_TYPE_TRASH,
+ /**< Specified all emails type of gmail account*/
+ ACC_MAILBOX_TYPE_MAX,
+} account_mailbox_type_e;
+
+/**
+ * @brief Folder view types according to folder operations
+ */
typedef enum
{
ACC_FOLDER_INVALID = -1,
ACC_FOLDER_CREATE,
ACC_FOLDER_DELETE,
ACC_FOLDER_RENAME,
-}folder_view_type_e;
+} folder_view_type_e;
+/**
+ * @brief Special additional mailbox type to display
+ * incoming mail from priority senders only
+ */
typedef enum
{
EMAIL_MAILBOX_TYPE_PRIORITY_SENDERS = EMAIL_MAILBOX_TYPE_USER_DEFINED + 1
-}email_mailbox_type_e_ext;
+} email_mailbox_type_e_ext;
typedef struct _view_data EmailAccountView;
+/**
+ * @brief Email account list item data
+ */
typedef struct _Item_Data Item_Data;
struct _Item_Data {
EmailAccountView *view;
- Elm_Object_Item *it; // Genlist Item pointer
- int i_boxtype; //for all account view
+
+ /*Genlist Item pointer*/
+ Elm_Object_Item *it;
+
+ /*Used for all account view*/
+ int i_boxtype;
char *mailbox_name;
int mailbox_type;
char *account_name;
};
+/**
+ * @brief Account move mails list data
+ */
typedef struct _email_move_list {
int move_view_mode;
int mailbox_cnt;
email_mailbox_t *mailbox_list;
} email_move_list;
+/**
+ * @brief Email account view data
+ */
struct _view_data
{
email_view_t base;
char *original_folder_name;
char *user_email_address;
- gchar *moved_mailbox_name; //for notification popup
+ /* Name of destination mailbox when move operation permitted */
+ gchar *moved_mailbox_name;
int account_count;
int account_id;
int folder_id;
int emf_handle;
int target_mailbox_id;
int need_refresh;
- bool selection_disabled;
/*move mail mode*/
GList *selected_mail_list_to_move; /* revised, used to move the mails selected in previous view */
guint signal_handler_storage;
};
+/**
+ * @brief Email account module data
+ */
typedef struct {
email_module_t base;
EmailAccountView view;
} EmailAccountModule;
+/**
+ * @brief Macros for obtaining account type by account id
+ *
+ * @param[in] account_id Account ID
+ *
+ * @return Macros calculates account server type
+ */
#define GET_ACCOUNT_SERVER_TYPE(account_id) \
({\
email_account_t *email_account = NULL;\
server_type;\
})
-
+/**
+ * @brief Create main genlist view with folder items
+ *
+ * @param[in] view Email account view data
+ *
+ * @return count of genlist items which were appended into list
+ */
int account_create_list(EmailAccountView *view);
-Evas_Object *account_add_empty_list(EmailAccountView *view);
+
+/**
+ * @brief Destroy account view
+ *
+ * @param[in] view Email account view data
+ */
void account_destroy_view(EmailAccountView *view);
+
+/**
+ * @brief Handler for email service GDbus events
+ *
+ * @param[in] sender_name The unique bus name of the sender of the signal.
+ * @param[in] object_path The object path that the signal was emitted on.
+ * @param[in] interface_name The name of the interface.
+ * @param[in] signal_name The name of the signal.
+ * @param[in] parameters A #GVariant tuple with parameters for the signal.
+ * @param[in] user_data User data passed when subscribing to the signal.
+ */
void account_gdbus_event_account_receive(GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
GVariant *parameters,
gpointer data);
+/**
+ * @brief Change view to folder view.
+ *
+ * Current function uses create list of all folders (including empty folders)
+ * for certain account or Combined account
+ *
+ * @param[in] view Email account view data
+ */
void account_show_all_folder(EmailAccountView *view);
#endif /* __EMAIL_ACCOUNT_H__ */
-
-
debug_leave();
}
+/**
+ * @brief Create list of folders for choose destination folder
+ * when mail move operation performed
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_folder_list_for_mail_move(EmailAccountView *view)
{
debug_enter();
return NULL;
}
+/**
+ * @brief Initialize genlist item class for folder move list
+ *
+ * Used in folder move list to display list of all mailboxes when mail
+ * move operation is performed. List item in this list has
+ * folder icon and folder name only.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_mail_move(EmailAccountView *view)
{
debug_enter();
static char *_create_gl_item_text(Item_Data *item_data, const char *text);
static int _convert_acc_boxtype_to_email_boxtype(int boxtype);
+/**
+ * @brief Initialize genlist item class for combined folder list
+ *
+ * Used to display folders for combined account list
+ * List item in combined folder list has only folder icon and folder name.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_combined_folder_list(EmailAccountView *view)
{
debug_enter();
view->itc_combined = itc_combined;
}
+/**
+ * @brief Initialize genlist item class for single folder list
+ *
+ * Used in single folder list to display list of all mailboxes in single account.
+ * List item in single folder list has folder icon and folder name only.
+ *
+ * param[in] view @param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_single_folder_list(EmailAccountView *view)
{
debug_enter();
}
+/*
+ * @brief Create list of folders in combined account mode
+ *
+ * This list contains all possible combined folders. It is created for example when user select
+ * 'Show all folders' for combined accounts section
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_combined_folder_list(EmailAccountView *view)
{
debug_enter();
}
}
+/*
+ * @brief Create list of folders for single account
+ *
+ * This list contains all folders for certain account.
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_single_account_folder_list(EmailAccountView *view)
{
debug_enter();
return inserted_count;
}
-void account_create_folder_create_view(void *data)
+void account_change_view_to_folder_create_mode(EmailAccountView *view)
{
debug_enter();
- RETURN_IF_FAIL(data != NULL);
-
- EmailAccountView *view = (EmailAccountView *)data;
+ RETURN_IF_FAIL(view != NULL);
if (view->folder_mode == ACC_FOLDER_NONE) {
view->folder_mode = ACC_FOLDER_CREATE;
- account_update_folder_item_dim_state(data);
+ account_update_folder_item_dim_state(view);
} else if (view->folder_mode == ACC_FOLDER_CREATE) {
view->folder_mode = ACC_FOLDER_NONE;
- account_update_folder_item_dim_state(data);
- account_update_view_title(data);
+ account_update_folder_item_dim_state(view);
+ account_update_view_title(view);
}
debug_leave();
}
-void account_delete_folder_view(void *data)
+/*
+ * @brief Change list view to delete folder mode
+ *
+ * In this mode folder items which can not be deleted must be dimmed
+ *
+ * param[in] view @param[in] view Email account view data
+ */
+void account_change_view_to_folder_delete_mode(EmailAccountView *view)
{
debug_enter();
- RETURN_IF_FAIL(data != NULL);
-
- EmailAccountView *view = (EmailAccountView *)data;
+ RETURN_IF_FAIL(view != NULL);
if (view->folder_mode == ACC_FOLDER_NONE) {
view->folder_mode = ACC_FOLDER_DELETE;
debug_leave();
}
-void account_rename_folder_view(void *data)
+/*
+ * @brief Change list view to rename folder mode
+ *
+ * In this mode folder items which can not be renamed must be dimmed
+ *
+ * param[in] view @param[in] view Email account view data
+ */
+void account_change_view_to_folder_rename_mode(EmailAccountView *view)
{
debug_enter();
- RETURN_IF_FAIL(data != NULL);
-
- EmailAccountView *view = (EmailAccountView *)data;
+ RETURN_IF_FAIL(view != NULL);
if (view->folder_mode == ACC_FOLDER_NONE) {
view->folder_mode = ACC_FOLDER_RENAME;
}
email_string_t EMAIL_ACCOUNT_HEADER_RENAME_FOLDER = { PACKAGE, "IDS_EMAIL_OPT_RENAME_FOLDER"};
- account_create_entry_popup(view, EMAIL_ACCOUNT_HEADER_RENAME_FOLDER, prev_folder_name, NULL,
+ account_create_entry_popup(view, EMAIL_ACCOUNT_HEADER_RENAME_FOLDER, prev_folder_name,
_rename_folder_cancel_cb, _rename_folder_ok_cb,
_rename_folder_cancel_cb, "IDS_EMAIL_BUTTON_CANCEL",
_rename_folder_ok_cb, "IDS_EMAIL_BUTTON_RENAME_ABB");
view->it = NULL;
view->editmode = false;
- account_rename_folder_view(view);
+ account_change_view_to_folder_rename_mode(view);
}
static void _rename_folder_ok_cb(void *data, Evas_Object *obj, void *event_info)
view->target_mailbox_id = -1;
view->editmode = false;
- account_create_folder_create_view(view);
+ account_change_view_to_folder_create_mode(view);
}
static void _back_button_cb(void *data, Evas_Object *obj, void *event_info)
switch (view->folder_mode) {
case ACC_FOLDER_CREATE:
- account_create_folder_create_view(view);
+ account_change_view_to_folder_create_mode(view);
break;
case ACC_FOLDER_DELETE:
- account_delete_folder_view(view);
+ account_change_view_to_folder_delete_mode(view);
view->folder_mode = ACC_FOLDER_NONE;
break;
case ACC_FOLDER_RENAME:
- account_rename_folder_view(view);
+ account_change_view_to_folder_rename_mode(view);
view->folder_mode = ACC_FOLDER_NONE;
break;
default:
evas_object_show(popup);
}
-void account_folder_newfolder(void *data, Evas_Object *obj, void *event_info)
+/*
+ * @brief Create popup for folder create operation to input new folder name
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
+void account_create_new_folder_popup(EmailAccountView *view)
{
debug_enter();
- RETURN_IF_FAIL(data != NULL);
-
- EmailAccountView *view = (EmailAccountView *)data;
+ RETURN_IF_FAIL(view != NULL);
email_string_t EMAIL_ACCOUNT_HEADER_CREATE_FOLDER = { PACKAGE, "IDS_EMAIL_OPT_CREATE_FOLDER_ABB2"};
- account_create_entry_popup(view, EMAIL_ACCOUNT_HEADER_CREATE_FOLDER, NULL, NULL,
+ account_create_entry_popup(view, EMAIL_ACCOUNT_HEADER_CREATE_FOLDER, NULL,
_create_folder_popup_cancel_cb, _create_folder_ok_cb,
_create_folder_popup_cancel_cb, "IDS_EMAIL_BUTTON_CANCEL",
_create_folder_ok_cb, "IDS_EMAIL_BUTTON_CREATE_ABB2");
static Evas_Object *_create_account_subitem_color_bar(Evas_Object *parent, unsigned int color);
static Evas_Object *_create_account_subitem_folder_icon(Evas_Object *parent, account_list_item_type item_type);
+/**
+ * @brief Create list of folders for combined account
+ *
+ * This list contains only important folders for combined account and all other accounts
+ * To go to folder list of some account or cmobined account show all folders item may be clicked
+ *
+ * param[in] view @param[in] view Email account view data
+ *
+ * @return count of list items in created list
+ */
int account_create_account_list_view(EmailAccountView *view)
{
debug_enter();
email_engine_free_account_list(&email_account, 1);
}
+/**
+ * @brief Initialize genlist item class for account view list
+ *
+ * Used in account view list to display items in combined accounts list
+ * List items in account view list has folder icon folder name
+ * and account color label.
+ *
+ * param[in] view Email account view data
+ */
void account_init_genlist_item_class_for_account_view_list(EmailAccountView *view)
{
debug_enter();
static void _entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info);
static void _entry_changed_cb(void *data, Evas_Object *obj, void *event_info);
-static void _entry_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void _register_entry_popup_rot_callback(Evas_Object *popup, EmailAccountView *view);
static void _unregister_entry_popup_rot_callback(Evas_Object *popup, EmailAccountView *view);
static void _entry_popup_del_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static Eina_Bool _entry_popup_idler_cb(void *data);
+/**
+ * @brief elm util function to get theme path
+ */
EMAIL_DEFINE_GET_EDJ_PATH(email_get_account_theme_path, "/email-account.edj")
+/**
+ * @brief Get ellipsised folder name text
+ *
+ * @param[in] view Email account view data
+ * @param[in] org_folder_name Original folder name
+ *
+ * @return ellipsised folder name
+ *
+ * @remarks Email address alias must be released after usage
+ */
char *account_get_ellipsised_folder_name(EmailAccountView *view, char *org_filename)
{
debug_enter();
return filename;
}
-/* from email-service char *emcore_convert_mutf7_to_utf8(char *mailbox_name) */
+/**
+ * @brief Convert utf-7 mailbox name text to utf-8 text
+ *
+ * @param[in] mailbox_name utf-7 mailbox name
+ *
+ * @return utf-8 encoded mailbox name on success, otherwise NULL
+ *
+ * @remark When not used anymore, the returned value must be freed.
+ */
char *account_util_convert_mutf7_to_utf8(char *mailbox_name)
{
char *result_mailbox_name = NULL;
return result_mailbox_name;
}
+/**
+ * @brief Convert mailbox data into mailbox alias name
+ *
+ * @param[in] mlist Mailbox data
+ *
+ * @return Folder alias name on success, otherwise NULL
+ *
+ * @remarks Folder alias must be released after usage
+ */
char *account_convert_folder_alias_by_mailbox(email_mailbox_t *mlist)
{
if (!mlist) {
return NULL;
}
+/**
+ * @brief Convert mailbox type into mailbox alias name
+ *
+ * @param[in] mailbox_type Mailbox type
+ *
+ * @return Folder alias name on success, otherwise NULL
+ *
+ * @remarks Folder alias must be released after usage
+ */
char *account_convert_folder_alias_by_mailbox_type(email_mailbox_type_e mailbox_type)
{
char *mailbox_alias = NULL;
return NULL;
}
+/**
+ * @brief Get name of folder icon by mailbox type
+ *
+ * @param[in] mailbox_type Mailbox type
+ *
+ * @return Icon name which is located in image resources on success, otherwise NULL
+ */
char *account_get_folder_icon_name_by_mailbox_type(int mailbox_type)
{
char *folder_image_name = NULL;
return folder_image_name;
}
+/**
+ * @brief Create folder icon widget
+ *
+ * @param[in] parent Icon widget parent
+ * @param[in] folder_image_name Name of folder icon image to be used for icon create
+ *
+ * @return Icon widget object on success, otherwise NULL
+ */
Evas_Object *account_create_folder_icon(Evas_Object *parent, const char *folder_image_name)
{
if (!parent || !folder_image_name) {
return folder_icon;
}
+/**
+ * @brief Update folder list item dim state when folder opetions rename/delete are performed
+ * If it is impossible to rename/delete folder it mudt be dimmed
+ *
+ * @param[in] view Email account view data
+ */
void account_update_folder_item_dim_state(EmailAccountView *view)
{
debug_enter();
return;
}
+/**
+ * @brief Update view title text
+ *
+ * @param[in] view Email account view data
+ */
void account_update_view_title(EmailAccountView *view)
{
if (view == NULL) {
}
}
+/**
+ * @brief Get user email address y account id
+ *
+ * @param[in] account_id Account id
+ *
+ * @return Email address on success, otherwise NULL
+ *
+ * @remarks Email address alias must be released after usage
+ */
char *account_get_user_email_address(int account_id)
{
email_account_t *email_account = NULL;
return ECORE_CALLBACK_DONE;
}
+/**
+ * @brief Create popup with entry for text input
+ *
+ * Such popup is used for rename/create folder operations in account module
+ * It contains with title, editfield and two buttons in the bottom
+ *
+ * @param[in] view Email account view data
+ * @param[in] t_title Popup title
+ * @param[in] entry_text Text to be presetted as entry inpt text
+ * @param[in] _back_response_cb Click callback for hardware back button press
+ * @param[in] _done_key_cb Click callback for done SIP button
+ * @param[in] btn1_response_cb Click callback for left popup button
+ * @param[in] btn1_text Text for left popup button
+ * @param[in] btn2_response_cb Click callback for right popup button
+ * @param[in] btn2_text Text for right popup button
+ *
+ * @return Popup widget on success, otherwise NULL
+ */
Evas_Object *account_create_entry_popup(EmailAccountView *view, email_string_t t_title,
- const char *entry_text, const char *entry_selection_text,
- Evas_Smart_Cb _back_response_cb, Evas_Smart_Cb _done_key_cb,
+ const char *entry_text, Evas_Smart_Cb _back_response_cb, Evas_Smart_Cb _done_key_cb,
Evas_Smart_Cb btn1_response_cb, const char *btn1_text, Evas_Smart_Cb btn2_response_cb, const char *btn2_text)
{
debug_enter();
view->original_folder_name = g_strdup(entry_text);
}
- if (entry_selection_text) {
- elm_entry_context_menu_disabled_set(editfield.entry, EINA_TRUE);
- elm_entry_entry_set(editfield.entry, entry_selection_text);
- elm_entry_select_all(editfield.entry);
- evas_object_smart_callback_add(editfield.entry, "clicked", _entry_clicked_cb, view);
- view->selection_disabled = true;
- } else {
- view->selection_disabled = false;
- }
-
if (elm_entry_is_empty(editfield.entry)) {
disable_btn = EINA_TRUE;
} else {
debug_leave();
}
-static void _entry_clicked_cb(void *data, Evas_Object *obj, void *event_info)
-{
- debug_enter();
- if (!data || !obj) {
- debug_log("data is NULL");
- return;
- }
- EmailAccountView *view = (EmailAccountView *)data;
-
- if (view->selection_disabled) {
- elm_entry_context_menu_disabled_set(obj, EINA_FALSE);
- elm_object_signal_emit(obj, "app,selection,handler,enable", "app");
- view->selection_disabled = false;
- evas_object_smart_callback_del(obj, "clicked", _entry_clicked_cb);
- }
-}
-
static void _entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_enter();
EmailAccountView *view = (EmailAccountView *)data;
Eina_Bool disable_btn = EINA_FALSE;
- if (view->selection_disabled) {
- elm_entry_context_menu_disabled_set(obj, EINA_FALSE);
- elm_object_signal_emit(obj, "app,selection,handler,enable", "app");
- view->selection_disabled = false;
- }
-
if (elm_entry_is_empty(obj)) {
disable_btn = EINA_TRUE;
} else {
elm_entry_input_panel_return_key_disabled_set(obj, disable_btn);
}
+/**
+ * @brief Stop currently running email service emf job by handle
+ *
+ * @param[in] view Email account view data
+ * @param[in] handle Job handle
+ */
void account_stop_emf_job(EmailAccountView *view, int handle)
{
debug_enter();
view->emf_handle = EMAIL_HANDLE_INVALID;
}
+/**
+ * @brief Cancel all synchronization processes email service
+ *
+ * @param[in] view Email account view data
+ */
void account_sync_cancel_all(EmailAccountView *view)
{
debug_enter();
_unregister_entry_popup_rot_callback(obj, view);
}
+/**
+ * @brief Get account color label by account id from local cache
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ *
+ * @return account color in compact mode as unsigned int value
+ *
+ * @see account_color_list_add, account_color_list_free, account_color_list_update
+ *
+ * @note to get R, G, B, A components need to use mask and offsets
+ */
int account_color_list_get_account_color(EmailAccountView *view, int account_id)
{
if (account_id <= 0 || !view) {
return 0;
}
+/**
+ * @brief Release list of account colors
+ *
+ * @param[in] view Email account view data
+ *
+ * @see account_color_list_add, account_color_list_update, account_color_list_get_account_color
+ */
void account_color_list_free(EmailAccountView *view)
{
retm_if(view == NULL, "EmailAccountView[NULL]");
}
}
+/**
+ * @brief Add new account color to account color list
+ *
+ * This function used to cache account colors which belong to
+ * accounts. All account colors are cached in account_color_list.
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ * @param[in] account_color Account color
+ *
+ * @see account_color_list_update, account_color_list_free, account_color_list_get_account_color
+ */
void account_color_list_add(EmailAccountView *view, int account_id, int account_color)
{
debug_enter();
view->account_color_list = g_list_append(view->account_color_list, account_color_data);
}
+/**
+ * @brief Update cached account color value for certain account id
+ *
+ * @param[in] view Email account view data
+ * @param[in] account_id Account id
+ * @param[in] update_color New account color
+ *
+ * @see account_color_list_add, account_color_list_free, account_color_list_get_account_color
+ */
void account_color_list_update(EmailAccountView *view, int account_id, int update_color)
{
debug_enter();
break;
case ACC_FOLDER_CREATE:
- account_create_folder_create_view(view);
+ account_change_view_to_folder_create_mode(view);
break;
case ACC_FOLDER_DELETE:
- account_delete_folder_view(view);
+ account_change_view_to_folder_delete_mode(view);
break;
case ACC_FOLDER_RENAME:
- account_rename_folder_view(view);
+ account_change_view_to_folder_rename_mode(view);
break;
default:
DELETE_EVAS_OBJECT(view->more_ctxpopup);
view->editmode = true;
- account_create_folder_create_view(view);
- account_folder_newfolder(view, obj, event_info);
+ account_change_view_to_folder_create_mode(view);
+ account_create_new_folder_popup(view);
debug_leave();
}
}
}
+/**
+ * @brief Create main genlist view with folder items
+ *
+ * @param[in] view Email account view data
+ *
+ * @return count of genlist items which were appended into list
+ */
int account_create_list(EmailAccountView *view)
{
debug_enter();
return inserted_cnt;
}
-Evas_Object *account_add_empty_list(EmailAccountView *view)
-{
- debug_enter();
- RETURN_VAL_IF_FAIL(view != NULL, NULL);
-
- Evas_Object *list = elm_list_add(view->base.module->win);
- elm_list_mode_set(list, ELM_LIST_COMPRESS);
- Elm_Object_Item *elm_item;
-
- elm_item = elm_list_item_append(list, "IDS_EMAIL_BODY_NO_ITEMS_TO_DISPLAY", NULL, NULL, NULL, view);
- elm_object_item_domain_text_translatable_set(elm_item, PACKAGE, EINA_TRUE);
- elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_NONE);
- elm_list_go(list);
-
- return list;
-}
-
static void _folder_delete_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_enter();
view->editmode = true;
- account_delete_folder_view(view);
+ account_change_view_to_folder_delete_mode(view);
debug_leave();
}
view->editmode = true;
- account_rename_folder_view(view);
+ account_change_view_to_folder_rename_mode(view);
debug_leave();
}
}
}
+/**
+ * @brief Destroy account view
+ *
+ * @param[in] view Email account view data
+ */
void account_destroy_view(EmailAccountView *view)
{
debug_enter();
}
}
+/**
+ * @brief Change view to folder view.
+ *
+ * Current function uses create list of all folders (including empty folders)
+ * for certain account or Combined account
+ *
+ * @param[in] view Email account view data
+ */
void account_show_all_folder(EmailAccountView *view)
{
debug_enter();
#ifndef __DEF_EMAIL_MAILBOX_UTIL_H_
#define __DEF_EMAIL_MAILBOX_UTIL_H_
-
-#define R_MASKING(val) (((val) & 0xff000000) >> 24)
-#define G_MASKING(val) (((val) & 0x00ff0000) >> 16)
-#define B_MASKING(val) (((val) & 0x0000ff00) >> 8)
-#define A_MASKING(val) (((val) & 0x000000ff))
-
/* int account_id, email_folder_type_e folder_type */
#define GET_MAILBOX_ID(account_id, folder_type) \
({\
#define SYNC_FAILED_TEXT_STYLE "<color=#e12222>%s</color>"
#define WIFI_AUTODOWNLOAD_TEXT_STYLE "<font_size=%d><color=#000000>%s</color></font_size>"
-#define R_MASKING(val) (((val) & 0xff000000) >> 24)
-#define G_MASKING(val) (((val) & 0x00ff0000) >> 16)
-#define B_MASKING(val) (((val) & 0x0000ff00) >> 8)
-#define A_MASKING(val) (((val) & 0x000000ff))
-
#define EMAIL_OP_HANDLE_INITIALIZER (0xcafebabe)
#ifndef APP_CONTROL_OPERATION_SETTING_WIFI