[Implementation] Interprete <br> symbols as space symbol in mailbox genlist style
Change-Id: I9d13c99cef813b32c4332be094be36eb9168afe3
Signed-off-by: Andriy Kolesnichenko <a.kolesniche@samsung.com>
/* Array length definition */
-#define TAG_LEN 50 /*tag for hightlight keyword <color=#ff0000>key</>*/
+#define TAG_LEN 50 /*tag for hightlight keyword <color=#ff0000>key</>*/
#define FROM_LEN 100
-#define SUBJECT_LEN 100
#define ADDR_LEN 320
#define RECIPIENT_LEN 100
typedef struct {
- gint uid;
- gint account_id;
- gchar from[FROM_LEN + TAG_LEN + 1];
- gchar sender[ADDR_LEN + 1];
- guint from_count; // will be removed
- char recipient[RECIPIENT_LEN + 1];
- gchar subject[SUBJECT_LEN + TAG_LEN + 1];
- gint mailbox_id;
- time_t datetime;
- gint priority;
- gint flags; /* See email_mail_status_type_e in email-types.h. */
- gboolean seen : 1;
- gboolean attachments : 1;
- gboolean lock : 1;
- gboolean body_download : 1;
- gboolean sending : 1;
- gboolean checked : 1;
- gboolean reserved_1 : 1;
- gboolean reserved_2 : 1;
- gint thread_id;
- gint thread_count;
- gint save_status;
-} email_mailbox_info_t;
-
-typedef struct {
gchar *name;
gchar *alias;
gchar *account_name;
} while (0)
/*utf8 util*/
-#define UTF8_VALIDATE(from, len) \
- ({\
- char *end = NULL;\
- if (STR_VALID(from))\
- if (!g_utf8_validate(from, len, (const gchar **)&end) && end)\
- *end = '\0';\
- NULL;\
- })
+#define UTF8_VALIDATE(from) \
+ do { \
+ gchar *end = NULL; \
+ g_utf8_validate(from, -1, (const gchar **)&end); \
+ if (end) {\
+ *end = '\0';\
+ } \
+ } while (0)
#define EMAIL_GENLIST_ITC_FREE(x) \
do { \
#define MAILBOX_TEXT_STYLE(style_name, font_size, font_color, font_match_color) \
style { name: style_name; \
base: "font=Tizen:style=Regular font_size="font_size" color="font_color" text_class=list_item ellipsis=1.0"; \
- tag: "br" "\n"; \
- tag: "tab" "\t"; \
+ tag: "br" " "; \
+ tag: "tab" " "; \
tag: "match" "+ color="font_match_color""; \
}
#define MAIL_ID_SIZE 30
#define MAIL_ID_COUNT 1000
-#define EMAIL_MAILBOX_PREVIEW_TEXT_DEFAULT_CHAR_COUNT 75
-#define EMAIL_MAILBOX_TITLE_DEFAULT_CHAR_COUNT 55
-
+#define EMAIL_MAILBOX_TITLE_DEFAULT_CHAR_COUNT 150
#define EMAIL_MAILBOX_CHECK_CACHE_SIZE 42
typedef enum {
retvm_if(!ld, NULL, "memory allocarion failed.");
gchar buf[MAX_STR_LEN] = { 0, };
- int preview_len = EMAIL_MAILBOX_PREVIEW_TEXT_DEFAULT_CHAR_COUNT;
- debug_log("account_id(%d), mail_id(%d), preview_len(%d)", mail_info->account_id, mail_info->mail_id, preview_len);
+ debug_log("account_id(%d), mail_id(%d)", mail_info->account_id, mail_info->mail_id);
ld->base.item_type = MAILBOX_LIST_ITEM_MAIL_BRIEF;
ld->base.item = NULL;
/* subject */
if (STR_VALID(mail_info->subject)) {
- UTF8_VALIDATE(mail_info->subject, SUBJECT_LEN);
+ UTF8_VALIDATE(mail_info->subject);
memset(buf, 0, sizeof(buf));
g_utf8_strncpy(buf, mail_info->subject, EMAIL_MAILBOX_TITLE_DEFAULT_CHAR_COUNT);
char *_subject = elm_entry_utf8_to_markup(buf);
STRNDUP(mail_info->email_address_sender, ADDR_LEN - 1) :
STRNDUP(email_get_email_string("IDS_EMAIL_MBODY_NO_EMAIL_ADDRESS_OR_NAME"), ADDR_LEN - 1);
- UTF8_VALIDATE(mail_info->full_address_from, FROM_LEN - 1);
+ UTF8_VALIDATE(mail_info->full_address_from);
char *alias = GET_ALIAS_FROM_FULL_ADDRESS(mail_info->full_address_from, mail_info->email_address_sender, FROM_LEN - 1);
if (alias) {
char *_alias = elm_entry_utf8_to_markup(alias);
gchar buf[MAX_STR_LEN] = { 0, };
FREE(ld->title);
- UTF8_VALIDATE(mail_info->subject, SUBJECT_LEN);
+ UTF8_VALIDATE(mail_info->subject);
g_utf8_strncpy(buf, mail_info->subject, EMAIL_MAILBOX_TITLE_DEFAULT_CHAR_COUNT);
char *_subject = elm_entry_utf8_to_markup(buf);
int title_len = STR_LEN(_subject);
gchar buf[MAX_STR_LEN] = { 0, };
FREE(ld->title);
- UTF8_VALIDATE(mail_info->subject, SUBJECT_LEN);
+ UTF8_VALIDATE(mail_info->subject);
g_utf8_strncpy(buf, mail_info->subject, EMAIL_MAILBOX_TITLE_DEFAULT_CHAR_COUNT);
char *_subject = elm_entry_utf8_to_markup(buf);
int title_len = STR_LEN(_subject);