part {
name: "img.body";
type: IMAGE;
+ mouse_events: 1;
scale: 1;
description {
state: "default" 0.0;
}
}
}
+ programs {
+ program {
+ name: "img_body_clicked";
+ source: "img.body";
+ signal: "mouse,clicked,1";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"img.body", st, 30, vl)
+
+ if (!strcmp(st, "default"))
+ emit ("attach_clicked", "");
+ }
+ }
+ }
}
}
name: "rect";
type: RECT;
scale: 1;
- mouse_events: 0;
+ mouse_events: 1;
description {
state: "default" 0.0;
min: 0 76;
}
part {
name: "bg_image";
+ type: IMAGE;
scale: 1;
- mouse_events: 0;
-
+ mouse_events: 1;
description {
state: "default" 0.0;
rel1{ to_x: "padding_left"; to_y: "padding_top_1"; relative: 1.0 1.0;}
name: "swl.thumbnail";
type: SWALLOW;
scale: 1;
-
description {
state: "default" 0.0;
min: 48 48;
type: TEXT;
scale: 1;
mouse_events: 0;
-
description {
state: "default" 0.0;
rel1 {
name: "swl.del_button";
type: SWALLOW;
scale: 1;
-
description {
state: "default" 0.0;
min: BODYPAGE_DELBUTTON_SIZE;
max: BODYPAGE_DELBUTTON_SIZE;
fixed: 1 1;
-
rel1 {
to_x: "padding_right";
to_y: "padding_top";
align: 1.0 0.0;
}
}
+ programs {
+ program {
+ name: "sound_clicked";
+ source: "bg_image";
+ signal: "mouse,clicked,1";
+ script {
+ new st[31];
+ new Float:vl;
+ get_state(PART:"bg_image", st, 30, vl)
+
+ if (!strcmp(st, "default"))
+ emit ("sound_clicked", "");
+ }
+ }
+ }
}
}
name: "bg_image";
scale: 1;
mouse_events: 0;
-
description {
state: "default" 0.0;
rel1{ to:"rect.thumbnail";relative: 0.0 0.0; }
name: "swl.thumbnail";
type: SWALLOW;
scale: 1;
-
description {
state: "default" 0.0;
fixed: 0 0;
name: "swl.del_button";
type: SWALLOW;
scale: 1;
-
description {
state: "default" 0.0;
min: BODYPAGE_DELBUTTON_SIZE;
part {
name: "rect_top_bg";
type: RECT;
- scale: 1;
+ scale: 0;
mouse_events: 0;
description {
state: "default" 0.0;
{\r
state: "default" 0.0;\r
color: 0 0 0 0;\r
+ rel1{relative: 0.0 0.0;}\r
+ rel2{relative: 1.0 1.0;}\r
}\r
}\r
part {\r
rel2{to: "rect"; relative: 1.0 0.0;}\r
}\r
}\r
+ part {\r
+ name: "msgtype_text";\r
+ type: TEXT;\r
+ scale: 1;\r
+ description {\r
+ state: "default" 0.0;\r
+ text {\r
+ font: "SLP:style=Medium";\r
+ size: 28;\r
+ min: 0 0;\r
+ max: 1 0;\r
+ align: 0.5 0.5;\r
+ }\r
+ color: 0 0 0 255;\r
+ align: 1.0 0.5;\r
+ fixed: 1 0;\r
+ rel1 { relative: 0.0 0.0;}\r
+ rel2 { relative: 0.0 1.0; to_x: "bubble.swallow.more"; offset: -5 0;}\r
+ }\r
+ }\r
\r
part {\r
name: "bubble.swallow.more";\r
fixed: 0 1;\r
align: 0.0 0.5;\r
rel1 {relative: 0.0 0.45;}\r
- rel2 {relative: 0.38 0.55;}\r
+ rel2 {relative: 0.25 0.55;}\r
image {\r
normal: "00_MessageBubble_date_bg.png";\r
}\r
state: "default" 0.0;\r
fixed: 0 1;\r
align: 1.0 0.5;\r
- rel1 {relative: 0.62 0.45;}\r
+ rel1 {relative: 0.75 0.45;}\r
rel2 {relative: 1.0 0.55;}\r
image {\r
normal: "00_MessageBubble_date_bg.png";\r
+#define MSGC_DIALOGUE_H 70
+#define MSGC_DIALOGUE_ICON_W 64
+#define MSGC_DIALOGUE_PADDING_W 16
+#define MSGC_DIALOGUE_ENTRY_W 20
+#define MSGC_DIALOGUE_TEXT_W 180
+#define MSGC_DIALOGUE_TEXT_COLOR 249 249 249 255
+#define MSGC_DIALOGUE_TEXT_SIZE 44
+
+group
+{
+ name: "composer/dialogue/custom";
+
+ parts
+ {
+ part
+ {
+ name: "rect";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ description
+ {
+ state: "default" 0.0;
+ min: 0 MSGC_DIALOGUE_H;
+ fixed: 1 1;
+ color: 0 0 0 0;
+ }
+ }
+
+ PADDING_RIGHT("padding_right",MSGC_DIALOGUE_PADDING_W);
+
+ part
+ {
+ name: "padding.text.left";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: MSGC_DIALOGUE_PADDING_W 0;
+ fixed: 1 0;
+ rel1{
+ relative: 0.0 0.0;
+ to_x: "elm.text";
+ }
+ rel2{
+ relative: 0.0 1.0;
+ to_x: "elm.text";
+ }
+
+ align: 1.0 0.0;
+ visible: 0;
+ }
+ }
+
+ part
+ {
+ name: "padding.entry.left";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: MSGC_DIALOGUE_PADDING_W 0;
+ fixed: 1 0;
+ rel1{
+ relative: 0.0 0.0;
+ to_x: "dialogue.swl.entry";
+ }
+ rel2{
+ relative: 0.0 1.0;
+ to_x: "dialogue.swl.entry";
+ }
+ align: 1.0 0.0;
+ visible: 0;
+ }
+ }
+
+ part
+ {
+ name: "elm.text";
+ type: TEXT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: MSGC_DIALOGUE_TEXT_W 0;
+ fixed: 1 0;
+ rel1{
+ to_x: "padding_right";
+ relative: 0.0 0.0;
+ }
+ rel2{
+ to_x: "padding_right";
+ relative: 0.0 1.0;
+ }
+ align: 1.0 0.0;
+ color: MSGC_DIALOGUE_TEXT_COLOR;
+ text {
+ font: SLP_FONT_ROMAN;
+ text_class: FONT_TEXT_CLASS_ROMAN;
+ size: MSGC_DIALOGUE_TEXT_SIZE;
+ min: 0 1;
+ align: 0.0 0.5;
+ text: "";
+ }
+ }
+ }
+
+ part
+ {
+ name: "dialogue.swl.entry";
+ type: SWALLOW;
+ scale: 1;
+ description
+ {
+ state: "default" 0.0;
+ min: MSGC_DIALOGUE_ENTRY_W 0;
+ fixed: 1 0;
+ rel1 {
+ to_x: "padding.text.left";
+ relative: 0.0 0.0;
+ }
+ rel2
+ {
+ to_x: "padding.text.left";
+ relative: 0.0 1.0;
+ }
+ align: 1.0 0.5;
+ }
+ }
+ }
+}
+
+#define MSGC_DATEFIELD_TXT_COLOR 173 170 165 255
+#define MSGC_DATEFIELD_TXT_SIZE 24
+#define MSGC_DATEFIELD_TEXT_H 60
+
+group {
+ name: "composer/datefield";
+ parts {
+ PADDING_TOP("padding_top", 16);
+ PADDING_LEFT("padding_left", 16);
+ part {
+ name: "text";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 MSGC_DATEFIELD_TEXT_H;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ rel1 {
+ to_x: "padding_left";
+ to_y: "padding_top";
+ relative: 1 1;
+ }
+ rel2 {
+ relative: 1 0;
+ }
+ color: MSGC_DATEFIELD_TXT_COLOR;
+ text {
+ font: SLP_FONT_ROMAN;
+ text_class: FONT_TEXT_CLASS_LABEL;
+ size: MSGC_DATEFIELD_TXT_SIZE;
+ min: 1 0;
+ align: 0.0 0.0;
+ text: "";
+ }
+ }
+ }
+
+ part {
+ name: "picker";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.0;
+ fixed: 1 1;
+ rel1 { relative: 0 1; to: "text"; }
+ rel2 { relative: 1 1; to: "text"; }
+ }
+ }
+ }
+}
+
#define MSGC_POPUP_INFO_TXT_COLOR_INC "#000000"
#define MSGC_POPUP_INFO_TXT_SIZE 40
#define MSGC_POPUP_ENTRY_FIELD_H 74
+styles {
+ style {
+ name: "popup_desc_style";
+ base: "font=SLP:style=Roman font_size="MSGC_POPUP_INFO_TXT_SIZE" align=center color="MSGC_POPUP_INFO_TXT_COLOR_INC" wrap=mixed text_class=slp_roman";
+ tag: "br" "\n";
+ tag: "ps" "ps";
+ tag: "whitecolor" "+ color=#ffffff";
+ tag: "tab" "\t";
+ }
+}
group {
name: "composer/popup/entryview";
- styles {
- style {
- name: "popup_desc_style";
- base: "font=SLP:style=Roman font_size="MSGC_POPUP_INFO_TXT_SIZE" align=center color="MSGC_POPUP_INFO_TXT_COLOR_INC" wrap=mixed text_class=slp_roman";
- tag: "br" "\n";
- tag: "ps" "ps";
- tag: "whitecolor" "+ color=#ffffff";
- tag: "tab" "\t";
- }
- }
+
parts {
PADDING_TOP("padding_top", 15);
PADDING_LEFT("padding_left", 16);
}
}
+#define MSGC_CHECK_POPUP_H 283
+#define MSGC_CHECK_POPUP_W 624
+group {
+ name: "composer/popup/popup_checkview";
+ parts {
+ part {
+ name: "base";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+
+ PADDING_TOP("padding_top", 25);
+ PADDING_LEFT("padding_left", 16);
+ PADDING_RIGHT("padding_right", 16);
+ PADDING_BOTTOM("padding_bottom", 25);
+
+ part {
+ name: "body_bg";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: MSGC_CHECK_POPUP_W MSGC_CHECK_POPUP_H;
+ max: MSGC_CHECK_POPUP_W MSGC_CHECK_POPUP_H;
+ rel1 { relative: 0.0 0.0; to: "base"; }
+ rel2 { relative: 1.0 1.0; to: "base"; }
+ color: 0 0 0 0;
+ }
+ }
+
+ part {
+ name: "text_msg";
+ type: TEXTBLOCK;
+
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 { relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
+ rel2 { relative: 0.0 (181/MSGC_CHECK_POPUP_H); to_x: "padding_right"; to_y: "body_bg"; }
+ text { style: "popup_desc_style"; }
+ }
+ }
+
+ part {
+ name: "check";
+ type: SWALLOW;
+ scale: 1;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 (206/MSGC_CHECK_POPUP_H); offset: 50 0; to_x: "padding_left"; to_y: "body_bg"; }
+ rel2 { relative: 1.0 0.0; offset: 50 0; to_x: "padding_left"; to_y: "padding_bottom";}
+ color: 0 0 0 0;
+ }
+ }
+
+ part {
+ name: "check_text";
+ type: TEXT;
+ //effect: SHADOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: (130/MSGC_CHECK_POPUP_W) (206/MSGC_CHECK_POPUP_H); to: "body_bg"; }
+ rel2 { relative: 0.0 0.0; to_x: "padding_right"; to_y: "padding_bottom"; }
+ text {
+ font: "SLP:style=Regular";
+ size: 40;
+ align: 0.0 0.5;
+ }
+ color: 0 0 0 255;
+ }
+ }
+ }
+}
+
+group {
+ name: "composer/popup/popup_processingview";
+ parts {
+ part {
+ name: "base";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 166;
+ fixed: 1 0;
+ visible: 0;
+ }
+ }
+ part {
+ name:"pad_t";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 10;
+ fixed: 0 1;
+ visible: 0;
+ rel1.to: "base";
+ rel2 {
+ relative: 1.0 0.0;
+ to: "base";
+ }
+ }
+ }
+ part {
+ name:"elm.swallow.content";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "pad_t";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "pad_t";
+ }
+ }
+ }
+ part {
+ name:"pad_after_content";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 10;
+ fixed: 0 1;
+ visible: 0;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "elm.swallow.content";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "elm.swallow.content";
+ }
+ }
+ }
+ part {
+ name:"elm.swallow.text";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 0.0 1.0;
+ to: "pad_after_content";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "pad_after_content";
+ }
+ }
+ }
+ }
+}
group
{
name: "composer/content/full";
+ images {
+ image: "M01_popup_bubble_bg.png" COMP;
+ }
parts{
part{
name: "rect";
type: RECT;
scale: 1;
mouse_events: 0;
- description
- {
+ description {
state: "default" 0.0;
color: 0 0 0 0;
}
rel2 {to: "rect"; relative:1.0 0.0;}
}
}
-
part{
name: "swl.composer.body";
type: SWALLOW;
scale: 1;
- description
- {
+ description {
state: "default" 0.0;
fixed: 1 1;
min: 0 1;
rel1{to: "rect"; relative: 0.0 1.0;}
rel2{to: "rect"; relative: 1.0 1.0;}
}
- description
- {
+ description {
state: "default" 0.1;
fixed: 1 1;
min: 0 1;
name: "swl.bubble.content";
type: SWALLOW;
scale: 1;
- description
- {
+ description {
state: "default" 0.0;
fixed: 1 1;
min: 0 1;
- rel1
- {
+ rel1 {
to: "swl.sel_all";
relative: 0.0 1.0;
offset: 0 20;
}
- rel2
- {
+ rel2 {
to: "swl.composer.body";
relative: 1.0 0.0;
}
}
}
part {
+ name: "titlemenu_bg";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ fixed: 0 0;
+ align: 0.0 0.0;
+ rel1 {
+ to_x: "titlemenu.padding.left";
+ to_y: "swl.bubble.titlemenu";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to_x: "titlemenu.padding.right";
+ to_y: "swl.bubble.titlemenu";
+ relative: 0.0 1.0;
+ offset: 0 6;
+ }
+ image {
+ normal: "M01_popup_bubble_bg.png";
+ border: 11 11 11 11;
+ border_scale: 1;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+
+ part {
+ name: "titlemenu.padding.left";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ fixed: 1 0;
+ min: 16 0;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 0.0 1.0;}
+ align: 0.0 0.0;
+ visible: 0;
+ }
+ }
+
+ part {
+ name: "titlemenu.padding.right";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ fixed: 1 0;
+ min: 9 0;
+ rel1 { relative: 1.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ align: 1.0 0.0;
+ visible: 0;
+ }
+ }
+
+ part {
+ name: "titlemenu.padding.bottom";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ fixed: 0 1;
+ min: 0 7;
+ max: 0 7;
+ rel1 { to: "swl.bubble.titlemenu"; relative: 0.0 1.0;}
+ rel2 { to: "swl.bubble.titlemenu"; relative: 1.0 1.0;}
+ align: 0.0 0.0;
+ visible: 1;
+ color: 255 0 0 100;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ }
+
+ }
+
+ part {
name: "swl.bubble.titlemenu";
type: SWALLOW;
scale: 1;
- description
- {
+ description {
state: "default" 0.0;
fixed: 0 1;
min: 0 0;
- rel1 { to: "swl.sel_all"; relative: 0.0 1.0; }
- rel2 { to: "swl.sel_all"; relative: 1.0 1.0; }
+ rel1 {to: "swl.sel_all"; relative: 0.0 1.0; offset: 16 0;}
+ rel2 {to: "swl.sel_all"; relative: 1.0 1.0; offset: -16 0;}
align: 0.0 0.0;
}
description {
state: "show" 0.0;
inherit: "default" 0.0;
fixed: 0 0;
- } description {
+ }
+ description {
state: "hide" 0.0;
inherit: "default" 0.0;
min: 0 0;
max: 0 0;
}
}
- part
- {
+ part {
name: "swl.bg_predictsearch";
type: SWALLOW;
scale: 1;
visible: 0;
}
}
-
- part
- {
+ part {
name: "swl.predictsearch";
type: SWALLOW;
scale: 1;
description {
state: "default" 0.0;
fixed: 1 1;
- rel1{to: "swl.composer.body"; relative: 0.0 0.0;}
- rel2{to: "swl.composer.body"; relative: 1.0 1.0;}
+ rel1 {to: "swl.recipient"; relative: 0.0 1.0;}
+ rel2 {to: "swl.composer.body"; relative: 1.0 0.0;}
align: 0.5 0.0;
visible: 1;
}
visible: 0;
}
}
- programs
- {
+ programs {
program {
name: "hide.predictsearch";
signal: "hide.predictsearch";
target: "swl.predictsearch";
target: "swl.bg_predictsearch";
}
-
program {
name: "show.predictsearch";
signal: "show.predictsearch";
source: "";
action: STATE_SET "show" 0.0;
target: "swl.bubble.titlemenu";
+ target: "titlemenu_bg";
transition: LINEAR 0.2;
}
program {
source: "";
action: STATE_SET "hide" 0.0;
target: "swl.bubble.titlemenu";
+ target: "titlemenu_bg";
transition: LINEAR 0.2;
}
}
/**************
* RECIPIENT
*************/
-#define MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H 114
-
-#define MSG_COMPOSER_RECIPIENT_BT_FIELD_MIN_H 114
-
-#define RECIPIENT_FIELD_MIN_H (MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H + MSG_COMPOSER_RECIPIENT_BT_FIELD_MIN_H)
+#define MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H 112
+#define CONTACT_BUTTON_PADDING_TOP 24
+#define CONTACT_BUTTON_PADDING_BOTTOM 24
+#define CONTACT_BUTTON_SIZE 64 64
/*
- composer/recipient/to_field
+ * composer/recipient/to_field
*/
-group
-{
+group {
name: "composer/recipient/to_field";
- parts
- {
- part
- {
+ parts {
+ part {
name: "rect";
type: RECT;
scale: 1;
mouse_events: 1;
- description
- {
+ description {
state: "default" 0.0;
min: 0 MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H;
- fixed: 1 0 ;
+ fixed: 0 1;
color: 0 255 255 0;
}
}
- part
- {
+ part {
name: "bg";
type: RECT;
scale: 1;
mouse_events: 1;
- description
- {
+ description {
state: "default" 0.0;
visible: 1;
rel1{ to: "rect"; relative: 0.0 0.0;}
}
}
- part
- {
- name: "swl.mbe_scroll";
- type: SWALLOW;
+ PADDING_TOP("padding_top", 0);
+ PADDING_LEFT("padding_left", 0);
+ PADDING_RIGHT("padding_right", 16);
+ PADDING_BOTTOM("padding_bottom", 0);
+
+ part {
+ name: "rect.btn.padding_top";
+ type: RECT;
scale: 1;
- description
- {
+ mouse_events: 0;
+
+ description {
state: "default" 0.0;
- rel1 {to: "rect"; relative: 0.0 0.0; }
- rel2 {to: "rect"; relative: 1.0 1.0; }
- align: 0.5 0.0;
+ min: 0 CONTACT_BUTTON_PADDING_TOP;
+ fixed: 0 1;
+ visible: 0;
+ rel1 {
+ to_x: "padding_right";
+ to_y: "padding_top";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to_x: "padding_right";
+ to_y: "padding_top";
+ relative: 0.0 1.0;
+ }
+ align: 0.0 0.0;
+ color: 0 0 0 0;
}
}
-
- part
- {
- name: "underline";
+ part {
+ name: "rect.btn.padding_bottom";
type: RECT;
scale: 1;
- description
- {
+ mouse_events: 0;
+
+ description {
state: "default" 0.0;
- min: 0 3;
- fixed: 1 1;
- rel1 {to: "rect"; relative: 0.0 1.0; }
- rel2 {to: "rect"; relative: 1.0 1.0; }
- align: 0.5 1.0;
- color: 0 0 0 50;
+ min: 0 CONTACT_BUTTON_PADDING_BOTTOM;
+ fixed: 0 1;
+ visible: 0;
+ rel1 {
+ to_x: "padding_right";
+ to_y: "padding_bottom";
+ relative: 0.0 0.0;
}
+ rel2 {
+ to_x: "padding_right";
+ to_y: "padding_bottom";
+ relative: 0.0 0.0;
}
-
-
+ align: 0.0 1.0;
+ color: 0 0 0 0;
}
-
-
- programs
- {
- program
- {
}
- }
-}
-
-/*
-composer/recipient/bt_field
-*/
-group
-{
- name:"composer/recipient/bt_field";
-
- parts
- {
- part
- {
- name: "rect";
+ part {
+ name: "rect.btn";
type: RECT;
scale: 1;
mouse_events: 0;
- description
- {
+
+ description {
state: "default" 0.0;
- visible: 1;
- min: 0 MSG_COMPOSER_RECIPIENT_BT_FIELD_MIN_H;
- max: 9999 MSG_COMPOSER_RECIPIENT_BT_FIELD_MIN_H;
- fixed: 1 0;
+ min: CONTACT_BUTTON_SIZE;
+ max: CONTACT_BUTTON_SIZE;
+ fixed: 1 1;
+ rel1 {
+ to_x: "padding_right";
+ to_y: "rect.btn.padding_bottom";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to_x: "padding_right";
+ to_y: "rect.btn.padding_bottom";
+ relative: 0.0 0.0;
+ }
+ align: 1.0 1.0;
color: 255 255 255 0;
}
-
}
-
- part
- {
- name: "swl.bt_left";
+ part {
+ name: "swl.closed_btn";
type: SWALLOW;
scale: 1;
- description
- {
- state: "default" 0.0;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0; //show contact button
+ min: 1 1;
fixed: 1 1;
visible: 1;
-
- rel1 {to: "rect"; relative: 0.05 0.2;}
- rel2 {to: "rect"; relative: 0.45 0.8;}
+ rel1 { to: rect.btn; relative: 0.0 0.0; }
+ rel2 { to: rect.btn; relative: 1.0 1.0; }
+ align: 0.0 0.0;
+ }
+ description {
+ state: "default" 0.1; //hide contact button
+ inherit: "default" 0.0;
+ visible: 0;
}
-
}
-
- part
- {
- name: "swl.bt_right";
+ part {
+ name: "swl.mbe_scroll";
type: SWALLOW;
scale: 1;
- description
- {
- state: "default" 0.0;
- fixed: 1 1;
- visible: 1;
- rel1{to: "rect"; relative: 0.55 0.2;}
- rel2{to: "rect"; relative: 0.95 0.8;}
-
+ description {
+ state: "default" 0.0; //show contact button
+ min: 0 112;
+ rel1 { to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0; }
+ rel2 { to_x: "swl.closed_btn"; to_y: "padding_bottom"; relative: 0.0 0.0; }
+ align: 0.0 0.0;
+ }
+ description {
+ state: "default" 0.1; //hide contact button
+ min: 0 112;
+ rel1 { to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0; }
+ rel2 { to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0; }
+ align: 0.0 0.0;
}
-
}
- part
- {
+ part {
name: "underline";
type: RECT;
- scale: 1;
- description
- {
+ scale: 0;
+ description {
state: "default" 0.0;
- min: 0 3;
+ min: 0 1;
fixed: 1 1;
rel1 {to: "rect"; relative: 0.0 1.0; }
rel2 {to: "rect"; relative: 1.0 1.0; }
- align: 0.5 1.0;
- color: 0 0 0 50;
+ align: 0.0 1.0;
+ color: 169 169 169 255;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "hide.ct_button";
+ signal: "hide.ct_button";
+ source: "*";
+ action: STATE_SET "default" 0.1;
+ target: "swl.mbe_scroll";
+ target: "swl.closed_btn";
}
+ program {
+ name: "show.ct_button";
+ signal: "show.ct_button";
+ source: "*";
+ action: STATE_SET "default" 0.0;
+ target: "swl.mbe_scroll";
+ target: "swl.closed_btn";
}
}
}
void msg_ui_composer_body_entry_clicked_cb(void *data, Evas_Object *obj, void *event_info);\r
void msg_ui_composer_body_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info);\r
\r
+void msg_ui_composer_body_page_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
+void msg_ui_composer_body_page_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
void msg_ui_composer_body_page_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);\r
+void msg_ui_composer_body_media_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);\r
+void msg_ui_composer_body_media_thumb_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info);\r
+void msg_ui_composer_body_media_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
+void msg_ui_composer_body_media_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
void msg_ui_composer_body_media_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);\r
void msg_ui_composer_body_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info);\r
void msg_ui_composer_body_body_layout_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
+void msg_ui_composer_body_body_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
\r
#endif /* MSG_UI_COMPOSER_BODY_CALLBACK_H_ */\r
int64 wishsize;
bool need_ChangeResolution;
char filepath[DEF_BUF_LEN_L];
+ int rotation;
} COMPOSER_THREAD_DATA_S;
/* function prototypes*/
Evas_Object *msg_ui_composer_body_create(MSG_COMPOSER_VIEW_DATA_S *cd, Evas_Object *parent);
void msg_ui_composer_body_delete(MSG_COMPOSER_VIEW_DATA_S *cd);
+void msg_ui_composer_body_clear(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_body_items_add(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_body_item_add(MSG_COMPOSER_VIEW_DATA_S *cd, const char *item_path);
-
COMPOSER_RETURN_TYPE_E msg_ui_composer_body_set_loaded_media(MSG_COMPOSER_VIEW_DATA_S *pcomp_data, char *filepath, int filetype, int nPage);
COMPOSER_RETURN_TYPE_E msg_ui_composer_body_set_loaded_text(MSG_COMPOSER_VIEW_DATA_S *pcomp_data, const char *body_text, int nPage);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_body_set_loaded_page_duration(MSG_COMPOSER_VIEW_DATA_S *pcomp_data, int duration, int nPage);
COMPOSER_RETURN_TYPE_E msg_ui_composer_read_preview_message(MSG_COMPOSER_VIEW_DATA_S *cd);
Eina_Bool msg_ui_composer_body_is_mms(MSG_COMPOSER_VIEW_DATA_S *cd);
+bool msg_ui_composer_body_has_media(MSG_COMPOSER_VIEW_DATA_S *cd);
void msg_ui_composer_body_focus_set(MSG_COMPOSER_VIEW_DATA_S *cd, int nPage);
COMPOSER_RETURN_TYPE_E msg_ui_composer_get_message_size(MSG_COMPOSER_VIEW_DATA_S *cd, int64 *size);
-void msg_ui_composer_body_clear(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E __msg_ui_composer_body_read_data(MSG_COMPOSER_VIEW_DATA_S *cd);
+void msg_ui_composer_body_update_send_btn_icon(MSG_COMPOSER_VIEW_DATA_S *cd, bool disable);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_check_is_text_top(msg_struct_t region_0, msg_struct_t region_1, bool *is_text_top);
+
#endif/*__MSG_UI_COMPOSER_BODY_H_*/
#include <Ecore.h>
#include <Elementary.h>
#include <ui-gadget-module.h>
-#include <aul.h>
#include <time.h>
#include "msg-ui-util.h"
#include <contacts-svc.h>
#include <contacts-ug.h>
+#define MSG_BUBBLE_EXPORT_DIR "/mnt/ums/message"
+#define MSG_BUBBLE_EXPORT_TEMPDIR "/tmp/message"
+
#define MSG_BUBBLE_SIM_MSG_ICON IMGDIR"/07_message_sim.png"
-#define MSG_BUBBLE_ATTACH_ICON IMGDIR"/Seven_IM_clip_nor.png"
+#define MSG_BUBBLE_ATTACH_ICON IMGDIR"/attach_icon.png"
+#define MSG_BUBBLE_AUDIOFILE_ICON IMGDIR"/M01_icon_voice.png"
+#define MSG_BUBBLE_PROTECTED_ICON IMGDIR"/M01_icon_locked.png"
/* STYLE for genlist and entry */
-#define MSG_BUBBLE_STYLE_SENT "sentmessage"
-#define MSG_BUBBLE_STYLE_RECV "readmessage"
+#define MSG_BUBBLE_STYLE_SENT "sentmessage/custom"
+#define MSG_BUBBLE_STYLE_RECV "readmessage/custom"
#define MSG_BUBBLE_CONTENT_H (653)
#define MSG_BUBBLE_IMG_MAX_W (320)
#define MSG_BUBBLE_IMG_MAX_H (320)
#define MSG_BUBBLE_CONTROLBAR_ITEM_NUM (4)
-
#define MSG_BUBBLE_DELETE_NOTI_TIME (1.5)
+#define MSG_BUBBLE_POPUP_LIST_MAX_MENU 4
+#define MSG_BUBBLE_POPUP_LIST_1LINE_HEIGHT 114
+
+
typedef enum {
BUBBLE_NORMAL_VIEW = 0,
BUBBLE_EDIT_VIEW,
MSG_BOX_PACK_AFTER,
} MsgBoxPackType;
+typedef enum {
+ BUBBLE_BACKUP_TYPE_NONE = 0,
+ BUBBLE_BACKUP_TYPE_SD,
+ BUBBLE_BACKUP_TYPE_EMAIL,
+} BubbleBackupType;
+
+typedef enum {
+ BUBBLE_THUMBNAIL_NONE = 0,
+ BUBBLE_THUMBNAIL_IMAGE,
+ BUBBLE_THUMBNAIL_VIDEO,
+ BUBBLE_THUMBNAIL_AUDIO,
+} BubbleThumbnailType;
+
typedef struct {
msg_message_id_t msgId;
int msgType;
bool bProtected;
int direction;
int attachment_cnt;
+ int thumbType;
char thumbNailPath[DEF_IMG_PATH_LEN + 1];
+ char attachment_filename[DEF_IMG_PATH_LEN + 1];
+ char audio_filename[DEF_IMG_PATH_LEN + 1];
char msgText[DEF_MAX_MSG_TEXT_LEN+1];
Evas_Object *ly;
Evas_Object *entry;
- Evas_Object *resend_button;
- Evas_Object *del_button;
Evas_Object *progressbar;
+ Evas_Object *failed_button;
Evas_Object *chk;
Eina_Bool isCheck;
Evas_Object *select_info;
Evas_Object *selectioninfo_layout;
- Evas_Object *deleted_info;
Eina_List *bubble_list;
Eina_List *realized_list;
char *time_12h_ptn;
char *time_24h_ptn;
- char *date_ptn;
+ char *date_ptn_default;
+ char *date_ptn_year;
msg_time_format time_fmt;
char locale[DEF_BUF_LEN];
int noti_fd;
Ecore_Animator *load_animator;
Ecore_Animator *add_animator;
- Ecore_Idler *scroll_idler;
- Ecore_Idler *add_idler;
Ecore_Idler *resend_idler;
Ecore_Idler *retrieve_idler;
- Ecore_Idler *conformant_idler;
Ecore_Thread *del_thread;
+ Ecore_Thread *backup_thread;
msg_handle_t msgHandle;
msg_thread_id_t threadId;
BUBBLE_ADDRESS_LIST addr_list;
char threadName[DEF_THREAD_NAME_LEN+1];
+ char backupPath[DEF_BUF_LEN+1];
int bubble_count;
int bubble_index;
bool isDraft;
bool title_optionheader_opened;
bool del_cancel;
+ bool backup_cancel;
+ int copy_id;
int check_cnt;
int del_index;
+ int backup_type;
void *callback_data;
} MSG_BUBBLE_DATA, *PMSG_BUBBLE_DATA;
Eina_Bool msg_ui_bubble_item_load_cb(void *data);
void msg_ui_bubble_resend_msg(PMSG_BUBBLE_DATA bubble_data, int msg_id);
void msg_ui_bubble_delete_msg(PMSG_BUBBLE_DATA bubble_data, int msg_id);
+void msg_ui_bubble_refresh_msg_lock_status(PMSG_BUBBLE_DATA bubble_data, int msg_id);
void msg_ui_bubble_list_load(PMSG_BUBBLE_DATA bubble_data);
void msg_ui_bubble_list_data_update(PMSG_BUBBLE_DATA bubble_data);
void msg_ui_bubble_item_data_update(PMSG_BUBBLE_DATA bubble_data, msg_struct_t msg);
void msg_ui_bubble_add_normal_toolbar_item(Evas_Object *toolbar, void *user_data);
void msg_ui_bubble_msg_storage_change_cb(msg_handle_t handle, msg_storage_change_type_t type, msg_id_list_s *pMsgIdList, void *user_param);
-void msg_ui_bubble_ctlbar_multi_del_cb(void *data, Evas_Object *obj, void *event_info);
Evas_Object *msg_ui_bubble_toolbar_btn_create(Evas_Object *parent, char *icon_path, char *button_text);
void msg_ui_bubble_option_header_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_bubble_option_header_backup_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_call_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_vcall_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_email_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_add_to_contact_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_view_ct_detail_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_bubble_ctlbar_block_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_bubble_ctlbar_unblock_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_delete_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_forward_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_ctlbar_move_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_scroll_edge_top_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_scroll_drag_start_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_bubble_anchor_menu_click_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_bubble_main_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
void msg_ui_bubble_launch_voice_call(const char *call_num);
void msg_ui_bubble_launch_video_call(const char *call_num);
void msg_ui_bubble_launch_contact_list_ug(PMSG_BUBBLE_DATA pData, int type, const char *str);
void msg_ui_bubble_launch_contact_detail_ug(PMSG_BUBBLE_DATA pData, int ct_id);
void msg_ui_bubble_show_notify(PMSG_BUBBLE_DATA bubbleData, char *msg);
+void msg_ui_popup_close_clicked_cb(void *data, Evas_Object *obj, void *event_info);
Evas_Object* msg_ui_bubble_show_notify_with_progressbar(PMSG_BUBBLE_DATA pData, int count);
void msg_ui_bubble_show_select_info(PMSG_BUBBLE_DATA pData);
void msg_ui_bubble_show_deleted_info(PMSG_BUBBLE_DATA pData);
+void msg_ui_bubble_status_message_post(PMSG_BUBBLE_DATA pData, char *msg);
void msg_ui_bubble_contact_info_update(PMSG_BUBBLE_DATA pData);
unsigned char msg_ui_bubble_check_word_type(char *txt);
void msg_ui_bubble_get_time_format(PMSG_BUBBLE_DATA pData);
void msg_ui_bubble_get_locale(PMSG_BUBBLE_DATA pData);
+char *msg_ui_bubble_create_export_folder_name(void);
+char *msg_ui_bubble_create_export_file_name(void);
+char *msg_ui_bubble_create_export_folder(PMSG_BUBBLE_DATA pData, const char* folder_name);
+char *msg_ui_bubble_create_export_string(PMSG_BUBBLE_DATA pData, msg_struct_t msg);
+
bool msg_is_sms(int msg_type);
bool msg_is_mms(int msg_type);
Evas_Object *msg_ui_composer_last_body_entry_get(void *data);
void msg_ui_composer_last_focused_entry_set(void *data, Evas_Object *entry);
Evas_Object *msg_ui_composer_last_focused_entry_get(void *data);
+bool msg_ui_composer_last_focus_is_recipient(void *data);
+
void bundle_send_to_result(void *data, char *key, char *val);
COMPOSER_RETURN_TYPE_E msg_ui_composer_change_message_type(MSG_COMPOSER_VIEW_DATA_S *cd, COMPOSER_MSG_TYPE_E msg_type);
bool msg_ui_composer_common_is_send_possible(MSG_COMPOSER_VIEW_DATA_S *cd);
-void msg_ui_composer_common_play_vibration();
COMPOSER_MSG_TYPE_E msg_ui_composer_check_message_type(MSG_COMPOSER_VIEW_DATA_S *cd);
void msg_ui_composer_message_type_check_and_change(MSG_COMPOSER_VIEW_DATA_S *cd);
int msg_ui_composer_get_keypad_height(Evas_Object *entry);
void msg_ui_composer_change_body_scroll_size(MSG_COMPOSER_VIEW_DATA_S *cd, int keypad_height);
+void msg_ui_composer_make_default_body_size(MSG_COMPOSER_VIEW_DATA_S *cd);
+
int msg_ui_composer_get_font_size(int index, int type);
void msg_ui_composer_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd);
#endif
#define TO_FIELD_LABEL_SIZE_MAX 512
-#define COMPOSER_RECIPIENT_PORTRAIT_HEIGHT_MAX 150
-#define COMPOSER_RECIPIENT_LANDSCAPE_HEIGHT_MAX 150
+#define COMPOSER_RECIPIENT_PORTRAIT_HEIGHT_MAX 188
+#define COMPOSER_RECIPIENT_LANDSCAPE_HEIGHT_MAX 112
#define COMPARE_STRING_NUM 8
#ifndef MAX_TO_ADDRESS_CNT
#define COMPOSER_SUBJECT_MAX_CHAR (40)
#define COMPOSER_SUBJECT_MAX_BYTE (COMPOSER_SUBJECT_MAX_CHAR * 3)
-#define COMPOSER_MMS_TEXT_MAX_CHAR (2000)
+#define COMPOSER_MMS_TEXT_MAX_CHAR (3000)
#define COMPOSER_MMS_TEXT_MAX_BYTE (COMPOSER_MMS_TEXT_MAX_CHAR * 3)
#define COMPOSER_MMS_MAX_PAGE (20)
#define COMPOSER_CMS_UNICODE_MAX_LEN (67)
#define COMPOSER_CMS_GSM7_MAX_LEN (153)
-/* temporary 10 pages, it needs to be changed by operator spec. */
-#define COMPOSER_CMS_MAX_PAGE (10)
+/* default 15 pages, it can be changed by operator spec. */
+#define COMPOSER_CMS_MAX_PAGE (15)
#define COMPOSER_TMP_PATH "/tmp"
#define MSGC_SOUND_THUMB_WIDTH 48
#define MSGC_SOUND_THUMB_HEIGHT 48
-#define MSGC_RECIPIENT_POPUP_W 620
-#define MSGC_RECIPIENT_POPUP_LIST_H 130
+#define MSGC_POPUP_GENLIST_H 128
+#define MSGC_POPUP_LIST_H 112
#define MSGC_BODY_FONT_SIZE 32
} MSG_UG_MODE_E;
typedef enum {
+ MSG_COMPOSER_MODE_NORMAL,
+ MSG_COMPOSER_MODE_EDIT,
+ MSG_COMPOSER_MODE_FORWARD,
+} MSG_COMPOSER_MODE_E;
+
+typedef enum {
COMPOSER_RETURN_SUCCESS = 0,
COMPOSER_RETURN_FAIL = -1,
COMPOSER_RETURN_NULL_POINTER = -2,
COMPOSER_RETURN_INVALID_MSG_TYPE = -6,
COMPOSER_RETURN_INVALID_PAGE = -7,
COMPOSER_RETURN_INVALID_MEDIA_TYPE = -8,
- COMPOSER_RETURN_CREATION_MODE_FAIL = -9,
- COMPOSER_RETURN_ATTACHMENT_ALREADY_EXIST = -10,
- COMPOSER_RETURN_LOW_RESOLUTION = -11,
- COMPOSER_RETURN_HIGH_RESOLUTION = -12,
- COMPOSER_RETURN_NONSTANDARD_FILE = -13,
- COMPOSER_RETURN_RECIPIENT_INVALID = -14,
- COMPOSER_RETURN_RECIPIENT_COUNTMAX = -15,
- COMPOSER_RETURN_RECIPIENT_DUPLICATE = -16,
- COMPOSER_RETURN_MSG_SIZE_OVER = -17,
- COMPOSER_RETURN_RESIZE_IMAGE = -18,
- COMPOSER_RETURN_DRM_FORWARDLOCK = -19,
- COMPOSER_RETURN_OVERSIZE_FILE = -20,
+ COMPOSER_RETURN_ATTACHMENT_ALREADY_EXIST = -9,
+ COMPOSER_RETURN_LOW_RESOLUTION = -10,
+ COMPOSER_RETURN_HIGH_RESOLUTION = -11,
+ COMPOSER_RETURN_NONSTANDARD_FILE = -12,
+ COMPOSER_RETURN_RECIPIENT_INVALID = -13,
+ COMPOSER_RETURN_RECIPIENT_COUNTMAX = -14,
+ COMPOSER_RETURN_RECIPIENT_DUPLICATE = -15,
+ COMPOSER_RETURN_MSG_SIZE_OVER = -16,
+ COMPOSER_RETURN_RESIZE_IMAGE = -17,
+ COMPOSER_RETURN_DRM_FORWARDLOCK = -18,
+ COMPOSER_RETURN_OVERSIZE_FILE = -19,
+ COMPOSER_RETURN_CREATION_RESTRICTED_MODE_FAIL = -20,
+ COMPOSER_RETURN_CREATION_RESTRICTED_MODE_PASS = -21,
+ COMPOSER_RETURN_CREATION_WARINING_MODE_FAIL = -22,
+ COMPOSER_RETURN_CREATION_WARINING_MODE_PASS = -23,
} COMPOSER_RETURN_TYPE_E;
typedef enum {
COMPOSER_MSG_FONT_SIZE
} COMPOSER_FONT_SIZE_TYPE_E;
+typedef enum {
+ COMPOSER_CONTENT_CREATION_NONE,
+ COMPOSER_CONTENT_CREATION_ALLOWED,
+ COMPOSER_CONTENT_CREATION_ALLOWED_WITH_RESIZE,
+ COMPOSER_CONTENT_CREATION_NOT_ALLOWED,
+} COMPOSER_CONTENT_CREATION_MODE_E;
+
/******************************
* structures
*******************************/
void *cd;
int mode;
int recipient_h;
+ bool is_required_address_popup;
Evas_Object *parent;
Evas_Object *bx_main;
Evas_Object *sc;
Evas_Object *ly_to;
Evas_Object *mbe;
- Evas_Object *ly_bt;
Evas_Object *popup_selected;
Elm_Object_Item *sel_mbe_item;
bool is_sound_item;
Evas_Object *sound_item;
char sound_file_path[COMPOSER_FILEPATH_LEN_MAX + 1];
- int sound_duration;
+
+ int page_duration;
} MSG_COMPOSER_BODY_PAGE_S;
typedef struct _MSG_COMPOSER_BODY_S {
Eina_List *page_list;
int region_order;
+ COMPOSER_CONTENT_CREATION_MODE_E creation_allowed;
} MSG_COMPOSER_BODY_S;
typedef struct _MSG_COMPOSER_DATA_S {
/*composer mode & state*/
MSG_UG_MODE_E msg_ug_mode;
+ MSG_COMPOSER_MODE_E composer_mode;
COMPOSER_STATE_TYPE_E state;
COMPOSER_ROTATE_TYPE_E rotate;
COMPOSER_MSG_TYPE_E msg_type;
bool add_menu_clicked;
bool loaded_aul;
+ bool loaded_view;
bool isSubject;
bool send_button_is_show;
bool isclosed; /* backkey is pressed */
bool loading_draft; /* draft msg loading status */
+ bool make_default_body_size;
+ bool is_default_body_size;
+ bool is_keypad_show;
int current_edit_entry;
int first_focus;
/* setting data */
FONT_SIZE_S font_size;
int mms_max_size;
+ int cms_max_page;
int page_duration;
/*message handler*/
msg_handle_t msg_handle;
+ void *tapi_handle;
/*module data*/
SUBJECT_S sub_data;
Evas_Object *more_btn;
Evas_Object *back_btn;
Evas_Object *toolbar_top;
- Elm_Object_Item *toolbar_item_top[4];
- Evas_Object *toolbar_btn[4];
+ Elm_Object_Item *toolbar_item_top[CONTROLBAR_ITEM_MAX];
+ Evas_Object *toolbar_btn[CONTROLBAR_ITEM_MAX];
Elm_Object_Item *navi_it;
Eina_Bool navi_optionheader_opened;
Eina_List *popup_list;
Evas_Object *page_duration_entry;
-
Evas_Object *last_focus_entry;
-
Ecore_Idler *last_focus_idler;
Ecore_Thread *attach_thread;
Ecore_Job *job_thread_end;
+ Ecore_Timer *flight_mode_timer;
Elm_Theme *th;
#define GALLERY_TOKEN ";"
#define MYFILE_TOKEN "?"
-#define TXT_UG_NAME_CALLLOG "logcheck-efl"
#define TXT_UG_NAME_CONTACT "contacts-list-efl"
#define TXT_UG_NAME_MYFILE "myfile-efl"
-#define TXT_UG_NAME_MSG_VIEWER "msg-viewer-efl"
+
#define TXT_UG_NAME_MEMO "memo-efl"
#define TXT_UG_NAME_GALLERY "gallery-efl"
#define TXT_UG_NAME_CALENDAR "calendar-efl"
-#define TXT_UG_NAME_LOG "phonelog-efl"
-
+#define TXT_UG_NAME_CONTACT_PHONEUI "contacts-tabui-efl"
+#define TXT_UG_NAME_MSG_VIEWER "msg-viewer-efl"
typedef enum {
COMPOSER_EXT_TYPE_GALLERY,
COMPOSER_EXT_TYPE_MYFILE,
- COMPOSER_EXT_TYPE_LOG,
- COMPOSER_EXT_TYPE_CONTACT,
- COMPOSER_EXT_TYPE_CONTACTLIST,
COMPOSER_EXT_TYPE_NAMECARD,
COMPOSER_EXT_TYPE_CALENDAR,
COMPOSER_EXT_TYPE_MEMO,
COMPOSER_EXT_TYPE_CAMERA,
COMPOSER_EXT_TYPE_CAMCORDER,
COMPOSER_EXT_TYPE_MSGVIEWER,
+ COMPOSER_EXT_TYPE_CONTACT_PHONEUI,
COMPOSER_EXT_TYPE_COMMON,
COMPOSER_EXT_TYPE_MAX = 0xff,
} COMPOSER_EXT_TYPE_E;
int bgcolor;
} MSG_COMP_REGION_S;
+enum __COMPOSER_CONFIG_TYPE_E {
+ COMPOSER_CONFIG_TYPE_GENERAL = MSG_GENERAL_OPT,
+ COMPOSER_CONFIG_TYPE_SMS_SEND = MSG_SMS_SENDOPT,
+ COMPOSER_CONFIG_TYPE_SMSC_LIST = MSG_SMSC_LIST,
+ COMPOSER_CONFIG_TYPE_MMS_SEND = MSG_MMS_SENDOPT,
+ COMPOSER_CONFIG_TYPE_MMS_RECIEVE = MSG_MMS_RECVOPT,
+ COMPOSER_CONFIG_TYPE_MMS_CLASS = MSG_MMS_CLASSOPT,
+ COMPOSER_CONFIG_TYPE_MMS_STYLE = MSG_MMS_STYLEOPT,
+ COMPOSER_CONFIG_TYPE_PUSHMSG = MSG_PUSHMSG_OPT,
+ COMPOSER_CONFIG_TYPE_CBMSG = MSG_CBMSG_OPT,
+ COMPOSER_CONFIG_TYPE_VOICEMAIL = MSG_VOICEMAIL_OPT,
+ COMPOSER_CONFIG_TYPE_MMS_SIZE = MSG_MSGSIZE_OPT,
+};
+
+enum __COMPOSER_CREATION_MODE_E {
+ COMPOSER_CREATIONMODE_RESTRICTED = MSG_CREATION_MODE_RESTRICTED,
+ COMPOSER_CREATIONMODE_WARNING = MSG_CREATION_MODE_WARNING,
+ COMPOSER_CREATIONMODE_FREE = MSG_CREATION_MODE_FREE,
+};
+
/*****************************
* structures
***************************/
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_page_count(int page_count);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_is_text_top(bool isTextTop);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_text(const char *text, int nPage);
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_media(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int nPage, int duration);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_media(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int nPage);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_page_duration(int nPage, int duration);
/* save send*/
COMPOSER_RETURN_TYPE_E msg_ui_composer_save_message(msg_handle_t msg_handle);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_make_and_send(msg_handle_t msg_handle, msg_thread_id_t *tid);
msg_struct_t msg_ui_composer_message_make_preview(msg_handle_t msg_handle);
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data);
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data, bool set_recipient);
COMPOSER_RETURN_TYPE_E msg_ui_composer_message_load_message(msg_handle_t msg_handle, int msgID);
#endif /*__MSG_UI_COMPOSER_MSG_H_*/
/* includes*/
#include "msg-ui-composer-data.h"
#include <Elementary.h>
-#include <status.h>
/* defines*/
#define COMPOSER_STATUS_POPUP_DEFAULT_TIME 2
Evas_Object *msg_ui_composer_status_btn_popup_show(MSG_COMPOSER_VIEW_DATA_S *cd, const char *msg, int time, const char *btn_text);
Evas_Object *msg_ui_composer_list_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd, const char *title, Evas_Object *list, const char *style);
+Evas_Object *msg_ui_composer_checkbox_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd, const char *title, const char *msg, const char *check_msg);
Evas_Object *msg_ui_composer_custom_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd, const char *title, Evas_Object *parent, Evas_Object *layout);
Evas_Object *msg_ui_composer_progress_popup_show(MSG_COMPOSER_VIEW_DATA_S *cd, const char *msg);
+Evas_Object *msg_ui_composer_popup_button_create(Evas_Object *parent, const char *str);
+
void msg_ui_composer_status_popup_response_cb(void *data, Evas_Object *obj, void *event_info);
Eina_Bool msg_ui_composer_popup_exist(void *data);
void msg_ui_recipient_multibuttonentry_focused_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_recipient_multibuttonentry_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_recipient_multibuttonentry_clicked_cb(void *data, Evas_Object *obj, void *event_info);
-void msg_ui_recipient_entry_changed_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_recipient_multibuttonentry_item_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_recipient_multibuttonentry_item_added_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_recipient_multibuttonentry_item_deleted_cb(void *data, Evas_Object *obj, void *event_info);
Eina_Bool msg_ui_recipient_multibuttonentry_item_verify_cb(Evas_Object *obj, const char *item_label, void *item_data, void *data);
+
+void msg_ui_recipient_entry_changed_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_recipient_entry_activated_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_recipient_entry_filter_cb(void *data, Evas_Object *entry, char **text);
+
void msg_ui_recipient_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
#endif/*__MSG_UI_COMPOSER_RECIPIENT_CALLBACK_H_*/
void msg_ui_composer_recipient_clear(RECIPIENT_S *rd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_append(RECIPIENT_S *rd, const char *recipient, int index);
-void msg_ui_composer_bt_show(RECIPIENT_S *rd);
-void msg_ui_composer_bt_hide(RECIPIENT_S *rd);
-
const char *msg_ui_composer_recipient_entry_text_get(RECIPIENT_S *rd);
void msg_ui_composer_recipient_entry_text_set(RECIPIENT_S *rd, const char *str);
void msg_ui_composer_recipient_focus_set(RECIPIENT_S *rd);
+void msg_ui_composer_recipient_expanded_set(RECIPIENT_S *rd, Eina_Bool expanded);
+
Eina_Bool msg_ui_composer_recipient_is_mms(MSG_COMPOSER_VIEW_DATA_S *cd);
Eina_Bool msg_ui_composer_recipient_vaild_check(const char *recipient);
void msg_ui_composer_recipient_addr_type_set(RECIPIENT_S *rd, COMPOSER_RECP_ADDR_E type);
int msg_ui_composer_recipient_count_get(RECIPIENT_S *rd);
Eina_List *msg_ui_composer_recipient_invalid_recipient_list_get(RECIPIENT_S *rd);
+
+COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_set_loaded_data(void *data, const char *recipient, int index);
+
#endif/* __MSG_UI_COMPOSER_RECIPIENT_H_ */
#define MSGC_EDJ_GRP_CONTENT_LAYOUT "composer/content/full"
#define MSGC_EDJ_GRP_BUBBLE_LAYOUT "composer/content/bubble"
#define MSGC_EDJ_GRP_BUBBLE_MEDIA_LAYOUT "composer/content/bubble/media"
+#define MSGC_EDJ_GRP_DATEFIELD "composer/datefield"
#endif/* __MSG_UI_COMPOSER_RES_H_ */
#define MSGC_STR_GALLERY _SYSSTR("IDS_COM_BODY_GALLERY")
#define MSGC_STR_MYFILE _SYSSTR("IDS_COM_BODY_MY_FILES")
#define MSGC_STR_CONTACT _SYSSTR("IDS_COM_BODY_CONTACTS")
-#define MSGC_STR_CALENDAR _SYSSTR("IDS_COM_BODY_CALENDAR")
-#define MSGC_STR_MEMO _SYSSTR("IDS_COM_BODY_MEMO")
#define MSGC_STR_RECENT _SYSSTR("IDS_COM_BUTTON_RECENT")
/*Title*/
#include "msg-ui-composer-recipient.h"
#include "msg-ui-composer-external.h"
#include "msg-ui-composer-common.h"
+#include <fcntl.h>
-#define BUBBLE_TITLE_MENU_GENLIST_MAX_LINE 3
+#define BUBBLE_TITLE_MENU_GENLIST_MAX_LINE 4
#define BUBBLE_TITLE_MENU_GENLIST_1LINE_HEIGHT 129
#define BUBBLE_RETURN_DELETE_CANCEL 1000
msg_error_t err = MSG_SUCCESS;
- err = msg_delete_thread_message_list(pData->msgHandle, pData->threadId);
+ err = msg_delete_thread_message_list(pData->msgHandle, pData->threadId, false);
if (err == MSG_SUCCESS) {
pData->bubble_count = 0;
if (cd->back_btn) {
evas_object_show(cd->back_btn);
elm_object_part_content_set(cd->navi_title_layout, "prev_btn", cd->back_btn);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,prev_btn,show", "");
}
if (cd->more_btn) {
evas_object_show(cd->more_btn);
elm_object_part_content_set(cd->navi_title_layout, "more_btn", cd->more_btn);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,more_btn,show", "");
}
/* change title */
}
}
+static void __msg_ui_bubble_unblock(PMSG_BUBBLE_DATA pData, char *addr)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pData || !addr);
+
+ if (msg_common_delete_block_number(pData->msgHandle, addr) == MSG_SUCCESS) {
+ char msg[DEF_BUF_LEN] = {0,};
+ const char *str = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_PS_UNBLOCKED");
+ snprintf(msg, sizeof(msg), str, addr);
+ msg_ui_bubble_show_notify(pData, msg);
+
+ if (pData->addr_list.addr_cnt == 1) {
+ Evas_Object *block_button = msg_ui_bubble_toolbar_btn_create(pData->toolbar, MSG_TITLE_ICON_BLOCK, NULL);
+ elm_object_item_del(pData->toolbar_item[CONTROLBAR_ITEM_4]);
+ pData->toolbar_item[CONTROLBAR_ITEM_4] = elm_toolbar_item_append(pData->toolbar, NULL, NULL, NULL, pData->callback_data);
+ elm_object_item_part_content_set(pData->toolbar_item[CONTROLBAR_ITEM_4], "object", block_button);
+ evas_object_smart_callback_add(block_button, "clicked", msg_ui_bubble_ctlbar_block_cb, pData);
+ }
+ }
+}
+
+static void __msg_ui_bubble_block(PMSG_BUBBLE_DATA pData, char *addr)
+{
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pData || !addr);
+
+ if (msg_common_add_block_number(pData->msgHandle, addr) == MSG_SUCCESS) {
+ char msg[DEF_BUF_LEN] = {0,};
+ const char *str = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_PS_BLOCKED");
+ snprintf(msg, sizeof(msg), str, addr);
+ msg_ui_bubble_show_notify(pData, msg);
+
+ if (pData->addr_list.addr_cnt == 1) {
+ Evas_Object *block_button = msg_ui_bubble_toolbar_btn_create(pData->toolbar, MSG_TITLE_ICON_UNBLOCK, NULL);
+ elm_object_item_del(pData->toolbar_item[CONTROLBAR_ITEM_4]);
+ pData->toolbar_item[CONTROLBAR_ITEM_4] = elm_toolbar_item_append(pData->toolbar, NULL, NULL, NULL, pData->callback_data);
+ elm_object_item_part_content_set(pData->toolbar_item[CONTROLBAR_ITEM_4], "object", block_button);
+ evas_object_smart_callback_add(block_button, "clicked", msg_ui_bubble_ctlbar_unblock_cb, pData);
+ }
+ } else {
+ msg_ui_bubble_show_notify(pData, dgettext(MESSAGE_PKGNAME, "Unable to block"));
+ }
+}
+
+
+void __msg_block_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ PMSG_BUBBLE_DATA pData = (PMSG_BUBBLE_DATA)data;
+
+ if (pData->popup) {
+ evas_object_del(pData->popup);
+ pData->popup = NULL;
+ }
+
+ char* addr = (char *)evas_object_data_get(obj, "address");
+ __msg_ui_bubble_block(pData, addr);
+}
+
+static void __msg_ui_bubble_create_block_popup(PMSG_BUBBLE_DATA pData, char *addr)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pData || !addr);
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)pData->callback_data;
+ char title[DEF_BUF_LEN] = {0,};
+
+ if (pData->popup) {
+ evas_object_del(pData->popup);
+ pData->popup = NULL;
+ }
+
+ Evas_Object *popup = elm_popup_add(cd->navi_bar);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ const char *str = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_BLOCK_PS_Q");
+ snprintf(title, sizeof(title), str, addr);
+ elm_object_text_set(popup, title);
+
+ Evas_Object *btn_ok = elm_button_add(popup);
+ elm_object_style_set(btn_ok, "popup_button/default");
+ evas_object_data_set(btn_ok, "address", addr);
+ elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"));
+ elm_object_part_content_set(popup, "button1", btn_ok);
+ evas_object_smart_callback_add(btn_ok, "clicked", __msg_block_ok_clicked_cb, pData);
+
+ Evas_Object *btn_cancel = elm_button_add(popup);
+ elm_object_style_set(btn_cancel, "popup_button/default");
+ elm_object_text_set(btn_cancel, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
+ elm_object_part_content_set(popup, "button2", btn_cancel);
+ evas_object_smart_callback_add(btn_cancel, "clicked", msg_ui_popup_close_clicked_cb, pData);
+
+ evas_object_show(popup);
+ pData->popup = popup;
+}
+
static void __msg_ui_bubble_list_popup_selected_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
service_destroy(svc_handle);
}
+ } else if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_SK3_BLOCK")) == 0) {
+ __msg_ui_bubble_create_block_popup(bubble_data, addr_info->address);
+ } else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_UNBLOCK")) == 0) {
+ __msg_ui_bubble_unblock(bubble_data, addr_info->address);
}
D_LEAVE;
return NULL;
}
-
static Evas_Object * __msg_ui_bubble_gl_content_get(void *data, Evas_Object *obj, const char *part)
{
// Currently, this function do nothing, caller_id concept is not determined
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
btn_close = elm_button_add(popup);
+ elm_object_style_set(btn_close, "popup_button/default");
elm_object_text_set(btn_close, dgettext("sys_string", "IDS_COM_BODY_CLOSE"));
elm_object_part_content_set(popup, "button1", btn_close);
evas_object_smart_callback_add(btn_close, "clicked", msg_ui_popup_close_clicked_cb, bubble_data);
elm_list_item_append(list, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, NULL, __msg_ui_bubble_list_popup_selected_cb, (void *)addr_info);
}
- evas_object_size_hint_max_set(list, -1, 512 * elm_scale_get());
+ if (num_type == WORD_TYPE_NUM) {
+ msg_error_t err;
+ bool isBlock;
+ err = msg_common_check_block_number(bubble_data->msgHandle, addr_info->address, &isBlock);
+
+ if (err == MSG_SUCCESS) {
+ if (isBlock == false)
+ elm_list_item_append(list, dgettext("sys_string", "IDS_COM_SK3_BLOCK"), NULL, NULL, __msg_ui_bubble_list_popup_selected_cb, (void *)addr_info);
+ else
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_UNBLOCK"), NULL, NULL, __msg_ui_bubble_list_popup_selected_cb, (void *)addr_info);
+ }
+ }
elm_list_go(list);
elm_object_content_set(popup, list);
/** 3. create genlist */
Evas_Object *genlist = elm_genlist_add(box);
+ elm_object_theme_set(genlist, cd->th);
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_genlist_homogeneous_set(genlist, EINA_TRUE);
elm_box_pack_end(box, genlist);
/** 3.1 set genlist styles */
- bubble_data->itc_title.item_style = "2text.1icon.2";
+ bubble_data->itc_title.item_style = "2text.1icon.2.custom";
bubble_data->itc_title.func.text_get = __msg_ui_bubble_gl_text_get;
bubble_data->itc_title.func.content_get = __msg_ui_bubble_gl_content_get;
bubble_data->itc_title.func.state_get = NULL;
cd->title_menu_layout = box;
/** emit signal for changing state of swl.bubble.titlemenu to open */
- elm_object_signal_emit(cd->title_menu_layout, "elm,state,title_menu,open", "");
+ elm_object_signal_emit(cd->content_layout, "elm,state,title_menu,open", "");
/** Determine genlist size to show - it shows maxmum 3 rows */
if (bubble_data->addr_list.addr_cnt >= BUBBLE_TITLE_MENU_GENLIST_MAX_LINE)
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
MSG_UI_RETM_IF(MSG_UI_LEVEL_ASSERT, !cd, "[ERROR] cd is NULL !!");
- elm_object_signal_emit(cd->title_menu_layout, "elm,state,title_menu,close", "");
+ elm_object_signal_emit(cd->content_layout, "elm,state,title_menu,close", "");
Evas_Object *layout = elm_object_part_content_unset(cd->content_layout, "swl.bubble.titlemenu");
if (layout)
bubble_data->toolbar = toolbar;
elm_object_item_signal_emit(cd->navi_it, "elm,state,optionheader,open", "");
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,title,show", "");
} else if (bubble_data->addr_list.addr_cnt > 1) {
msg_ui_bubble_open_title_menu_genlist(bubble_data);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,title,show,multi", "");
} else {
D_EMSG("invalid address count [%d]", bubble_data->addr_list.addr_cnt);
return;
}
-
- elm_object_signal_emit(cd->navi_title_layout, "elm,state,title,show", "");
}
bubble_data->title_optionheader_opened = !bubble_data->title_optionheader_opened;
if (!user_param || !pMsgIdList)
return;
- PMSG_BUBBLE_DATA BubbleData = user_param;
+ MSG_COMPOSER_VIEW_DATA_S *cd = user_param;
+ PMSG_BUBBLE_DATA BubbleData = cd->bubble_data;
+
+ if (BubbleData == NULL)
+ return;
if (BubbleData->ug_state == BUBBLE_UG_DESTROY)
return;
int i;
for (i = 0; i < pMsgIdList->nCount; i++) {
- msg_struct_t msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+ msg_struct_t conv = msg_create_struct(MSG_STRUCT_CONV_INFO);
msg_error_t err = MSG_SUCCESS;
- err = msg_get_message(BubbleData->msgHandle, pMsgIdList->msgIdList[i], msg, sendOpt);
-
+ err = msg_get_conversation(BubbleData->msgHandle, pMsgIdList->msgIdList[i], conv);
if (err != MSG_SUCCESS) {
- msg_release_struct(&msg);
- msg_release_struct(&sendOpt);
+ msg_release_struct(&conv);
return;
}
int folder_id = 0;
int thread_id = 0;
- msg_get_int_value(msg, MSG_MESSAGE_FOLDER_ID_INT, &folder_id);
- msg_get_int_value(msg, MSG_MESSAGE_THREAD_ID_INT, &thread_id);
+ int msg_id = 0;
+ msg_get_int_value(conv, MSG_CONV_MSG_FOLDER_ID_INT, &folder_id);
+ msg_get_int_value(conv, MSG_CONV_MSG_THREAD_ID_INT, &thread_id);
+ msg_get_int_value(conv, MSG_CONV_MSG_ID_INT, &msg_id);
if (BubbleData->threadId == thread_id && folder_id != MSG_SPAMBOX_ID) {
switch (type) {
case MSG_STORAGE_CHANGE_INSERT :
- msg_ui_bubble_list_append(BubbleData, msg);
+ if (msg_id != BubbleData->copy_id)
+ msg_ui_bubble_list_append(BubbleData, conv);
+ else
+ BubbleData->copy_id = 0;
break;
case MSG_STORAGE_CHANGE_UPDATE :
- msg_ui_bubble_item_data_update(BubbleData, msg);
+ msg_ui_bubble_item_data_update(BubbleData, conv);
break;
default :
}
}
- msg_release_struct(&msg);
- msg_release_struct(&sendOpt);
+ msg_release_struct(&conv);
}
D_LEAVE;
}
-void msg_ui_bubble_option_header_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+static void __backup_thread_fn(void *data, Ecore_Thread *thread)
+{
+ D_ENTER;
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+
+ int fd;
+ char *folderpath = NULL;
+ char *foldername = NULL;
+ char *filename = NULL;
+ msg_struct_list_s msg_list;
+ msg_error_t err = MSG_SUCCESS;
+ int bubble_count = 0;
+ int i = 0;
+
+ // initialize backup file path
+ memset(bubble_data->backupPath, 0x00, sizeof(bubble_data->backupPath));
+
+ err = msg_get_conversation_view_list(bubble_data->msgHandle, bubble_data->threadId, &msg_list);
+ if (err != MSG_SUCCESS)
+ return;
+
+ bubble_count = msg_list.nCount;
+ if (bubble_count <= 0) {
+ msg_release_list_struct(&msg_list);
+ return;
+ }
+
+ foldername = msg_ui_bubble_create_export_folder_name();
+ if (!foldername) {
+ D_EMSG("create folder error!!!");
+ goto FREE_MEM;
+ }
+
+ folderpath = msg_ui_bubble_create_export_folder(bubble_data, foldername);
+ if (!folderpath) {
+ D_EMSG("file path is NULL!!!");
+ goto FREE_MEM;
+ }
+
+ filename = msg_ui_bubble_create_export_file_name();
+ if (!filename) {
+ D_EMSG("filename create error!!!");
+ goto FREE_MEM;
+ }
+
+ snprintf(bubble_data->backupPath, sizeof(bubble_data->backupPath), "%s/%s", folderpath, filename);
+
+ // open file
+ fd = open(bubble_data->backupPath, O_RDWR | O_CREAT | O_DSYNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ if (fd < 0) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "open error");
+ goto FREE_MEM;
+ }
+
+ // write file
+ for (i = 0; i < bubble_count; i++) {
+
+ if (bubble_data->backup_cancel)
+ break;
+
+ char *msg_str = msg_ui_bubble_create_export_string(bubble_data, msg_list.msg_struct_info[i]);
+ if (msg_str) {
+ if (write(fd, msg_str, strlen(msg_str)) > 0)
+ fdatasync(fd);
+ } else {
+ continue;
+ }
+ }
+ close(fd);
+FREE_MEM:
+ msg_release_list_struct(&msg_list);
+
+ if (foldername)
+ free(foldername);
+
+ if (folderpath)
+ free(folderpath);
+
+ if (filename)
+ free(filename);
+}
+
+static void __backup_thread_end_fn(void *data, Ecore_Thread *thread)
+{
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+
+ if (bubble_data->backupPath[0] == '\0') {
+ /** if backup file path is NULL, it can be considered as a fail to backup */
+ msg_ui_bubble_status_message_post(bubble_data, dgettext("sys_string", "IDS_COM_POP_FAILED"));
+ goto INIT_VARS;
+ }
+
+ if (bubble_data->backup_type == BUBBLE_BACKUP_TYPE_SD) {
+ if (bubble_data->backup_cancel) {
+ msg_ui_bubble_status_message_post(bubble_data, dgettext("sys_string", "IDS_COM_POP_CANCELLED"));
+ } else {
+ msg_ui_bubble_status_message_post(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_SAVED_IN_MY_FILES"));
+ }
+ } else if (bubble_data->backup_type == BUBBLE_BACKUP_TYPE_EMAIL) {
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
+ // send via email
+ service_h svc_handle;
+ if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
+ D_EMSG("service_create() is failed !!");
+ } else {
+ service_set_operation(svc_handle, SERVICE_OPERATION_SEND);
+ service_set_app_id(svc_handle, "email-composer-efl");
+ service_set_uri(svc_handle, bubble_data->backupPath);
+ service_add_extra_data(svc_handle, "RUN_TYPE","5");
+
+ Ecore_X_Window win_id = elm_win_xwindow_get(cd->main_window);
+ service_set_window(svc_handle, win_id);
+
+ service_send_launch_request(svc_handle, NULL, NULL);
+
+ service_destroy(svc_handle);
+ }
+ }
+
+INIT_VARS:
+ memset(bubble_data->backupPath, 0x00, sizeof(bubble_data->backupPath));
+ bubble_data->backup_type = BUBBLE_BACKUP_TYPE_NONE;
+ bubble_data->backup_cancel = false;
+}
+
+
+static void __backup_thread_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+ bubble_data->backup_cancel = true;
+
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+}
+
+static void __msg_ui_bubble_backup_menu_selected_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
+
+ const char *label = elm_object_item_text_get((Elm_Object_Item *) event_info);
+
+ // create popup
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+
+ Evas_Object *popup = elm_popup_add(cd->navi_bar);
+
+ elm_object_text_set(popup, dgettext("sys_string", "In progress..."));
+
+ Evas_Object *cancel_btn = elm_button_add(popup);
+ elm_object_style_set(cancel_btn, "popup_button/default");
+ elm_object_text_set(cancel_btn, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
+ elm_object_part_content_set(popup, "button1", cancel_btn);
+ evas_object_smart_callback_add(cancel_btn, "clicked", __backup_thread_cancel_clicked_cb, bubble_data);
+
+ bubble_data->popup = popup;
+ evas_object_show(popup);
+
+ if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "export SD card")) == 0) {
+ bubble_data->backup_type = BUBBLE_BACKUP_TYPE_SD;
+ } else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "Send via email")) == 0) {
+ bubble_data->backup_type = BUBBLE_BACKUP_TYPE_EMAIL;
+ } else {
+ D_EMSG("invalid label text");
+ return;
+ }
+
+ bubble_data->backup_thread = ecore_thread_run(__backup_thread_fn, __backup_thread_end_fn, NULL, (void *)bubble_data);
+}
+
+
+void msg_ui_bubble_option_header_backup_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
-
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !bubble_data);
- bubble_data->viewmode = BUBBLE_EDIT_VIEW;
- bubble_data->check_cnt = 0;
- bubble_data->del_index = 0;
+ Evas_Object *popup = elm_popup_add(cd->navi_bar);
+ elm_object_style_set(popup, "min_menustyle");
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_part_content_unset(cd->navi_title_layout, "prev_btn");
- elm_object_part_content_unset(cd->navi_title_layout, "more_btn");
+ Evas_Object *btn_close = elm_button_add(popup);
+ elm_object_style_set(btn_close, "popup_button/default");
+ elm_object_text_set(btn_close, dgettext("sys_string", "IDS_COM_BODY_CLOSE"));
+ elm_object_part_content_set(popup, "button1", btn_close);
+ evas_object_smart_callback_add(btn_close, "clicked", msg_ui_popup_close_clicked_cb, bubble_data);
- if (cd->back_btn)
- evas_object_hide(cd->back_btn);
+ Evas_Object *list = elm_list_add(popup);
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
- if (cd->more_btn)
- evas_object_hide(cd->more_btn);
+ evas_object_data_set(list, "bubble_data", bubble_data);
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "export SD card"), NULL, NULL, __msg_ui_bubble_backup_menu_selected_cb, (void *)bubble_data);
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "Send via email"), NULL, NULL, __msg_ui_bubble_backup_menu_selected_cb, (void *)bubble_data);
- Eina_List *l;
- PMSG_APP_CONV_DATA_S item_data = NULL;
- EINA_LIST_FOREACH(bubble_data->realized_list, l, item_data) {
- if (item_data) {
- Evas_Object *check = NULL;
- if (!item_data->chk) {
- check = elm_check_add(item_data->ly);
- elm_check_state_pointer_set(check, &item_data->isCheck);
- evas_object_data_set(check, "item_data", (const void *)item_data);
- evas_object_smart_callback_add(check, "changed", msg_ui_bubble_list_checked_cb, (const void *)bubble_data);
- evas_object_propagate_events_set(check, EINA_FALSE);
- item_data->chk = check;
- }
- evas_object_event_callback_add(item_data->ly, EVAS_CALLBACK_MOUSE_DOWN, msg_ui_bubble_item_mouse_down_cb, (const void*)item_data);
- elm_object_style_set(check, "default/genlist_edit");
- elm_object_part_content_set(item_data->ly, "elm.swallow.select_icon", item_data->chk);
- elm_object_signal_emit(item_data->ly, "elm,state,select,enable", "elm");
- }
- }
+ elm_list_go(list);
+ elm_object_content_set(popup, list);
+ evas_object_show(popup);
- msg_ui_composer_editable_set(cd, EINA_FALSE);
+ bubble_data->popup = popup;
- _bubble_change_edit_mode_title(bubble_data);
- _bubble_add_edit_controlbar(bubble_data);
- _bubble_add_navi_select_all_ly(bubble_data);
}
-void msg_ui_bubble_ctlbar_multi_del_cb(void *data, Evas_Object *obj, void *event_info)
+void msg_ui_bubble_option_header_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
- MSG_COMPOSER_VIEW_DATA_S *cd = data;
- PMSG_BUBBLE_DATA pData = cd->bubble_data;
- MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pData);
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
- pData->viewmode = BUBBLE_EDIT_VIEW;
- pData->check_cnt = 0;
- pData->del_index = 0;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !bubble_data);
+
+ bubble_data->viewmode = BUBBLE_EDIT_VIEW;
+ bubble_data->check_cnt = 0;
+ bubble_data->del_index = 0;
- elm_object_item_part_content_unset(cd->navi_it, "title_right_btn");
+ elm_object_part_content_unset(cd->navi_title_layout, "prev_btn");
+ elm_object_part_content_unset(cd->navi_title_layout, "more_btn");
if (cd->back_btn) {
evas_object_hide(cd->back_btn);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,prev_btn,hide", "");
+ }
+
+ if (cd->more_btn) {
+ evas_object_hide(cd->more_btn);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,more_btn,hide", "");
}
+
Eina_List *l;
PMSG_APP_CONV_DATA_S item_data = NULL;
- EINA_LIST_FOREACH(pData->realized_list, l, item_data) {
+ EINA_LIST_FOREACH(bubble_data->realized_list, l, item_data) {
if (item_data) {
Evas_Object *check = NULL;
if (!item_data->chk) {
check = elm_check_add(item_data->ly);
elm_check_state_pointer_set(check, &item_data->isCheck);
evas_object_data_set(check, "item_data", (const void *)item_data);
- evas_object_smart_callback_add(check, "changed", msg_ui_bubble_list_checked_cb, (const void *)pData);
+ evas_object_smart_callback_add(check, "changed", msg_ui_bubble_list_checked_cb, (const void *)bubble_data);
evas_object_propagate_events_set(check, EINA_FALSE);
item_data->chk = check;
}
msg_ui_composer_editable_set(cd, EINA_FALSE);
- _bubble_add_edit_controlbar(pData);
- _bubble_add_navi_select_all_ly(pData);
+ _bubble_change_edit_mode_title(bubble_data);
+ _bubble_add_edit_controlbar(bubble_data);
+ _bubble_add_navi_select_all_ly(bubble_data);
}
void msg_ui_bubble_ctlbar_email_cb(void *data, Evas_Object *obj, void *event_info)
if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
D_EMSG("service_create() is failed !!");
} else {
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_RUN_TYPE, MSG_BUNDLE_VALUE_EMAIL_COMPOSE);
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TO, pData->addr_list.addr_info[0].address);
- msg_ui_composer_launch_email_create(cd, svc_handle);
- if (!cd->loaded_ug)
- msg_ui_bubble_show_notify(pData, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_OPEN"));
+ service_set_operation(svc_handle, SERVICE_OPERATION_SEND);
+ service_set_app_id(svc_handle, "email-composer-efl");
+ service_add_extra_data(svc_handle, "RUN_TYPE","5");
+
+ Ecore_X_Window win_id = elm_win_xwindow_get(cd->main_window);
+
+ service_set_window(svc_handle, win_id);
+ service_add_extra_data(svc_handle, SERVICE_DATA_TO, pData->addr_list.addr_info[0].address);
+
+ service_send_launch_request(svc_handle, NULL, NULL);
+
service_destroy(svc_handle);
}
}
msg_ui_composer_launch_contact_detail_ug(cd, pData->addr_list.addr_info[0].contact_id);
}
+void msg_ui_bubble_ctlbar_block_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+
+ PMSG_BUBBLE_DATA pData = (PMSG_BUBBLE_DATA)data;
+
+ __msg_ui_bubble_create_block_popup(pData, pData->addr_list.addr_info[0].address);
+}
+
+void msg_ui_bubble_ctlbar_unblock_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+
+ PMSG_BUBBLE_DATA pData = data;
+
+ __msg_ui_bubble_unblock(pData, pData->addr_list.addr_info[0].address);
+}
+
void msg_ui_bubble_ctlbar_delete_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
}
-
void msg_ui_bubble_ctlbar_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
msg_ui_bubble_get_locale(BubbleData);
msg_ui_bubble_get_time_format(BubbleData);
+
+ if (BubbleData->date_ptn_default) {
+ free(BubbleData->date_ptn_default);
+ BubbleData->date_ptn_default = NULL;
+ }
+
+ if (BubbleData->date_ptn_year) {
+ free(BubbleData->date_ptn_year);
+ BubbleData->date_ptn_year = NULL;
+ }
+
+ if (BubbleData->time_12h_ptn) {
+ free(BubbleData->time_12h_ptn);
+ BubbleData->time_12h_ptn = NULL;
+ }
+
+ if (BubbleData->time_24h_ptn) {
+ free(BubbleData->time_24h_ptn);
+ BubbleData->time_24h_ptn = NULL;
+ }
+
BubbleData->time_12h_ptn = msg_common_get_date_best_pattern(BubbleData->locale, MSG_UI_TIME_PATTERN_12H);
BubbleData->time_24h_ptn = msg_common_get_date_best_pattern(BubbleData->locale, MSG_UI_TIME_PATTERN_24H);
- BubbleData->date_ptn = msg_common_get_date_best_pattern(BubbleData->locale, UDAT_YEAR_NUM_MONTH_DAY);
+ BubbleData->date_ptn_default = msg_common_get_date_best_pattern(BubbleData->locale, MSG_UI_DATE_PATTERN_DEFAULT);
+ BubbleData->date_ptn_year = msg_common_get_date_best_pattern(BubbleData->locale, MSG_UI_DATE_PATTERN_YEAR);
msg_ui_bubble_list_data_update(BubbleData);
if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
D_EMSG("service_create() is failed !!");
} else {
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_RUN_TYPE, MSG_BUNDLE_VALUE_EMAIL_COMPOSE);
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TO, title);
- msg_ui_composer_launch_email_create(cd, svc_handle);
- if (!cd->loaded_ug)
- msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_OPEN"));
+ service_set_operation(svc_handle, SERVICE_OPERATION_SEND);
+ service_set_app_id(svc_handle, "email-composer-efl");
+ service_add_extra_data(svc_handle, "RUN_TYPE","5");
+
+ Ecore_X_Window win_id = elm_win_xwindow_get(cd->main_window);
+
+ service_set_window(svc_handle, win_id);
+ service_add_extra_data(svc_handle, SERVICE_DATA_TO, title);
+
+ service_send_launch_request(svc_handle, NULL, NULL);
service_destroy(svc_handle);
}
D_LEAVE;
}
+void msg_ui_bubble_main_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(data == NULL, "data is NULL");
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ if (!cd->is_keypad_show)
+ msg_ui_composer_make_default_body_size(cd);
+
+ cd->make_default_body_size = true;
+
+ D_LEAVE;
+}
#include "msg-ui-composer-common.h"
#include "syspopup_caller.h"
-bool g_isVisible = false;
bool g_isFirstLoading = true;
#define MSG_BUBBLE_BLOCK_COUNT (20)
bool isMsgText = false;
Eina_Strbuf *msg_data = eina_strbuf_new();
- /* Subject */
+ if (conv_data->msgText[0] != '\0')
+ isMsgText = true;
+
+ /* Subject & image */
if ((conv_data->msgType == MSG_TYPE_MMS || conv_data->msgType == MSG_TYPE_MMS_NOTI)) {
if (conv_data->subject[0] != '\0') {
char *subject = NULL;
free(subject);
eina_strbuf_append(msg_data, "<br>");
}
- }
-
- /* Message Text */
- eina_strbuf_append(msg_data, "<color=#4D3A17FF>");
- char *tmp_str = elm_entry_utf8_to_markup(conv_data->msgText);
- eina_strbuf_append(msg_data, tmp_str);
- if (tmp_str) {
- isMsgText = true;
- free(tmp_str);
- }
-
- if (conv_data->msgType == MSG_TYPE_MMS) {
-
- if (conv_data->attachment_cnt > 0) {
- eina_strbuf_append(msg_data, "<font_size=24>");
- eina_strbuf_append_printf(msg_data, "<br><item size=32x32 vsize=full href=file://%s>%d</item>", MSG_BUBBLE_ATTACH_ICON, conv_data->attachment_cnt);
- }
if (conv_data->thumbNailPath[0] != '\0') {
Evas_Object *tmp_obj = NULL;
int h = 0;
double rate = 0.0;
- //FIXME :: It should be fixed at elm_image.c
tmp_obj = evas_object_image_filled_add(evas_object_evas_get(conv_data->entry));
evas_object_image_file_set(tmp_obj, conv_data->thumbNailPath, NULL);
evas_object_image_size_get(tmp_obj, &w, &h);
h = h * rate;
} else {
rate = MSG_BUBBLE_IMG_MAX_H / (double)h;
- w = h * rate;
+ w = w * rate;
h = MSG_BUBBLE_IMG_MAX_H;
}
+ /* Don't remove <br> between <item> and </item>. if it is removed, anchor wouldn't work */
+ /* In case of body text is not exist, <br> should not be shown. for this, change font size to 1*/
+ if (!isMsgText && conv_data->attachment_cnt == 0 && conv_data->audio_filename[0] == '\0')
+ eina_strbuf_append(msg_data, "<font_size=1>");
+ eina_strbuf_append_printf(msg_data, "<a href=image.%d>", conv_data->msgId);
+ eina_strbuf_append_printf(msg_data, "<item size=%dx%d vsize=full href=file://%s><br></item></a>", w, h, conv_data->thumbNailPath);
+ }
+ }
+
+ if (conv_data->bProtected)
+ eina_strbuf_append_printf(msg_data, "<item size=44x44 vsize=full href=file://%s></item>", MSG_BUBBLE_PROTECTED_ICON);
+
+ /* Message Text */
+ eina_strbuf_append(msg_data, "<color=#4D3A17FF>");
+ char *tmp_str = elm_entry_utf8_to_markup(conv_data->msgText);
+ eina_strbuf_append(msg_data, tmp_str);
+ if (tmp_str)
+ free(tmp_str);
+
+ if (conv_data->msgType == MSG_TYPE_MMS) {
+ /** audio file */
+ if (conv_data->audio_filename[0] != '\0') {
+
if (isMsgText)
eina_strbuf_append(msg_data, "<br>");
- eina_strbuf_append(msg_data, "<font_size=8>");
- eina_strbuf_append_printf(msg_data, "<br><a href=image.%d>", conv_data->msgId);
- eina_strbuf_append_printf(msg_data, "<item size=%dx%d vsize=full href=file://%s><br></item></a>", w, h, conv_data->thumbNailPath);
- /** <br> between <item>, </item> is needed, if it is not exist, it couldn't use anchor */
+ eina_strbuf_append_printf(msg_data, "<a href=audio.%d>", conv_data->msgId);
+ eina_strbuf_append_printf(msg_data, "<item size=42x42 vsize=full href=file://%s> %s</item></a>", MSG_BUBBLE_AUDIOFILE_ICON, conv_data->audio_filename);
+ }
+ /** attachment files*/
+ if (conv_data->attachment_cnt > 0) {
+ char attach_str[DEF_BUF_LEN] = {0,};
+ if (conv_data->attachment_cnt == 1 && conv_data->attachment_filename[0] != '\0') {
+ snprintf(attach_str, sizeof(attach_str), "%s", conv_data->attachment_filename);
+ } else {
+ const char *text = dgettext(MESSAGE_PKGNAME, "IDS_MSGC_BODY_PD_ATTACHMENTS");
+ snprintf(attach_str, sizeof(attach_str), text, conv_data->attachment_cnt);
+ }
+
+ if (isMsgText || conv_data->audio_filename[0] != '\0')
+ eina_strbuf_append(msg_data, "<br>");
+
+ eina_strbuf_append_printf(msg_data, "<item size=42x42 vsize=full href=file://%s> %s</item>", MSG_BUBBLE_ATTACH_ICON, attach_str);
}
} else if (conv_data->msgType == MSG_TYPE_SMS && conv_data->storageId == MSG_STORAGE_SIM) {
if (isMsgText) {
eina_strbuf_append(msg_data, "<br>");
}
- eina_strbuf_append_printf(msg_data, "<item size=25x25 vsize=full href=file://%s></item>", MSG_BUBBLE_SIM_MSG_ICON);
+ eina_strbuf_append_printf(msg_data, "<item size=34x34 vsize=full href=file://%s></item>", MSG_BUBBLE_SIM_MSG_ICON);
}
elm_entry_entry_set(conv_data->entry, eina_strbuf_string_get(msg_data));
if (type == MSG_BOX_PACK_BEFORE || type == MSG_BOX_PACK_AFTER) {
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !obj);
}
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
Evas_Object *layout = elm_layout_add(bubble_data->box);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
if (conv_data->direction == MSG_DIRECTION_TYPE_MO) {
elm_layout_theme_set(layout, "layout", "bubble", "sentmessage/default");
+ elm_object_theme_set(entry, cd->th);
elm_object_style_set(entry, MSG_BUBBLE_STYLE_SENT);
} else {
elm_layout_theme_set(layout, "layout", "bubble", "readmessage/default");
+ elm_object_theme_set(entry, cd->th);
elm_object_style_set(entry, MSG_BUBBLE_STYLE_RECV);
}
elm_check_state_set(conv_data->chk, conv_data->isCheck);
}
}
-
}
-static void __msg_image_clicked_cb(PMSG_BUBBLE_DATA bubble_data, char *msgID)
+
+static void __msg_media_clicked_cb(PMSG_BUBBLE_DATA bubble_data, char *msgID, int file_type)
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !msgID);
msg_get_list_handle(mms_data, MSG_MMS_PAGE_LIST_HND, (void **)&page_list);
pageCnt = msg_list_length(page_list);
-
for (i = 0 ; i < pageCnt; i++) {
mms_page = (msg_struct_t)msg_list_nth_data(page_list, i);
msg_list_handle_t medialist = NULL;
for (j = 0; j < mediaCnt; j++) {
int media_type;
- mms_media = (msg_struct_t)msg_list_nth_data(medialist, i);
+ mms_media = (msg_struct_t)msg_list_nth_data(medialist, j);
msg_get_int_value(mms_media, MSG_MMS_MEDIA_TYPE_INT, &media_type);
- if (media_type == MMS_SMIL_MEDIA_IMG) {
+ if (media_type == file_type) {
goto OUTSIDE_OF_LOOP;
}
}
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, bubble_data == NULL);
-
PMSG_APP_CONV_DATA_S conv_data = NULL;
- Eina_List *l;
+ Eina_List *l;
EINA_LIST_FOREACH(bubble_data->bubble_list, l, conv_data) {
if (conv_data) {
if (msg_id == conv_data->msgId) {
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, bubble_data == NULL);
-
PMSG_APP_CONV_DATA_S conv_data = NULL;
- Eina_List *l;
+ Eina_List *l;
EINA_LIST_FOREACH(bubble_data->bubble_list, l, conv_data) {
if (conv_data && msg_id == conv_data->msgId) {
Evas_Object *retrieve_btn = elm_object_part_content_get(conv_data->entry, "elm.swallow.end");
MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, tok_r == NULL);
if (g_strcmp0(token, "image") == 0)
- __msg_image_clicked_cb(bubble_data, tok_r);
+ __msg_media_clicked_cb(bubble_data, tok_r, MMS_SMIL_MEDIA_IMG);
+ else if (g_strcmp0(token, "audio") == 0)
+ __msg_media_clicked_cb(bubble_data, tok_r, MMS_SMIL_MEDIA_AUDIO);
D_LEAVE;
}
return;
}
- const char *origin_text = elm_entry_entry_get(conv_data->entry);
- char *text_temp = NULL;
- char *text = NULL;
-
- if (origin_text) {
- text_temp = strdup(origin_text);
- const char *startTag = NULL;
- if (text_temp) {
- startTag = strstr(text_temp, "<item");
- if (startTag != NULL) {
- int offset = (int)(startTag-text_temp);
- text_temp[offset] = '\0';
- } else {
- }
- text = elm_entry_markup_to_utf8(text_temp);
- g_free(text_temp);
- } else {
- D_EMSG("text_temp is NULL (strdup error)");
- return;
- }
+ char copy_str[DEF_BUF_LEN_L + DEF_BUF_LEN_S + 1] = {0,};
+ if (conv_data->subject[0] != '\0') {
+ strncat(copy_str, conv_data->subject, strlen(conv_data->subject));
+ strncat(copy_str, "\n", strlen("\n"));
}
- if (text) {
- const char *startTag = strstr(text, "<item");
- if (startTag != NULL) {
- int offset = (int)(startTag-text);
- text[offset] = '\0';
- }
- elm_cnp_selection_set(conv_data->entry, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT, text, strlen(text));
- g_free(text);
- }
+ if (conv_data->msgText[0] != '\0')
+ strncat(copy_str, conv_data->msgText, sizeof(copy_str) - strlen(conv_data->subject) - 1);
+
+ if (copy_str[0] != '\0')
+ elm_cnp_selection_set(conv_data->entry, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT, copy_str, strlen(copy_str));
D_LEAVE;
}
+static void __msg_protect_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data);
+
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+ PMSG_APP_CONV_DATA_S conv_data = (PMSG_APP_CONV_DATA_S)evas_object_data_get(obj, "conv_data");
+
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+
+ if (msg_update_protected_status(bubble_data->msgHandle, conv_data->msgId, !conv_data->bProtected) == MSG_SUCCESS) {
+ conv_data->bProtected = !conv_data->bProtected;
+ msg_ui_bubble_fill_bubble_contents(bubble_data, conv_data);
+ }
+}
+
static void __msg_delete_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
if (bubble_data->bubble_count == 1 && isDraft == false) {
bubble_data->bubble_count = 0;
- err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId);
+ err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
} else {
msg_id = conv_data->msgId;
err = msg_delete_message(bubble_data->msgHandle, msg_id);
}
}
-
static void __msg_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
elm_object_text_set(popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_DELETE_Q"));
Evas_Object *btn_ok = elm_button_add(popup);
+ elm_object_style_set(btn_ok, "popup_button/default");
elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"));
elm_object_part_content_set(popup, "button1", btn_ok);
evas_object_smart_callback_add(btn_ok, "clicked", __msg_delete_ok_clicked_cb, bubble_data);
Evas_Object *btn_cancel = elm_button_add(popup);
+ elm_object_style_set(btn_cancel, "popup_button/default");
elm_object_text_set(btn_cancel, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
elm_object_part_content_set(popup, "button2", btn_cancel);
evas_object_smart_callback_add(btn_cancel, "clicked", __msg_delete_cancel_clicked_cb, bubble_data);
D_EMSG("service_create() is failed !!");
} else {
snprintf(buf, sizeof(buf), "%d", conv_data->msgId);
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FORWARD, buf);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_MSG_ID, buf);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_MODE, MSG_BUNDLE_VALUE_FORWARD);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, MSG_BUNDLE_VALUE_INTERNAL);
msg_ui_composer_launch_composer_create(cd, svc_handle);
service_destroy(svc_handle);
}
D_LEAVE;
}
-static void __msg_move_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+static void __msg_bubble_copy_to_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
if (!conv_data) {
D_EMSG("conv_data is NULL");
- msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_MOVE"));
+ msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_COPY"));
return;
}
msg_error_t err = MSG_SUCCESS;
+ int msg_id = 0;
+ msg_struct_t msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+ msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+
+ if (msg_get_message(bubble_data->msgHandle, conv_data->msgId, msg, sendOpt) != MSG_SUCCESS)
+ goto COPY_FAIL;
if (conv_data->msgType == MSG_TYPE_SMS) {
if (conv_data->storageId == MSG_STORAGE_PHONE) {
- err = msg_move_msg_to_storage(bubble_data->msgHandle, conv_data->msgId, MSG_STORAGE_SIM);
+ if ((msg_id = msg_add_message(bubble_data->msgHandle, msg, sendOpt)) < 0)
+ goto COPY_FAIL;
+ bubble_data->copy_id = msg_id;
+ err = msg_move_msg_to_storage(bubble_data->msgHandle, msg_id, MSG_STORAGE_SIM);
} else if (conv_data->storageId == MSG_STORAGE_SIM) {
- err = msg_move_msg_to_storage(bubble_data->msgHandle, conv_data->msgId, MSG_STORAGE_PHONE);
+ msg_set_int_value(msg, MSG_MESSAGE_STORAGE_ID_INT, MSG_STORAGE_PHONE);
+ if ((msg_id = msg_add_message(bubble_data->msgHandle, msg, sendOpt)) < 0)
+ goto COPY_FAIL;
} else {
D_EMSG("invalid storage id [%d]", conv_data->storageId);
- msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_MOVE"));
+ msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_COPY"));
return;
}
- } else {
- D_EMSG("invalid msg_type [%d]", conv_data->msgType);
- msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_MOVE"));
- return;
+ /** remove if it failed to move */
+ if (err != MSG_SUCCESS)
+ msg_delete_message(bubble_data->msgHandle, msg_id);
}
if (err == MSG_SUCCESS) {
- msg_ui_bubble_show_notify(bubble_data, dgettext("sys_string", "IDS_COM_POP_MOVED"));
+ msg_ui_bubble_status_message_post(bubble_data, dgettext("sys_string", "IDS_COM_POP_COPIED_P"));
+ if (conv_data->storageId != MSG_STORAGE_PHONE)
msg_ui_bubble_list_load(bubble_data);
} else {
- msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_MOVE"));
+ goto COPY_FAIL;
}
+ if (msg)
+ msg_release_struct(&msg);
+
+ if (sendOpt)
+ msg_release_struct(&sendOpt);
+
D_LEAVE;
-}
+ return;
+
+
+COPY_FAIL:
+ if (msg)
+ msg_release_struct(&msg);
+
+ if (sendOpt)
+ msg_release_struct(&sendOpt);
+ msg_ui_bubble_show_notify(bubble_data, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_UNABLE_TO_COPY"));
+
+}
static void __longpressed_cb(void *data, Evas_Object *obj, void *event_info)
{
PMSG_APP_CONV_DATA_S conv_data = (PMSG_APP_CONV_DATA_S)evas_object_data_get(obj, "conv_data");
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !conv_data);
+ if(bubble_data->viewmode != BUBBLE_NORMAL_VIEW)
+ return;
+
/** create popup */
popup = elm_popup_add(cd->main_window);
if (!popup) {
return;
}
- elm_object_style_set(popup, "menustyle");
+ elm_object_style_set(popup, "min_menustyle");
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
/** set popup title */
/** Sender: contents ... ex> "01012341234: Hello......" */
/** create menu list */
list = elm_list_add(cd->main_window);
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
+ evas_object_size_hint_max_set(list, -1, MSG_BUBBLE_POPUP_LIST_1LINE_HEIGHT * MSG_BUBBLE_POPUP_LIST_MAX_MENU * elm_scale_get());
+
if (!list)
return;
evas_object_data_set(list, "conv_data", conv_data);
- elm_list_item_append(list, dgettext("sys_string", "IDS_COM_BODY_COPY"), NULL, NULL, __msg_copy_clicked_cb, bubble_data);
elm_list_item_append(list, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, NULL, __msg_delete_clicked_cb, bubble_data);
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_MESSAGE_TEXT_ABB"), NULL, NULL, __msg_copy_clicked_cb, bubble_data);
+ if (conv_data->bProtected == true)
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_PROTECTION_OFF"), NULL, NULL, __msg_protect_clicked_cb, bubble_data);
+ else
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_PROTECTION_ON"), NULL, NULL, __msg_protect_clicked_cb, bubble_data);
elm_list_item_append(list, dgettext("sys_string", "IDS_COM_BODY_FORWARD"), NULL, NULL, __msg_forward_clicked_cb, bubble_data);
if (conv_data->msgType == COMPOSER_MSG_TYPE_SMS) {
if (conv_data->storageId == MSG_STORAGE_PHONE)
- elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_MOVE_TO_SIM"), NULL, NULL, __msg_move_clicked_cb, bubble_data);
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_SIM"), NULL, NULL, __msg_bubble_copy_to_clicked_cb, bubble_data);
else if (conv_data->storageId == MSG_STORAGE_SIM)
- elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_MOVE_TO_PHONE"), NULL, NULL, __msg_move_clicked_cb, bubble_data);
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE"), NULL, NULL, __msg_bubble_copy_to_clicked_cb, bubble_data);
}
elm_object_content_set(popup, list);
Evas_Object * btn1 = elm_button_add(popup);
+ elm_object_style_set(btn1, "popup_button/default");
elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_BODY_CLOSE"));
elm_object_part_content_set(popup, "button1", btn1);
bubble_data->popup = popup;
char *msg_date = NULL;
- msg_get_int_value(msgInfo, MSG_MESSAGE_ID_INT, (int *)(&conv_data->msgId));
- msg_get_int_value(msgInfo, MSG_MESSAGE_TYPE_INT, &conv_data->msgType);
- msg_get_int_value(msgInfo, MSG_MESSAGE_STORAGE_ID_INT, (int *)(&conv_data->storageId));
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_ID_INT, (int *)(&conv_data->msgId));
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_TYPE_INT, &conv_data->msgType);
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_STORAGE_ID_INT, (int *)(&conv_data->storageId));
if (conv_data->msgTime == NULL)
conv_data->msgTime = (time_t *) calloc(1, sizeof(time_t));
PMSG_BUBBLE_DATA bubble_data = msg_ui_bubble_get_bubble_data();
bzero(conv_data->msgTime,sizeof(time_t));
- msg_get_int_value(msgInfo, MSG_MESSAGE_DISPLAY_TIME_INT, (int *)conv_data->msgTime);
- msg_date = msg_common_get_display_date(bubble_data->locale, bubble_data->date_ptn, conv_data->msgTime);
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_DISPLAY_TIME_INT, (int *)conv_data->msgTime);
+ msg_date = msg_common_get_display_date(bubble_data->locale, bubble_data->date_ptn_default, bubble_data->date_ptn_year, conv_data->msgTime);
snprintf(conv_data->displayDate, sizeof(conv_data->displayDate), "%s", msg_date);
if (msg_date)
free(msg_date);
}
-
- msg_get_int_value(msgInfo, MSG_MESSAGE_NETWORK_STATUS_INT, (int *)(&conv_data->networkStatus));
- msg_get_bool_value(msgInfo, MSG_MESSAGE_READ_BOOL, &conv_data->bRead);
- msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &conv_data->bProtected);
- msg_get_int_value(msgInfo, MSG_MESSAGE_DIRECTION_INT, &conv_data->direction);
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_NETWORK_STATUS_INT, (int *)(&conv_data->networkStatus));
+ msg_get_bool_value(msgInfo, MSG_CONV_MSG_READ_BOOL, &conv_data->bRead);
+ msg_get_bool_value(msgInfo, MSG_CONV_MSG_PROTECTED_BOOL, &conv_data->bProtected);
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_DIRECTION_INT, &conv_data->direction);
bzero(conv_data->thumbNailPath, sizeof(conv_data->thumbNailPath));
- msg_get_str_value(msgInfo, MSG_MESSAGE_THUMBNAIL_PATH_STR, conv_data->thumbNailPath, DEF_IMG_PATH_LEN);
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_IMAGE_THUMB_PATH_STR, conv_data->thumbNailPath, DEF_IMG_PATH_LEN);
+
+ if (conv_data->thumbNailPath[0] == '\0') {
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_VIDEO_THUMB_PATH_STR, conv_data->thumbNailPath, DEF_IMG_PATH_LEN);
+
+ if (conv_data->thumbNailPath[0] == '\0')
+ conv_data->thumbType = BUBBLE_THUMBNAIL_VIDEO;
+ else
+ conv_data->thumbType = BUBBLE_THUMBNAIL_NONE;
+
+ } else {
+ conv_data->thumbType = BUBBLE_THUMBNAIL_IMAGE;
+ }
+
+ bzero(conv_data->audio_filename, sizeof(conv_data->audio_filename));
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_AUDIO_NAME_STR, conv_data->audio_filename, DEF_IMG_PATH_LEN);
bzero(conv_data->subject, sizeof(conv_data->subject));
- msg_get_str_value(msgInfo, MSG_MESSAGE_SUBJECT_STR, conv_data->subject, DEF_BUF_LEN_S);
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_SUBJECT_STR, conv_data->subject, DEF_BUF_LEN_S);
if (conv_data->msgType == MSG_TYPE_MMS) {
- msg_get_str_value(msgInfo, MSG_MESSAGE_SMS_DATA_STR, conv_data->msgText, DEF_MAX_MSG_TEXT_LEN); /** get body text */
- msg_get_int_value(msgInfo, MSG_MESSAGE_ATTACH_COUNT_INT, &conv_data->attachment_cnt); /** get attachment count */
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_TEXT_STR, conv_data->msgText, DEF_MAX_MSG_TEXT_LEN); /** get body text */
+ msg_get_int_value(msgInfo, MSG_CONV_MSG_ATTACH_COUNT_INT, &conv_data->attachment_cnt); /** get attachment count */
+ if (conv_data->attachment_cnt == 1)
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_ATTACH_NAME_STR, conv_data->attachment_filename, DEF_IMG_PATH_LEN);
} else if (conv_data->msgType == MSG_TYPE_MMS_NOTI) {
bzero(conv_data->msgText, sizeof(conv_data->msgText));
} else {
- msg_get_str_value(msgInfo, MSG_MESSAGE_SMS_DATA_STR, conv_data->msgText, DEF_MAX_MSG_TEXT_LEN);
+ msg_get_str_value(msgInfo, MSG_CONV_MSG_TEXT_STR, conv_data->msgText, DEF_MAX_MSG_TEXT_LEN);
}
}
return sh;
}
-static Eina_Bool __unfreeze_scroller_cb(void *data)
-{
- PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA) data;
-
- elm_scroller_gravity_set(bubble_data->scrl, 0.0, 0.0);
- if (g_isFirstLoading) {
- elm_scroller_region_show(bubble_data->scrl, 0, __calc_scroller_geometry(bubble_data), 0, 0);
- g_isFirstLoading = false;
- }
- evas_object_show(bubble_data->scrl);
-
- bubble_data->scroll_idler = NULL;
-
- evas_object_smart_callback_add(bubble_data->scrl, "edge,top", msg_ui_bubble_scroll_edge_top_cb, data);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
void __msg_resend_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
PMSG_APP_CONV_DATA_S item_data = NULL;
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+
item_data = (PMSG_APP_CONV_DATA_S)evas_object_data_get(obj, "conv_data");
msg_ui_bubble_resend_msg(bubble_data, item_data->msgId);
}
}
}
+
+static void __msg_send_failed_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+
+ PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)data;
+ PMSG_APP_CONV_DATA_S conv_data = (PMSG_APP_CONV_DATA_S)evas_object_data_get(obj, "conv_data");
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
+
+ if (bubble_data->popup) {
+ evas_object_del(bubble_data->popup);
+ bubble_data->popup = NULL;
+ }
+
+ Evas_Object *popup = elm_popup_add(cd->navi_bar);
+ elm_object_style_set(popup, "min_menustyle");
+ elm_object_part_text_set(popup, "title,text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_SENDING_FAILED_MESSAGE"));
+
+ Evas_Object *btn_close = elm_button_add(popup);
+ elm_object_style_set(btn_close, "popup_button/default");
+ elm_object_text_set(btn_close, dgettext("sys_string", "IDS_COM_BODY_CLOSE"));
+ elm_object_part_content_set(popup, "button1", btn_close);
+ evas_object_smart_callback_add(btn_close, "clicked", msg_ui_popup_close_clicked_cb, bubble_data);
+
+ Evas_Object *list = elm_list_add(popup);
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
+ evas_object_data_set(list, "conv_data", conv_data);
+
+ elm_list_item_append(list, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESEND"), NULL, NULL, __msg_resend_btn_clicked_cb, (void *)bubble_data);
+ elm_list_item_append(list, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, NULL, __msg_delete_clicked_cb, (void *)bubble_data);
+
+ elm_list_go(list);
+ elm_object_content_set(popup, list);
+ evas_object_show(popup);
+
+ bubble_data->popup = popup;
+}
+
void msg_ui_bubble_fill_bubble_contents(PMSG_BUBBLE_DATA bubble_data, PMSG_APP_CONV_DATA_S item_data)
{
D_ENTER;
evas_object_smart_callback_add(more_btn, "clicked", __msg_more_btn_clicked_cb, bubble_data);
elm_object_part_content_set(media_layout, "bubble.swallow.more", more_btn);
+ evas_object_smart_calculate(media_layout);
+
+ elm_object_part_text_set(media_layout, "msgtype_text", dgettext(MESSAGE_PKGNAME, "MMS")); // need to change string id
evas_object_show(more_btn);
}
evas_object_show(media_layout);
elm_object_part_content_set(item_data->entry, "elm.swallow.end", media_layout);
+ elm_entry_calc_force(item_data->entry);
} else if (item_data->msgType == MSG_TYPE_MMS_NOTI && item_data->networkStatus != MSG_NETWORK_RETRIEVE_SUCCESS && item_data->networkStatus != MSG_NETWORK_RETRIEVING) {
Evas_Object *prev_obj = NULL;
Evas_Object *retrieve_btn = NULL;
elm_object_part_content_set(item_data->entry, "elm.swallow.end", install_btn);
}
- if (item_data->direction == MSG_DIRECTION_TYPE_MO && item_data->networkStatus == MSG_NETWORK_SEND_FAIL) {
- /** create & show resend button */
- Evas_Object *resend_btn = elm_button_add(item_data->ly);
- elm_object_style_set(resend_btn, "send");
- elm_object_part_content_set(item_data->ly, "elm.swallow.icon2", resend_btn);
-
- evas_object_data_set(resend_btn, "conv_data", item_data);
- evas_object_smart_callback_add(resend_btn, "clicked", __msg_resend_btn_clicked_cb, bubble_data);
-
- /** create & show delete button */
- Evas_Object *del_btn = elm_button_add(item_data->ly);
- elm_object_style_set(del_btn, "cancel");
- elm_object_part_content_set(item_data->ly, "elm.swallow.icon1", del_btn);
-
- evas_object_data_set(del_btn, "conv_data", item_data);
- evas_object_smart_callback_add(del_btn, "clicked", __msg_delete_clicked_cb, bubble_data);
-
- /** elm.swallow.icon1 & elm.swallow.icon2 will be shown only when state is "content_on" */
- /** "elm,state,contents,enabled" signal make bubble state to "content_on" */
- elm_object_signal_emit(item_data->ly, "elm,state,contents,enabled", "elm");
-
- evas_object_show(resend_btn);
- evas_object_show(del_btn);
-
- item_data->del_button = del_btn;
- item_data->resend_button = resend_btn;
- }
-
/** Network status (Sending, Retrieving); */
switch (item_data->networkStatus) {
case MSG_NETWORK_SEND_FAIL:
+ if (item_data->direction == MSG_DIRECTION_TYPE_MO) {
+ if (item_data->progressbar) {
+ evas_object_del(item_data->progressbar);
+ item_data->progressbar = NULL;
+ }
+
+ item_data->failed_button = elm_button_add(item_data->entry);
+ elm_object_style_set(item_data->failed_button, "warning");
+ evas_object_show(item_data->failed_button);
+ elm_object_part_content_set(item_data->entry, "elm.swallow.icon1", item_data->failed_button);
+
+ evas_object_data_set(item_data->failed_button, "conv_data", item_data);
+ evas_object_smart_callback_add(item_data->failed_button, "clicked", __msg_send_failed_btn_clicked_cb, bubble_data);
+
+ elm_object_signal_emit(item_data->entry, "elm,state,text,status,disabled", "elm");
+ elm_object_signal_emit(item_data->entry, "elm,state,content,status,enabled", "elm");
+ } else {
+ strncpy(time_status_str, dgettext("sys_string", "IDS_COM_POP_FAILED"), sizeof(time_status_str)-1);
+ }
+ break;
case MSG_NETWORK_RETRIEVE_FAIL:
/** elm.text.status */
strncpy(time_status_str, dgettext("sys_string", "IDS_COM_POP_FAILED"), sizeof(time_status_str)-1);
elm_object_signal_emit(item_data->entry, "elm,state,text,status,disabled", "elm");
elm_object_signal_emit(item_data->entry, "elm,state,content,status,enabled", "elm");
-
-
break;
default:
/** display time */
}
if (cb_cancel == false) {
- if (!g_isVisible) {
- if (__calc_scroller_geometry(bubble_data) > MSG_BUBBLE_CONTENT_H) {
- evas_object_show(bubble_data->scrl);
- g_isVisible = true;
- } else
- evas_object_hide(bubble_data->scrl);
- }
-
elm_scroller_gravity_get(bubble_data->scrl, NULL, &scr_g);
if(!scr_g)
elm_scroller_gravity_set(bubble_data->scrl, 0.0, 1.0);
bubble_data->bubble_index--;
bubble_data->added_count++;
+ } else {
+ elm_scroller_gravity_set(bubble_data->scrl, 0.0, 0.0);
+ evas_object_show(bubble_data->scrl);
+ if (g_isFirstLoading) {
+ Evas_Coord height = __calc_scroller_geometry(bubble_data);
+ if (height <= MSG_BUBBLE_CONTENT_H)
+ elm_scroller_region_show(bubble_data->scrl, 0, 0, 0, 0);
+ else
+ elm_scroller_region_show(bubble_data->scrl, 0, height, 0, 0);
+
+ g_isFirstLoading = false;
}
- if (cb_cancel == true ||bubble_data->bubble_index < 0) {
- D_MSG("Scroller pointer = [%p]", bubble_data->scrl);
- elm_scroller_gravity_get(bubble_data->scrl, NULL, &scr_g);
- if (scr_g == 1.0 && !bubble_data->scroll_idler)
- bubble_data->scroll_idler = ecore_idler_add(__unfreeze_scroller_cb, (const void *)bubble_data);
-
bubble_data->load_animator = NULL;
bubble_data->added_count = 0;
msg_error_t err = MSG_SUCCESS;
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)bubble_data->callback_data;
- msg_struct_list_s msg_list;
+ msg_struct_list_s conv_list;
PMSG_APP_CONV_DATA_S item_data = NULL;
int i;
- err = msg_get_conversation_view_list(bubble_data->msgHandle, bubble_data->threadId, &msg_list);
+ err = msg_get_conversation_view_list(bubble_data->msgHandle, bubble_data->threadId, &conv_list);
if (err != MSG_SUCCESS)
return;
msg_ui_bubble_start_bubble_list(bubble_data);
- g_isVisible = false;
g_isFirstLoading = true;
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Bubble count = %d", msg_list.nCount);
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Bubble count = %d", conv_list.nCount);
- bubble_data->bubble_count = msg_list.nCount;
+ bubble_data->bubble_count = conv_list.nCount;
if (bubble_data->bubble_count <= 0) {
- msg_release_list_struct(&msg_list);
+ msg_release_list_struct(&conv_list);
return;
}
int folder_id = MSG_MAX_FOLDER_ID;
int msg_id = 0;
- for (i = 0; i < msg_list.nCount; i++) {
- msg_get_int_value(msg_list.msg_struct_info[i], MSG_MESSAGE_FOLDER_ID_INT, &folder_id);
+ for (i = 0; i < conv_list.nCount; i++) {
+ msg_get_int_value(conv_list.msg_struct_info[i], MSG_CONV_MSG_FOLDER_ID_INT, &folder_id);
if (folder_id == MSG_DRAFT_ID) {
- msg_get_int_value(msg_list.msg_struct_info[i], MSG_MESSAGE_ID_INT, &msg_id);
+ msg_get_int_value(conv_list.msg_struct_info[i], MSG_CONV_MSG_ID_INT, &msg_id);
D_MSG("msg_id = %d is a draft message", msg_id);
bubble_data->bubble_count--;
}
item_data = (PMSG_APP_CONV_DATA_S) calloc(1, sizeof(MSG_APP_CONV_DATA_S));
- __set_msg_data_by_conv_data(item_data, msg_list.msg_struct_info[i]);
+ __set_msg_data_by_conv_data(item_data, conv_list.msg_struct_info[i]);
bubble_data->bubble_list = eina_list_append(bubble_data->bubble_list, (const void *)item_data);
}
msg_ui_composer_message_init();
msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
- msg_ui_composer_message_set_loaded_data(cd);
+ msg_ui_composer_message_set_loaded_data(cd, false);
msg_ui_composer_message_destroy();
cd->loading_draft = false;
msg_ui_composer_editable_set(cd, EINA_TRUE);
}
- msg_release_list_struct(&msg_list);
+ msg_release_list_struct(&conv_list);
bubble_data->bubble_index = bubble_data->bubble_count - 1; // bubble_index : Message index to append on box.
bubble_data->load_animator = ecore_animator_add(msg_ui_bubble_item_load_cb, (const void *)bubble_data);
int msg_id = 0 ;
time_t msgTime = 0;
- msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &msg_id);
- msg_get_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, (int *)(&msgTime));
+ msg_get_int_value(msg, MSG_CONV_MSG_ID_INT, &msg_id);
+ msg_get_int_value(msg, MSG_CONV_MSG_DISPLAY_TIME_INT, (int *)(&msgTime));
Eina_List *l = NULL;
EINA_LIST_FOREACH (bubble_data->bubble_list, l, item_data) {
MSG_UI_LEAVE();
}
-static Eina_Bool __add_item_finish_cb(void *data)
-{
- PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA) data;
-
- elm_scroller_region_show(bubble_data->scrl, 0, __calc_scroller_geometry(bubble_data), 0, 0);
-
- bubble_data->added_list = eina_list_free(bubble_data->added_list);
-
- bubble_data->add_idler = NULL;
-
- return ECORE_CALLBACK_CANCEL;
-}
-
Eina_Bool msg_ui_bubble_item_add_cb(void *data)
{
D_ENTER;
}
if (cb_cancel == true) {
- if (!bubble_data->add_idler)
- bubble_data->add_idler = ecore_idler_add(__add_item_finish_cb, (const void *)bubble_data);
+ elm_scroller_gravity_set(bubble_data->scrl, 0.0, 0.0);
+ elm_scroller_region_show(bubble_data->scrl, 0, __calc_scroller_geometry(bubble_data), 0, 0);
bubble_data->add_animator = NULL;
return ECORE_CALLBACK_CANCEL;
}
+ elm_scroller_gravity_set(bubble_data->scrl, 0.0, 1.0);
__add_bubble_item(bubble_data, pack_info->add_item, pack_info->pack_type, pack_info->rel_obj);
bubble_data->realized_list = eina_list_append(bubble_data->realized_list, pack_info->add_item);
Eina_List *l = NULL;
PMSG_APP_CONV_DATA_S item_data = NULL;
- msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &msg_id);
+ msg_get_int_value(msg, MSG_CONV_MSG_ID_INT, &msg_id);
EINA_LIST_FOREACH(bubble_data->bubble_list, l, item_data) {
if (item_data && item_data->msgId == msg_id)
PMSG_APP_CONV_DATA_S insert_data = NULL;
BUBBLE_PACK_INFO *add_pack_info = NULL;
- msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &msg_id);
+ msg_get_int_value(msg, MSG_CONV_MSG_ID_INT, &msg_id);
Eina_List *l;
EINA_LIST_FOREACH(bubble_data->added_list, l, add_pack_info) {
if (bubble_data->bubble_count == 1 && isDraft == false) {
bubble_data->bubble_count = 0;
- err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId);
+ err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
} else {
err = msg_delete_message(bubble_data->msgHandle, msg_id);
msg_ui_bubble_list_load(bubble_data);
return;
}
+
+void msg_ui_bubble_refresh_msg_lock_status(PMSG_BUBBLE_DATA bubble_data, int msg_id)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !bubble_data);
+ PMSG_APP_CONV_DATA_S conv_data = NULL;
+ Eina_List *l;
+ bool is_found = false;
+
+ EINA_LIST_FOREACH(bubble_data->bubble_list, l, conv_data) {
+ if (conv_data) {
+ if (msg_id == conv_data->msgId) {
+ conv_data->bProtected = !conv_data->bProtected;
+ msg_ui_bubble_fill_bubble_contents(bubble_data, conv_data);
+ is_found = !is_found;
+ break;
+ }
+ }
+ }
+
+ if (!is_found)
+ D_MSG("given msg_id(%d) is not found within current bubble data", msg_id);
+
+ return;
+}
+
msg_ui_bubble_init_bubble_list(bubble_data);
- if (bubble_data->date_ptn) {
- free(bubble_data->date_ptn);
- bubble_data->date_ptn = NULL;
+ if (bubble_data->date_ptn_default) {
+ free(bubble_data->date_ptn_default);
+ bubble_data->date_ptn_default = NULL;
+ }
+
+ if (bubble_data->date_ptn_year) {
+ free(bubble_data->date_ptn_year);
+ bubble_data->date_ptn_year = NULL;
}
if (bubble_data->time_12h_ptn) {
ecore_idler_del(bubble_data->retrieve_idler);
bubble_data->retrieve_idler = NULL;
}
-
- if (bubble_data->add_idler) {
- ecore_idler_del(bubble_data->add_idler);
- bubble_data->add_idler = NULL;
- }
-
- if (bubble_data->scroll_idler) {
- ecore_idler_del(bubble_data->scroll_idler);
- bubble_data->scroll_idler = NULL;
- }
-
if (bubble_data->bubble_layout) {
evas_object_del(bubble_data->bubble_layout);
bubble_data->bubble_layout = NULL;
}
+ if (bubble_data->title_button) {
+ evas_object_del(bubble_data->title_button);
+ bubble_data->title_button = NULL;
+ }
if (bubble_data->noti_fd) {
if (heynoti_unsubscribe(bubble_data->noti_fd, "setting_time_changed", msg_ui_bubble_timezone_change_cb) == -1) {
bubble_data->viewmode = BUBBLE_NORMAL_VIEW;
/* To avoid a fluctuation of bubble list on split view. */
- elm_scroller_region_show(bubble_data->scrl, 0, 0, 0, 0);
+ //elm_scroller_region_show(bubble_data->scrl, 0, 0, 0, 0);
D_LEAVE;
}
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
elm_object_part_content_set(bubble_layout, "elm.swallow.content", scroller);
evas_object_smart_callback_add(scroller, "scroll,drag,start", msg_ui_bubble_scroll_drag_start_cb, user_data);
+ evas_object_event_callback_add(bubble_layout, EVAS_CALLBACK_MOUSE_UP, msg_ui_bubble_main_layout_clicked_cb, bubble_data->callback_data);
bubble_data->parent_layout = parent;
bubble_data->bubble_layout = bubble_layout;
msg_ui_bubble_get_time_format(bubble_data);
bubble_data->time_12h_ptn = msg_common_get_date_best_pattern(bubble_data->locale, MSG_UI_TIME_PATTERN_12H);
bubble_data->time_24h_ptn = msg_common_get_date_best_pattern(bubble_data->locale, MSG_UI_TIME_PATTERN_24H);
- bubble_data->date_ptn = msg_common_get_date_best_pattern(bubble_data->locale, UDAT_YEAR_NUM_MONTH_DAY);
+ bubble_data->date_ptn_default = msg_common_get_date_best_pattern(bubble_data->locale, MSG_UI_DATE_PATTERN_DEFAULT);
+ bubble_data->date_ptn_year = msg_common_get_date_best_pattern(bubble_data->locale, MSG_UI_DATE_PATTERN_YEAR);
bubble_data->noti_fd = heynoti_init();
if (bubble_data->noti_fd == -1) {
bubble_data->toolbar_item[CONTROLBAR_ITEM_2] = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, bubble_data->callback_data);
elm_object_item_part_content_set(bubble_data->toolbar_item[CONTROLBAR_ITEM_2], "object", videocall_button);
+ /* Add / View contact */
bubble_data->toolbar_item[CONTROLBAR_ITEM_3] = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, bubble_data->callback_data);
elm_object_item_part_content_set(bubble_data->toolbar_item[CONTROLBAR_ITEM_3], "object", addcontact_button);
+
+ /** block / unblock */
+ bool isBlock = false;
+ msg_error_t err;
+ Evas_Object *block_button = NULL;
+
+ err = msg_common_check_block_number(bubble_data->msgHandle, bubble_data->addr_list.addr_info[0].address, &isBlock);
+
+ if (isBlock == false) {
+ block_button = msg_ui_bubble_toolbar_btn_create(toolbar, MSG_TITLE_ICON_BLOCK, NULL);
+ evas_object_smart_callback_add(block_button, "clicked", msg_ui_bubble_ctlbar_block_cb, bubble_data);
+ } else {
+ block_button = msg_ui_bubble_toolbar_btn_create(toolbar, MSG_TITLE_ICON_UNBLOCK, NULL);
+ evas_object_smart_callback_add(block_button, "clicked", msg_ui_bubble_ctlbar_unblock_cb, bubble_data);
+ }
+ bubble_data->toolbar_item[CONTROLBAR_ITEM_4] = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, bubble_data->callback_data);
+ elm_object_item_part_content_set(bubble_data->toolbar_item[CONTROLBAR_ITEM_4], "object", block_button);
+
+ if (err != MSG_SUCCESS) {
+ elm_object_item_disabled_set(bubble_data->toolbar_item[CONTROLBAR_ITEM_4], EINA_TRUE);
+ elm_object_disabled_set(block_button, EINA_TRUE);
+ }
} else if (num_type == WORD_TYPE_EMAIL) {
Evas_Object *email_button = msg_ui_bubble_toolbar_btn_create(toolbar, NULL, dgettext("sys_string","IDS_COM_BODY_EMAIL"));
evas_object_smart_callback_add(email_button, "clicked", msg_ui_bubble_ctlbar_email_cb, bubble_data->callback_data);
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, pData == NULL, "PMSG_BUBBLE_DATA is NULL");
- msg_reg_storage_change_callback(pData->msgHandle, &msg_ui_bubble_msg_storage_change_cb, (void *)pData);
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)pData->callback_data;
+
+ msg_reg_storage_change_callback(pData->msgHandle, &msg_ui_bubble_msg_storage_change_cb, (void *)cd);
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
}
#include <regex.h>
#include "appsvc.h"
#include <status.h>
+#include <time.h>
void msg_ui_bubble_launch_voice_call(const char *call_num)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !call_num);
- char *num_str = NULL;
-
- num_str = msg_ui_bubble_get_trimmed_number(call_num);
-
- bundle *b = bundle_create();
+ char *num_str = msg_ui_bubble_get_trimmed_number(call_num);
- if (!b)
- return;
+ service_h svc_handle = NULL;
+ char tel_num[DEF_BUF_LEN] = {0,};
+ char contact_id[DEF_BUF_LEN_D] = {0,};
- bundle_add(b, MSG_BUNDLE_KEY_VCALL_TYPE, MSG_BUNDLE_VALUE_VCALL_MO);
- bundle_add(b, MSG_BUNDLE_KEY_VCALL_HANDLE, MSG_BUNDLE_VALUE_VCALL_HANDLE);
- bundle_add(b, MSG_BUNDLE_KEY_VCALL_PARTY_NUM, num_str);
- bundle_add(b, MSG_BUNDLE_KEY_VCALL_CLI_CAUSE, MSG_BUNDLE_VALUE_VCALL_FALSE);
- bundle_add(b, MSG_BUNDLE_KEY_VCALL_FORWARDED, MSG_BUNDLE_VALUE_VCALL_FALSE);
+ if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
+ D_EMSG("service_create() is failed !!");
+ } else {
+ service_set_operation(svc_handle, "http://tizen.org/appcontrol/operation/vt");
- aul_launch_app(VIDEO_CALL_PKG_NAME, b);
+ if (num_str) {
+ snprintf(tel_num, sizeof(tel_num), "tel:%s", num_str);
+ service_set_uri(svc_handle, tel_num);
+ }
+ snprintf(contact_id, sizeof(contact_id), "%d", -1);
+ service_add_extra_data(svc_handle, "ctindex", contact_id);
- bundle_free(b);
+ service_send_launch_request(svc_handle, NULL, NULL);
+ service_destroy(svc_handle);
+ }
- if (num_str)
+ if (num_str) {
free(num_str);
+ num_str = NULL;
+ }
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
}
bubbleData->select_info = NULL;
}
- if (bubbleData->deleted_info) {
- evas_object_del(bubbleData->select_info);
- bubbleData->select_info = NULL;
- }
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
}
evas_object_show(box);
cancel_btn = elm_button_add(popup);
+ elm_object_style_set(cancel_btn, "popup_button/default");
elm_object_text_set(cancel_btn, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
elm_object_part_content_set(popup, "button1", cancel_btn);
evas_object_smart_callback_add(cancel_btn, "clicked", __msg_delete_progress_cancel_clicked_cb, pData);
MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !pData);
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)pData->callback_data;
+
if (!pData->select_info) {
- pData->select_info = elm_notify_add(ug_get_window());
+ pData->select_info = elm_notify_add(cd->content_layout);
elm_notify_orient_set(pData->select_info, ELM_NOTIFY_ORIENT_BOTTOM);
pData->selectioninfo_layout = elm_layout_add(pData->select_info);
}
if (pData->isRotate)
- elm_layout_theme_set(pData->selectioninfo_layout, "standard", "selectioninfo", "horizontal/bottom_64");
+ elm_layout_theme_set(pData->selectioninfo_layout, "standard", "selectioninfo", "horizontal/bottom_12");
else
- elm_layout_theme_set(pData->selectioninfo_layout, "standard", "selectioninfo", "vertical/bottom_64");
+ elm_layout_theme_set(pData->selectioninfo_layout, "standard", "selectioninfo", "vertical/bottom_12");
if (pData->check_cnt <= 0) {
evas_object_hide(pData->select_info);
elm_object_item_disabled_set(pData->toolbar_item[CONTROLBAR_ITEM_1], EINA_TRUE);
} else {
char text[128] = { '0', };
- if (pData->check_cnt == 1)
- snprintf(text, sizeof(text), dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_1_MESSAGE_SELECTED"));
- else
- snprintf(text, sizeof(text), dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_PD_MESSAGES_SELECTED"), pData->check_cnt);
+ snprintf(text, sizeof(text), "%s (%d)", dgettext(MESSAGE_PKGNAME, "IDS_MSGC_POP_SPACE_SELECTED"), pData->check_cnt);
edje_object_part_text_set(_EDJ(pData->selectioninfo_layout), "elm.text", text);
evas_object_show(pData->select_info);
}
}
+void msg_ui_bubble_status_message_post(PMSG_BUBBLE_DATA pData, char *msg)
+{
+ D_ENTER;
+ MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !pData);
+
+ if (pData->popup) {
+ evas_object_del(pData->popup);
+ pData->popup = NULL;
+ }
+
+ status_message_post(msg);
+}
+
void msg_ui_bubble_contact_info_update(PMSG_BUBBLE_DATA pData)
{
D_MSG("Locale = %s", pData->locale);
}
+char *msg_ui_bubble_create_export_folder_name(void)
+{
+ struct tm t;
+ time_t cur_time;
+ cur_time = (time_t)time(NULL);
+
+ char folder_name[DEF_BUF_LEN+1] = {0,};
+
+ localtime_r(&cur_time, &t);
+
+ // folder name format (yyyymmddHHMMSS)
+ snprintf(folder_name, sizeof(folder_name), "Message_%04d%02d%02d%02d%02d%02d",\
+ t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
+ D_MSG("export folder name [%s]", folder_name);
+
+ return strdup(folder_name);
+}
+
+char *msg_ui_bubble_create_export_file_name(void)
+{
+ struct tm t;
+ time_t cur_time;
+ cur_time = (time_t) time(NULL);
+ char file_name[DEF_BUF_LEN+1] = {0,};
+
+ localtime_r(&cur_time, &t);
+
+ // folder name format (yyyymmddHHMM.txt)
+ snprintf(file_name, sizeof(file_name), "Message_%04d%02d%02d%02d%02d.txt",\
+ t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min);
+ D_MSG("export folder name [%s]", file_name);
+
+ return strdup(file_name);
+}
+
+char *msg_ui_bubble_create_export_folder(PMSG_BUBBLE_DATA pData, const char* folder_name)
+{
+ char folder_path[DEF_BUF_LEN+1] = {0,};
+
+ if (ecore_file_exists(MSG_BUBBLE_EXPORT_DIR) == EINA_FALSE) {
+ if(ecore_file_mkdir(MSG_BUBBLE_EXPORT_DIR) == EINA_FALSE) {
+ return NULL;
+ }
+ }
+
+ if (folder_name) {
+ if (pData->backup_type == BUBBLE_BACKUP_TYPE_SD)
+ snprintf(folder_path, sizeof(folder_path), MSG_BUBBLE_EXPORT_DIR"/%s", folder_name);
+ else if (pData->backup_type == BUBBLE_BACKUP_TYPE_EMAIL)
+ snprintf(folder_path, sizeof(folder_path), MSG_BUBBLE_EXPORT_TEMPDIR"/%s", folder_name);
+ else
+ return NULL;
+ D_MSG("export folder name [%s]", folder_path);
+
+ if (ecore_file_exists(folder_path) == EINA_FALSE) {
+ if(ecore_file_mkdir(folder_path) == EINA_FALSE)
+ return NULL;
+ }
+ } else {
+ return NULL;
+ }
+
+ return strdup(folder_path);
+}
+
+char *msg_ui_bubble_create_export_string(PMSG_BUBBLE_DATA pData, msg_struct_t msg)
+{
+ D_ENTER;
+ MSG_UI_RETVM_IF(MSG_UI_LEVEL_ERR, !pData || !msg, NULL, "Message text is NULL!");
+
+ int folder_id;
+ time_t msgtime = 0;
+ int msg_type;
+ char *date_str = NULL;
+ char *time_str = NULL;
+ char sender[DEF_BUF_LEN+1] = {0,};
+ char subject[DEF_BUF_LEN_S+1] = {0,};
+ char thumbnail_path[DEF_BUF_LEN+1] = {0,};
+ char msg_text[DEF_BUF_LEN_L+1] = {0,};
+
+ char export_str[2*DEF_BUF_LEN_L+1] = {0,};
+
+ /* determine sender name & skip draft box message */
+ msg_get_int_value(msg, MSG_CONV_MSG_FOLDER_ID_INT, &folder_id);
+ if (folder_id == MSG_INBOX_ID) {
+ if (pData->addr_list.addr_cnt == 1) {
+ if (pData->addr_list.addr_info[0].contact_id > 0 && pData->addr_list.addr_info[0].name[0] != '\0')
+ snprintf(sender, sizeof(sender), "%s", pData->addr_list.addr_info[0].name);
+ else if (pData->addr_list.addr_info[0].address[0] != '\0')
+ snprintf(sender, sizeof(sender), "%s", pData->addr_list.addr_info[0].address);
+ else
+ snprintf(sender, sizeof(sender), dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+ }
+ } else if (folder_id == MSG_OUTBOX_ID || folder_id == MSG_SENTBOX_ID) {
+ snprintf(sender, sizeof(sender), "%s", dgettext(MESSAGE_PKGNAME, "Me"));
+ } else {
+ D_EMSG("invalid_folder_id [%d]", folder_id);
+ snprintf(sender, sizeof(sender), "%s", dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+ }
+
+ /* Message sent / recieved time */
+ msg_get_int_value(msg, MSG_CONV_MSG_DISPLAY_TIME_INT, (int *)&msgtime);
+ date_str = msg_common_get_formatted_date(pData->locale, pData->date_ptn_year, &msgtime);
+ time_str = msg_common_get_formatted_date(pData->locale, pData->time_12h_ptn, &msgtime);
+
+ /* subject */
+ msg_get_int_value(msg, MSG_CONV_MSG_TYPE_INT, &msg_type);
+ if (msg_type == MSG_TYPE_MMS || msg_type == MSG_TYPE_MMS_NOTI) {
+ msg_get_str_value(msg, MSG_CONV_MSG_SUBJECT_STR, subject, DEF_BUF_LEN_S);
+ msg_get_str_value(msg, MSG_CONV_MSG_IMAGE_THUMB_PATH_STR, thumbnail_path, DEF_BUF_LEN);
+ // Todo : sound path
+ }
+
+ /* msg text */
+ msg_get_str_value(msg, MSG_CONV_MSG_TEXT_STR, msg_text, DEF_BUF_LEN_L);
+
+ // (DateTime,sender: [Subject] body text)
+ if (msg_type > MSG_TYPE_INVALID && msg_type < MSG_TYPE_MMS) {
+ snprintf(export_str, sizeof(export_str), "%s %s, %s: %s\n", date_str, time_str, sender, msg_text);
+ } else if (msg_type >= MSG_TYPE_MMS) {
+ if (subject[0] !='\0' && thumbnail_path[0] != '\0') {
+ snprintf(export_str, sizeof(export_str), "%s %s, %s: [%s] %s, %s\n", date_str, time_str, sender, subject, dgettext("sts_string", "image"), msg_text);
+ } else if (subject[0] !='\0') {
+ snprintf(export_str, sizeof(export_str), "%s %s, %s: [%s] %s\n", date_str, time_str, sender, subject, msg_text);
+ } else if (thumbnail_path[0] != '\0') {
+ snprintf(export_str, sizeof(export_str), "%s %s, %s: %s, %s\n", date_str, time_str, sender, dgettext("sts_string", "image"), msg_text);
+ } else {
+ snprintf(export_str, sizeof(export_str), "%s %s, %s: %s\n", date_str, time_str, sender, msg_text);
+ }
+ }
+
+ return strdup(export_str);
+}
+
bool msg_is_sms(int msg_type)
{
int result = false;
#include <appsvc.h>
#include <app_service.h>
#include <ui-gadget.h>
-#include <aul.h>
-#include <aul_service.h>
#include <Ecore_X.h>
#include <contacts-svc.h>
D_LEAVE;
}
-static void __ug_contacts_checklist_result_cb(ui_gadget_h ug, service_h result, void *priv)
+static void __ug_contact_phonui_result_cb(ui_gadget_h ug, service_h result, void *priv)
{
D_ENTER;
D_MSG_RETM_IF(!ug,"ug data is NULL");
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)priv;
D_MSG_RETM_IF(cd->recipient == NULL,"Recipient data is NULL");
- int contact_index;
+ int contact_index = 0;
+ int person_index = 0;
int *num_id_list = NULL;
int len = 0;
int i = 0;
-
- const char *number_str = NULL;
- char *service_val = NULL;
+ int ct_ret = CTS_SUCCESS;
const char *current_number = NULL;
+ char *number_str = NULL;
+ char *service_val = NULL;
char *entry_text = NULL;
-
- bool bMaxCount = false;
- bool bInvalidNum = false;
- bool bDup = false;
+ MSG_BOOL bMaxCount = FALSE;
+ MSG_BOOL bInvalidNum = FALSE;
+ MSG_BOOL bDup = FALSE;
+ MSG_BOOL isContactId = FALSE;
service_get_extra_data(result, CT_UG_BUNDLE_RESULT_NUMBER_ID_LIST, &service_val);
- D_MSG_RETM_IF(!service_val, "bundle_val data is NULL");
- num_id_list = (int *)g_base64_decode(service_val, (gsize *)&len);
+ if (service_val) {
+ /* contact id list */
+ num_id_list = (int *)g_base64_decode(service_val, (gsize *)&len);
+ isContactId = TRUE;
+ } else {
+ /* phonelog id list*/
+ service_get_extra_data(result, MSG_BUNDLE_KEY_GET_SEL_LIST, &service_val);
+ D_MSG_RETM_IF(!service_val, "service_val is NULL");
+
+ num_id_list = (int *)g_base64_decode(service_val, (gsize *)&len);
+ }
+
D_MSG_RETM_IF(!num_id_list,"number_id list is NULL");
/* get entry text */
entry_text = strdup(current_number);
}
- for (i = 0; i < len / sizeof(int); i++) {
+ D_MSG("len = %d", len/sizeof(int));
+ for (i = 0; i < len / sizeof(int); i++) {
if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
- bMaxCount = true;
+ bMaxCount = TRUE;
break;
}
+ if (isContactId) {
+ /* contact id list */
CTSvalue *value = NULL;
+ CTSstruct *contact = NULL;
+
contact_index = contacts_svc_get_contact_value(CTS_GET_NUMBER_VALUE, num_id_list[i], &value);
if (contact_index <= 0 ) {
- D_EMSG("Fail to get contact value");
+ D_EMSG("Fail to get contact value contact_index = %d", contact_index);
continue;
}
- number_str = contacts_svc_value_get_str(value, CTS_NUM_VAL_NUMBER_STR);
- D_MSG("selected number_id = %d, contact_id = %d, number = %s", num_id_list[i], contact_index, number_str);
+ /* get number str */
+ number_str = strdup(contacts_svc_value_get_str(value, CTS_NUM_VAL_NUMBER_STR));
+ contacts_svc_value_free(value);
+ value = NULL;
+
+ /* get person id */
+ ct_ret = contacts_svc_get_contact(contact_index, &contact);
+ if (ct_ret != CTS_SUCCESS) {
+ D_EMSG("contacts_svc_get_contact is failed ct_ret = %d", ct_ret);
if (number_str) {
- if (msg_ui_composer_recipient_duplicate_check(cd->recipient, number_str) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
- bDup = true;
- contacts_svc_value_free(value);
+ free(number_str);
+ number_str = NULL;
+ }
continue;
}
- if (msg_ui_composer_recipient_vaild_check(number_str) == EINA_FALSE) {
- bInvalidNum = true;
- } else {
- msg_ui_composer_recipient_append(cd->recipient, number_str, contact_index);
+ ct_ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &value);
+ if (ct_ret != CTS_SUCCESS) {
+ D_EMSG("contacts_svc_struct_get_value is failed ct_ret = %d", ct_ret);
+ contacts_svc_struct_free(contact);
+ if (number_str) {
+ free(number_str);
+ number_str = NULL;
+ }
+ continue;
}
- } else {
- D_EMSG("contact index[%d] is unuseable !!", contact_index);
- }
+ person_index = contacts_svc_value_get_int(value, CTS_BASE_VAL_PERSON_ID_INT);
contacts_svc_value_free(value);
- }
+ contacts_svc_struct_free(contact);
- /* set entry text */
- if (entry_text) {
- msg_ui_composer_recipient_entry_text_set(cd->recipient, entry_text);
- g_free(entry_text);
- }
+ D_MSG("selected number_id = %d, contact_id = %d, person_id = %d, number = %s", num_id_list[i], contact_index, person_index, number_str);
- D_MSG("bMaxCount = %d, bInvalidNum = %d, bDup = %d", bMaxCount, bInvalidNum, bDup);
- if (bMaxCount) {
- msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
- } else if (bInvalidNum) {
- msg_ui_composer_status_btn_popup_show(cd, MSGC_STR_NOTI_RECIPIENT_INVALID, 0, MSGC_STR_BUTTON_OK);
- } else if (bDup) {
- msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
+ if (number_str) {
+ if (msg_ui_composer_recipient_duplicate_check(cd->recipient, number_str) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+ bDup = TRUE;
+ free(number_str);
+ number_str = NULL;
+ continue;
}
- g_free(num_id_list);
+ if (msg_ui_composer_recipient_vaild_check(number_str) == EINA_FALSE) {
+ bInvalidNum = TRUE;
+ } else {
+ msg_ui_composer_recipient_append(cd->recipient, number_str, person_index);
+ }
- D_LEAVE;
+ free(number_str);
+ number_str = NULL;
+ } else {
+ D_EMSG("contact id %d, person id %d is unuseable !!", contact_index, person_index);
+ }
+ } else {
+ /* phonelog id list */
+ CTSvalue *plog = NULL;
+ int ret = contacts_svc_get_phonelog(num_id_list[i], &plog);
+ if (ret != CTS_SUCCESS) {
+ D_EMSG("Fail to get phonlog value ret = %d", ret);
+ continue;
}
-static void __ug_calllog_return_cb(ui_gadget_h ug, service_h result, void *priv)
-{
- D_ENTER;
- MSG_COMPOSER_VIEW_DATA_S *cd = NULL;
+ number_str = strdup(contacts_svc_value_get_str(plog, CTS_PLOG_VAL_NUMBER_STR));
+ contact_index = contacts_svc_value_get_int(plog, CTS_PLOG_VAL_RELATED_ID_INT);
- bool bMaxCount = false;
- bool bInvalidNum = false;
- bool bDup = false;
+ contacts_svc_value_free(plog);
- if (!ug || !priv || !result) {
- D_EMSG("parameter error ug = %p, priv = %p, result = %p", ug, priv, result);
- return;
+ if (number_str) {
+ if (msg_ui_composer_recipient_duplicate_check(cd->recipient, number_str) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+ bDup = TRUE;
+ free(number_str);
+ number_str = NULL;
+ continue;
}
- cd = (MSG_COMPOSER_VIEW_DATA_S *)priv;
- D_MSG_RETM_IF(cd->recipient == NULL, "Recipient Data is NULL");
-
- int *list = NULL;
- int len = 0;
- int i = 0;
- char *encoded_str = NULL;
-
- service_get_extra_data(result, MSG_BUNDLE_KEY_GET_SEL_LIST, &encoded_str);
- if (encoded_str)
- list = (int *)g_base64_decode(encoded_str, (gsize *)&len);
-
- for (i = 0; i < len / sizeof(int); i++) {
-
- if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
- bMaxCount = true;
- break;
+ if (msg_ui_composer_recipient_vaild_check(number_str) == EINA_FALSE) {
+ bInvalidNum = TRUE;
+ } else {
+ msg_ui_composer_recipient_append(cd->recipient, number_str, contact_index);
}
- CTSvalue *plog = NULL;
- int ret = contacts_svc_get_phonelog(list[i], &plog);
- if (ret == CTS_SUCCESS) {
- const char *number = contacts_svc_value_get_str(plog, CTS_PLOG_VAL_NUMBER_STR);
- if (number) {
- if (msg_ui_composer_recipient_duplicate_check(cd->recipient, number) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
- bDup = true;
- contacts_svc_value_free(plog);
- continue;
+ free(number_str);
+ number_str = NULL;
}
-
- if (msg_ui_composer_recipient_vaild_check(number) == EINA_FALSE) {
- bInvalidNum = true;
}
-
- int contact_id = contacts_svc_value_get_int(plog, CTS_PLOG_VAL_RELATED_ID_INT);
-
- msg_ui_composer_recipient_append(cd->recipient, number, contact_id);
}
- contacts_svc_value_free(plog);
- }
+ /* set entry text */
+ if (entry_text) {
+ msg_ui_composer_recipient_entry_text_set(cd->recipient, entry_text);
+ g_free(entry_text);
}
D_MSG("bMaxCount = %d, bInvalidNum = %d, bDup = %d", bMaxCount, bInvalidNum, bDup);
msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
}
- g_free(list);
+ free(num_id_list);
+
D_LEAVE;
}
Evas_Object *entry;
char *str = NULL;
char *tmp_memo = NULL;
- char *memo_image = NULL;
char buf[DEF_BUF_LEN_S] = { 0, };
int img_count = 0;
int txt_count = 0;
return;
}
- if (service_get_extra_data(result, MSG_BUNDLE_KEY_IMAGE, &str) == SERVICE_ERROR_NONE) {
- if (str)
- img_count = atoi(str);
- }
+ if (service_get_extra_data(result, MSG_BUNDLE_KEY_PATH, &str) == SERVICE_ERROR_NONE) {
+ gchar **split_str = NULL;
+
+ split_str = g_strsplit_set(str, "\n", -1);
- D_MSG("[MEMO] attach image count : %d", img_count);
+ if (split_str) {
+ int count = g_strv_length(split_str);
- /*if image memo then attach image */
- if (img_count > 0) {
- for (i = 1; i <= img_count; i++) {
- snprintf(buf, sizeof(buf)-1, "image%d", i);
- if (service_get_extra_data(result, buf, &memo_image) == SERVICE_ERROR_NONE) {
- if (memo_image)
- cd->attachlist = eina_list_append(cd->attachlist, g_strdup(memo_image));
+ for (i = 0; i < count; i++) {
+ if (split_str[i] && strlen(split_str[i])) {
+ D_MSG("%dth split_str = (%s)", i, split_str[i]);
+ cd->attachlist = eina_list_append(cd->attachlist, g_strdup(split_str[i]));
+ }
}
+
+ g_strfreev(split_str);
}
+
}
if (service_get_extra_data(result, MSG_BUNDLE_KEY_TEXT, &str) == SERVICE_ERROR_NONE) {
return;
}
+ if (service_get_extra_data(result, MSG_BUNDLE_KEY_REFRESH_CONV, &msgid_str) == SERVICE_ERROR_NONE) {
+ if (msgid_str)
+ msg_id = atoi(msgid_str);
+
+ D_MSG("Refresh request msg id(%d) from viewer", msg_id);
+ msg_ui_bubble_refresh_msg_lock_status(cd->bubble_data, msg_id);
+ return;
+ }
+
D_LEAVE;
}
return ug;
}
-ui_gadget_h ug_contact_checklist_create(void *data)
+ui_gadget_h ug_contact_phoneui_create(void *data)
{
D_ENTER;
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETVM_IF(cd == NULL, NULL, "Composer data is NULL");
ui_gadget_h ug;
struct ug_cbs cbs = {0,};
return NULL;
}
- char contact_ug[DEF_BUF_LEN] = { 0, };
+ char request_number[DEF_BUF_LEN_D + 1] = { 0, };
- snprintf(contact_ug, sizeof(contact_ug)-1, "%d", CT_UG_REQUEST_CHECK_FOR_NUMBER);
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TYPE, contact_ug);
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_REQUEST_TYPE, MSG_BUNDLE_VALUE_CONTACT_CHECK_LIST);
+ snprintf(request_number, sizeof(request_number)-1, "%d", CT_UG_REQUEST_CHECK_FOR_NUMBER);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TYPE, request_number);
cbs.layout_cb = __ug_layout_cb;
- cbs.result_cb = __ug_contacts_checklist_result_cb;
+ cbs.result_cb = __ug_contact_phonui_result_cb;
cbs.destroy_cb = __ug_closed_cb;
cbs.priv = data;
- ug = ug_create(cd->ug, TXT_UG_NAME_CONTACT, UG_MODE_FULLVIEW, svc_handle, &cbs);
+ ug = ug_create(cd->ug, TXT_UG_NAME_CONTACT_PHONEUI, UG_MODE_FULLVIEW, svc_handle, &cbs);
service_destroy(svc_handle);
D_LEAVE;
- return ug;
-}
-
-ui_gadget_h ug_calllog_create(void *data)
-{
- D_ENTER;
-
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
- ui_gadget_h ug;
- struct ug_cbs cbs = { 0, };
-
- service_h svc_handle = NULL;
-
- if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
- D_EMSG("service_create() is failed !!");
- return NULL;
- }
-
- cbs.layout_cb = __ug_layout_cb;
- cbs.result_cb = __ug_calllog_return_cb;
- cbs.destroy_cb = __ug_closed_cb;
- cbs.priv = data;
- ug = ug_create(cd->ug, TXT_UG_NAME_LOG, UG_MODE_FULLVIEW, svc_handle, &cbs);
-
- service_destroy(svc_handle);
return ug;
}
return NULL;
}
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TYPE, MSG_BUNDLE_VALUE_SELECT);
+
ug = ug_create(cd->ug, TXT_UG_NAME_MEMO, UG_MODE_FULLVIEW, svc_handle, &cbs);
service_destroy(svc_handle);
return COMPOSER_RETURN_FAIL;
}
+ service_set_window(svc_handle, elm_win_xwindow_get(cd->main_window));
service_set_operation(svc_handle, SERVICE_OPERATION_CREATE_CONTENT);
service_set_mime(svc_handle, "image/jpg");
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_CALLER, MESSAGE_PKGNAME);
return COMPOSER_RETURN_FAIL;
}
+ service_set_window(svc_handle, elm_win_xwindow_get(cd->main_window));
service_set_operation(svc_handle, SERVICE_OPERATION_CREATE_CONTENT);
service_set_mime(svc_handle, "video/3gp");
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_CALLER, MESSAGE_PKGNAME);
external_ug = ug_myfile_create(cd);
break;
- case COMPOSER_EXT_TYPE_LOG:
- external_ug = ug_calllog_create(cd);
- break;
-
- case COMPOSER_EXT_TYPE_CONTACTLIST:
- external_ug = ug_contact_checklist_create(cd);
- break;
-
case COMPOSER_EXT_TYPE_NAMECARD:
external_ug = ug_namecard_create(cd);
break;
case COMPOSER_EXT_TYPE_MEMO:
external_ug = ug_memo_create(cd);
break;
+
case COMPOSER_EXT_TYPE_MSGVIEWER:
external_ug = ug_msgviewer_create(cd, reserved);
break;
+ case COMPOSER_EXT_TYPE_CONTACT_PHONEUI:
+ external_ug = ug_contact_phoneui_create(cd);
+ break;
+
default:
D_MSG("ERROR ext type = %d!!!!!!!!!!!!", ext_type);
ret = COMPOSER_RETURN_FAIL;
switch (ext_type) {
case COMPOSER_EXT_TYPE_GALLERY:
case COMPOSER_EXT_TYPE_MYFILE:
- case COMPOSER_EXT_TYPE_LOG:
- case COMPOSER_EXT_TYPE_CONTACTLIST:
case COMPOSER_EXT_TYPE_NAMECARD:
case COMPOSER_EXT_TYPE_CALENDAR:
case COMPOSER_EXT_TYPE_MEMO:
case COMPOSER_EXT_TYPE_MSGVIEWER:
+ case COMPOSER_EXT_TYPE_CONTACT_PHONEUI:
ret = msg_ui_composer_external_ug_call(cd, ext_type, reserved);
break;
int win_h = 0;
if (ug == NULL || priv == NULL) {
- D_EMSG("[ASSERT] ug = %p, priv = %p", ug, priv);
+ D_EMSG("ug = %p, priv = %p", ug, priv);
return NULL;
}
cd->main_window = ug_get_window();
if (cd->main_window == NULL) {
- D_EMSG("[ASSERT] main window is NULL");
+ D_EMSG("main window is NULL");
return NULL;
}
cd->window_h = win_h;
D_MSG("screen width = %d, screen_height = %d", win_w, win_h);
- cd->base = msg_ui_composer_layout_create(cd->main_window, true);
+ bool show_indicator = true;
+ char *indicator = NULL;
+
+ service_get_extra_data(data, MSG_BUNDLE_KEY_INDICATOR_MODE, &indicator);
+ if (indicator && g_strcmp0(indicator, MSG_BUNDLE_VALUE_NO_INDICATOR) == 0)
+ show_indicator = false;
+
+ cd->base = msg_ui_composer_layout_create(cd->main_window, show_indicator);
if (cd->base == NULL) {
+ D_EMSG("cd->base is NULL");
return NULL;
}
char *from = NULL;
char *thread_id = NULL;
char *msg_id = NULL;
+ char *composer_mode = NULL;
+ char *operation = NULL;
cd->bg = msg_ui_composer_bg_create(cd->base);
elm_object_part_content_set(cd->base, "elm.swallow.bg", cd->bg);
elm_object_style_set(cd->bg, "edit_mode");
+ if (service_get_operation(data, &operation) == SERVICE_ERROR_NONE && operation)
+ cd->isAppControl = true;
+ else
+ cd->isAppControl = false;
+
service_get_extra_data(data, MSG_BUNDLE_KEY_FROM, &from);
if (from && g_strcmp0(from, MSG_BUNDLE_VALUE_INTERNAL) == 0)
service_get_extra_data(data, MSG_BUNDLE_KEY_THREAD_ID, &thread_id);
service_get_extra_data(data, MSG_BUNDLE_KEY_MSG_ID, &msg_id);
- if (thread_id || msg_id) {
+ service_get_extra_data(data, MSG_BUNDLE_KEY_MODE, &composer_mode);
+
+ if (composer_mode) {
+ if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_EDIT) == 0)
+ cd->composer_mode = MSG_COMPOSER_MODE_EDIT;
+ else if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_FORWARD) == 0)
+ cd->composer_mode = MSG_COMPOSER_MODE_FORWARD;
+ else
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+ } else {
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+ }
+
+ if ((thread_id || msg_id) && (cd->composer_mode == MSG_COMPOSER_MODE_NORMAL)) {
cd->msg_ug_mode = MSG_UG_MODE_BUBBLE_COMPOSER;
} else {
if (cd->isMsgInternal == true) {
}
}
- D_MSG("UG MODE %d[Internal = %d]", cd->msg_ug_mode, cd->isMsgInternal);
+ D_MSG("UG MODE %d[Internal = %d], composer mode = %d", cd->msg_ug_mode, cd->isMsgInternal, cd->composer_mode);
cd->isFullview = true;
if (msg_ui_composer_init(cd) != COMPOSER_RETURN_SUCCESS) {
D_EMSG("msg_ui_composer_init error");
+ evas_object_del(cd->base);
+
return NULL;
}
if (msg_ui_composer_create(cd) != COMPOSER_RETURN_SUCCESS) {
D_EMSG("creating main layout failed");
+ evas_object_del(cd->base);
+
return NULL;
}
D_MSG_RETM_IF(cd->state == COMPOSER_STATE_TYPE_DESTROY, "Composer state is already Destroy");
cd->state = COMPOSER_STATE_TYPE_DESTROY;
+ cd->isclosed = true;
if (cd->bubble_data)
cd->bubble_data->ug_state = BUBBLE_UG_DESTROY;
#define MSG_COMPOSER_SMIL_REGION_HEIGHT 50
#define MSG_COMPOSER_SMIL_DEFAULT_BGCOLOR 0xFFFFFF
-#define MSG_COMPOSER_PAGE_DEFAULT_DURATION 5000 //(msec)
#define MSG_COMPOSER_SMIL_DEFAULT_FONT_COLOR 0x000000
#define MSG_COMPOSER_SMIL_DEFAULT_FONT_SIZE 30
#define MSG_COMPOSER_SMIL_DEFAULT_BOLD false
return COMPOSER_RETURN_SUCCESS;
}
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_media(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int nPage, int duration)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_page_duration(int nPage, int duration)
+{
+ D_ENTER;
+
+ if (!msg_data) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] message data is NOT exist");
+ return COMPOSER_RETURN_NULL_POINTER;
+ }
+
+ if (nPage >= COMPOSER_MMS_MAX_PAGE) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Invalid nPage index");
+ return COMPOSER_RETURN_FAIL;
+ }
+
+ MSG_COMP_MMS_DATA_S *mms_data = &msg_data->mms_data;
+
+ if (duration > COMPOSER_PAGE_DEFAULT_DURATION)
+ mms_data->pagelist[nPage].page_duration = duration;
+
+
+ D_LEAVE;
+ return COMPOSER_RETURN_SUCCESS;
+}
+
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_mms_set_media(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int nPage)
{
D_ENTER;
D_MSG_RETVM_IF(ecore_file_exists(file_path) == EINA_FALSE, COMPOSER_RETURN_FAIL,"File is NOT exist");
}
switch (media_type) {
-
case COMPOSER_MEDIA_TYPE_IMAGE:
mms_data->pagelist[nPage].isImage = true;
strncpy(mms_data->pagelist[nPage].image_file_path, file_path, strlen(file_path));
break;
+
case COMPOSER_MEDIA_TYPE_VIDEO:
mms_data->pagelist[nPage].isVideo = true;
strncpy(mms_data->pagelist[nPage].image_file_path, file_path, strlen(file_path));
break;
+
case COMPOSER_MEDIA_TYPE_AUDIO:
mms_data->pagelist[nPage].isSound = true;
strncpy(mms_data->pagelist[nPage].sound_file_path, file_path, strlen(file_path));
- mms_data->pagelist[nPage].page_duration = duration;
break;
+
default:
MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "[ERROR] invalid media type");
return COMPOSER_RETURN_INVALID_MEDIA_TYPE;
int page_duration = 0;
/* verify page duration */
- if (MSG_COMPOSER_PAGE_DEFAULT_DURATION < ui_mms_data->pagelist[i].page_duration)
+ if (COMPOSER_PAGE_DEFAULT_DURATION < ui_mms_data->pagelist[i].page_duration)
page_duration = ui_mms_data->pagelist[i].page_duration;
else
- page_duration = MSG_COMPOSER_PAGE_DEFAULT_DURATION;
+ page_duration = COMPOSER_PAGE_DEFAULT_DURATION;
+
+ D_MSG("%dth page's page duration = %d", i + 1, page_duration);
+ page_duration = page_duration * 1000;
/* 1. make page */
if (msg_mms_add_item(fw_mms_data, MSG_STRUCT_MMS_PAGE, &page_info) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] create mms page error");
return COMPOSER_RETURN_FAIL;
}
+
msg_set_int_value(page_info, MSG_MMS_PAGE_PAGE_DURATION_INT, page_duration);
/* 2. add media */
if (ret != COMPOSER_RETURN_FAIL) {
ret = __msg_ui_composer_send(msg_handle);
- if (ret == COMPOSER_RETURN_SUCCESS) {
+ if (ret == COMPOSER_RETURN_SUCCESS || ret == COMPOSER_RETURN_NO_SIM) {
msg_struct_list_s *addr_list = NULL;
msg_get_list_handle(msg_data->msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
msg_release_struct(&sendOpt);
return COMPOSER_RETURN_FAIL;
}
+
/* load "FROM" address */
+ msg_struct_list_s *addr_list = NULL;
+ msg_get_list_handle(load_msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+
+ if (addr_list) {
+ int addr_count = addr_list->nCount;
+ int i = 0;
+ char number_str[MAX_ADDRESS_VAL_LEN + 1] = {0,};
+
+ for (i = 0; i < addr_count; i++) {
+ memset(number_str, 0, sizeof(number_str));
+
+ msg_get_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, number_str, MAX_ADDRESS_VAL_LEN);
+
+ if (strlen(number_str))
+ msg_ui_composer_message_add_address(number_str);
+ }
+ }
/* load message type */
int msgType;
return COMPOSER_RETURN_FAIL;
}
msg_get_mms_struct(load_msg, mmsBody);
-
+ /* load subject */
if (msg_get_str_value(load_msg, MSG_MESSAGE_SUBJECT_STR, subject, MAX_SUBJECT_LEN) != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] No subject data");
msg_data->mms_data.isSubject = false;
strncpy(msg_data->mms_data.subject, subject, COMPOSER_SUBJECT_MAX_BYTE);
}
+ /* load region */
+ msg_list_handle_t region_list = NULL;
+ msg_get_list_handle(mmsBody, MSG_MMS_REGION_LIST_HND, (void **)®ion_list);
+
+ int region_count = msg_list_length(region_list);
+ if (region_count >= 2) {
+ msg_struct_t region_info_0 = NULL;
+ msg_struct_t region_info_1 = NULL;
+ bool is_text_top = false;
+
+ region_info_0 = (msg_struct_t)msg_list_nth_data(region_list, 0);
+ region_info_1 = (msg_struct_t)msg_list_nth_data(region_list, 1);
+
+ if (msg_ui_composer_check_is_text_top(region_info_0, region_info_1, &is_text_top) == COMPOSER_RETURN_SUCCESS)
+ msg_data->mms_data.isTextTop = is_text_top;
+ } else {
+ D_EMSG("there is no region info region_count = %d", region_count);
+ }
+
/* load attachment */
msg_list_handle_t attach_list = NULL;
msg_get_list_handle(mmsBody, MSG_MMS_ATTACH_LIST_HND, (void **)&attach_list);
continue;
}
+ /* get page duration */
+ int page_duration = 0;
+ msg_get_int_value(pageInfo, MSG_MMS_PAGE_PAGE_DURATION_INT, &page_duration);
+ if (page_duration % 1000)
+ page_duration = page_duration / 1000 + 1;
+ else
+ page_duration = page_duration / 1000;
+
+ msg_data->mms_data.pagelist[i].page_duration = page_duration;
+
msg_get_list_handle(pageInfo, MSG_MMS_PAGE_MEDIA_LIST_HND, (void **)&media_list);
media_count = msg_list_length(media_list);
return COMPOSER_RETURN_SUCCESS;
}
-COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_message_set_loaded_data(void *composer_data, bool set_recipient)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)composer_data;
int i = 0;
+ /* recipient */
+ if (set_recipient) {
+ if (msg_data->recp_list) {
+
+ int count = g_slist_length(msg_data->recp_list);
+ char *address = NULL;
+
+ for (i = 0; i < count; i++) {
+ address = (char *)g_slist_nth_data(msg_data->recp_list, i);
+
+ if (address)
+ msg_ui_composer_recipient_set_loaded_data(cd, address, 0);
+ }
+ }
+ }
+
if (msg_data->msg_type == COMPOSER_MSG_TYPE_SMS) {
- msg_ui_composer_body_set_loaded_text(composer_data, msg_data->sms_data.body_text, 0);
+ msg_ui_composer_body_set_loaded_text(cd, msg_data->sms_data.body_text, 0);
return COMPOSER_RETURN_SUCCESS;
}
/* subject */
if (msg_data->mms_data.isSubject) {
- msg_ui_composer_subject_set_loaded_data(composer_data, msg_data->mms_data.subject);
+ msg_ui_composer_subject_set_loaded_data(cd, msg_data->mms_data.subject);
}
+ /* region */
+ if (msg_data->mms_data.isTextTop)
+ cd->body_data.region_order = COMPOSER_REGION_ORDER_TEXT_TOP;
+ else
+ cd->body_data.region_order = COMPOSER_REGION_ORDER_IMAGE_TOP;
+
/* attachment */
for (i = 0; i < msg_data->mms_data.attach_count; i++) {
char *filepath = msg_data->mms_data.attachlist[i].filepath;
int filetype = msg_data->mms_data.attachlist[i].filetype;
- msg_ui_composer_attachment_set_loaded_data(composer_data, filepath, filetype);
+ msg_ui_composer_attachment_set_loaded_data(cd, filepath, filetype);
}
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] MMS PAGE COUNT [%d]", msg_data->mms_data.page_count);
for (i = 0; i < msg_data->mms_data.page_count; i++) {
if (msg_data->mms_data.pagelist[i].isImage) {
- msg_ui_composer_body_set_loaded_media(composer_data, msg_data->mms_data.pagelist[i].image_file_path, COMPOSER_MEDIA_TYPE_IMAGE, i);
+ msg_ui_composer_body_set_loaded_media(cd, msg_data->mms_data.pagelist[i].image_file_path, COMPOSER_MEDIA_TYPE_IMAGE, i);
} else if (msg_data->mms_data.pagelist[i].isVideo) {
- msg_ui_composer_body_set_loaded_media(composer_data, msg_data->mms_data.pagelist[i].image_file_path, COMPOSER_MEDIA_TYPE_VIDEO, i);
+ msg_ui_composer_body_set_loaded_media(cd, msg_data->mms_data.pagelist[i].image_file_path, COMPOSER_MEDIA_TYPE_VIDEO, i);
}
if (msg_data->mms_data.pagelist[i].isSound) {
- msg_ui_composer_body_set_loaded_media(composer_data, msg_data->mms_data.pagelist[i].sound_file_path, COMPOSER_MEDIA_TYPE_AUDIO, i);
+ msg_ui_composer_body_set_loaded_media(cd, msg_data->mms_data.pagelist[i].sound_file_path, COMPOSER_MEDIA_TYPE_AUDIO, i);
}
if (msg_data->mms_data.pagelist[i].isText) {
- msg_ui_composer_body_set_loaded_text(composer_data, msg_data->mms_data.pagelist[i].body_text, i);
+ msg_ui_composer_body_set_loaded_text(cd, msg_data->mms_data.pagelist[i].body_text, i);
}
+
+ /* set page duration */
+ msg_ui_composer_body_set_loaded_page_duration(cd, msg_data->mms_data.pagelist[i].page_duration, i);
}
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
D_MSG_RETM_IF(cd->ly_attach_main == NULL, "ly_attach_main is NULL");
char buf[DEF_BUF_LEN_S + 1] = {0,};
- snprintf(buf, sizeof(buf), _MSGSTR("IDS_MSGC_BODY_PD_ATTACHMENTS"), attach_count);
+ const char *str = _MSGSTR("IDS_MSGC_BODY_PD_ATTACHMENTS");
+ snprintf(buf, sizeof(buf), str, attach_count);
edje_object_part_text_set(_EDJ(cd->ly_attach_main), "text.filename", buf);
if (!msg_ui_composer_common_is_send_possible(cd)) {
elm_object_disabled_set(cd->send_button, EINA_TRUE);
+ msg_ui_composer_body_update_send_btn_icon(cd, true);
edje_object_part_text_set(_EDJ(cd->ly_body), "text.char_count", "");/* remove character count */
if(cd->ly_body) {
Evas_Object* entry = msg_ui_composer_last_focused_entry_get(cd);
}
} else {
elm_object_disabled_set(cd->send_button, EINA_FALSE);
+ msg_ui_composer_body_update_send_btn_icon(cd, false);
}
/* remove attach main layout */
MSGC_EVAS_OBJECT_DEL(cd->ly_attach_main);
D_LEAVE;
}
+static void __msgc_attachment_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);
+}
+
+static void __msgc_attachment_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_ATTACHMENT_DEL_ICON, NULL);
+}
+
static void __msgc_attachment_del_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
Evas_Object *layout = evas_object_data_get(obj, "layout");
MSG_COMPOSER_ATTACH_ITEM_S *remove_item = NULL;
- remove_item = evas_object_data_get(layout, "attach_item");
- __msgc_remove_attachment_item(data, remove_item);
+ if (!cd->is_default_body_size) {
+ remove_item = evas_object_data_get(layout, "attach_item");
+ __msgc_remove_attachment_item(data, remove_item);
- msg_ui_composer_message_type_check_and_change(cd);
+ msg_ui_composer_message_type_check_and_change(cd);
+ }
+
+ /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */
+ if (msg_ui_composer_last_focus_is_recipient(cd)) {
+ const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);
+
+ if (recipient && recipient[0] != '\0') {
+ if (!msg_ui_composer_recipient_vaild_check(recipient))
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);
+ }
+ }
D_LEAVE;
}
{
D_ENTER;
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
- Evas_Object *layout = evas_object_data_get(obj, "layout");
- MSG_COMPOSER_ATTACH_ITEM_S *attach_item = evas_object_data_get(layout, "attach_item");
- D_MSG("File path %s", attach_item->file_path);
+ if (!cd->is_default_body_size) {
+ Evas_Object *layout = evas_object_data_get(obj, "layout");
+ MSG_COMPOSER_ATTACH_ITEM_S *attach_item = evas_object_data_get(layout, "attach_item");
+
+ D_MSG("File path %s", attach_item->file_path);
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_COMMON, attach_item->file_path);
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_COMMON, attach_item->file_path);
+ }
D_LEAVE;
}
elm_icon_file_set(del_icon, MSGC_IMG_ATTACHMENT_DEL_ICON, NULL);
evas_object_size_hint_weight_set(del_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(del_icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_focus_allow_set(del_icon, EINA_TRUE);
evas_object_show(del_icon);
evas_object_data_set(del_icon, "layout", layout);
elm_object_part_content_set(layout, "swl.delete_btn", del_icon);
evas_object_smart_callback_add(del_icon, "clicked", __msgc_attachment_del_icon_clicked_cb, cd);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, __msgc_attachment_del_btn_down_cb, NULL);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, __msgc_attachment_del_btn_up_cb, NULL);
if (!cd->isAppControl)
evas_object_smart_callback_add(thumb_icon, "clicked", __msgc_attachment_thumb_icon_clicked_cb, cd);
{
D_ENTER;
D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+ D_MSG_RETM_IF(cd->ly_attach_main == NULL, "ly_attach_main is NULL");
if (evas_object_visible_get(cd->ly_attach_main) == EINA_TRUE) {
/*hide attach main layout */
{
D_ENTER;
D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+ D_MSG_RETM_IF(cd->ly_attach_main == NULL, "ly_attach_main is NULL");
if (evas_object_visible_get(cd->ly_attach_main) == EINA_FALSE) {
/* hide attachment list */
D_MSG("attach_count = %d", attach_count);
- for (i = 0; i < attach_count; i++) {
- attach_item = (MSG_COMPOSER_ATTACH_ITEM_S *)eina_list_nth(attach_list, i);
- if (attach_item) {
- elm_box_unpack(cd->body_box, attach_item->layout);
- evas_object_hide(attach_item->layout);
- } else {
- D_EMSG("attach_item is NULL !! i = %d", i);
+ if (attach_count > 1) {
+ for (i = 0; i < attach_count; i++) {
+ attach_item = (MSG_COMPOSER_ATTACH_ITEM_S *)eina_list_nth(attach_list, i);
+ if (attach_item) {
+ elm_box_unpack(cd->body_box, attach_item->layout);
+ evas_object_hide(attach_item->layout);
+ } else {
+ D_EMSG("attach_item is NULL !! i = %d", i);
+ }
}
- }
- Eina_List *page_list = cd->body_data.page_list;
- MSG_COMPOSER_BODY_PAGE_S *page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, 0);
- /* show attach main layout */
- elm_box_pack_before(cd->body_box, cd->ly_attach_main, page_data->layout);
- evas_object_show(cd->ly_attach_main);
+ Eina_List *page_list = cd->body_data.page_list;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, 0);
+ /* show attach main layout */
+ elm_box_pack_before(cd->body_box, cd->ly_attach_main, page_data->layout);
+ evas_object_show(cd->ly_attach_main);
+ }
} else {
D_MSG("attach main layout is Already shown");
}
}
-static void __msgc_attachment_main_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void __msgc_attachment_main_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
D_ENTER;
D_MSG_RETM_IF(data == NULL, "data is NULL");
elm_object_part_content_set(layout, "swl.image", thumb_icon);
char buf[DEF_BUF_LEN_S + 1] = {0,};
+ const char *str = _MSGSTR("IDS_MSGC_BODY_PD_ATTACHMENTS");
- snprintf(buf, sizeof(buf), _MSGSTR("IDS_MSGC_BODY_PD_ATTACHMENTS"), attach_count);
+ snprintf(buf, sizeof(buf), str, attach_count);
edje_object_part_text_set(_EDJ(layout), "text.filename", buf);
- evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_UP, __msgc_attachment_main_layout_clicked_cb, cd);
+ edje_object_signal_callback_add(_EDJ(layout), "attach_clicked", "", __msgc_attachment_main_layout_clicked_cb, (void *)cd);
D_LEAVE;
return layout;
if (attach_count >= COMPOSER_MMS_MAX_ATTACH_COUNT) {
char popup_msg[DEF_BUF_LEN_L + 1] = { 0, };
- snprintf(popup_msg, sizeof(popup_msg) - 1, MSGC_STR_POP_ATTACHMENT_COUNT_MAX, COMPOSER_MMS_MAX_ATTACH_COUNT, COMPOSER_MMS_MAX_ATTACH_COUNT);
+ const char *str = MSGC_STR_POP_ATTACHMENT_COUNT_MAX;
+ snprintf(popup_msg, sizeof(popup_msg), str, COMPOSER_MMS_MAX_ATTACH_COUNT, COMPOSER_MMS_MAX_ATTACH_COUNT);
Evas_Object *popup = msg_ui_composer_status_popup_show(cd, popup_msg, COMPOSER_STATUS_POPUP_DEFAULT_TIME);
Evas_Object *btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup_button/default");
#include "msg-ui-composer-util.h"\r
#include "msg-ui-composer-external.h"\r
#include "syspopup_caller.h"\r
+#include <tapi_common.h>\r
+#include <ITapiModem.h>\r
\r
/*==================================================================================================\r
* FUNCTION IMPLEMENTATIONS\r
msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMCORDER, NULL);\r
} else if (!g_strcmp0(label, MSGC_STR_CONTACT)) {\r
msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_NAMECARD, NULL);\r
- } else if (!g_strcmp0(label, MSGC_STR_CALENDAR)) {\r
+ } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_CALENDAR"))) {\r
msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CALENDAR, NULL);\r
- } else if (!g_strcmp0(label, MSGC_STR_MEMO)) {\r
+ } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_MEMO"))) {\r
msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MEMO, NULL);\r
} else {\r
D_EMSG("Unknown Menu List Item");\r
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
Evas_Object *popup = NULL;\r
Evas_Object *list = NULL;\r
- Elm_Object_Item *item = NULL;\r
+ int count = 0;\r
+ int list_padding = 4;\r
+\r
\r
list = elm_list_add(cd->main_window);\r
D_MSG_RETM_IF(list == NULL, "list is NULL");\r
+ elm_list_mode_set(list, ELM_LIST_EXPAND);\r
\r
- if (!cd->isAppControl) {\r
- if (!cd->isSubject)\r
+ Elm_Object_Item *item = NULL;\r
+\r
+ if (cd->isAppControl) {\r
item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
+ if (cd->isSubject)\r
+ elm_object_item_disabled_set(item, EINA_TRUE);\r
+\r
+ } else {\r
+ if (!cd->isSubject) {\r
+ elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
+ }\r
\r
elm_list_item_append(list, MSGC_STR_GALLERY, NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
elm_list_item_append(list, MSGC_STR_MYFILE, NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
elm_list_item_append(list, MSGC_STR_CONTACT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- elm_list_item_append(list, MSGC_STR_CALENDAR, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- elm_list_item_append(list, MSGC_STR_MEMO, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- } else {\r
- item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- if (cd->isSubject)\r
- elm_object_item_disabled_set(item, EINA_TRUE);\r
+ ++count;\r
+ elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_CALENDAR"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
+ elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_MEMO"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
+ ++count;\r
}\r
\r
elm_list_go(list);\r
\r
- if (!cd->isAppControl) {\r
- popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, NULL);\r
- } else {\r
- elm_list_mode_set(list, ELM_LIST_EXPAND);\r
- popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, "min_menustyle");\r
+ if (count >= 4) {\r
+ count = 4;\r
+\r
+ int popup_height = MSGC_POPUP_LIST_H * count + list_padding;\r
+ evas_object_size_hint_max_set(list, -1, popup_height * elm_scale_get());\r
}\r
\r
+ popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, "min_menustyle");\r
+\r
Evas_Object *btn1 = elm_button_add(popup);\r
elm_object_style_set(btn1, "popup_button/default");\r
elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);\r
D_LEAVE;\r
}\r
\r
-static void __nosim_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+static void __msgc_show_bubble_view(void *data, msg_thread_id_t tid)\r
{\r
D_ENTER;\r
-\r
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");\r
+ D_MSG_RETM_IF(cd == NULL, "cd is NULL");\r
+\r
+ /* show indicator area */\r
+ elm_layout_theme_set(cd->base, "layout", "application", "default");\r
+ elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);\r
\r
- if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {\r
- msg_ui_composer_change_bubble_view(cd);\r
- } else if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {\r
+ msg_ui_composer_change_bubble_view(cd);\r
+\r
+ if (tid <= 0) {\r
+ D_EMSG("Can not find tid = %d !!", tid);\r
+ msg_ui_composer_message_destroy();\r
ug_destroy_me(cd->ug);\r
- } else {\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+\r
+ return;\r
}\r
- msg_ui_composer_clear(cd);\r
+\r
+ msg_ui_composer_bubble_data_set(cd, tid);\r
+ msg_ui_bubble_start_view(cd->bubble_data);\r
+ msg_ui_composer_navi_title_set((void *)cd);\r
+\r
+ /* set recipient list for bubble composer */\r
+ msg_ui_composer_recipient_set_recipient_list(cd, tid);\r
+\r
D_LEAVE;\r
}\r
\r
-void msg_ui_composer_body_send_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+static void __nosim_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
{\r
D_ENTER;\r
- D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");\r
\r
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- msg_thread_id_t tid = 0;\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_TRUE);\r
-\r
- /*Check recipient available sending*/\r
- RECIPIENT_S *rd = cd->recipient;\r
- if (rd) {\r
- /*add recipient, if entry text exist*/\r
- Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);\r
- char *entry_txt = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));\r
- if (entry_txt) {\r
- if (strlen(entry_txt) > 0) {\r
- if (NULL == elm_multibuttonentry_item_append(rd->mbe, entry_txt, NULL, NULL)) {\r
- g_free(entry_txt);\r
- goto error_return;\r
- }\r
- }\r
- g_free(entry_txt);\r
- }\r
-\r
- /*check recipient count is zero*/\r
- if (msg_ui_composer_recipient_count_get(rd) == 0) {\r
- D_EMSG("there is no recipient");\r
- msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_NO_RECIPIENT);\r
- }\r
-\r
- /*check invalid recipient*/\r
- Eina_List *invalid_list = msg_ui_composer_recipient_invalid_recipient_list_get(rd);\r
- if (invalid_list) {\r
- RECIPIENT_ITEM_S *r_item;\r
- char *ret = NULL;\r
- char *err_msg = NULL;\r
- int inval_count = 0;\r
-\r
- EINA_LIST_FREE(invalid_list, r_item) {\r
- if (r_item) {\r
- if (inval_count == 0) {\r
- ret = g_strconcat(r_item->display_name, NULL);\r
- } else {\r
- ret = g_strconcat(ret, ", ", r_item->display_name, NULL);\r
- }\r
-\r
- D_MSG("invalid display name %s type %d", r_item->display_name, r_item->type);\r
-\r
- inval_count++;\r
- }\r
- }\r
-\r
- D_MSG("ret name %s ", ret);\r
-\r
- if (inval_count > 1){\r
- err_msg = g_strconcat(MSGC_STR_NOTI_RECIPIENTS_INVALID,"(", ret, ")", NULL);\r
- } else {\r
- err_msg = g_strconcat(MSGC_STR_NOTI_RECIPIENT_INVALID,"(", ret, ")", NULL);\r
- }\r
+ D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");\r
\r
- if (err_msg != NULL) {\r
- Evas_Object *popup = msg_ui_composer_status_popup_show(cd, err_msg, COMPOSER_STATUS_POPUP_DEFAULT_TIME);\r
- Evas_Object *btn1 = elm_button_add(popup);\r
- elm_object_style_set(btn1, "popup_button/default");\r
- elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);\r
- elm_object_part_content_set(popup, "button1", btn1);\r
- evas_object_smart_callback_add(btn1, "clicked", msg_ui_composer_status_popup_response_cb, popup);\r
- g_free(err_msg);\r
- }\r
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER)\r
+ ug_destroy_me(cd->ug);\r
\r
- if (ret != NULL)\r
- g_free(ret);\r
+ D_LEAVE;\r
+}\r
\r
- goto error_return;\r
- }\r
- }\r
+void msg_ui_composer_body_make_and_send_message(void *data)\r
+{\r
+ D_ENTER;\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
+ msg_thread_id_t tid = 0;\r
\r
/*Make message*/\r
msg_ui_composer_message_init();\r
/*Send message*/\r
COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, &tid);\r
\r
+ /* reset region info */\r
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
+ body_data->region_order = COMPOSER_REGION_ORDER_UNDETERMINDED;\r
+\r
if (ret == COMPOSER_RETURN_SUCCESS) {\r
D_MSG("Send Success");\r
\r
- if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {\r
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {\r
ug_destroy_me(cd->ug);\r
} else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {\r
-\r
- msg_ui_composer_change_bubble_view(cd);\r
-\r
- if (tid <= 0) {\r
- D_EMSG("Can not find thread id!!");\r
- msg_ui_composer_message_destroy();\r
- ug_destroy_me(cd->ug);\r
-\r
- return;\r
- }\r
-\r
- msg_ui_composer_bubble_data_set(cd, tid);\r
- msg_ui_bubble_start_view(cd->bubble_data);\r
- msg_ui_composer_navi_title_set((void *)cd);\r
-\r
- /* set recipient list for bubble composer */\r
- msg_ui_composer_recipient_set_recipient_list(cd, tid);\r
-\r
+ __msgc_show_bubble_view(cd, tid);\r
msg_ui_composer_clear(cd);\r
} else {\r
msg_ui_composer_clear(cd);\r
}\r
\r
- } else {\r
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;\r
\r
+ } else {\r
if (ret == COMPOSER_RETURN_NO_SIM) {\r
- D_MSG("Send Fail : NO SIM");\r
- Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_NOSIM, COMPOSER_STATUS_POPUP_DEFAULT_TIME);\r
- Evas_Object *btn1 = elm_button_add(popup);\r
- elm_object_style_set(btn1, "popup_button/default");\r
- elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);\r
- elm_object_part_content_set(popup, "button1", btn1);\r
- evas_object_smart_callback_add(btn1, "clicked", msg_ui_composer_status_popup_response_cb, popup);\r
- evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __nosim_popup_delete_cb, cd);\r
+ D_EMSG("Send Fail : NO SIM");\r
+ Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_NOSIM, 1);\r
+\r
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {\r
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __nosim_popup_delete_cb, cd);\r
+ } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {\r
+ __msgc_show_bubble_view(cd, tid);\r
+ }\r
+\r
+ msg_ui_composer_clear(cd);\r
} else {\r
- D_MSG("Send Fail : Unable Send");\r
- msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_UNABLE_SEND, COMPOSER_STATUS_POPUP_DEFAULT_TIME);\r
- }\r
+ D_EMSG("Send Fail : Unable Send");\r
+ if ((cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD))\r
+ ug_destroy_me(cd->ug);\r
+ else\r
+ msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_UNABLE_SEND, COMPOSER_STATUS_POPUP_DEFAULT_TIME);\r
+ }\r
+\r
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;\r
\r
goto error_return;\r
}\r
D_LEAVE;\r
}\r
\r
+static void __msgc_flight_mode_tapi_cb(TapiHandle *handle, int result, void *data, void *user_data)\r
+{\r
+ D_ENTER;\r
+ bool is_success = false;\r
+\r
+ switch (result) {\r
+ case TAPI_POWER_FLIGHT_MODE_RESP_ON:\r
+ D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_ON");\r
+ break;\r
+\r
+ case TAPI_POWER_FLIGHT_MODE_RESP_OFF:\r
+ D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_OFF");\r
+ is_success = true;\r
+ break;\r
+\r
+ case TAPI_POWER_FLIGHT_MODE_RESP_FAIL:\r
+ D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_FAIL");\r
+ break;\r
+\r
+ case TAPI_POWER_FLIGHT_MODE_RESP_MAX:\r
+ D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_MAX");\r
+ break;\r
+ default:\r
+ D_MSG("result = %d", result);\r
+ break;\r
+ }\r
+\r
+ if (!is_success)\r
+ D_EMSG("flight mode off is failed");\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+static Eina_Bool __msgc_flight_mode_enabled_check_timer_cb(void *data)\r
+{\r
+ D_MSG_RETVM_IF(data == NULL, ECORE_CALLBACK_CANCEL, "data is NULL");\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+\r
+ int network_status = -1;\r
+ static int count = 0;\r
+ bool ret = false;\r
+\r
+ if (count >= 100) { /* 0.5 sec * 100 = 50 sec */\r
+ D_EMSG("self time expiration");\r
+ MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
+ goto return_end;\r
+ }\r
+\r
+ ++count;\r
+\r
+ /* check if call network is enabled - to send message l*/\r
+ ret = msg_composer_get_network_status(&network_status);\r
+ if (ret == true) {\r
+ if (network_status == VCONFKEY_TELEPHONY_SVCTYPE_NONE ||\r
+ network_status == VCONFKEY_TELEPHONY_SVCTYPE_NOSVC ||\r
+ network_status == VCONFKEY_TELEPHONY_SVCTYPE_EMERGENCY ||\r
+ network_status == VCONFKEY_TELEPHONY_SVCTYPE_SEARCH) {\r
+ D_MSG("Cannot send message - check again");\r
+ return ECORE_CALLBACK_RENEW;\r
+ }\r
+ } else {\r
+ D_EMSG("msg_composer_get_network_status is failed");\r
+ return ECORE_CALLBACK_RENEW;\r
+ }\r
+\r
+ MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
+\r
+ D_MSG("try to send message");\r
+ msg_ui_composer_body_send_btn_clicked_cb(cd, NULL, NULL);\r
+\r
+return_end:\r
+\r
+ count = 0;\r
+ cd->flight_mode_timer = NULL;\r
+\r
+ return ECORE_CALLBACK_CANCEL;\r
+}\r
+\r
+static void __flight_mode_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");\r
+\r
+ Evas_Object *check = (Evas_Object *)evas_object_data_get(cd->custom_popup, "check_box");\r
+\r
+ if (elm_check_state_get(check)) {\r
+ /* set flight mode off*/\r
+ if (msg_composer_set_flight_mode(cd->tapi_handle, TAPI_POWER_FLIGHT_MODE_LEAVE, __msgc_flight_mode_tapi_cb, NULL) == false) {\r
+ D_EMSG("msg_composer_set_flight_mode is failed");\r
+ } else {\r
+ /* show progress popup */\r
+ MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
+ cd->progress_popup = msg_ui_composer_progress_popup_show(cd, _MSGSTR("Disabling Flight mode"));\r
+\r
+ /* give focus to back btn to hide keypad */\r
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
+\r
+ if (cd->flight_mode_timer) {\r
+ ecore_timer_del(cd->flight_mode_timer);\r
+ cd->flight_mode_timer = NULL;\r
+ }\r
+ cd->flight_mode_timer = ecore_timer_add(0.5, __msgc_flight_mode_enabled_check_timer_cb, cd);\r
+ }\r
+ } else {\r
+ D_MSG("checkbox is not checked");\r
+ }\r
+\r
+ MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
+\r
+ if (cd->send_button)\r
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+static void __flight_mode_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");\r
+\r
+ MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
+\r
+ if (cd->send_button)\r
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+void msg_ui_composer_body_send_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");\r
+\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+\r
+ if (cd->send_button)\r
+ elm_object_disabled_set(cd->send_button, EINA_TRUE);\r
+\r
+ /* check flight mode */\r
+ int flight_mode = 0;\r
+ if (msg_composer_get_flight_mode(&flight_mode) && flight_mode) {\r
+ /*get tapi handle */\r
+ if (!cd->tapi_handle)\r
+ cd->tapi_handle = (void *)tel_init(NULL);\r
+\r
+ if (!cd->tapi_handle) {\r
+ D_EMSG("tel_init is failed");\r
+ } else {\r
+ /* show popup */\r
+ Evas_Object *popup = NULL;\r
+ Evas_Object *btn1 = NULL;\r
+ Evas_Object *btn2 = NULL;\r
+ char *popup_msg = _MSGSTR("Unable to send messages while Flight mode is enabled. Disable Flight mode and try again");\r
+ char *checkbox_msg = _MSGSTR("Disable Flight mode");\r
+\r
+ MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
+\r
+ popup = msg_ui_composer_checkbox_popup_create(cd, NULL, popup_msg, checkbox_msg);\r
+\r
+ btn1 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_OK"));\r
+ elm_object_part_content_set(popup, "button1", btn1);\r
+ evas_object_smart_callback_add(btn1, "clicked", __flight_mode_popup_ok_btn_clicked_cb, cd);\r
+ btn2 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_CANCEL"));\r
+ elm_object_part_content_set(popup, "button2", btn2);\r
+ evas_object_smart_callback_add(btn2, "clicked", __flight_mode_popup_cancel_btn_clicked_cb, cd);\r
+\r
+ cd->custom_popup = popup;\r
+\r
+ elm_object_focus_set(popup, EINA_TRUE);\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ /*Check recipient available sending*/\r
+ RECIPIENT_S *rd = cd->recipient;\r
+ if (rd) {\r
+ /*add recipient, if entry text exist*/\r
+ Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);\r
+ char *entry_txt = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));\r
+ if (entry_txt) {\r
+ if (strlen(entry_txt) > 0) {\r
+ if (NULL == elm_multibuttonentry_item_append(rd->mbe, entry_txt, NULL, NULL)) {\r
+ g_free(entry_txt);\r
+\r
+ if (cd->send_button)\r
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+\r
+ return;\r
+ }\r
+ }\r
+ g_free(entry_txt);\r
+ }\r
+\r
+ /*check recipient count is zero*/\r
+ if (msg_ui_composer_recipient_count_get(rd) == 0) {\r
+ D_EMSG("there is no recipient");\r
+ //msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_NO_RECIPIENT);\r
+\r
+ /* change focus to recipient */\r
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER)\r
+ msg_ui_composer_recipient_focus_set(cd->recipient);\r
+\r
+ if (cd->send_button)\r
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+\r
+ return;\r
+ }\r
+ }\r
+\r
+ msg_ui_composer_body_make_and_send_message(cd);\r
+\r
+ D_LEAVE;\r
+ return;\r
+}\r
+\r
void msg_ui_composer_body_add_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
{\r
D_ENTER;\r
page_data->text_info.encode = COMPOSER_CHAR_ENCODE_UNICODE;\r
page_data->text_info.char_count = 0;\r
} else {\r
- unsigned char ucs2_text[4000] = {0,};\r
+ unsigned char ucs2_text[COMPOSER_MMS_TEXT_MAX_CHAR*2] = {0,};\r
int ucs2_len = msg_ui_composer_convert_UTF8ToUCS2(ucs2_text, sizeof(ucs2_text), body_text, text_len);\r
page_data->text_info.encode = msg_ui_composer_body_entry_char_count(cd, ucs2_text, ucs2_len, &page_data->text_info.char_count);\r
}\r
\r
if (msg_ui_composer_common_is_send_possible(cd)) {\r
elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
+ msg_ui_composer_body_update_send_btn_icon(cd, false);\r
} else {\r
elm_object_disabled_set(cd->send_button, EINA_TRUE);\r
+ msg_ui_composer_body_update_send_btn_icon(cd, true);\r
}\r
\r
D_LEAVE;\r
return;\r
}\r
\r
- /* change body scroller size */\r
- int keypad_h = msg_ui_composer_get_keypad_height(obj);\r
- msg_ui_composer_change_body_scroll_size(cd, keypad_h);\r
-\r
if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {\r
MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
\r
}\r
\r
msg_ui_composer_last_focused_entry_set(data, obj);\r
+\r
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS)\r
+ msg_ui_composer_toolbar_top_update(cd);\r
+\r
D_LEAVE;\r
}\r
\r
+void msg_ui_composer_body_page_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);\r
+}\r
+\r
+void msg_ui_composer_body_page_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
+ elm_icon_file_set(obj, MSGC_IMG_PAGE_DEL_ICON, NULL);\r
+}\r
+\r
void msg_ui_composer_body_page_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
{\r
D_ENTER;\r
msg_ui_composer_message_type_check_and_change(cd);\r
\r
msg_ui_composer_body_info_area_update(cd);\r
+\r
+ /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */\r
+ if (msg_ui_composer_last_focus_is_recipient(cd)) {\r
+ const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);\r
+\r
+ if (recipient && recipient[0] != '\0') {\r
+ if (!msg_ui_composer_recipient_vaild_check(recipient))\r
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
+ }\r
+ }\r
D_LEAVE;\r
}\r
\r
+static void __msg_ui_composer_body_launch_media_item(void *data, Evas_Object *obj)\r
+{\r
+ D_ENTER;\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
+\r
+ Evas_Object *layout = NULL;\r
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;\r
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
+ Eina_List *page_list = body_data->page_list;\r
+ int page_count = body_data->page_count;\r
+ int i = 0;\r
+ char file_path[COMPOSER_FILEPATH_LEN_MAX + 1] = {0, };\r
+\r
+ layout = evas_object_data_get(obj, "layout");\r
+\r
+ if (!layout || !page_list) {\r
+ D_EMSG("Invalid data layout = %x, page_list = %x", layout, page_list);\r
+ return;\r
+ }\r
+\r
+ for (i = 0; i < page_count; i++) {\r
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
+\r
+ if (!page_data) {\r
+ D_EMSG("page data is NULL !!!");\r
+ return;\r
+ }\r
+\r
+ if (page_data->sound_item == layout) {\r
+ strncpy(file_path, page_data->sound_file_path, COMPOSER_FILEPATH_LEN_MAX);\r
+ break;\r
+ } else if (page_data->image_item == layout) {\r
+ strncpy(file_path, page_data->image_file_path, COMPOSER_FILEPATH_LEN_MAX);\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (file_path[0] != '\0')\r
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_COMMON, file_path);\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+void msg_ui_composer_body_media_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(data == NULL, "data is NULL");\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+\r
+ __msg_ui_composer_body_launch_media_item(cd, obj);\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+void msg_ui_composer_body_media_thumb_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
+\r
+ if (!cd->is_default_body_size)\r
+ __msg_ui_composer_body_launch_media_item(cd, obj);\r
+\r
+ D_LEAVE;\r
+}\r
+\r
+void msg_ui_composer_body_media_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
+ int media_type = 0;\r
+\r
+ media_type = (int)evas_object_data_get(obj, "media_type");\r
+ D_MSG("media_type = %d", media_type);\r
+\r
+ if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)\r
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);\r
+ else\r
+ elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_PRESS_ICON, NULL);\r
+}\r
+\r
+void msg_ui_composer_body_media_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
+ int media_type = 0;\r
+\r
+ media_type = (int)evas_object_data_get(obj, "media_type");\r
+\r
+ if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)\r
+ elm_icon_file_set(obj, MSGC_SOUND_INSERT_DEL_ICON, NULL);\r
+ else\r
+ elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_ICON, NULL);\r
+}\r
+\r
void msg_ui_composer_body_media_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
{\r
D_ENTER;\r
int page_count = body_data->page_count;\r
int body_length = 0;\r
\r
- Evas_Object *delete_layout = (Evas_Object *)evas_object_data_get(obj, "layout");\r
+ if (!cd->is_default_body_size) {\r
+ Evas_Object *delete_layout = (Evas_Object *)evas_object_data_get(obj, "layout");\r
\r
- int i = 0;\r
+ int i = 0;\r
\r
- for (i = 0; i < page_count; i++) {\r
- page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
+ for (i = 0; i < page_count; i++) {\r
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
\r
- if (!page_data) {\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL !!!");\r
- return;\r
- }\r
+ if (!page_data) {\r
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL !!!");\r
+ return;\r
+ }\r
\r
- if (page_data->sound_item == delete_layout) {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_AUDIO);\r
+ if (page_data->sound_item == delete_layout) {\r
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_AUDIO);\r
\r
- char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
- if (!body_text)\r
- return;\r
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
+ if (!body_text)\r
+ return;\r
\r
- body_length = strlen(body_text);\r
+ body_length = strlen(body_text);\r
\r
- if (body_length == 0 && !page_data->is_image_item)\r
- msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
+ if (body_length == 0 && !page_data->is_image_item)\r
+ msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
\r
- g_free(body_text);\r
+ g_free(body_text);\r
\r
- break;\r
- } else if (page_data->image_item == delete_layout) {\r
+ break;\r
+ } else if (page_data->image_item == delete_layout) {\r
\r
- char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
- if (!body_text)\r
- return;\r
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
+ if (!body_text)\r
+ return;\r
\r
- body_length = strlen(body_text);\r
+ body_length = strlen(body_text);\r
\r
- if (page_data->isVideo) {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_VIDEO);\r
- } else {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_IMAGE);\r
+ if (page_data->isVideo) {\r
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_VIDEO);\r
+ } else {\r
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_IMAGE);\r
+ }\r
+\r
+ if (body_length == 0 && !page_data->is_sound_item)\r
+ msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
+\r
+ g_free(body_text);\r
+ break;\r
}\r
+ }\r
+\r
+ msg_ui_composer_message_type_check_and_change(cd);\r
+ }\r
\r
- if (body_length == 0 && !page_data->is_sound_item)\r
- msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
+ /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */\r
+ if (msg_ui_composer_last_focus_is_recipient(cd)) {\r
+ const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);\r
\r
- g_free(body_text);\r
- break;\r
+ if (recipient && recipient[0] != '\0') {\r
+ if (!msg_ui_composer_recipient_vaild_check(recipient))\r
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
}\r
}\r
\r
- msg_ui_composer_message_type_check_and_change(cd);\r
D_LEAVE;\r
}\r
\r
\r
D_LEAVE;
}\r
+\r
+void msg_ui_composer_body_body_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+{\r
+ D_ENTER;\r
+ D_MSG_RETM_IF(data == NULL, "data is NULL");\r
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
+\r
+ msg_ui_composer_body_focus_set(cd, 0);\r
+\r
+ evas_object_event_callback_del(cd->body_box, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_body_layout_clicked_cb);\r
+\r
+ cd->is_default_body_size = false;\r
+\r
+ D_LEAVE;\r
+}\r
+\r
for (i = 0; i < page_count; i++) {
page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
char *body_text;
+ D_MSG("page duration = %d", page_data->page_duration);
+
+ msg_ui_composer_message_mms_set_page_duration(i, page_data->page_duration);
if (page_data->entry) {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] read TEXT region data");
}
if (page_data->is_image_item) {
-
if (page_data->isVideo) {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] read video region data");
- msg_ui_composer_message_mms_set_media(page_data->image_file_path, COMPOSER_MEDIA_TYPE_VIDEO, i, 0);
+ msg_ui_composer_message_mms_set_media(page_data->image_file_path, COMPOSER_MEDIA_TYPE_VIDEO, i);
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] read image region data");
- msg_ui_composer_message_mms_set_media(page_data->image_file_path, COMPOSER_MEDIA_TYPE_IMAGE, i, 0);
+ msg_ui_composer_message_mms_set_media(page_data->image_file_path, COMPOSER_MEDIA_TYPE_IMAGE, i);
}
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] No [Image] region data");
if (page_data->is_sound_item) {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] read SOUND region data");
- msg_ui_composer_message_mms_set_media(page_data->sound_file_path, COMPOSER_MEDIA_TYPE_AUDIO, i, page_data->sound_duration);
+ msg_ui_composer_message_mms_set_media(page_data->sound_file_path, COMPOSER_MEDIA_TYPE_AUDIO, i);
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] No [Sound] region data");
}
if (!(char_count % COMPOSER_CMS_UNICODE_MAX_LEN))
--cms_page;
- if (cms_page >= COMPOSER_CMS_MAX_PAGE)
- max_count = COMPOSER_CMS_UNICODE_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ if (cms_page >= cd->cms_max_page)
+ max_count = COMPOSER_CMS_UNICODE_MAX_LEN * cd->cms_max_page;
else
max_count = COMPOSER_CMS_UNICODE_MAX_LEN * (cms_page+1);
} else {
max_count = COMPOSER_SMS_UNICODE_MAX_LEN;
}
- cms_max_count = COMPOSER_CMS_UNICODE_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ cms_max_count = COMPOSER_CMS_UNICODE_MAX_LEN * cd->cms_max_page;
} else if (char_encode == COMPOSER_CHAR_ENCODE_GSM7) {
if (char_count > COMPOSER_SMS_GSM7_MAX_LEN){
cms_page = char_count / COMPOSER_CMS_GSM7_MAX_LEN;
if (!(char_count % COMPOSER_CMS_GSM7_MAX_LEN))
--cms_page;
- if (cms_page >= COMPOSER_CMS_MAX_PAGE)
- max_count = COMPOSER_CMS_GSM7_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ if (cms_page >= cd->cms_max_page)
+ max_count = COMPOSER_CMS_GSM7_MAX_LEN * cd->cms_max_page;
else
max_count = COMPOSER_CMS_GSM7_MAX_LEN * (cms_page+1);
} else {
max_count = COMPOSER_SMS_GSM7_MAX_LEN;
}
- cms_max_count = COMPOSER_CMS_GSM7_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ cms_max_count = COMPOSER_CMS_GSM7_MAX_LEN * cd->cms_max_page;
} else {
D_EMSG("Unknown character encode");
return;
elm_icon_file_set(del_icon, MSGC_IMG_PAGE_DEL_ICON, NULL);
evas_object_size_hint_weight_set(del_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(del_icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_focus_allow_set(del_icon, EINA_TRUE);
evas_object_data_set(del_icon, "layout", page_data->layout);
elm_object_part_content_set(layout, "swl.del_button", del_icon);
evas_object_smart_callback_add(del_icon, "clicked", msg_ui_composer_body_page_del_btn_clicked_cb, cd);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, msg_ui_composer_body_page_del_btn_down_cb, NULL);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_page_del_btn_up_cb, NULL);
elm_box_pack_end(page_box, entry);
page_data->page_box = page_box;
page_data->del_icon = del_icon;
+ if (cd->page_duration > COMPOSER_PAGE_DEFAULT_DURATION)
+ page_data->page_duration = cd->page_duration;
+ else
+ page_data->page_duration = COMPOSER_PAGE_DEFAULT_DURATION;
+
D_LEAVE;
return layout;
}
elm_object_part_content_set(layout, "swl.page.main", page_main_box);
-
body_data->page_list = eina_list_append(body_data->page_list, (void *)page_data);
D_LEAVE;
return COMPOSER_RETURN_FAIL;
}
+ if (body_data->page_count == 0) {
+ cd->page_duration = COMPOSER_PAGE_DEFAULT_DURATION;
+ }
+
new_page = __msg_ui_composer_body_page_main_create(cd, main_box);
if (!new_page) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page create error");
D_ENTER;
if (!cd || !remove_page) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] comoser data or page data is NOT exist");
+ D_EMSG("comoser data or page data is NOT exist");
return COMPOSER_RETURN_NULL_POINTER;
}
}
}
}
+ D_MSG("focus change to the first page");
+ /* focus change to the first page */
+ cd->current_edit_entry = 0;
Evas_Object *body_entry = msg_ui_composer_last_body_entry_get(cd);
Evas_Object *last_focused_entry = msg_ui_composer_last_focused_entry_get(cd);
/* last focus is body entry*/
- if (body_entry && (body_entry == last_focused_entry)) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "focus change to the first page");
- /* focus change to the first page */
- cd->current_edit_entry = 0;
+ if (body_entry && (body_entry == last_focused_entry))
msg_ui_composer_last_focused_entry_set(cd, page_data->entry);
- msg_ui_composer_last_focus_load(cd);
- }
+
} else {
for (i = 0; i < page_count; i++) {
page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(body_data->page_list, i);
if (page_data->layout == remove_page) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEUBG] Remove MMS (%d)th page", i + 1);
+ D_MSG("Remove MMS (%d)th page", i + 1);
elm_box_unpack(cd->body_box, remove_page);
Evas_Object *body_entry = msg_ui_composer_last_body_entry_get(cd);
evas_object_del(page_data->page_box);
}
- if (page_data->del_icon)
+ if (page_data->del_icon) {
+ evas_object_event_callback_del(page_data->del_icon, EVAS_CALLBACK_MOUSE_DOWN, msg_ui_composer_body_page_del_btn_down_cb);
+ evas_object_event_callback_del(page_data->del_icon, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_page_del_btn_up_cb);
+
evas_object_del(page_data->del_icon);
+ }
evas_object_del(page_data->upper_layout);
break;
}
}
+
+ /* if 1 page is remained after delete, hide delete button */
+ if (body_data->page_count == 1) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(body_data->page_list, 0);
+
+ if (page_data)
+ edje_object_signal_emit(_EDJ(page_data->upper_layout), "hide.delete", "*");
+ }
}
D_LEAVE;
Evas_Object *layout = NULL;
Evas_Object *thumb_icon = NULL;
- Evas_Object *del_button = NULL;
+ Evas_Object *del_icon = NULL;
const char *filename = NULL;
char thumbnail_path[COMPOSER_FILEPATH_LEN_MAX + 1] = { 0, };
+ double scale = elm_config_scale_get();
+ int image_icon_w = (int)(MSGC_IMAGE_THUMB_WIDTH * scale);
+ int image_icon_h = (int)(MSGC_IMAGE_THUMB_HEIGHT * scale);
+ int sound_icon_w = (int)(MSGC_SOUND_THUMB_WIDTH * scale);
+ int sound_icon_h = (int)(MSGC_SOUND_THUMB_HEIGHT * scale);
layout = elm_layout_add(parent);
if (!layout) {
D_EMSG("layout create error !!!!");
return NULL;
}
+
if (isSound == 1 )
elm_layout_file_set(layout, msg_ui_composer_edj_get(cd), MSGC_EDJ_GRP_BODY_SOUND);
else
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
evas_object_show(layout);
thumb_icon = elm_icon_add(layout);
if (media_type == COMPOSER_MEDIA_TYPE_IMAGE) {
elm_icon_file_set(thumb_icon, file_path, NULL);
- evas_object_size_hint_min_set(thumb_icon, MSGC_IMAGE_THUMB_WIDTH, MSGC_IMAGE_THUMB_HEIGHT);
+ evas_object_size_hint_min_set(thumb_icon, image_icon_w, image_icon_h);
} else if (media_type == COMPOSER_MEDIA_TYPE_VIDEO) {
if (msg_composer_common_get_thumbnail(cd, file_path, thumbnail_path, COMPOSER_FILEPATH_LEN_MAX) == COMPOSER_RETURN_SUCCESS) {
elm_icon_file_set(thumb_icon, thumbnail_path, NULL);
} else {
elm_icon_file_set(thumb_icon, MSGC_IMG_INSERT_ETC_ICON, NULL);
}
- evas_object_size_hint_min_set(thumb_icon, MSGC_IMAGE_THUMB_WIDTH, MSGC_IMAGE_THUMB_HEIGHT);
+ evas_object_size_hint_min_set(thumb_icon, image_icon_w, image_icon_h);
} else if (media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
const char *icon_path = NULL;
D_EMSG("icon_path is NULL");
elm_icon_file_set(thumb_icon, MSGC_IMG_INSERT_VOICE_ICON, NULL);
}
- evas_object_size_hint_min_set(thumb_icon, MSGC_SOUND_THUMB_WIDTH, MSGC_SOUND_THUMB_HEIGHT);
+ evas_object_size_hint_min_set(thumb_icon, sound_icon_w, sound_icon_h);
} else {
elm_icon_file_set(thumb_icon, MSGC_IMG_INSERT_ETC_ICON, NULL);
- evas_object_size_hint_min_set(thumb_icon, MSGC_SOUND_THUMB_WIDTH, MSGC_SOUND_THUMB_HEIGHT);
+ evas_object_size_hint_min_set(thumb_icon, sound_icon_w, sound_icon_h);
}
evas_object_show(thumb_icon);
}
}
- del_button = elm_icon_add(layout);
+ del_icon = elm_icon_add(layout);
if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)
- elm_icon_file_set(del_button, MSGC_SOUND_INSERT_DEL_ICON, NULL);
+ elm_icon_file_set(del_icon, MSGC_SOUND_INSERT_DEL_ICON, NULL);
else
- elm_icon_file_set(del_button, MSGC_IMG_INSERT_DEL_ICON, NULL);
+ elm_icon_file_set(del_icon, MSGC_IMG_INSERT_DEL_ICON, NULL);
+
+ evas_object_size_hint_align_set(del_icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ evas_object_data_set(del_icon, "layout", layout);
+ evas_object_data_set(del_icon, "media_type", (void *)media_type);
- evas_object_size_hint_align_set(del_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_focus_allow_set(del_button, EINA_TRUE);
+ evas_object_smart_callback_add(del_icon, "clicked", msg_ui_composer_body_media_del_btn_clicked_cb, cd);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, msg_ui_composer_body_media_del_btn_down_cb, NULL);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_media_del_btn_up_cb, NULL);
- evas_object_data_set(del_button, "layout", layout);
- evas_object_smart_callback_add(del_button, "clicked", msg_ui_composer_body_media_del_btn_clicked_cb, cd);
+ if (!cd->isAppControl) {
+ if (media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
+ evas_object_data_set(_EDJ(layout), "layout", layout);
+ edje_object_signal_callback_add(_EDJ(layout), "sound_clicked", "", msg_ui_composer_body_media_layout_clicked_cb, (void *)cd);
+ } else {
+ evas_object_data_set(thumb_icon, "layout", layout);
+ evas_object_smart_callback_add(thumb_icon, "clicked", msg_ui_composer_body_media_thumb_icon_clicked_cb, cd);
+ }
+ }
- elm_object_part_content_set(layout, "swl.del_button", del_button);
+ elm_object_part_content_set(layout, "swl.del_button", del_icon);
D_LEAVE;
return layout;
D_ENTER;
if (!cd) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] composer data is NULL");
+ D_EMSG("composer data is NULL");
return COMPOSER_RETURN_FAIL;
}
if (file_path == NULL || strlen(file_path) == 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "[ERROR] empty file path");
+ D_EMSG("empty file path");
return COMPOSER_RETURN_FAIL;
}
/* error cases */
if (page_count < 1) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] mms page count error");
+ D_EMSG("mms page count error");
return COMPOSER_RETURN_FAIL;
}
if (page_count <= cd->current_edit_entry) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] mms page count error 2");
+ D_EMSG("mms page count error case page_count <= cd->current_edit_entry");
return COMPOSER_RETURN_INVALID_PAGE;
}
if (page_data->is_sound_item || (page_data->is_image_item && page_data->isVideo))
is_new_page_needed = true;
} else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] invalid media type [%d]", media_type);
+ D_EMSG("invalid media type [%d]", media_type);
return COMPOSER_RETURN_INVALID_MEDIA_TYPE;
}
if (is_new_page_needed) {
if (msg_ui_composer_body_add_page(cd) != COMPOSER_RETURN_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] Fail of new page created");
+ D_EMSG("Fail of new page created");
return COMPOSER_RETURN_FAIL;
}
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] new page created");
+ D_MSG("new page created");
/* if new page added, current edit entry is changed to a new page's entry */
cd->current_edit_entry = page_count;
}
strncpy(page_data->sound_file_path, file_path, length);
page_data->sound_file_path[length] = '\0';
- msg_composer_common_get_media_duration(file_path, &page_data->sound_duration);
+ int media_duration = 0;
+ msg_composer_common_get_media_duration(file_path, &media_duration);
+ D_MSG("audio file duration [%d]", media_duration);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] audio file duration [%d]", page_data->sound_duration);
+ if (media_duration % 1000)
+ media_duration = media_duration / 1000 + 1;
+ else
+ media_duration = media_duration / 1000;
+
+ if (media_duration > page_data->page_duration)
+ page_data->page_duration = media_duration;
page_data->sound_item = __msg_ui_composer_body_media_layout_create(cd, page_data->sound_file_path, page_data->layout, 1);
if (page_data->sound_item) {
elm_box_pack_end(page_data->page_main_box, page_data->sound_item);
} else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] creating insert item layout error");
+ D_EMSG("creating insert item layout error");
return COMPOSER_RETURN_FAIL;
}
} else {
strncpy(page_data->image_file_path, file_path, length);
page_data->image_file_path[length] = '\0';
+ if (page_data->isVideo) {
+ int media_duration = 0;
+ msg_composer_common_get_media_duration(file_path, &media_duration);
+ D_MSG("video file duration [%d]", media_duration);
+
+ if (media_duration % 1000)
+ media_duration = media_duration / 1000 + 1;
+ else
+ media_duration = media_duration / 1000;
+
+ if (media_duration > page_data->page_duration)
+ page_data->page_duration = media_duration;
+ }
+
page_data->image_item = __msg_ui_composer_body_media_layout_create(cd, page_data->image_file_path, page_data->layout, 0);
if (page_data->image_item) {
elm_box_pack_start(page_data->page_box, page_data->image_item);
} else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] creating insert item layout error");
+ D_EMSG("creating insert item layout error");
return COMPOSER_RETURN_FAIL;
}
}
msg_ui_composer_message_type_check_and_change(cd);
msg_ui_composer_body_info_area_update(cd);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "cd->attach_index = %d", cd->attach_index);
+ D_MSG("cd->attach_index = %d", cd->attach_index);
if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {
int media_count = eina_list_count(cd->attachlist);
D_LEAVE;
}
+static void __msgc_restricted_mode_popup_close_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
+
+ MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+
+ if (cd->iter_list)
+ msg_ui_composer_body_items_add(cd);
+
+ D_LEAVE;
+}
+
+static void __msgc_warning_mode_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
+
+ MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_ALLOWED;
+
+ if (cd->iter_list)
+ msg_ui_composer_body_items_add(cd);
+ else
+ D_EMSG("cd->iter_list is NULL");
+
+ D_LEAVE;
+}
+
+static void __msgc_warning_mode_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
+
+ MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_NOT_ALLOWED;
+
+ if (cd->iter_list) {
+ /* check next iter_list(file list) */
+ cd->iter_list = eina_list_next(cd->iter_list);
+
+ if (cd->iter_list) {
+ msg_ui_composer_body_items_add(cd);
+ } else {
+ char *list_data = NULL;
+
+ if (cd->isLoad == true)
+ cd->isLoad = false;
+
+ EINA_LIST_FREE(cd->attachlist, list_data) {
+ if (list_data)
+ free(list_data);
+ }
+
+ cd->attach_index = 0;
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_NONE;
+ }
+ }
+
+ D_LEAVE;
+}
+
COMPOSER_RETURN_TYPE_E msg_ui_composer_get_message_size(MSG_COMPOSER_VIEW_DATA_S *cd, int64 *size)
{
D_ENTER;
return COMPOSER_RETURN_SUCCESS;
}
-static COMPOSER_RETURN_TYPE_E __msg_ui_composer_jpeg_image_resolution_change(const char *src_path, const char *dst_path)
+static COMPOSER_RETURN_TYPE_E __msgc_jpeg_image_get_resolution(const char *src_path, int *dst_w, int *dst_h)
{
D_ENTER;
D_MSG_RETVM_IF(src_path == NULL, COMPOSER_RETURN_FAIL, "Parameter Source Path is Invaild");
- D_MSG_RETVM_IF(dst_path == NULL, COMPOSER_RETURN_FAIL, "Parameter Destination Path is Invaild");
-
- unsigned int restrict_w = 0;
- unsigned int restrict_h = 0;
- unsigned int from_w = 0;
- unsigned int from_h = 0;
- unsigned int to_w = 0;
- unsigned int to_h = 0;
+ D_MSG_RETVM_IF(dst_w == NULL, COMPOSER_RETURN_FAIL, "dst_w is Invaild");
+ D_MSG_RETVM_IF(dst_h == NULL, COMPOSER_RETURN_FAIL, "dst_h is Invaild");
- /*Check Jpeg file*/
- const char *file_ext = msg_common_get_file_ext(src_path);
- D_MSG_RETVM_IF((strcasecmp(file_ext, "jpeg") != 0 && strcasecmp(file_ext, "jpg") != 0), COMPOSER_RETURN_FAIL, "File Ext Value is NOT Valid");
+ int restrict_w = 0;
+ int restrict_h = 0;
+ int from_w = 0;
+ int from_h = 0;
+ int to_w = 0;
+ int to_h = 0;
/*Get original image resolution*/
int util_ret = jpeg_image_get_resolution(src_path, &from_w, &from_h);
- D_MSG_RETVM_IF(util_ret != COMPOSER_UTIL_ERR_NONE, COMPOSER_RETURN_FAIL, "Fail to Get Resolution");
+ D_MSG_RETVM_IF(util_ret != COMPOSER_UTIL_RET_SUCCESS, COMPOSER_RETURN_FAIL, "Fail to Get Resolution");
D_MSG("Input IMAGE resolution %d X %d", from_w, from_h);
if (from_w > from_h) {
to_w = from_w*weight_h;
to_h = restrict_h;
} else {
- D_MSG("It does not need to resize image");
- return COMPOSER_RETURN_SUCCESS;
+ D_EMSG("It does not need to resize image");
+ return COMPOSER_RETURN_FAIL;
}
- D_MSG("Set input image resolution to %d X %d",to_w, to_h);
+ D_MSG("dest image resolution to %d X %d", to_w, to_h);
- util_ret = jpeg_image_resize(src_path, to_w, to_h, dst_path);
- if (util_ret != COMPOSER_UTIL_ERR_NONE) {
- D_EMSG("image resize error");
- return COMPOSER_RETURN_FAIL;
- }
+ *dst_w = to_w;
+ *dst_h = to_h;
D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
-static COMPOSER_RETURN_TYPE_E __msg_ui_composer_jpeg_image_quality_down(const char *src_path, const char *dst_path, int64 wishsize)
+static COMPOSER_RETURN_TYPE_E __msgc_jpeg_image_change_image(const char *src_path, int64 wishsize, MSGC_UTIL_CHANGE_IMAGE_S *req, const char *dst_path)
{
D_ENTER;
D_MSG_RETVM_IF(src_path == NULL, COMPOSER_RETURN_FAIL, "Parameter Source Path is Invaild");
D_MSG_RETVM_IF(dst_path == NULL, COMPOSER_RETURN_FAIL, "Parameter Destination Path is Invaild");
+ D_MSG_RETVM_IF(req == NULL, COMPOSER_RETURN_FAIL, "Parameter req is Invaild");
D_MSG_RETVM_IF(wishsize <= 0, COMPOSER_RETURN_FAIL, "Parameter remain size (%d) is Invaild", wishsize);
const int max_resize_loop = COMPOSER_RESIZE_LOOP_MAX;
- int quality;
- char *file_ext;
+ int quality = 0;
+ char *file_ext = NULL;
int i = 0;
int util_ret;
int percent;
percent = (int)(wishsize * 100) / file_size;
D_MSG("percent(%d) = wishsize(%lld) / filesize(%lld)", percent, wishsize, file_size);
-
/* remain size of msg / Original File Size x 100 = percentage to reduce original file
- If percent > 60 then proper quality is 95
- If 40 < percent < 60 then proper quality is 85
+ If percent > 60 then proper quality is 90
+ If 40 < percent < 60 then proper quality is 80
If 20 < percent < 40 then proper quality is 60
If 15 < percent < 20 then proper quality is 20
If 15 < percent < 20 then proper quality is 20
If 10 < percent < 15 then proper quality is 10
*/
-
if (percent > 60) {
- quality = 95;
+ quality = 90;
} else if (percent > 40) {
- quality = 85;
+ quality = 80;
} else if (percent > 20) {
quality = 60;
} else if (percent > 15) {
D_MSG("quality= %d", quality);
} else {
D_MSG("It does NOT need Quality Set");
- return COMPOSER_RETURN_SUCCESS;
+
+ if ((req->type & MSGC_IMAGE_CHANGE_RESIZE) || (req->type & MSGC_IMAGE_CHANGE_ROTATION))
+ quality = 90;
+ else
+ return COMPOSER_RETURN_SUCCESS;
}
/*Try image qulity down */
return COMPOSER_RETURN_FAIL;
}
- util_ret = jpeg_image_quality_set(src_path, quality, dst_path);
- if (util_ret == COMPOSER_UTIL_ERR_NONE) {
+ /* set quality value to image request info. */
+ req->quality = quality;
+ req->type |= MSGC_IMAGE_CHANGE_QUAILTY;
+
+ util_ret = jpeg_image_change_image(src_path, req, dst_path);
+ if (util_ret == COMPOSER_UTIL_RET_SUCCESS) {
file_size = msg_composer_get_file_size(dst_path);
quality /= 2;
+ /* init req type */
+ req->type = 0;
} else {
D_EMSG("Fail to Resizing");
return COMPOSER_RETURN_FAIL;
COMPOSER_THREAD_DATA_S *th_data;
COMPOSER_RETURN_TYPE_E ret;
char *list_data;
+ char *str = NULL;
th_data = data;
D_MSG_RETM_IF(th_data == NULL, "Thread Data is NULL");
ecore_file_remove(th_data->filepath);
if (cd->isLoad == true && cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
- snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_POP_ATTACHMENT_SIZE_MAX_Q, cd->mms_max_size/ 1024);
+ str = MSGC_STR_POP_ATTACHMENT_SIZE_MAX_Q;
+ snprintf(popup_msg, sizeof(popup_msg), str, cd->mms_max_size/ 1024);
Evas_Object *popup = msg_ui_composer_status_popup_show(cd, popup_msg, 0);
Evas_Object *btn1 = elm_button_add(popup);
evas_object_smart_callback_add(btn2, "clicked", __attach_max_popup_cancel_btn_clicked_cb, cd);
cd->popup_end = popup;
} else {
- snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_POP_ATTACHMENT_SIZE_MAX, cd->mms_max_size/ 1024);
+ str = MSGC_STR_POP_ATTACHMENT_SIZE_MAX;
+ snprintf(popup_msg, sizeof(popup_msg), str, cd->mms_max_size/ 1024);
Evas_Object *popup = msg_ui_composer_status_popup_show(cd, popup_msg, COMPOSER_STATUS_POPUP_DEFAULT_TIME);
Evas_Object *btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup_button/default");
cd->attachlist = NULL;
cd->attach_index = 0;
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_NONE;
/*resizing progress popup*/
if (cd->progress_popup) {
{
D_ENTER;
COMPOSER_RETURN_TYPE_E resize_result;
- COMPOSER_RETURN_TYPE_E ret;
MSG_COMPOSER_VIEW_DATA_S *cd;
COMPOSER_THREAD_DATA_S *th_data = data;
return;
}
+ MSGC_UTIL_CHANGE_IMAGE_S image_req = {0,};
+
if (th_data->need_ChangeResolution == true) {
- ret = __msg_ui_composer_jpeg_image_resolution_change(th_data->filepath, th_data->filepath);
- if (ret != COMPOSER_RETURN_SUCCESS) {
- th_data->status = COMPOSER_THREAD_STATUS_RESIZE_FAIL;
- return;
+ image_req.type |= MSGC_IMAGE_CHANGE_RESIZE;
+ __msgc_jpeg_image_get_resolution(th_data->filepath, &image_req.dest_width, &image_req.dest_height);
}
+
+ if (th_data->rotation) {
+ image_req.type |= MSGC_IMAGE_CHANGE_ROTATION;
+ image_req.rotation = th_data->rotation;
+
+ th_data->rotation = 0;
}
- resize_result = __msg_ui_composer_jpeg_image_quality_down(th_data->filepath, th_data->filepath, th_data->wishsize);
+ resize_result = __msgc_jpeg_image_change_image(th_data->filepath, th_data->wishsize, &image_req, th_data->filepath);
if (resize_result == COMPOSER_RETURN_SUCCESS) {
th_data->status = COMPOSER_THREAD_STATUS_RESIZE_SUCCESS;
ecore_thread_feedback(thread, th_data->filepath);
Eina_List *l = NULL;
Eina_List *o = NULL;
char popup_msg[DEF_BUF_LEN_L] = { 0, };
+ char *str = NULL;
if (cd->iter_list)
o = cd->iter_list;
evas_object_smart_callback_add(btn1, "clicked", msg_ui_composer_status_popup_response_cb, popup);
break;
} else if (ret == COMPOSER_RETURN_OVERSIZE_FILE) {
-
if (cd->isLoad == true && cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
- snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_POP_ATTACHMENT_SIZE_MAX_Q, cd->mms_max_size/ 1024);
+ str = MSGC_STR_POP_ATTACHMENT_SIZE_MAX_Q;
+ snprintf(popup_msg, sizeof(popup_msg), str, cd->mms_max_size/ 1024);
Evas_Object *popup = msg_ui_composer_status_popup_show(cd, popup_msg, 0);
Evas_Object *btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup_button/default");
elm_object_part_content_set(popup, "button1", btn1);
evas_object_smart_callback_add(btn1, "clicked", __attach_max_popup_ok_btn_clicked_cb, cd);
Evas_Object *btn2 = elm_button_add(popup);
- elm_object_style_set(btn1, "popup_button/default");
+ elm_object_style_set(btn2, "popup_button/default");
elm_object_text_set(btn2, MSGC_STR_BUTTON_CANCEL);
elm_object_part_content_set(popup, "button2", btn2);
evas_object_smart_callback_add(btn2, "clicked", __attach_max_popup_cancel_btn_clicked_cb, cd);
cd->popup_end = popup;
} else {
- snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_POP_ATTACHMENT_SIZE_MAX, cd->mms_max_size/ 1024);
+ str = MSGC_STR_POP_ATTACHMENT_SIZE_MAX;
+ snprintf(popup_msg, sizeof(popup_msg), str, cd->mms_max_size/ 1024);
Evas_Object *popup = msg_ui_composer_status_popup_show(cd, popup_msg, 0);
Evas_Object *btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup_button/default");
}
break;
+ } else if (ret == COMPOSER_RETURN_CREATION_RESTRICTED_MODE_FAIL) {
+ Evas_Object *popup = msg_ui_composer_status_popup_show(cd, _MSGSTR("Unsupported media type. Select different media"), 0);
+ Evas_Object *btn1 = elm_button_add(popup);
+ elm_object_style_set(btn1, "popup_button/default");
+ elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);
+ elm_object_part_content_set(popup, "button1", btn1);
+ evas_object_smart_callback_add(btn1, "clicked", __msgc_restricted_mode_popup_close_btn_clicked_cb, cd);
+ cd->popup_end = popup;
+ break;
+ } else if (ret == COMPOSER_RETURN_CREATION_WARINING_MODE_FAIL) {
+ Evas_Object *popup = msg_ui_composer_status_popup_show(cd, _MSGSTR("Restricted content type. Attach anyway?"), 0);
+ Evas_Object *btn1 = elm_button_add(popup);
+ elm_object_style_set(btn1, "popup_button/default");
+ elm_object_text_set(btn1, MSGC_STR_BUTTON_OK);
+ elm_object_part_content_set(popup, "button1", btn1);
+ evas_object_smart_callback_add(btn1, "clicked", __msgc_warning_mode_popup_ok_btn_clicked_cb, cd);
+ Evas_Object *btn2 = elm_button_add(popup);
+ elm_object_style_set(btn2, "popup_button/default");
+ elm_object_text_set(btn2, MSGC_STR_BUTTON_CANCEL);
+ elm_object_part_content_set(popup, "button2", btn2);
+ evas_object_smart_callback_add(btn2, "clicked", __msgc_warning_mode_popup_cancel_btn_clicked_cb, cd);
+ cd->popup_end = popup;
+ break;
+ } else if (ret == COMPOSER_RETURN_CREATION_RESTRICTED_MODE_PASS ||
+ ret == COMPOSER_RETURN_CREATION_WARINING_MODE_PASS) {
+ D_MSG("skip this file = (%s)", list_data);
} else if (ret != COMPOSER_RETURN_SUCCESS) {
msg_ui_composer_status_popup_show(cd, _MSGSTR("IDS_MSGC_POP_MMSCANTADD"), COMPOSER_STATUS_POPUP_DEFAULT_TIME);
D_MSG("Fail to add item");
if (ret == COMPOSER_RETURN_RESIZE_IMAGE) {
cd->iter_list = eina_list_next(l);
+ } else if (ret == COMPOSER_RETURN_CREATION_RESTRICTED_MODE_FAIL) {
+ cd->iter_list = eina_list_next(l);
+
+ if (!cd->iter_list)
+ goto clear_data;
+ } else if (ret == COMPOSER_RETURN_CREATION_WARINING_MODE_FAIL) {
+ /* keep current file */
+ cd->iter_list = l;
} else {
- if (cd->isLoad == true)
- cd->isLoad = false;
-
- EINA_LIST_FREE(cd->attachlist,list_data) {
- if (list_data)
- free(list_data);
- }
- cd->iter_list = NULL;
- cd->attach_index = 0;
+ goto clear_data;
}
D_LEAVE;
return ret;
+
+clear_data:
+ if (cd->isLoad == true)
+ cd->isLoad = false;
+
+ EINA_LIST_FREE(cd->attachlist,list_data) {
+ if (list_data)
+ free(list_data);
+ }
+ cd->iter_list = NULL;
+ cd->attach_index = 0;
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_NONE;
+
+ return ret;
}
bool msg_ui_composer_body_weburi_append(MSG_COMPOSER_VIEW_DATA_S *cd, const char *uri)
D_MSG("media_type = %d", media_type);
/*Check Creation Mode*/
- bool bIsSuitable = true;
+ COMPOSER_UTIL_RETURN_E allowed_type = COMPOSER_UTIL_RET_ERR;
int creationMode;
+ bool need_to_resize = false; /* set for restricted resizing image */
msg_struct_t setting = NULL;
+
setting = msg_create_struct(MSG_STRUCT_SETTING_MMS_SEND_OPT);
if (setting) {
msg_get_mms_send_opt(cd->msg_handle, setting);
if (msg_get_int_value(setting, MSG_MMS_SENDOPT_CREATION_MODE_INT, &creationMode) == MSG_SUCCESS) {
if (creationMode == MSG_CREATION_MODE_RESTRICTED || creationMode == MSG_CREATION_MODE_WARNING) {
- D_MSG("restricted");
- bIsSuitable = msg_composer_util_is_allow_creation_mode(item_path, media_type);
+ allowed_type = msg_composer_is_allowed_creation_mode(item_path, media_type, creationMode);
}
}
D_EMSG("msg_create_struct is failed");
}
+ /* creation restricted mode */
+ if (creationMode == MSG_CREATION_MODE_RESTRICTED) {
+ if (allowed_type == COMPOSER_UTIL_RET_NOT_ALLOWED) {
+ if (cd->body_data.creation_allowed != COMPOSER_CONTENT_CREATION_NOT_ALLOWED) {
+ cd->body_data.creation_allowed = COMPOSER_CONTENT_CREATION_NOT_ALLOWED;
+ /* show restricted popup one time */
+ return COMPOSER_RETURN_CREATION_RESTRICTED_MODE_FAIL;
+ } else {
+ return COMPOSER_RETURN_CREATION_RESTRICTED_MODE_PASS;
+ }
+ } else if (allowed_type == COMPOSER_UTIL_RET_ALLOWED_WITH_RESIZE) {
+ need_to_resize = true;
+ }
+ }
+
+ /* creation warning mode */
+ if (creationMode == MSG_CREATION_MODE_WARNING) {
+ if (allowed_type == COMPOSER_UTIL_RET_NOT_ALLOWED) {
+ if (cd->body_data.creation_allowed != COMPOSER_CONTENT_CREATION_ALLOWED &&
+ cd->body_data.creation_allowed != COMPOSER_CONTENT_CREATION_NOT_ALLOWED) {
+ /* show warning popup one time */
+ return COMPOSER_RETURN_CREATION_WARINING_MODE_FAIL;
+ } else if (cd->body_data.creation_allowed == COMPOSER_CONTENT_CREATION_NOT_ALLOWED) {
+ return COMPOSER_RETURN_CREATION_WARINING_MODE_PASS;
+ }
+ }
+ }
+
/*Check file size && resize able (if Image)*/
int64 msg_size, file_size, remain_size;
ret = msg_ui_composer_get_message_size(cd, &msg_size);
remain_size = cd->mms_max_size - msg_size;
file_size = msg_composer_get_file_size(item_path);
- if (file_size > remain_size) {
+ if (file_size > remain_size || need_to_resize) {
char *file_ext = msg_common_get_file_ext(item_path);
/*If image type resize*/
th_data->cd = cd;
- if (bIsSuitable) {
- th_data->need_ChangeResolution = false;
- D_MSG("Suitable");
- } else {
+ if (need_to_resize) {
th_data->need_ChangeResolution = true;
- D_MSG("Not Suitable");
+ D_MSG("need to resize");
+ } else {
+ th_data->need_ChangeResolution = false;
}
th_data->wishsize = remain_size;
return COMPOSER_RETURN_FAIL;
}
+ /* get rotation info */
+ int rotation = 0;
+ th_data->rotation = 0;
+
+ if (jpeg_image_get_rotation(th_data->filepath, &rotation) == COMPOSER_UTIL_RET_SUCCESS)
+ th_data->rotation = rotation;
+
if (!cd->progress_popup)
cd->progress_popup = msg_ui_composer_progress_popup_show(th_data->cd, _MSGSTR("IDS_MSGC_BODY_PICTURE_TOO_LARGE_COMPRESSING_ING"));
char local_item_path[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
/* copy temp file */
ret = msg_ui_composer_common_get_file(cd, item_path, local_item_path, COMPOSER_FILEPATH_LEN_MAX);
-
if (ret != COMPOSER_RETURN_SUCCESS) {
D_EMSG("get file error");
return COMPOSER_RETURN_FAIL;
}
- if (bIsSuitable) {
- if (media_type == COMPOSER_MEDIA_TYPE_IMAGE || media_type == COMPOSER_MEDIA_TYPE_VIDEO || media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
- msg_ui_composer_body_insert_media(cd, local_item_path, media_type);
- } else {
- msg_ui_composer_add_attach_media(cd, local_item_path, media_type);
+ /* rotate image if required*/
+ char *file_ext = msg_common_get_file_ext(local_item_path);
+ if (media_type == COMPOSER_MEDIA_TYPE_IMAGE
+ && is_drm == false
+ && (strcasecmp(file_ext, "jpeg") == 0 || strcasecmp(file_ext, "jpg") == 0)) {
+ int rotation = 0;
+
+ if (jpeg_image_get_rotation(local_item_path, &rotation) == COMPOSER_UTIL_RET_SUCCESS) {
+ if (jpeg_image_rotate_image(local_item_path, rotation, local_item_path) != COMPOSER_UTIL_RET_SUCCESS)
+ D_EMSG("jpeg_image_rotate_image is failed");
}
+ }
+
+ if (media_type == COMPOSER_MEDIA_TYPE_IMAGE || media_type == COMPOSER_MEDIA_TYPE_VIDEO || media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
+ msg_ui_composer_body_insert_media(cd, local_item_path, media_type);
} else {
- D_MSG("Adding Item is not Suitable to add");
- return COMPOSER_RETURN_FAIL;
+ msg_ui_composer_add_attach_media(cd, local_item_path, media_type);
}
}
evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
icon = elm_icon_add(parent);
- elm_icon_file_set(icon, MSGC_IMG_SEND_ICON, NULL);
+ elm_icon_file_set(icon, MSGC_SMS_SEND_ICON, NULL);
elm_object_part_content_set(button, "icon", icon);
evas_object_show(button);
void msg_ui_composer_body_delete(MSG_COMPOSER_VIEW_DATA_S *cd)
{
+ msg_ui_composer_body_clear(cd);
+ if (cd->ly_body) {
+ evas_object_del(cd->ly_body);
+ cd->ly_body = NULL;
+ }
}
void msg_ui_composer_body_clear(MSG_COMPOSER_VIEW_DATA_S *cd)
D_ENTER;
if (!pcomp_data) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] composer data is NULL");
+ D_EMSG("composer data is NULL");
return COMPOSER_RETURN_NULL_POINTER;
}
return COMPOSER_RETURN_SUCCESS;
}
+COMPOSER_RETURN_TYPE_E msg_ui_composer_body_set_loaded_page_duration(MSG_COMPOSER_VIEW_DATA_S *pcomp_data, int duration, int nPage)
+{
+ D_ENTER;
+
+ if (!pcomp_data) {
+ D_EMSG("composer data is NULL");
+ return COMPOSER_RETURN_NULL_POINTER;
+ }
+
+ if (pcomp_data->body_data.page_count < nPage + 1) {
+ D_EMSG("Invalid page count nPage = %d", nPage);
+ return COMPOSER_RETURN_INVALID_PAGE;
+ }
+
+ Eina_List *pagelist = pcomp_data->body_data.page_list;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(pagelist, nPage);
+
+ if (duration > COMPOSER_PAGE_DEFAULT_DURATION)
+ page_data->page_duration = duration;
+
+ D_LEAVE;
+ return COMPOSER_RETURN_SUCCESS;
+}
+
COMPOSER_RETURN_TYPE_E msg_ui_composer_body_data_init(MSG_COMPOSER_VIEW_DATA_S *pcomp_data)
{
D_ENTER;
if (!pcomp_data) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] composer data is NULL;");
+ D_EMSG("composer data is NULL;");
return COMPOSER_RETURN_FAIL;
}
D_ENTER;
if (!cd || !entry) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] NULL parameter passed.");
+ D_EMSG("NULL parameter passed.");
return false;
}
int cms_max_count = 0;
int char_encode = COMPOSER_CHAR_ENCODE_MAX;
char* body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
- unsigned char ucs2_text[4000] = {0,};
+ unsigned char ucs2_text[COMPOSER_MMS_TEXT_MAX_CHAR * 2] = {0,};
if (body_text == NULL){
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "[ERROR] no text on there")
+ D_EMSG("no text on there")
return false;
}
- ucs2_len = msg_ui_composer_convert_UTF8ToUCS2(ucs2_text, 4000, body_text, strlen(body_text));
+ ucs2_len = msg_ui_composer_convert_UTF8ToUCS2(ucs2_text, sizeof(ucs2_text), body_text, strlen(body_text));
free(body_text);
char_encode = msg_ui_composer_body_entry_char_count(cd, ucs2_text, ucs2_len, &char_count);
if (char_encode == COMPOSER_CHAR_ENCODE_UNICODE) {
- cms_max_count = COMPOSER_CMS_UNICODE_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ cms_max_count = COMPOSER_CMS_UNICODE_MAX_LEN * cd->cms_max_page;
} else if (char_encode == COMPOSER_CHAR_ENCODE_GSM7) {
- cms_max_count = COMPOSER_CMS_GSM7_MAX_LEN * COMPOSER_CMS_MAX_PAGE;
+ cms_max_count = COMPOSER_CMS_GSM7_MAX_LEN * cd->cms_max_page;
} else {
return false;
}
D_LEAVE;
- if (cms_page > COMPOSER_CMS_MAX_PAGE || cms_max_count < char_count) {
+ if (cms_page > cd->cms_max_page || cms_max_count < char_count) {
return true;
} else {
return false;
Eina_Bool msg_ui_composer_body_is_mms(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
-
- if (!cd) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] composer data is NULL");
- return EINA_FALSE;
- }
+ D_MSG_RETVM_IF(cd == NULL, EINA_FALSE, "param is NULL");
MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
Eina_List *page_list = body_data->page_list;
MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
if (body_data->page_count > 1) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] composer message type MMS (multi-page)");
+ D_MSG("composer message type MMS (multi-page)");
return EINA_TRUE;
} else if (body_data->page_count == 1) {
page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, 0);
if (!page_data) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL");
+ D_EMSG("page data is NULL");
return EINA_FALSE;
}
if (page_data->is_image_item && (strlen(page_data->image_file_path) > 0)) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] composer message type MMS (image/video data exist)");
+ D_MSG("composer message type MMS (image/video data exist)");
return EINA_TRUE;
}
if (page_data->is_sound_item && (strlen(page_data->sound_file_path) > 0)) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] composer message type MMS (image/video data exist)");
+ D_MSG("composer message type MMS (sound data exist)");
return EINA_TRUE;
}
if (__msg_ui_composer_is_mms_text(cd, page_data->entry) == true) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG] number of body character is over CMS max count)");
+ D_MSG("number of body character is over CMS max count)");
return EINA_TRUE;
}
} else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page_count value is not valid");
+ D_EMSG("page_count value is not valid");
return EINA_FALSE;
}
return EINA_FALSE;
}
+bool msg_ui_composer_body_has_media(MSG_COMPOSER_VIEW_DATA_S *cd)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(cd == NULL, false, "param is NULL");
+
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+ Eina_List *page_list = body_data->page_list;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+
+ if (body_data->page_count > 1) {
+ D_MSG("composer message type MMS (multi-page)");
+ return true;
+ } else if (body_data->page_count == 1) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, 0);
+ if (!page_data) {
+ D_EMSG("page data is NULL");
+ return false;
+ }
+
+ if (page_data->is_image_item && (strlen(page_data->image_file_path) > 0)) {
+ D_MSG("composer message type MMS (image/video data exist)");
+ return true;
+ }
+
+ if (page_data->is_sound_item && (strlen(page_data->sound_file_path) > 0)) {
+ D_MSG("composer message type MMS (sound data exist)");
+ return true;
+ }
+
+ if (page_data->entry) {
+ bool has_text = false;
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));
+
+ if (body_text) {
+ if (strlen(body_text))
+ has_text = true;
+
+ free(body_text);
+ }
+
+ return has_text;
+ }
+
+ } else {
+ D_EMSG("page_count value is not valid");
+ return false;
+ }
+
+ return false;
+}
+
void msg_ui_composer_body_focus_set(MSG_COMPOSER_VIEW_DATA_S *cd, int nPage)
{
D_ENTER;
D_LEAVE;
}
+
+void msg_ui_composer_body_update_send_btn_icon(MSG_COMPOSER_VIEW_DATA_S *cd, bool disable)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ const char *file_path = NULL;
+ Evas_Object *icon = NULL;
+
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) { /* mms type */
+ if (disable) {
+ file_path = MSGC_MMS_SEND_DIM_ICON;
+ } else {
+ file_path = MSGC_MMS_SEND_ICON;
+ }
+ } else { /* sms type */
+ if (disable) {
+ file_path = MSGC_SMS_SEND_DIM_ICON;
+ } else {
+ file_path = MSGC_SMS_SEND_ICON;
+ }
+ }
+
+ if (file_path) {
+ icon = elm_icon_add(cd->send_button);
+ elm_icon_file_set(icon, file_path, NULL);
+ elm_object_part_content_set(cd->send_button, "icon", icon);
+ evas_object_show(icon);
+ } else {
+ D_EMSG("Invalid icon_path");
+ }
+
+ D_LEAVE;
+}
+
+COMPOSER_RETURN_TYPE_E msg_ui_composer_check_is_text_top(msg_struct_t region_0, msg_struct_t region_1, bool *is_text_top)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(region_0 == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
+ D_MSG_RETVM_IF(region_1 == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
+ D_MSG_RETVM_IF(is_text_top == NULL, COMPOSER_RETURN_FAIL, "is_text_top is NULL");
+
+ int top_0 = 0;
+ int top_1 = 0;
+ int height_0 = 0;
+ int height_1 = 0;
+ char sz_id_0[MAX_SMIL_REGION_ID] = {0,};
+ char sz_id_1[MAX_SMIL_REGION_ID] = {0,};
+
+ /* get region_0 */
+ msg_get_str_value(region_0, MSG_MMS_REGION_ID_STR, sz_id_0, sizeof(sz_id_0));
+ msg_get_int_value(region_0, MSG_MMS_REGION_LENGTH_TOP_INT, &top_0);
+ msg_get_int_value(region_0, MSG_MMS_REGION_LENGTH_HEIGHT_INT, &height_0);
+
+ /* get region_1 */
+ msg_get_str_value(region_1, MSG_MMS_REGION_ID_STR, sz_id_1, sizeof(sz_id_1));
+ msg_get_int_value(region_1, MSG_MMS_REGION_LENGTH_TOP_INT, &top_1);
+ msg_get_int_value(region_1, MSG_MMS_REGION_LENGTH_HEIGHT_INT, &height_1);
+
+ /*check text top
+ * if (text's top == 0 & image's top != 0)
+ * text top
+ * else if (text's top < image's top)
+ * text top
+ * else if (text's top == 0 & image's top == 0) {
+ * if (text' height < image's height )
+ * text top
+ * }
+ */
+
+ *is_text_top = false;
+
+ /* find and set image, text region */
+ if (!strcasecmp(sz_id_0, "Image")) { /* region_0 is IMAGE REGION */
+ if (top_1 == 0 && top_0 != 0) {
+ *is_text_top = true;
+ } else if (top_1 < top_0) {
+ *is_text_top = true;
+ } else if (top_1 == 0 && top_0 == 0) {
+ if (height_1 < height_0) {
+ *is_text_top = true;
+ }
+ }
+
+ } else if (!strcasecmp(sz_id_1, "Image")) { /* region_1 is IMAGE_REGION */
+ if (top_0 == 0 && top_1 != 0) {
+ *is_text_top = true;
+ } else if (top_0 < top_1) {
+ *is_text_top = true;
+ } else if (top_0 == 0 && top_1 == 0) {
+ if (height_0 < height_1) {
+ *is_text_top = true;
+ }
+ }
+ }
+
+ D_LEAVE;
+ return COMPOSER_RETURN_SUCCESS;
+}
+
#include <Elementary.h>
#include <utilX.h>
#include <Ecore_X.h>
-#include <aul.h>
#include <mmf/mm_error.h>
-#include <mm_file.h>
-#include <mm_util_jpeg.h>
-#include <devman_haptic.h>
+#include <metadata_extractor.h>
+#include <image_util.h>
#include "msg-ui-composer-common.h"
#include "msg-ui-composer-subject.h"
#include "msg-ui-composer-body.h"
+#include "msg-ui-composer-body-callback.h"
#include "msg-ui-composer-attachment.h"
#include "msg-ui-composer-recipient.h"
#include "msg-ui-composer-popup.h"
{"xxx", "application/octet-stream", COMPOSER_MEDIA_TYPE_UNKNOWN},
};
-/* vib feedback apply when message type change*/
-static bool bVibrating;
-static int dev_handle;
-
char *msg_ui_composer_edj_get(MSG_COMPOSER_VIEW_DATA_S *cd)
{
return MSGC_UI_DEFAULT_EDJ;
COMPOSER_RETURN_TYPE_E msg_composer_common_get_media_duration(const char *file_path, int *duration)
{
- MMHandleType content_attrs = 0;
- int ret = 0;
+ D_ENTER;
+
+ metadata_extractor_h metadata_h = NULL;
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ char *value = NULL;
if (!file_path || !duration) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] file_path or duration is not exist");
+ D_EMSG("file_path or duration is not exist");
return COMPOSER_RETURN_FAIL;
}
- ret = mm_file_create_content_attrs(&content_attrs, file_path);
- if (ret == MM_ERROR_NONE) {
- char *error = NULL;
-
- ret = mm_file_get_attrs(content_attrs, &error, MM_FILE_CONTENT_DURATION, duration, NULL);
+ ret = metadata_extractor_create(&metadata_h);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_create is failed ret = %d", ret);
+ return COMPOSER_RETURN_FAIL;
+ }
- if (ret != MM_ERROR_NONE) {
- if (error) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG]fail to mm_file_get_attrs() - ret(%x), error(%s)", ret, error);
- free(error);
- } else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG]fail to mm_file_get_attrs() - ret(%x)", ret);
- }
+ ret = metadata_extractor_set_path(metadata_h, file_path);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_set_path is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
+ return COMPOSER_RETURN_FAIL;
+ }
- if (content_attrs)
- mm_file_destroy_content_attrs(content_attrs);
+ ret = metadata_extractor_get_metadata(metadata_h, METADATA_DURATION, &value);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_get_metadata is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
+ return COMPOSER_RETURN_FAIL;
+ }
- return COMPOSER_RETURN_FAIL;
- }
+ if (value) {
+ *duration = atoi(value);
+ free(value);
+ }
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG]file : %s, duration : %d", file_path, *duration);
- } else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[DEBUG]fail to mm_file_create_content_attrs() - ret(%x)", ret);
+ D_MSG("file : %s, duration : %d", file_path, *duration);
- if (content_attrs)
- mm_file_destroy_content_attrs(content_attrs);
+ metadata_extractor_destroy(metadata_h);
- return COMPOSER_RETURN_FAIL;
- }
+ D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
return COMPOSER_RETURN_FAIL;
}
+ bool ret = msg_ui_composer_common_is_send_possible(cd);
+ msg_ui_composer_body_update_send_btn_icon(cd, !ret);
+
D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
return NULL;
}
+bool msg_ui_composer_last_focus_is_recipient(void *data)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(data == NULL, false, "data is NULL");
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ RECIPIENT_S *recipient = cd->recipient;
+ Evas_Object *last_focus = msg_ui_composer_last_focused_entry_get(cd);
+
+ if (last_focus && recipient) {
+ if (last_focus == recipient->mbe) {
+ return true;
+ }
+ }
+
+ D_LEAVE;
+ return false;
+}
+
void bundle_send_to_result(void *data, char *key, char *val)
{
D_ENTER;
return false;
}
-static gboolean __msg_ui_composer_vib_timeout_cb(gpointer data)
+COMPOSER_RETURN_TYPE_E msg_composer_common_get_image_in_video(const char *video_file_path, char *image_file_path)
{
D_ENTER;
- int ret = 0;
-
- if (bVibrating == true) {
- ret = device_haptic_stop_play(dev_handle);
-
- if (ret != 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Fail to stop haptic : [%d]", ret);
- }
-
- ret = device_haptic_close(dev_handle);
-
- if (ret != 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Fail to close haptic : [%d]", ret);
- }
+ COMPOSER_MEDIA_TYPE_E media_type;
+ metadata_extractor_h metadata_h = NULL;
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ int video_w = 0;
+ int video_h = 0;
+ int thumbsize = 0;
+ void *thumbnail = NULL;
+ char *value = NULL;
- bVibrating = false;
+ media_type = msg_composer_get_media_type(video_file_path);
+ if (media_type != COMPOSER_MEDIA_TYPE_VIDEO) {
+ D_EMSG("It is not video file %s", video_file_path);
+ return COMPOSER_RETURN_FAIL;
}
- D_LEAVE;
-
- return FALSE;
-}
-
-void msg_ui_composer_common_play_vibration()
-{
- D_ENTER;
-
- int ret = 0;
- int vibPattern = EFFCTVIBE_NOTIFICATION;
-
- bVibrating = true;
- dev_handle = device_haptic_open(DEV_IDX_0, 0);
-
- g_timeout_add(150, __msg_ui_composer_vib_timeout_cb, NULL);
-
- ret = device_haptic_play_pattern(dev_handle, vibPattern, 1, HAPTIC_FEEDBACK_LEVEL_5);
+ ret = metadata_extractor_create(&metadata_h);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_create is failed ret = %d", ret);
+ return COMPOSER_RETURN_FAIL;
+ }
- if (ret != 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Fail to play haptic : [%d]", ret);
+ ret = metadata_extractor_set_path(metadata_h, video_file_path);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_set_path is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
+ return COMPOSER_RETURN_FAIL;
}
- D_LEAVE;
-}
+ ret = metadata_extractor_get_metadata(metadata_h, METADATA_VIDEO_WIDTH, &value);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_get_metadata is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
+ return COMPOSER_RETURN_FAIL;
+ }
-COMPOSER_RETURN_TYPE_E msg_composer_common_get_image_in_video(const char *video_file_path, char *image_file_path)
-{
- COMPOSER_MEDIA_TYPE_E media_type;
- MMHandleType content_attrs = 0;
- int ret;
- int video_track_num = 0;
- int video_w = 0, video_h = 0, thumbsize = 0;
- void *thumbnail = NULL;
+ if (value) {
+ video_w = atoi(value);
+ free(value);
+ value = NULL;
+ }
- media_type = msg_composer_get_media_type(video_file_path);
- if (media_type != COMPOSER_MEDIA_TYPE_VIDEO) {
- D_EMSG("It is not video file %s", video_file_path);
+ ret = metadata_extractor_get_metadata(metadata_h, METADATA_VIDEO_HEIGHT, &value);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_get_metadata is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
return COMPOSER_RETURN_FAIL;
}
- ret = mm_file_create_content_attrs(&content_attrs, video_file_path);
- if (ret != MM_ERROR_NONE){
- D_EMSG("Fail to get content of %s", video_file_path);
+ if (value) {
+ video_h = atoi(value);
+ free(value);
+ value = NULL;
+ }
+
+ ret = metadata_extractor_get_frame(metadata_h, &thumbnail, &thumbsize);
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
+ D_EMSG("metadata_extractor_get_frame is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
return COMPOSER_RETURN_FAIL;
}
+ if (thumbnail) {
+ ret = image_util_encode_jpeg((unsigned char *)thumbnail, video_w, video_h, IMAGE_UTIL_COLORSPACE_RGB888, 100, image_file_path);
- mm_file_get_attrs(content_attrs, NULL, MM_FILE_CONTENT_VIDEO_TRACK_COUNT, &video_track_num, NULL);
- if (video_track_num) {
- mm_file_get_attrs(content_attrs, NULL, MM_FILE_CONTENT_VIDEO_WIDTH, &video_w,
- MM_FILE_CONTENT_VIDEO_HEIGHT, &video_h,
- MM_FILE_CONTENT_VIDEO_THUMBNAIL, &thumbnail, &thumbsize, NULL);
+ free(thumbnail);
- if (thumbnail) {
- ret = mm_util_jpeg_encode_to_file(image_file_path, thumbnail, video_w, video_h, MM_UTIL_JPEG_FMT_RGB888, 100);
- if (ret) {
- D_EMSG("Fail of save image file %s", image_file_path);
- mm_file_destroy_content_attrs(content_attrs);
- return COMPOSER_RETURN_FAIL;
- }
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_encode_jpeg is failed ret = %d", ret);
+ metadata_extractor_destroy(metadata_h);
+ return COMPOSER_RETURN_FAIL;
}
}
- mm_file_destroy_content_attrs(content_attrs);
+ metadata_extractor_destroy(metadata_h);
+
+ D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
char *convert_text = NULL;
D_MSG("text [%s]", *text);
/* Check preeditting text and return if it exist*/
- preedit_str = strstr(*text, "<preedit_sel>");
- if (preedit_str) return;
+ preedit_str = strstr(*text, "<preedit>");
+ if (preedit_str)
+ return;
/* convert from markup text to utf8 text from entry */
utf8_text = elm_entry_markup_to_utf8(*text);
+
if (utf8_text) {
/* If the string contains "Carrage return ('\n'), it should be changed "<br>" to show properly*/
convert_text = elm_entry_utf8_to_markup(utf8_text);
D_MSG_RETM_IF(cd == NULL, "Composer Data is Invalid");
if (tickertype == COMPOSER_TICKERNOTI_COUNT_MAX) {
- snprintf(popup_msg, sizeof(popup_msg)-1, MSGC_STR_NOTI_RECIPIENT_MAX, COMPOSER_RECIPIENT_COUNT_MAX);
+ const char *str = MSGC_STR_NOTI_RECIPIENT_MAX;
+ snprintf(popup_msg, sizeof(popup_msg), str, COMPOSER_RECIPIENT_COUNT_MAX);
} else if (tickertype == COMPOSER_TICKERNOTI_DUP_RECP) {
- snprintf(popup_msg, sizeof(popup_msg)-1, MSGC_STR_NOTI_RECIPIENT_DUP);
+ snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_NOTI_RECIPIENT_DUP);
} else if (tickertype == COMPOSER_TICKERNOTI_INVALID_RECP) {
- snprintf(popup_msg, sizeof(popup_msg)-1, MSGC_STR_NOTI_RECIPIENT_INVALID);
+ snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_NOTI_RECIPIENT_INVALID);
} else if (tickertype == COMPOSER_TICKERNOTI_CHANGED_SMS) {
- snprintf(popup_msg, sizeof(popup_msg)-1, MSGC_STR_NOTI_CHANGE_SMS);
+ snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_NOTI_CHANGE_SMS);
} else if (tickertype == COMPOSER_TICKERNOTI_CHANGED_MMS) {
- snprintf(popup_msg, sizeof(popup_msg)-1, MSGC_STR_NOTI_CHANGE_MMS);
+ snprintf(popup_msg, sizeof(popup_msg), MSGC_STR_NOTI_CHANGE_MMS);
} else if (tickertype == COMPOSER_TICKERNOTI_AUTO_SAVED) {
- snprintf(popup_msg, sizeof(popup_msg)-1, _MSGSTR("IDS_MSGC_POP_MESSAGE_SAVED_AS_DRAFT"));
+ snprintf(popup_msg, sizeof(popup_msg), _MSGSTR("IDS_MSGC_POP_MESSAGE_SAVED_AS_DRAFT"));
} else if (tickertype == COMPOSER_TICKERNOTI_NO_RECIPIENT) {
- snprintf(popup_msg, sizeof(popup_msg)-1, _MSGSTR("IDS_MSGF_POP_NO_RECIPIENTS_ADDED_ENTER_RECIPIENTS"));
+ snprintf(popup_msg, sizeof(popup_msg), _MSGSTR("IDS_MSGF_POP_NO_RECIPIENTS_ADDED_ENTER_RECIPIENTS"));
} else if (tickertype == COMPOSER_TICKERNOTI_MAXLENGHT_CHAR) {
- snprintf(popup_msg, sizeof(popup_msg)-1, _MSGSTR("Maximum number of characters reached"));
+ snprintf(popup_msg, sizeof(popup_msg), _MSGSTR("IDS_MSGF_POP_MAXIMUM_CHARACTERS"));
} else {
return;
}
if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
RECIPIENT_S *rd = cd->recipient;
- int recipient_h = rd->recipient_h;
+ D_MSG_RETM_IF(rd == NULL, "recipient Data is NULL");
+ int recipient_h = 0;
+
+ recipient_h = rd->recipient_h;
D_MSG("recipient_h = %d", recipient_h);
if (cd->rotate == COMPOSER_ROTATE_PORTRAIT || cd->rotate == COMPOSER_ROTATE_PORTRAIT_UPSIDEDOWN)
D_LEAVE;
}
-void msg_ui_composer_entry_imf_resize_cb(void * data, Ecore_IMF_Context *ctx, int value)
+void msg_ui_composer_make_default_body_size(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ int scroll_height = COMPOSER_FRAME_BODY_LANDSCAPE_HEIGHT_MIN;
+
+ cd->is_default_body_size = true;
+
+ msg_ui_composer_contract_attach_list(cd);
+
+ evas_object_size_hint_max_set(cd->body_scroll, 9999, scroll_height);
+ elm_scroller_content_min_limit(cd->body_scroll, EINA_FALSE, EINA_TRUE);
+ /* move scroll to top */
+ elm_scroller_region_show(cd->body_scroll, 0, 0, 0, 0);
+
+ evas_object_event_callback_add(cd->body_box, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_body_layout_clicked_cb, cd);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_entry_imf_resize_cb(void * data, Ecore_IMF_Context *ctx, int value)
+{
+ D_ENTER;
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
D_MSG_RETM_IF(cd == NULL, "Composer Data is Invalid");
D_MSG_RETM_IF(ctx == NULL, "Ecore_IMF_Context is Invalid");
ecore_imf_context_input_panel_geometry_get(ctx, &keypad_x, &keypad_y, &keypad_w, &keypad_h);
D_MSG("keypad x = %d, y = %d, w = %d, h = %d", keypad_x, keypad_y, keypad_w, keypad_h);
- if (keypad_w != 0 && keypad_h != 0)
- msg_ui_composer_change_body_scroll_size(cd, keypad_h);
+ D_MSG("cd->make_default_body_size = %d", cd->make_default_body_size);
+
+ if (cd->make_default_body_size) {
+ if (!cd->is_keypad_show)
+ cd->make_default_body_size = false;
+ } else {
+ if (keypad_w != 0 && keypad_h != 0)
+ msg_ui_composer_change_body_scroll_size(cd, keypad_h);
+ }
D_LEAVE;
}
D_MSG_RETM_IF(ctx == NULL, "Ecore_IMF_Context is Invalid");
if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
- D_MSG("Imf status SHOW");
int keypad_x = 0;
int keypad_y = 0;
int keypad_w = 0;
int keypad_h = 0;
+ D_MSG("Imf status SHOW");
+
+ cd->is_keypad_show = true;
+
ecore_imf_context_input_panel_geometry_get(ctx, &keypad_x, &keypad_y, &keypad_w, &keypad_h);
D_MSG("keypad x = %d, y = %d, w = %d, h = %d", keypad_x, keypad_y, keypad_w, keypad_h);
+
msg_ui_composer_change_body_scroll_size(cd, keypad_h);
} else if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
D_MSG("Imf status HIDE");
+
+ cd->is_keypad_show = false;
+
+ D_MSG("cd->make_default_body_size = %d", cd->make_default_body_size);
+
+ if (cd->make_default_body_size) {
+ cd->make_default_body_size = false;
+ msg_ui_composer_make_default_body_size(cd);
+ } else {
msg_ui_composer_change_body_scroll_size(cd, 0);
+ }
} else {
D_EMSG("imf status INVALID");
}
if (type == COMPOSER_MSG_FONT_SIZE) {
switch (index) {
+ case MSG_APP_FONT_SIZE_INDEX_GIANT:
+ font_size = MSG_APP_FONT_SIZE_GIANT;
+ break;
case MSG_APP_FONT_SIZE_INDEX_HUGE:
font_size = MSG_APP_FONT_SIZE_HUGE;
break;
case MSG_APP_FONT_SIZE_INDEX_SMALL:
font_size = MSG_APP_FONT_SIZE_SMALL;
break;
- case MSG_APP_FONT_SIZE_INDEX_TINY:
- font_size = MSG_APP_FONT_SIZE_TINY;
- break;
case MSG_APP_FONT_SIZE_INDEX_SYSTEM_FONT:
default:
D_MSG("get defulat size index = %d", index);
/* includes*/
#include <Ecore_X.h>
+#include <tapi_common.h>
+#include <TapiUtility.h>
#include "msg-ui-composer-main.h"
#include "msg-ui-composer-recipient.h"
#include "msg-ui-composer-common.h"
#include "msg-ui-composer-external.h"
#include "msg-ui-composer-bubble.h"
+#include "msg-ui-composer-main.h" /*for page duration, it should be removed if more option concept is changed*/
#include "msg-ui-common-utility.h"
D_ENTER;
D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
D_MSG_RETM_IF(svc_handle == NULL, "svc_handle is NULL");
+ D_MSG_RETM_IF(uri == NULL, "uri is NULL");
char *content = NULL;
char *recipient = NULL;
}
}
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
- }
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject)
msg_ui_composer_subject_set_loaded_data(cd, (const char *)subject);
- }
if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_ATTACHFILE, &attachment) == SERVICE_ERROR_NONE) && attachment) {
cd->attachlist = make_tokenize_list((const char *)attachment, COMPOSER_BUNDLE_ATTACH_TOKEN);
{
D_ENTER;
D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ D_MSG_RETM_IF(uri == NULL, "uri is NULL");
char *content = NULL;
char attachment[DEF_IMG_PATH_LEN + 1] = {0, };
{
D_ENTER;
D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ D_MSG_RETM_IF(svc_handle == NULL, "svc_handle is NULL");
+ D_MSG_RETM_IF(uri == NULL, "uri is NULL");
char *content = NULL;
char *recipient = NULL;
}
g_free(scheme);
} else {
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
__msgc_parse_recipient_list(cd, (const char *)recipient);
}
- }
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
- }
D_LEAVE;
}
} else if (g_str_has_prefix(uri, MSG_BUNDLE_VALUE_FILE_URI)) { /* URI : file */
__msgc_ui_parse_file_uri(cd, svc_handle, (const char *)uri);
} else {
- D_MSG("Not supported mime type");
+ D_EMSG("Not supported mime type");
return;
}
} else {
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
__msgc_parse_recipient_list(cd, (const char *)recipient);
- }
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
- }
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject)
msg_ui_composer_subject_set_loaded_data(cd, (const char *)subject);
- }
if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_ATTACHFILE, &attachment) == SERVICE_ERROR_NONE) && attachment) {
cd->attachlist = make_tokenize_list((const char *)attachment, COMPOSER_BUNDLE_ATTACH_TOKEN);
if (g_str_has_prefix(uri, MSG_BUNDLE_VALUE_SMS_URI)) { /* SMS URI : sms */
__msg_ui_parse_sms_uri(cd, svc_handle, (const char *)uri);
} else {
- D_MSG("Not supported mime type");
+ D_EMSG("Not supported mime type");
return;
}
} else {
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
__msgc_parse_recipient_list(cd, (const char *)recipient);
- }
- if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text) {
+ if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
- }
}
} else {
D_EMSG("Invalid operation type !!");
char *bundle_txt = NULL;
- service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_FORWARD, &bundle_txt);
-
- if (bundle_txt) {
- int msg_id = atoi(bundle_txt);
- msg_ui_composer_message_init();
- msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
- msg_ui_composer_message_set_loaded_data(cd);
- msg_ui_composer_message_destroy();
- } else {
+ if (cd->isAppControl) { /* composer launching from appcontrol */
char *operation = NULL;
- if (service_get_operation(svc_handle, &operation) == SERVICE_ERROR_NONE && operation) { /* composer launching via service */
- cd->isAppControl = true;
-
- __msgc_get_service_app_svc_op(cd, svc_handle, operation);
-
- } else { /* internal ug mode */
- cd->isAppControl = false;
+ service_get_operation(svc_handle, &operation);
+ __msgc_get_service_app_svc_op(cd, svc_handle, operation);
+ } else {
+ if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
+ if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MSG_ID, &bundle_txt) == SERVICE_ERROR_NONE) && bundle_txt) {
+ bool set_recipient = false;
+ int msg_id = atoi(bundle_txt);
+
+ if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT)
+ set_recipient = true;
+
+ msg_ui_composer_message_init();
+ msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
+ msg_ui_composer_message_set_loaded_data(cd, set_recipient);
+ msg_ui_composer_message_destroy();
+ } else {
+ D_EMSG("there is no msgid");
+ }
+ } else {
if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_TO, &bundle_txt) == SERVICE_ERROR_NONE) && bundle_txt) {
__msgc_parse_recipient_list(cd, bundle_txt);
} else {
if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_NUMBER_INDEX, &bundle_txt)== SERVICE_ERROR_NONE) && bundle_txt) {
- char *recipient;
- char *index;
- char *save_p;
- int idx;
+ char *recipient = NULL;
+ char *index = NULL;
+ char *save_p = NULL;
+ int idx = 0;
char *copy_string = MSG_STRDUP(bundle_txt);
if (copy_string) {
int err = MSG_SUCCESS;
if (bubble_data->isDraft == true)
- err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId);
+ err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
if (err == MSG_SUCCESS) {
service_h svc_handle;
char buf[DEF_BUF_LEN_S + 1] = {0,};
int pageduration = 0;
int isBubble = 0;
+ char *str = NULL;
char *markup_str = NULL;
if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
isBubble = 1;
pageduration = msg_ui_composer_pageduration_value_get(cd);
- snprintf(buf, sizeof(buf), _MSGSTR("IDS_MSGC_BUTTON2_DURATION_N_HPD_SECS"), pageduration);
+ str = _MSGSTR("IDS_MSGC_BUTTON2_DURATION_N_HPD_SECS");
+ snprintf(buf, sizeof(buf), str, pageduration);
markup_str = elm_entry_utf8_to_markup(buf);
if (markup_str) {
D_MSG_RETVM_IF(data == NULL, NULL, "data == NULL");
D_MSG("Title type = %d", title);
- Evas_Object *btn;
+ Evas_Object *btn = NULL;
btn = elm_button_add(parent);
if (btn == NULL)
return NULL;
elm_object_style_set(btn, "naviframe/title/default");
elm_object_text_set(btn, MSGC_STR_BUTTON_CANCEL);
} else {
- elm_object_style_set(btn, "naviframe/back_btn/default");
+ elm_object_style_set(btn, "naviframe/title/icon/previous");
}
evas_object_smart_callback_add(btn, "clicked", __naviframe_back_btn_clicked_cb, data);
evas_object_show(btn);
return btn;
}
-static char *__working_dir_create(void)
-{
- D_ENTER;
- char *base_dir = "/tmp/message";
- char working_path[DEF_PATH_MAX] = {0,};
- int i = 0;
-
- /*Create base dir*/
- if (ecore_file_exists(base_dir) == EINA_FALSE) {
- if(ecore_file_mkdir(base_dir) == EINA_FALSE) {
- return NULL;
- }
- }
-
- /*Create work dir*/
- do {
-
- bzero(working_path, DEF_PATH_MAX);
- snprintf(working_path, sizeof(working_path)-1, "%s/composer_%d/", base_dir, i);
- if (ecore_file_exists(working_path) == EINA_FALSE) {
- if (ecore_file_mkdir(working_path) == EINA_FALSE) {
- return NULL;
- } else {
- D_MSG("Success to create working path = %s", working_path);
- return strdup(working_path);
- }
- break;
- }
- i++;
- } while(i < 255);
-
- return NULL;
-}
-
void msg_ui_composer_reset_request(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle)
{
D_ENTER;
COMPOSER_EDIT_STATE_E edit_state = __msg_ui_composer_edit_check(cd);
D_MSG("edit_state = %d", edit_state);
+ D_MSG("composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
if (edit_state == COMPOSER_EDIT_RECIPIENT_AND_BODY) {
int err = MSG_SUCCESS;
if (bubble_data->isDraft == true)
- err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId);
+ err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
if (err == MSG_SUCCESS) {
service_h svc_handle;
g_free(cd->working_path);
}
- cd->working_path = __working_dir_create();
+ cd->working_path = msg_composer_create_working_dir();
if (cd->working_path == NULL) {
- D_EMSG("[ASSERT] Fail of make working dir!!!");
+ D_EMSG("Fail of make working dir!!!");
return COMPOSER_RETURN_FAIL;
}
if (svc_handle) {
msg_ui_composer_clear(cd);
- /*Change to Bubble view*/
+
char *thread_id = NULL;
char *msg_id = NULL;
+ char *composer_mode = NULL;
+ char *from = NULL;
+
service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, &thread_id);
service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MSG_ID, &msg_id);
- if (thread_id || msg_id) {
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MODE, &composer_mode);
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, &from);
+
+ if (composer_mode) {
+ if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_EDIT) == 0)
+ cd->composer_mode = MSG_COMPOSER_MODE_EDIT;
+ else if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_FORWARD) == 0)
+ cd->composer_mode = MSG_COMPOSER_MODE_FORWARD;
+ else
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+ } else {
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+ }
+
+ if (from && g_strcmp0(from, MSG_BUNDLE_VALUE_INTERNAL) == 0)
+ cd->isMsgInternal = true;
+ else
+ cd->isMsgInternal = false;
+
+ /*Change to Bubble view*/
+ if ((thread_id || msg_id) && cd->composer_mode == MSG_COMPOSER_MODE_NORMAL) {
+ D_MSG("bubble view composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
+
if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
- D_MSG("chagne bubble view");
+ D_MSG("change bubble view");
msg_ui_composer_change_bubble_view(cd);
msg_ui_bubble_parse_bubble_data(cd->bubble_data, svc_handle);
msg_ui_bubble_start_view(cd->bubble_data);
/* set recipient list for bubble composer */
msg_ui_composer_recipient_set_recipient_list(cd, cd->bubble_data->threadId);
-
} else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
D_MSG("reload bubble view");
msg_ui_bubble_parse_bubble_data(cd->bubble_data, svc_handle);
/* set recipient list for bubble composer */
msg_ui_composer_recipient_set_recipient_list(cd, cd->bubble_data->threadId);
+ } else {
+ D_EMSG("Invalid type");
}
+
+ cd->msg_ug_mode = MSG_UG_MODE_BUBBLE_COMPOSER;
} else {
+ D_MSG("normal composer composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
+
if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+ D_MSG("change composer view");
if (cd->bubble_data) {
cd->bubble_data->ug_state = BUBBLE_UG_DESTROY;
MSGC_EVAS_OBJECT_DEL(cd->bubble_data->toolbar);
msg_ui_bubble_deinit_bubble_data(cd->bubble_data);
cd->bubble_data = NULL;
}
+
msg_ui_composer_change_composer_view(cd);
}
+
+ if (cd->isMsgInternal == true)
+ cd->msg_ug_mode = MSG_UG_MODE_FULL_COMPOSER;
+ else
+ cd->msg_ug_mode = MSG_UG_MODE_ONLY_COMPOSER;
+
__msg_ui_composer_bundle_data_process(cd, svc_handle);
}
}
+
D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
}
}
- /*First Focus*/
+ /* set first focus*/
if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
if (!msg_ui_composer_popup_exist(cd)) {
int recipient_count = msg_ui_composer_recipient_count_get(cd->recipient);
- if (recipient_count > 0)
+ if (recipient_count > 0) {
msg_ui_composer_body_focus_set(cd, 0);
- else
+ msg_ui_composer_recipient_expanded_set(cd->recipient, EINA_FALSE);
+ } else {
msg_ui_composer_recipient_focus_set(cd->recipient);
+ }
}
}
-
D_LEAVE;
return ret;
}
D_EMSG("Fail to unregister vconf CB with [%s]", VCONFKEY_MSG_APP_FONT_SIZE);
}
+ if (!cd->tapi_handle) {
+ if (tel_deinit(cd->tapi_handle) != TAPI_API_SUCCESS)
+ D_EMSG("tel_deinit is failed");
+ cd->tapi_handle = NULL;
+ }
+
if(cd->job_thread_end) {
D_PRINT("----- Job Delete -----");
ecore_job_del(cd->job_thread_end);
cd->last_focus_idler = NULL;
}
+ if (cd->flight_mode_timer) {
+ ecore_timer_del(cd->flight_mode_timer);
+ cd->flight_mode_timer = NULL;
+ }
+
if (cd->popup_conform) {
evas_object_del(cd->popup_conform);
cd->popup_conform = NULL;
if (rotate == COMPOSER_ROTATE_PORTRAIT || rotate == COMPOSER_ROTATE_PORTRAIT_UPSIDEDOWN) {
if (cd->bubble_data)
cd->bubble_data->isRotate = false;
+
+ if (cd->bubble_data->selectioninfo_layout)
+ elm_layout_theme_set(cd->bubble_data->selectioninfo_layout, "standard", "selectioninfo", "vertical/bottom_12");
+
} else {
if (cd->bubble_data)
cd->bubble_data->isRotate = true;
+
+ if (cd->bubble_data->selectioninfo_layout)
+ elm_layout_theme_set(cd->bubble_data->selectioninfo_layout, "standard", "selectioninfo", "horizontal/bottom_12");
+
+ elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);
}
/* change body scroller size */
return COMPOSER_RETURN_FAIL;
}
- cd->working_path = __working_dir_create();
+ cd->working_path = msg_composer_create_working_dir();
if (cd->working_path == NULL) {
D_EMSG("[ASSERT] Fail of make working dir!!!");
return COMPOSER_RETURN_FAIL;
msg_release_struct(&setting);
}
+ if (cd->cms_max_page == 0) {
+ // TODO: get cms max page from msgfw when it is supported by msgfw.
+ cd->cms_max_page = COMPOSER_CMS_MAX_PAGE;
+ }
+
/* set default font size*/
__msgc_init_font_size(cd);
more_button = __naviframe_more_btn_create(navi_frame, cd);
elm_object_part_content_set(cd->navi_title_layout, "more_btn", more_button);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,more_btn,show", "");
+
elm_object_part_content_set(cd->navi_title_layout, "prev_btn", back_btn);
+ elm_object_signal_emit(cd->navi_title_layout, "elm,state,prev_btn,show", "");
cd->more_btn = more_button;
elm_object_part_content_set(cd->content_layout, "swl.predictsearch", predict_search_layout);
MSGC_EVAS_OBJECT_DEL(cd->back_btn);
-
Evas_Object *back_btn = __naviframe_back_btn_create(cd->navi_bar, (void *)cd, true);
- elm_object_item_part_content_set(cd->navi_it, "title_right_btn", back_btn);
+ elm_object_part_content_set(cd->navi_title_layout, "prev_btn", back_btn);
cd->back_btn = back_btn;
- elm_object_item_text_set(cd->navi_it, MSGC_STR_NEW_MESSAGE);
+ msg_ui_composer_navi_title_set(cd);
+
D_LEAVE;
return COMPOSER_RETURN_SUCCESS;
}
if (smstype == true) {
if (cd->toolbar_item_top[CONTROLBAR_ITEM_1]) {
+ /* preview */
elm_object_item_disabled_set(cd->toolbar_item_top[CONTROLBAR_ITEM_1+isBubble], EINA_TRUE);
elm_object_focus_allow_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], EINA_FALSE);
elm_object_disabled_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], EINA_TRUE);
-
+ /* page duration */
elm_object_item_disabled_set(cd->toolbar_item_top[CONTROLBAR_ITEM_2+isBubble], EINA_TRUE);
elm_object_focus_allow_set(cd->toolbar_btn[CONTROLBAR_ITEM_2+isBubble], EINA_FALSE);
elm_object_disabled_set(cd->toolbar_btn[CONTROLBAR_ITEM_2+isBubble], EINA_TRUE);
}
} else {
if (cd->toolbar_item_top[CONTROLBAR_ITEM_1]) {
- elm_object_item_disabled_set(cd->toolbar_item_top[CONTROLBAR_ITEM_1+isBubble], EINA_FALSE);
- elm_object_focus_allow_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], EINA_TRUE);
- elm_object_disabled_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], EINA_FALSE);
+ Eina_Bool disabled = EINA_FALSE;
+ if (msg_ui_composer_body_has_media(cd) == false)
+ disabled = EINA_TRUE;
+
+ /* preview */
+ elm_object_item_disabled_set(cd->toolbar_item_top[CONTROLBAR_ITEM_1+isBubble], disabled);
+ elm_object_focus_allow_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], !disabled);
+ elm_object_disabled_set(cd->toolbar_btn[CONTROLBAR_ITEM_1+isBubble], disabled);
+ /* page duration */
elm_object_item_disabled_set(cd->toolbar_item_top[CONTROLBAR_ITEM_2+isBubble], EINA_FALSE);
elm_object_focus_allow_set(cd->toolbar_btn[CONTROLBAR_ITEM_2+isBubble], EINA_TRUE);
elm_object_disabled_set(cd->toolbar_btn[CONTROLBAR_ITEM_2+isBubble], EINA_FALSE);
elm_object_part_text_set(cd->navi_title_layout, "title_text", ""); // text part clear first
title_button = elm_button_add(cd->navi_bar);
+ elm_object_focus_allow_set(title_button, EINA_FALSE);
elm_object_theme_set(title_button, cd->th);
elm_object_style_set(title_button, "title_button");
if (bubble_data->addr_list.addr_cnt == 1) {
if (bubble_data->addr_list.addr_info[0].contact_id > 0 && bubble_data->addr_list.addr_info[0].name[0] != '\0')
elm_object_text_set(title_button, bubble_data->addr_list.addr_info[0].name);
- else
+ else if (bubble_data->addr_list.addr_info[0].address[0] != '\0')
elm_object_text_set(title_button, bubble_data->addr_list.addr_info[0].address);
+ else
+ elm_object_text_set(title_button, dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
} else if (bubble_data->addr_list.addr_cnt > 1) {
char title_text[DEF_BUF_LEN+1] = {0,};
if (bubble_data->addr_list.addr_info[0].contact_id > 0 && bubble_data->addr_list.addr_info[0].name[0] != '\0')
snprintf(title_text, sizeof(title_text), "%s +%d", bubble_data->addr_list.addr_info[0].name, bubble_data->addr_list.addr_cnt-1);
- else
+ else if (bubble_data->addr_list.addr_info[0].address[0] != '\0')
snprintf(title_text, sizeof(title_text), "%s +%d", bubble_data->addr_list.addr_info[0].address, bubble_data->addr_list.addr_cnt-1);
+ else
+ snprintf(title_text, sizeof(title_text), "%s +%d", dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"), bubble_data->addr_list.addr_cnt-1);
elm_object_text_set(title_button, title_text);
} else {
#define MSGC_PAGE_DURATION_MIN 5
#define CUSTOM_TIME_CHAR_MAX 2
+static void __msg_ui_composer_pageduration_value_set(MSG_COMPOSER_VIEW_DATA_S *cd, int page_duration)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ Evas_Object *body_entry = msg_ui_composer_last_body_entry_get(cd);
+ Evas_Object *last_focused_entry = msg_ui_composer_last_focused_entry_get(cd);
+
+ /* focus is body entry*/
+ if (body_entry && (body_entry == last_focused_entry)) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "body entry has a focus");
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+
+ page_data = eina_list_nth(cd->body_data.page_list, cd->current_edit_entry);
+
+ if (page_data)
+ page_data->page_duration = page_duration;
+ else
+ D_EMSG("page_data is NULL!!");
+ } else {
+ cd->page_duration = page_duration;
+ }
+}
+
static void __msgc_pageduration_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
}
/*save pageduration */
- cd->page_duration = page_duration;
+ __msg_ui_composer_pageduration_value_set(cd, page_duration);
msg_ui_composer_toolbar_top_update(cd);
+ MSGC_EVAS_OBJECT_DEL(cd->page_duration_entry);
MSGC_EVAS_OBJECT_DEL(cd->popup_conform);
MSGC_EVAS_OBJECT_DEL(cd->custom_popup);
- cd->page_duration_entry = NULL;
}
static void __msgc_pageduration_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info)
D_MSG_RETM_IF(data == NULL, "data param is NULL");
MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ MSGC_EVAS_OBJECT_DEL(cd->page_duration_entry);
MSGC_EVAS_OBJECT_DEL(cd->popup_conform);
MSGC_EVAS_OBJECT_DEL(cd->custom_popup);
- cd->page_duration_entry = NULL;
}
int msg_ui_composer_pageduration_value_get(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
D_MSG_RETVM_IF(cd == NULL, MSGC_PAGE_DURATION_MIN, "Composer Data is NULL");
+ Evas_Object *body_entry = msg_ui_composer_last_body_entry_get(cd);
+ Evas_Object *last_focused_entry = msg_ui_composer_last_focused_entry_get(cd);
int page_duration = MSGC_PAGE_DURATION_MIN;
- if (cd->page_duration != 0)
- page_duration = cd->page_duration;
- else
- page_duration = COMPOSER_PAGE_DEFAULT_DURATION;
+ /* focus is body entry*/
+ if (body_entry && (body_entry == last_focused_entry)) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "body entry has a focus");
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(cd->body_data.page_list, cd->current_edit_entry);
+
+ if (page_data)
+ page_duration = page_data->page_duration;
+ } else {
+ if (cd->page_duration > COMPOSER_PAGE_DEFAULT_DURATION)
+ page_duration = cd->page_duration;
+ }
return page_duration;
}
+static bool __msg_ui_composer_get_page_number(MSG_COMPOSER_VIEW_DATA_S *cd, int *cur_page, int *total_page)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(cd == NULL, false, "Composer Data is NULL");
+ D_MSG_RETVM_IF(cur_page == NULL, false, "param is NULL");
+ D_MSG_RETVM_IF(total_page == NULL, false, "param is NULL");
+
+ Evas_Object *body_entry = msg_ui_composer_last_body_entry_get(cd);
+ Evas_Object *last_focused_entry = msg_ui_composer_last_focused_entry_get(cd);
+
+ /* focus is body entry*/
+ if (body_entry && (body_entry == last_focused_entry)) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "body entry has a focus");
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+ int page_count = cd->body_data.page_count;
+ int i = 0;
+
+ for (i = 0; i < page_count; i++) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(cd->body_data.page_list, i);
+ if (page_data->entry == body_entry) {
+ D_MSG("page NO.[%d]/[%d] focused !!!", i + 1, page_count);
+ *cur_page = i + 1;
+ *total_page = page_count;
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+static void __msg_ui_composer_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "entry obj is NULL");
+
+ char *enter_str = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
+ if (enter_str == NULL) {
+ D_EMSG("enter_str is NULL");
+ return;
+ }
+
+ Evas_Object *btn = evas_object_data_get(obj, "ok_btn");
+ int text_len = strlen(enter_str);
+
+ if (text_len <= 0)
+ elm_object_disabled_set(btn, EINA_TRUE);
+ else
+ elm_object_disabled_set(btn, EINA_FALSE);
+
+ g_free(enter_str);
+ D_LEAVE;
+}
+
void msg_ui_composer_pageduration_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
Elm_Entry_Filter_Limit_Size limit_filter;
Elm_Entry_Filter_Accept_Set accept_filter;
int page_duration = MSGC_PAGE_DURATION_MIN;
- char duration_str[DEF_BUF_LEN] = {0,};
- char popup_msg[DEF_BUF_LEN] = {0,};
+ int cur_page = 0;
+ int total_page = 0;
+ bool has_page_number = false;
+ char duration_str[DEF_BUF_LEN_S + 1] = {0,};
+ char popup_msg[DEF_BUF_LEN + 1] = {0,};
+ char *str = NULL;
content = elm_layout_add(cd->main_window);
conform = msg_ui_composer_conformant_create(cd->main_window, content);
elm_layout_file_set(layout, MSGC_UI_DEFAULT_EDJ, "composer/popup/entryview");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- snprintf(popup_msg, sizeof(popup_msg), _MSGSTR("IDS_MSG_BODY_DURATION_MUST_BE_LONGER_THAN_PD_SECONDS"), MSGC_PAGE_DURATION_MIN);
- elm_object_part_text_set(layout, "elm.text", popup_msg);
+ str = _MSGSTR("IDS_MSG_BODY_DURATION_MUST_BE_LONGER_THAN_PD_SECONDS");
+ snprintf(popup_msg, sizeof(popup_msg), str, MSGC_PAGE_DURATION_MIN);
+
+ has_page_number = __msg_ui_composer_get_page_number(cd, &cur_page, &total_page);
+
+ if (has_page_number) {
+ char popup_msg_with_page[DEF_BUF_LEN + 1] = {0,};
+ snprintf(popup_msg_with_page, sizeof(popup_msg_with_page), "%s (%d/%d)", popup_msg, cur_page, total_page);
+ elm_object_part_text_set(layout, "elm.text", popup_msg_with_page);
+ } else {
+ elm_object_part_text_set(layout, "elm.text", popup_msg);
+ }
entry = elm_entry_add(content);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_text_style_user_push(entry, "DEFAULT='font_size=32'");
elm_object_text_set(entry, duration_str);
elm_entry_cursor_end_set(entry);
+
+ evas_object_smart_callback_add(entry, "changed", __msg_ui_composer_entry_changed_cb, NULL);
+
elm_object_part_content_set(layout, "swl.entry", entry);
evas_object_show(entry);
evas_object_show(layout);
cd->custom_popup = popup;
+ evas_object_data_set(entry, "ok_btn", btn1);
elm_object_focus_set(entry, EINA_TRUE);
D_LEAVE;
#include "msg-ui-composer-popup.h"
#include "msg-ui-composer-recipient-callback.h"
#include "msg-ui-composer-recipient.h"
-
+#include <status.h>
/*
Destroy all window popup
D_MSG("popup list count = %d", eina_list_count(cd->popup_list));
cd->popup_list = eina_list_remove(cd->popup_list, popup);
if (!msg_ui_composer_popup_exist(data) && !cd->loaded_ug && !cd->loaded_aul && !cd->popup_end) {
- msg_ui_composer_last_focus_load(cd);
+ if (!cd->isclosed)
+ msg_ui_composer_last_focus_load(cd);
}
} else {
D_EMSG("popup_list is not exist");
return popup;
}
-
Evas_Object *msg_ui_composer_progress_popup_show(MSG_COMPOSER_VIEW_DATA_S *cd, const char *msg)
{
D_ENTER;
D_MSG_RETVM_IF(cd == NULL, NULL, "Composer data is NULL");
D_MSG_RETVM_IF(cd->main_window == NULL, NULL, "main window is NULL");
+ D_MSG_RETVM_IF(msg == NULL, NULL, "param is NULL");
- Evas_Object *popup;
- Evas_Object *progressbar;
- Evas_Object *lb;
+ Evas_Object *layout = NULL;
+ Evas_Object *label = NULL;
+ Evas_Object *progressbar = NULL;
+ Evas_Object *popup = NULL;
popup = elm_popup_add(cd->main_window);
- if (!popup)
+ if (popup == NULL)
return NULL;
- Evas_Object *box;
- box = elm_box_add(popup);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_style_set(popup, "customstyle");
+
+ /* create custom inner layout */
+ layout = elm_layout_add(popup);
+ elm_layout_file_set(layout, MSGC_UI_DEFAULT_EDJ, "composer/popup/popup_processingview");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- progressbar = elm_progressbar_add(popup);
+ label = elm_label_add(layout);
+ elm_object_style_set(label, "popup/default");
+ elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
+ elm_object_text_set(label, msg);
+ evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(label);
+
+ progressbar = elm_progressbar_add(layout);
elm_object_style_set(progressbar, "list_process");
- evas_object_size_hint_align_set(progressbar, 0.5, EVAS_HINT_FILL);
+ elm_progressbar_horizontal_set(progressbar, EINA_TRUE);
+ evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(progressbar);
elm_progressbar_pulse(progressbar, EINA_TRUE);
+ evas_object_show(progressbar);
- lb = elm_label_add(popup);
- elm_object_style_set(lb, "popup_description/default");
- evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.0);
- evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_text_set(lb, msg);
- evas_object_show(lb);
-
- elm_box_pack_end(box, lb);
- elm_box_pack_end(box, progressbar);
+ elm_object_part_content_set(layout, "elm.swallow.content", progressbar);
+ elm_object_part_content_set(layout, "elm.swallow.text", label);
- elm_object_content_set(popup, box);
+ elm_object_content_set(popup, layout);
evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __popup_delete_cb, cd);
cd->popup_list = eina_list_append(cd->popup_list, popup);
evas_object_show(popup);
- elm_object_focus_set(popup, EINA_TRUE);
+
D_LEAVE;
return popup;
}
}
/*
+ checkbox popup
+*/
+Evas_Object *msg_ui_composer_checkbox_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd, const char *title, const char *msg, const char *check_msg)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(cd == NULL, NULL, "Composer data is NULL");
+ D_MSG_RETVM_IF(cd->main_window == NULL, NULL, "main window is NULL");
+ D_MSG_RETVM_IF(msg == NULL, NULL, "param is NULL");
+ D_MSG_RETVM_IF(check_msg == NULL, NULL, "param is NULL");
+
+ Evas_Object *popup = NULL;
+ Evas_Object *layout = NULL;
+ Evas_Object *check = NULL;
+
+ popup = elm_popup_add(cd->main_window);
+ if (popup == NULL)
+ return NULL;
+
+ elm_object_style_set(popup, "customstyle");
+
+ if (title)
+ elm_object_part_text_set(popup, "title,text", title);
+
+ /* create custom inner layout */
+ layout = elm_layout_add(popup);
+ elm_layout_file_set(layout, MSGC_UI_DEFAULT_EDJ, "composer/popup/popup_checkview");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ check = elm_check_add(layout);
+ evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(check);
+
+ edje_object_part_text_set(_EDJ(layout), "text_msg", msg);
+ edje_object_part_text_set(_EDJ(layout), "check_text", check_msg);
+ elm_object_part_content_set(layout, "check", check);
+ evas_object_show(layout);
+
+ elm_object_content_set(popup, layout);
+
+ evas_object_data_set(popup, "check_box", check);
+
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __popup_delete_cb, cd);
+
+ cd->popup_list = eina_list_append(cd->popup_list, popup);
+
+ evas_object_show(popup);
+
+ D_LEAVE;
+ return popup;
+}
+
+/*
custom type popup
*/
Evas_Object *msg_ui_composer_custom_popup_create(MSG_COMPOSER_VIEW_DATA_S *cd, const char *title, Evas_Object *parent, Evas_Object *layout)
elm_object_focus_set(p, EINA_TRUE);
}
+Evas_Object *msg_ui_composer_popup_button_create(Evas_Object *parent, const char *str)
+{
+ D_MSG_RETVM_IF(parent == NULL, NULL, "param is NULL");
+ Evas_Object *btn = NULL;
+
+ btn = elm_button_add(parent);
+ elm_object_style_set(btn, "popup_button/default");
+ elm_object_text_set(btn, str);
+
+ return btn;
+}
if (ps->count > 0) {
__predictsearch_show(ps);
- msg_ui_composer_bt_hide(cd->recipient);
if (ps->state != COMPOSER_PREDICTSEARCH_END)
ps->idler_ps = ecore_idler_add(__predictsearch_idler_process, ps);
} else {
__predictsearch_hide(ps);
- msg_ui_composer_bt_show(cd->recipient);
}
} else {
__predictsearch_hide(ps);
- msg_ui_composer_bt_show(cd->recipient);
}
return ECORE_CALLBACK_CANCEL;
} else {
msg_ui_composer_predictsearch_clear(cd);
__predictsearch_hide(ps);
- msg_ui_composer_bt_show(cd->recipient);
}
D_LEAVE;
#include "msg-ui-composer-recipient.h"
#include "msg-ui-composer-recipient-callback.h"
#include "msg-ui-composer-attachment.h"
+#include "msg-ui-composer-body.h"
+#include "msg-ui-composer-main.h" /*for page duration, it should be removed if more option concept is changed*/
/*==================================================================================================
* FUNCTION IMPLEMENTATIONS
MSG_COMPOSER_VIEW_DATA_S *cd = data;
D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
-
- const char *bt_label = elm_object_text_get(obj);
- D_MSG("clicked bt label [%s]", bt_label);
-
- /* temporarily, set focus to back_btn to resolve invalid focus tree issue of ly_bt show/hide*/
+ /*set focus to back_btn to resolve invalid focus tree issue regarding contact_btn show/hide*/
elm_object_focus_set(cd->back_btn, EINA_TRUE);
-
- if (!g_strcmp0(bt_label, MSGC_STR_RECENT)) {
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_LOG, NULL);
- } else if (!g_strcmp0(bt_label, MSGC_STR_CONTACT)) {
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CONTACTLIST, NULL);
- } else {
- D_EMSG("Under Construct");
- }
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CONTACT_PHONEUI, NULL);
D_LEAVE;
}
Elm_Object_Item *item = elm_multibuttonentry_selected_item_get(obj);
elm_multibuttonentry_item_selected_set(item, EINA_FALSE);
- if (ps->IsShow == EINA_FALSE)
- msg_ui_composer_bt_show(rd);
-
elm_multibuttonentry_expanded_set(obj, EINA_TRUE);
+ if (!cd->isAppControl)
+ edje_object_signal_emit(_EDJ(rd->ly_to), "show.ct_button", "*");
+
D_LEAVE;
}
D_ENTER;
MSG_COMPOSER_VIEW_DATA_S *cd = data;
D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ RECIPIENT_S *rd = cd->recipient;
/*If it exist Selected item popup, then it should not shrink mode set == 1*/
- if(msg_ui_composer_popup_exist(cd) == EINA_TRUE) {
+ if (msg_ui_composer_popup_exist(cd) == EINA_TRUE)
return;
- }
elm_multibuttonentry_expanded_set(obj, EINA_FALSE);
- msg_ui_composer_bt_hide(cd->recipient);
+
+ if (!cd->isAppControl)
+ edje_object_signal_emit(_EDJ(rd->ly_to), "hide.ct_button", "*");
+
D_LEAVE;
}
D_LEAVE;
}
-void msg_ui_recipient_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
-{
- D_ENTER;
- MSG_COMPOSER_VIEW_DATA_S *cd = data;
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
-
- RECIPIENT_S *rd = cd->recipient;
- D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
-
- char *recipient_str;
- static char saved_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX + 1] = { 0, };
-
- recipient_str = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
- if (recipient_str == NULL)
- return;
-
- COMPOSER_RECP_ADDR_E addr_type = COMPOSER_RECP_ADDR_NONE;
- if (recipient_str && strlen(recipient_str)) {
- addr_type = msg_ui_composer_recipient_type_get(recipient_str);
- }
-
- msg_ui_composer_recipient_addr_type_set(rd, addr_type);
- D_MSG("recipient is invalid recipient addr_type = %d", addr_type);
-
- D_MSG("saved_str = %s", saved_str);
- D_MSG("recipient_str = %s", recipient_str);
-
- if (g_strcmp0(saved_str, recipient_str) == 0) {
- D_MSG("It is same string before str(%s), current str(%s)", saved_str, recipient_str);
- g_free(recipient_str);
- return;
- }
-
- strncpy(saved_str, recipient_str, sizeof(saved_str) - 1);
- saved_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX] = '\0';
-
- if (strlen(recipient_str) > 0 ) {
- msg_ui_composer_predictsearch_request(cd, recipient_str);
- } else {
- msg_ui_composer_predictsearch_clear(cd);
- if (elm_object_focus_get(rd->mbe) == EINA_TRUE)
- msg_ui_composer_bt_show(rd);
- }
-
- g_free(recipient_str);
- D_LEAVE;
-}
-
void msg_ui_recipient_multibuttonentry_item_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
rd->notify_popup_idler = NULL;
- if (!msg_ui_composer_popup_exist(cd) && !cd->loaded_ug && !cd->loaded_aul) {
+ if (!msg_ui_composer_popup_exist(cd) && !cd->loaded_ug && !cd->loaded_aul && !cd->loaded_view) {
/* show popup when message window has a top focus.(active state of app) */
if (elm_win_focus_get(cd->main_window) == EINA_TRUE) {
if (cd->isclosed == false)
RECIPIENT_ITEM_S *r_item = NULL;
+ if (cd->state == COMPOSER_STATE_TYPE_PAUSE)
+ return EINA_FALSE;
+
msg_ui_composer_recipient_addr_type_set(rd, COMPOSER_RECP_ADDR_NONE);
/*Check recipient count*/
D_LEAVE;
}
+void msg_ui_recipient_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ RECIPIENT_S *rd = cd->recipient;
+ D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
+
+ char *recipient_str;
+ static char saved_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX + 1] = { 0, };
+
+ /* show invalid address popup, after either inserting text(keypad, paste) or deleting text */
+ if (rd->is_required_address_popup) {
+ msg_ui_composer_recipient_addr_type_set(rd, COMPOSER_RECP_ADDR_INVALID);
+
+ if (rd->notify_popup_idler) {
+ ecore_idler_del(rd->notify_popup_idler);
+ rd->notify_popup_idler = NULL;
+ }
+ rd->notify_popup_idler = ecore_idler_add(__show_invalid_address_popup, cd);
+
+ rd->is_required_address_popup = false;
+ }
+
+ recipient_str = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
+ if (recipient_str == NULL)
+ return;
+
+ COMPOSER_RECP_ADDR_E addr_type = COMPOSER_RECP_ADDR_NONE;
+ if (recipient_str && strlen(recipient_str)) {
+ addr_type = msg_ui_composer_recipient_type_get(recipient_str);
+
+ /* remove ',' ';' character of last position, it is used for deleting character case */
+ int str_len = strlen(recipient_str);
+ if (str_len > 1) {
+ bool is_removed_delimeter = false;
+
+ while (recipient_str[str_len - 1] == ',' || recipient_str[str_len - 1] == ';') {
+ D_MSG("remove , or ;");
+ recipient_str[str_len - 1] = '\0';
+ --str_len;
+
+ is_removed_delimeter = true;
+
+ if (str_len == 0)
+ break;
+ }
+
+ if (is_removed_delimeter) {
+ char *markup_str = NULL;
+ markup_str = elm_entry_utf8_to_markup(recipient_str);
+
+ if (markup_str) {
+ D_MSG("remove string is set recipient_str = (%s)!!", recipient_str);
+ elm_entry_entry_set(obj, markup_str);
+ rd->is_required_address_popup = true;
+
+ free(markup_str);
+ free(recipient_str);
+
+ return;
+ }
+ }
+ }
+ }
+
+ msg_ui_composer_recipient_addr_type_set(rd, addr_type);
+ D_MSG("recipient is invalid recipient addr_type = %d", addr_type);
+
+ D_MSG("saved_str = %s", saved_str);
+ D_MSG("recipient_str = %s", recipient_str);
+
+ if (g_strcmp0(saved_str, recipient_str) == 0) {
+ D_MSG("It is same string before str(%s), current str(%s)", saved_str, recipient_str);
+ g_free(recipient_str);
+ return;
+ }
+
+ strncpy(saved_str, recipient_str, sizeof(saved_str) - 1);
+ saved_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX] = '\0';
+
+ if (strlen(recipient_str) > 0 ) {
+ msg_ui_composer_predictsearch_request(cd, recipient_str);
+ } else {
+ msg_ui_composer_predictsearch_clear(cd);
+ }
+
+ g_free(recipient_str);
+ D_LEAVE;
+}
+
+void msg_ui_recipient_entry_activated_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ RECIPIENT_S *rd = cd->recipient;
+ D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
+
+ char *recipient_str = NULL;
+ const char *entry_str = elm_entry_entry_get(obj);
+
+ recipient_str = elm_entry_markup_to_utf8(entry_str);
+
+ if (recipient_str == NULL) {
+ D_EMSG("recipient_str is NULL");
+ return;
+ }
+
+ if (msg_ui_composer_recipient_vaild_check(recipient_str) == EINA_TRUE) {
+ /*Check recipient count*/
+ int r_count = msg_ui_composer_recipient_count_get(rd);
+
+ if (r_count >= COMPOSER_RECIPIENT_COUNT_MAX) {
+ D_EMSG("recipient is over max count %d ", COMPOSER_RECIPIENT_COUNT_MAX);
+ } else {
+ if (msg_ui_composer_recipient_duplicate_check(rd, recipient_str) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+ D_EMSG("Input recipient is duplicated");
+ } else {
+ if (msg_ui_composer_recipient_append(cd->recipient, recipient_str, 0) != COMPOSER_RETURN_SUCCESS) {
+ D_EMSG("recipient append is failed");
+ }
+ }
+ }
+
+ msg_ui_composer_body_focus_set(cd, 0);
+ }
+
+ free(recipient_str);
+ D_LEAVE;
+}
+
+void msg_ui_recipient_entry_filter_cb(void *data, Evas_Object *entry, char **text)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(text == NULL || *text == NULL, "New Text is NULL");
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ RECIPIENT_S *rd = cd->recipient;
+ D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
+
+ const char *pre_str = NULL;
+ char *utf8_text = NULL;
+ gchar *full_str = NULL;
+ gchar **split_str = NULL;
+
+ utf8_text = elm_entry_markup_to_utf8(*text);
+ if (utf8_text) {
+ /* get previous entered str */
+ pre_str = elm_entry_entry_get(entry);
+
+ /* make full str */
+ if (pre_str)
+ full_str = g_strconcat(pre_str, utf8_text, NULL);
+ else
+ full_str = g_strdup(utf8_text);
+
+ if (full_str) {
+ int full_str_len = strlen(full_str);
+
+ if (full_str_len < 1) {
+ D_EMSG("full_str_len is %d", full_str_len);
+ free(utf8_text);
+ g_free(full_str);
+ return;
+ }
+
+ /* check last character is either ',' or ';' */
+ if (full_str[full_str_len - 1] == ',' || full_str[full_str_len - 1] == ';') {
+ D_MSG("pre text [%s]", pre_str);
+ D_MSG("new text [%s]", *text);
+ D_MSG("full_str [%s]", full_str);
+
+ /* remove last ',' or ';' */
+ full_str[full_str_len - 1] = '\0';
+ --full_str_len;
+
+ /* parse full str with delimeter , ; */
+ split_str = g_strsplit_set(full_str, ",;", -1);
+
+ if (split_str) {
+ int count = g_strv_length(split_str);
+ int i = 0;
+ MSG_BOOL is_added = FALSE;
+ MSG_BOOL is_count_max = FALSE;
+ MSG_BOOL *is_used_list = NULL;
+
+ D_MSG("splitted string count = %d", count);
+
+ is_used_list = (MSG_BOOL *)calloc(count, sizeof(MSG_BOOL));
+
+ if (is_used_list) {
+ for (i = 0; i < count; i++) {
+ D_MSG("%dth string is [%s]", i, split_str[i]);
+
+ if (split_str[i] && strlen(split_str[i])) {
+ if (msg_ui_composer_recipient_vaild_check(split_str[i]) == EINA_TRUE) {
+ /*Check recipient count*/
+ int r_count = msg_ui_composer_recipient_count_get(rd);
+ if (r_count >= COMPOSER_RECIPIENT_COUNT_MAX) {
+ D_EMSG("recipient is over max count %d ", COMPOSER_RECIPIENT_COUNT_MAX);
+ is_count_max = TRUE;
+ is_added = TRUE;
+ is_used_list[i] = TRUE;
+ continue;
+ }
+
+ if (msg_ui_composer_recipient_duplicate_check(rd, split_str[i]) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+ D_EMSG("Input recipient is duplicated");
+ is_added = TRUE;
+ is_used_list[i] = TRUE;
+ continue;
+ }
+
+ if (msg_ui_composer_recipient_append(cd->recipient, split_str[i], 0) == COMPOSER_RETURN_SUCCESS) {
+ is_added = TRUE;
+ is_used_list[i] = TRUE;
+ }
+ }
+ }
+ }
+
+ if (is_count_max)
+ msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
+
+ /* re-assemble string */
+ if (is_added) {
+ char *re_assembled_str = NULL;
+
+ re_assembled_str = (char *)calloc(full_str_len + 1, sizeof(char));
+
+ if (re_assembled_str) {
+ for (i = 0; i < count - 1; i++) {
+ if (split_str[i] && strlen(split_str[i])) {
+ if (!is_used_list[i]) {
+ strncat(re_assembled_str, split_str[i], strlen(split_str[i]));
+ strncat(re_assembled_str, ",", 1);
+ }
+ } else {
+ strncat(re_assembled_str, ",", 1);
+ }
+ }
+ /* append last parsted string */
+ if (split_str[i] && strlen(split_str[i])) {
+ if (!is_used_list[i])
+ strncat(re_assembled_str, split_str[i], strlen(split_str[i]));
+ }
+
+ /* remove ',' ';' of last position */
+ int str_len = strlen(re_assembled_str);
+ if (str_len > 1) {
+ while (re_assembled_str[str_len - 1] == ',' || re_assembled_str[str_len - 1] == ';') {
+ re_assembled_str[str_len - 1] = '\0';
+ --str_len;
+
+ if (str_len == 0)
+ break;
+ }
+ }
+
+ D_MSG("reassembeld str = [%s]", re_assembled_str);
+ /*set re-assembed str to text */
+ Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);
+ elm_entry_entry_set(entry, "");
+
+ free(*text);
+
+ if (strlen(re_assembled_str)) {
+ rd->is_required_address_popup = true;
+ *text = strdup(re_assembled_str);
+ } else {
+ *text = NULL;
+ }
+
+ free(re_assembled_str);
+ } else {
+ D_EMSG("calloc is failed");
+ }
+ }
+
+ free(is_used_list);
+ } else {
+ D_EMSG("calloc is failed");
+ }
+
+ g_strfreev(split_str);
+ } else {
+ D_EMSG("g_strsplit_set is failed");
+ }
+ }
+
+ g_free(full_str);
+
+ } else {
+ D_EMSG("full_str is NULL");
+ }
+
+ free(utf8_text);
+ }
+ D_LEAVE;
+}
+
void msg_ui_recipient_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
D_ENTER;
#include "msg-ui-composer-popup.h"
#include "msg-ui-composer-external.h"
+#define CONTACT_NAME_IS_NOT_SUPPORT
/*==================================================================================================
* FUNCTION IMPLEMENTATIONS
*==================================================================================================*/
Evas_Object *genlist = NULL;
int error_code = CTS_SUCCESS;
int count = 0;
- CTSstruct *contact = NULL;
GSList *get_list = NULL;
GSList *iter = NULL;
RECIPIENT_ITEM_S *r_item = NULL;
CONTACT_ITEM_S *ct_item = NULL;
+ CTSiter *citer = NULL;
r_item = msg_ui_composer_recipient_selected_item_data_get(cd);
D_MSG_RETM_IF(r_item == NULL, "Selected Data is NULL");
D_MSG_RETM_IF(r_item->index <= 0, "Selected index <= 0");
- error_code = contacts_svc_get_contact(r_item->index, &contact);
- if (error_code) {
- D_MSG("error_code %d", error_code);
- return;
- }
-
rd->change_number_itc.item_style = "2text.3";
rd->change_number_itc.func.text_get = __change_number_text_get;
rd->change_number_itc.func.content_get = NULL;
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_data_set(genlist, "selected_item", r_item);
- contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &get_list);
- iter = get_list;
+ contacts_svc_get_list_with_int(CTS_LIST_MEMBERS_OF_PERSON_ID, r_item->index, &citer);
- while (NULL != iter) {
- int phone_type = contacts_svc_value_get_int(iter->data, CTS_NUM_VAL_TYPE_INT);
+ while (CTS_SUCCESS == contacts_svc_iter_next(citer)) {
+ CTSvalue *ct_value = NULL;
+ CTSstruct *contact = NULL;
+ int contact_id = 0;
- if (phone_type != CTS_NUM_TYPE_ASSISTANT) {
- const char *content = contacts_svc_value_get_str(iter->data, CTS_NUM_VAL_NUMBER_STR);
- D_MSG("[%d][%d]%s", r_item->index, phone_type, content);
+ ct_value = contacts_svc_iter_get_info(citer);
+ if (ct_value) {
+ contact_id = contacts_svc_value_get_int(ct_value, CTS_LIST_NUM_CONTACT_ID_INT);
- ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
- if (ct_item) {
- ct_item->type = COMPOSER_ADDR_TYPE_NUMBER;
- ct_item->contact_type = phone_type;
- strncpy(ct_item->recipient, (char *)content, sizeof(ct_item->recipient) - 1);
+ if (contact_id > 0) {
+ error_code = contacts_svc_get_contact(contact_id, &contact);
+ if (error_code != CTS_SUCCESS) {
+ D_EMSG("contacts_svc_get_contact is failed error_code = %d", error_code);
+ contacts_svc_value_free(ct_value);
+ continue;
+ }
- elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, __change_number_popup_list_clicked_cb, cd);
+ get_list = NULL;
+ contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &get_list);
+ iter = get_list;
- count++;
- } else {
- D_EMSG("calloc is failed");
- }
+ while (NULL != iter) {
+ int phone_type = contacts_svc_value_get_int(iter->data, CTS_NUM_VAL_TYPE_INT);
- }
+ if (phone_type != CTS_NUM_TYPE_ASSISTANT) {
+ const char *content = contacts_svc_value_get_str(iter->data, CTS_NUM_VAL_NUMBER_STR);
+ D_MSG("[%d][%d]%s", r_item->index, phone_type, content);
- iter = g_slist_next(iter);
- }
+ ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
+ if (ct_item) {
+ ct_item->type = COMPOSER_ADDR_TYPE_NUMBER;
+ ct_item->contact_type = phone_type;
+ strncpy(ct_item->recipient, (char *)content, sizeof(ct_item->recipient) - 1);
+
+ elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, __change_number_popup_list_clicked_cb, cd);
+
+ count++;
+ } else {
+ D_EMSG("calloc is failed");
+ }
+ }
+
+ iter = g_slist_next(iter);
+ }
- get_list = NULL;
- contacts_svc_struct_get_list(contact, CTS_CF_EMAIL_LIST, &get_list);
- iter = get_list;
+ get_list = NULL;
+ contacts_svc_struct_get_list(contact, CTS_CF_EMAIL_LIST, &get_list);
+ iter = get_list;
- while (NULL != iter) {
- int email_type = contacts_svc_value_get_int(iter->data, CTS_EMAIL_VAL_TYPE_INT);
- const char *content = contacts_svc_value_get_str(iter->data, CTS_EMAIL_VAL_ADDR_STR);
+ while (NULL != iter) {
+ int email_type = contacts_svc_value_get_int(iter->data, CTS_EMAIL_VAL_TYPE_INT);
+ const char *content = contacts_svc_value_get_str(iter->data, CTS_EMAIL_VAL_ADDR_STR);
- D_MSG("[%d][%d]%s", r_item->index, email_type, content);
+ D_MSG("[%d][%d]%s", r_item->index, email_type, content);
- ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
- if (ct_item) {
- ct_item->type = COMPOSER_ADDR_TYPE_EMAIL;
- ct_item->contact_type = email_type;
- strncpy(ct_item->recipient, (char *)content, sizeof(ct_item->recipient) - 1);
+ ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
+ if (ct_item) {
+ ct_item->type = COMPOSER_ADDR_TYPE_EMAIL;
+ ct_item->contact_type = email_type;
+ strncpy(ct_item->recipient, (char *)content, sizeof(ct_item->recipient) - 1);
- elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, __change_number_popup_list_clicked_cb, cd);
+ elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, __change_number_popup_list_clicked_cb, cd);
+
+ count++;
+ } else {
+ D_EMSG("calloc is failed");
+ }
+
+ iter = g_slist_next(iter);
+ }
+
+ contacts_svc_struct_free(contact);
+
+ } else {
+ D_EMSG("Invalid contact_id = %d", contact_id);
+ }
+
+ contacts_svc_value_free(ct_value);
- count++;
} else {
- D_EMSG("calloc is failed");
+ D_EMSG("contacts_svc_iter_get_info is failed");
}
-
- iter = g_slist_next(iter);
}
- if (count >= 5) {
- popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_SK_SELECT"), genlist, NULL);
- } else {
- Evas_Object *box = NULL;
-
- box = elm_box_add(cd->main_window);
- evas_object_size_hint_min_set(box, MSGC_RECIPIENT_POPUP_W * elm_scale_get(),
- MSGC_RECIPIENT_POPUP_LIST_H * count * elm_scale_get());
- evas_object_show(genlist);
- elm_box_pack_end(box, genlist);
- popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_SK_SELECT"), box, "min_menustyle");
- }
+ contacts_svc_iter_remove(citer);
+
+ if (count >= 5)
+ count = 4;
+
+ Evas_Object *box = elm_box_add(cd->main_window);
+ evas_object_size_hint_min_set(box, 0, MSGC_POPUP_GENLIST_H * count * elm_scale_get());
+ evas_object_show(genlist);
+ elm_box_pack_end(box, genlist);
+ popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_SK_SELECT"), box, "min_menustyle");
Evas_Object *btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup_button/default");
Elm_Object_Item *mbe_item = NULL;
Evas_Object *sc_entry = NULL;
+#ifdef CONTACT_NAME_IS_NOT_SUPPORT
+ RECIPIENT_ITEM_S *r_item = NULL;
+#else
const char *label_selected_bt = NULL;
+#endif
mbe_item = rd->sel_mbe_item;
if (!mbe_item) {
return;
}
+#ifdef CONTACT_NAME_IS_NOT_SUPPORT
+ r_item = msg_ui_composer_recipient_selected_item_data_get(cd);
+ D_MSG_RETM_IF(r_item == NULL, "Selected Data is NULL");
+
+ sc_entry = elm_multibuttonentry_entry_get(rd->mbe);
+ elm_entry_entry_set(sc_entry, r_item->recipient);
+ elm_entry_cursor_line_end_set(sc_entry);
+#else
label_selected_bt = elm_object_item_text_get(mbe_item);
sc_entry = elm_multibuttonentry_entry_get(rd->mbe);
elm_entry_entry_set(sc_entry, label_selected_bt);
elm_entry_cursor_line_end_set(sc_entry);
-
+#endif
elm_object_item_del(mbe_item);
msg_ui_composer_message_type_check_and_change(cd);
D_PRINT("mbe geometry h = %d ", box_h);
elm_scroller_region_show(rd->sc, 0, box_h - scr_h, scr_w, scr_h);
- D_PRINT("scroller region shwo x = %d, y = %d, w = %d, h = %d ", 0, box_h - scr_h, scr_w, scr_h);
+ D_PRINT("scroller region show x = %d, y = %d, w = %d, h = %d ", 0, box_h - scr_h, scr_w, scr_h);
D_LEAVE;
return EINA_FALSE;
rd->scroll_down_idler = NULL;
}
- rd->scroll_down_idler = ecore_idler_add(__move_to_scroll_end, rd);
+ int r_count = msg_ui_composer_recipient_count_get(rd);
+ if (r_count > 1)
+ rd->scroll_down_idler = ecore_idler_add(__move_to_scroll_end, rd);
+
D_LEAVE;
}
static Evas_Object *__mbe_create(RECIPIENT_S *rd)
{
D_ENTER;
- Evas_Object *mbe;
- Evas_Object *entry;
- Ecore_IMF_Context *context;
+ Evas_Object *mbe = NULL;
+ Evas_Object *entry = NULL;
+ Ecore_IMF_Context *context = NULL;
+ Elm_Entry_Filter_Limit_Size limit_filter;
char label_txt[TO_FIELD_LABEL_SIZE_MAX] = { 0, };
- gsize len;
+ gsize len = 0;
mbe = elm_multibuttonentry_add(rd->parent);
evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, 0.0);
evas_object_show(mbe);
/*set mbe label */
- memset(label_txt, '\0', sizeof(label_txt));
len = snprintf(label_txt, (gsize)sizeof(label_txt), "%s:", MSGC_STR_TO);
if (len == -1) {
D_EMSG("len = %d", len);
entry = elm_multibuttonentry_entry_get(mbe);
evas_object_smart_callback_add(entry, "changed", msg_ui_recipient_entry_changed_cb, rd->cd);
evas_object_smart_callback_add(entry, "preedit,changed", msg_ui_recipient_entry_changed_cb, rd->cd);
+ /* activated is added for enter key of keypad */
+ evas_object_smart_callback_add(entry, "activated", msg_ui_recipient_entry_activated_cb, rd->cd);
+
+ elm_entry_markup_filter_append(entry, msg_ui_recipient_entry_filter_cb, rd->cd);
+
+ /* set entry max character count*/
+ limit_filter.max_char_count = COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX;
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter);
context = elm_entry_imf_context_get(entry);
ecore_imf_context_input_panel_event_callback_add((Ecore_IMF_Context *)context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, msg_ui_composer_entry_imf_state_cb, rd->cd);
if (rd == NULL)
return NULL;
- Evas_Object *layout;
+ Evas_Object *layout = NULL;
Evas_Object *parent = rd->parent;
layout = msg_ui_composer_load_edj(parent, MSGC_UI_DEFAULT_EDJ, MSGC_EDJ_GRP_RECIPIENT_TO_FIELD);
- if (!layout)
+ if (!layout) {
+ D_EMSG("layout is NULL");
return NULL;
+ }
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box2, mbe);
elm_object_part_content_set(layout, "swl.mbe_scroll", to_sc);
- Evas_Object *base = msg_ui_composer_layout_create(parent, false);
- Evas_Object *bg = msg_ui_composer_bg_create(base);
- elm_object_part_content_set(base, "elm.swallow.bg", bg);
- elm_object_part_content_set(base, "elm.swallow.content", layout);
-
- D_LEAVE;
- return base;
-}
-
-static Evas_Object *__msg_ui_composer_recipient_ly_bt_create(RECIPIENT_S *rd)
-{
- D_ENTER;
-
- Evas_Object *layout;
- Evas_Object *bt;
-
- layout = msg_ui_composer_load_edj(rd->parent, MSGC_UI_DEFAULT_EDJ, MSGC_EDJ_GRP_RECIPIENT_BT_FIELD);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(layout);
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)rd->cd;
- bt = elm_button_add(rd->parent);
- elm_object_text_set(bt, MSGC_STR_RECENT);
- elm_object_style_set(bt, "style2");
- evas_object_show(bt);
- elm_object_part_content_set(layout, "swl.bt_left", bt);
- evas_object_smart_callback_add(bt, "clicked", msg_ui_recipient_bt_clicked_cb, rd->cd);
+ if (!cd->isAppControl) {
+ Evas_Object *contact_btn = elm_button_add(rd->parent);
+ elm_object_theme_set(contact_btn, cd->th);
+ elm_object_style_set(contact_btn, "circle/contact_button");
- bt = elm_button_add(rd->parent);
- elm_object_text_set(bt, MSGC_STR_CONTACT);
- elm_object_style_set(bt, "style2");
- evas_object_show(bt);
- elm_object_part_content_set(layout, "swl.bt_right", bt);
- evas_object_smart_callback_add(bt, "clicked", msg_ui_recipient_bt_clicked_cb, rd->cd);
+ Evas_Object *icon = elm_icon_add(contact_btn);
+ elm_icon_file_set(icon, MSGC_IMG_CONTACT_BUTTON_ICON, NULL);
+ elm_object_part_content_set(contact_btn, "icon", icon);
- Evas_Object *base = msg_ui_composer_layout_create(rd->parent, false);
- Evas_Object *bg = msg_ui_composer_bg_create(base);
- elm_object_part_content_set(base, "elm.swallow.bg", bg);
- elm_object_part_content_set(base, "elm.swallow.content", layout);
+ evas_object_smart_callback_add(contact_btn, "clicked", msg_ui_recipient_bt_clicked_cb, rd->cd);
+ elm_object_part_content_set(layout, "swl.closed_btn", contact_btn);
+ } else {
+ edje_object_signal_emit(_EDJ(layout), "hide.ct_button", "*");
+ }
D_LEAVE;
- return base;
+ return layout;
}
static void __msg_ui_composer_recipient_layout_create(RECIPIENT_S *r)
{
D_ENTER;
D_MSG_RETM_IF(r->parent == NULL, "r->parent is NULL");
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)r->cd;
/*Create layout*/
Evas_Object *bx;
r->ly_to = __msg_ui_composer_recipient_to_layout_create(r);
elm_box_pack_end(r->bx_main, r->ly_to);
- if (!cd->isAppControl) {
- r->ly_bt = __msg_ui_composer_recipient_ly_bt_create(r);
- evas_object_hide(r->ly_bt);
- }
-
evas_object_event_callback_add(r->bx_main, EVAS_CALLBACK_RESIZE, msg_ui_recipient_resize_cb, r);
D_LEAVE;
RECIPIENT_ITEM_S *msg_ui_composer_recipient_item_make_by_string(const char *str)
{
+ D_MSG_RETVM_IF(str == NULL, NULL, "str is NULL");
+
COMPOSER_UTIL_ADDRTYPE_E type;
RECIPIENT_ITEM_S r_item;
RECIPIENT_ITEM_S *recipient_item;
-
+#ifndef CONTACT_NAME_IS_NOT_SUPPORT
int ret;
char tmp_display_name1[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
char tmp_display_name2[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
+#endif
bzero(&r_item, sizeof(r_item));
- if (!str) return NULL;
-
type = get_address_type(str);
if (type == COMPOSER_UTIL_ADDRTYPE_NUMBER || type == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
}
- } else {/*IF string is name*/
+ } else {
+#ifdef CONTACT_NAME_IS_NOT_SUPPORT
+ /* contact name is not supported */
+ r_item.type = COMPOSER_RECP_ADDR_INVALID;
+ strncpy(r_item.recipient, str, sizeof(r_item.recipient)-1);
+ strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
+#else
+ /*IF string is name*/
r_item.index = get_contact_index_by_name(str);
if (r_item.index > 0) {
ret = get_contact_display_name_by_index(r_item.index, r_item.display_name, sizeof(r_item.display_name)-1);
r_item.type = COMPOSER_RECP_ADDR_INVALID;
strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
}
+#endif
}
/*make recipient Item*/
COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_duplicate_check(RECIPIENT_S *rd, const char *recipient)
{
D_ENTER;
+ D_MSG_RETVM_IF(rd == NULL, COMPOSER_RETURN_FAIL, "rd is NULL");
+ D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "recipient is NULL");
RECIPIENT_ITEM_S *recipient_item;
Elm_Object_Item *mbe_item;
D_LEAVE;
}
+void msg_ui_composer_recipient_expanded_set(RECIPIENT_S *rd, Eina_Bool expanded)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(rd == NULL, "rd is NULL");
+
+ if (rd->mbe == NULL)
+ return;
+
+ elm_multibuttonentry_expanded_set(rd->mbe, expanded);
+ D_LEAVE;
+}
+
Eina_List *msg_ui_composer_recipient_invalid_recipient_list_get(RECIPIENT_S *rd)
{
D_ENTER;
RECIPIENT_S *rd;
rd = calloc(1, sizeof(RECIPIENT_S));
- if (rd == NULL) {
- D_EMSG("calloc is failed");
+ if (rd == NULL)
return NULL;
- }
rd->parent = p;
rd->cd = data;
MSGC_EVAS_OBJECT_DEL(rd->mbe);
MSGC_EVAS_OBJECT_DEL(rd->ly_to);
- MSGC_EVAS_OBJECT_DEL(rd->ly_bt);
MSGC_EVAS_OBJECT_DEL(rd->bx_main);
MSGC_EVAS_OBJECT_DEL(rd->popup_change_number);
g_free(rd);
D_LEAVE;
}
-/*This function used by predict search, result cb of contact&log and bundle val*/
COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_append(RECIPIENT_S *rd, const char *recipient, int index)
{
D_ENTER;
return COMPOSER_RETURN_SUCCESS;
}
-void msg_ui_composer_bt_show(RECIPIENT_S *rd)
-{
- D_ENTER;
- D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
- D_MSG_RETM_IF(rd->ly_bt == NULL, "laytout button is NULL");
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)rd->cd;
-
- if (cd->isAppControl)
- return;
-
- if (evas_object_visible_get(rd->ly_bt) == false) {
- elm_box_pack_end(rd->bx_main, rd->ly_bt);
- evas_object_show(rd->ly_bt);
- } else {
- D_MSG("layout button is Already shown");
- }
-
- D_LEAVE;
-}
-
-void msg_ui_composer_bt_hide(RECIPIENT_S *rd)
-{
- D_ENTER;
- D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
- D_MSG_RETM_IF(rd->ly_bt == NULL, "laytout button is NULL");
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)rd->cd;
-
- if (cd->isAppControl)
- return;
-
- if (evas_object_visible_get(rd->ly_bt) == true) {
- elm_box_unpack(rd->bx_main, rd->ly_bt);
- evas_object_hide(rd->ly_bt);
- } else {
- D_MSG("layout button is Already hidden");
- }
-
- D_LEAVE;
-}
-
COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_read_data(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
- D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "cd is NULL");
RECIPIENT_S *r;
RECIPIENT_ITEM_S *r_item;
Elm_Object_Item *mbe_item;
int r_count = 0;
+ if (!cd)
+ return COMPOSER_RETURN_FAIL;
if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
Eina_List *recipient_list = cd->recipient_list;
return COMPOSER_RETURN_SUCCESS;
}
+COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_set_loaded_data(void *data, const char *recipient, int index)
+{
+ D_MSG_RETVM_IF(data == NULL, COMPOSER_RETURN_FAIL, "data is NULL");
+ D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "recipient is NULL");
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX)
+ return COMPOSER_RETURN_RECIPIENT_COUNTMAX;
+
+ if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE)
+ return COMPOSER_RETURN_RECIPIENT_DUPLICATE;
+
+ if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE)
+ return COMPOSER_RETURN_RECIPIENT_INVALID;
+ else
+ return msg_ui_composer_recipient_append(cd->recipient, recipient, index);
+}
+
#include "msg-ui-composer-body.h"
#include "msg-ui-composer-popup.h"
#include "msg-ui-composer-attachment.h"
+#include "msg-ui-composer-main.h" /*for page duration, it should be removed if more option concept is changed*/
/* defines*/
#define MSGC_SUBJECT_CHAR_MAX 40
if (msg_ui_composer_common_is_send_possible(cd)) {
elm_object_disabled_set(cd->send_button, EINA_FALSE);
+ msg_ui_composer_body_update_send_btn_icon(cd, false);
msg_ui_composer_body_info_area_update(cd);
} else {
elm_object_disabled_set(cd->send_button, EINA_TRUE);
+ msg_ui_composer_body_update_send_btn_icon(cd, true);
edje_object_part_text_set(_EDJ(cd->ly_body), "text.char_count", "");// remove character count
}
/* show delete button */
edje_object_signal_emit(_EDJ(cd->sub_data.layout), "show.delete", "*");
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS)
+ msg_ui_composer_toolbar_top_update(cd);
+
D_LEAVE;
}
if (!msg_ui_composer_common_is_send_possible(cd)) {
elm_object_disabled_set(cd->send_button, EINA_TRUE);
+ msg_ui_composer_body_update_send_btn_icon(cd, true);
edje_object_part_text_set(_EDJ(cd->ly_body), "text.char_count", "");/* remove character count*/
if (cd->ly_body) {
Evas_Object *entry = msg_ui_composer_last_focused_entry_get(cd);
}
} else {
elm_object_disabled_set(cd->send_button, EINA_FALSE);
+ msg_ui_composer_body_update_send_btn_icon(cd, false);
msg_ui_composer_body_info_area_update(cd);
}
if (first_page_data) {
if (!elm_object_focus_get(first_page_data->entry)) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] ENTRY FOCUS CHANGE");
+ D_MSG("ENTRY FOCUS CHANGE");
msg_ui_composer_last_focused_entry_set(cd, first_page_data->entry);
cd->current_edit_entry = 0;
msg_ui_composer_last_focus_load(cd);
D_LEAVE;
}
+static void __msgc_subject_delete_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);
+}
+
+static void __msgc_subject_delete_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_SUBJECT_DEL_ICON, NULL);
+}
+
COMPOSER_RETURN_TYPE_E msg_ui_composer_read_subject(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
cd->sub_data.entry = NULL;
}
+ if (cd->sub_data.del_icon) {
+ evas_object_event_callback_del(cd->sub_data.del_icon, EVAS_CALLBACK_MOUSE_DOWN, __msgc_subject_delete_btn_down_cb);
+ evas_object_event_callback_del(cd->sub_data.del_icon, EVAS_CALLBACK_MOUSE_UP, __msgc_subject_delete_btn_up_cb);
+ }
+
if (cd->sub_data.layout) {
evas_object_del(cd->sub_data.layout);
cd->sub_data.layout = NULL;
elm_icon_file_set(del_icon, MSGC_IMG_SUBJECT_DEL_ICON, NULL);
evas_object_size_hint_weight_set(del_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(del_icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_object_focus_allow_set(del_icon, EINA_TRUE);
evas_object_data_set(del_icon, "layout", layout);
elm_object_part_content_set(layout, "subject.swl.del_button", del_icon);
evas_object_smart_callback_add(del_icon, "clicked", __msg_ui_composer_subject_delete_clicked_cb, cd);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, __msgc_subject_delete_btn_down_cb, NULL);
+ evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, __msgc_subject_delete_btn_up_cb, NULL);
cd->sub_data.layout = layout;
cd->sub_data.del_icon = del_icon;
#include <contacts-svc.h>
-#include <mm_util_imgp.h>
-#include <mm_util_jpeg.h>
+#include <image_util.h>
+#include <libexif/exif-data.h>
+#include <tapi_common.h>
+#include <TapiUtility.h>
+#include <TelPower.h>
+#include <ITapiModem.h>
+#include <vconf.h>
+
#include "msg-ui-composer-data.h"
#include "msg-ui-composer-util.h"
#include "msg-ui-composer-message.h"
#define MSG_CREATION_MODE_LARGE_IMG_WIDTH 640
#define MSG_CREATION_MODE_LARGE_IMG_HEIGHT 480
+/* information of exif value
+1 : top left
+2 : top right
+3 : bottom right
+4 : bottom left
+5 : left top
+6 : right top
+7 : right bottom
+8 : left bottom
+*/
+enum MSGC_EXIF_ORIENTATION {
+ MSGC_EXIF_NOT_AVAILABLE = 0,
+ MSGC_EXIF_NORMAL = 1,
+ MSGC_EXIF_HFLIP = 2,
+ MSGC_EXIF_ROT_180 = 3,
+ MSGC_EXIF_VFLIP = 4,
+ MSGC_EXIF_TRANSPOSE = 5,
+ MSGC_EXIF_ROT_90 = 6,
+ MSGC_EXIF_TRANSVERSE = 7,
+ MSGC_EXIF_ROT_270 = 8
+};
+
COMPOSER_UTIL_ADDRTYPE_E get_address_type(const char *address)
{
COMPOSER_UTIL_ADDRTYPE_E addrtype = COMPOSER_UTIL_ADDRTYPE_INVALID;
return addrtype;
}
+Eina_Bool IsMultipleNumber(int index)
+{
+ D_ENTER;
+ int error_code = CTS_SUCCESS;
+ int count = 0;
+ GSList *get_list = NULL;
+ GSList *iter = NULL;
+ CTSiter *citer = NULL;
+
+ contacts_svc_get_list_with_int(CTS_LIST_MEMBERS_OF_PERSON_ID, index, &citer);
+
+ while (CTS_SUCCESS == contacts_svc_iter_next(citer)) {
+ CTSvalue *ct_value = NULL;
+ CTSstruct *contact = NULL;
+ int contact_id;
+
+ ct_value = contacts_svc_iter_get_info(citer);
+ if (ct_value) {
+ contact_id = contacts_svc_value_get_int(ct_value, CTS_LIST_NUM_CONTACT_ID_INT);
+
+ if (contact_id > 0) {
+ error_code = contacts_svc_get_contact(contact_id, &contact);
+ if (error_code != CTS_SUCCESS) {
+ D_EMSG("contacts_svc_get_contact is failed error_code = %d", error_code);
+ contacts_svc_value_free(ct_value);
+ continue;
+ }
+
+ get_list = NULL;
+ contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &get_list);
+ iter = get_list;
+
+ while (NULL != iter) {
+ int phone_type = contacts_svc_value_get_int(iter->data, CTS_NUM_VAL_TYPE_INT);
+
+ if (phone_type != CTS_NUM_TYPE_ASSISTANT) {
+ const char *content = contacts_svc_value_get_str(iter->data, CTS_NUM_VAL_NUMBER_STR);
+ D_MSG("[%d][%d]%s", index, phone_type, content);
+
+ count++;
+ }
+
+ iter = g_slist_next(iter);
+ }
+
+ get_list = NULL;
+ contacts_svc_struct_get_list(contact, CTS_CF_EMAIL_LIST, &get_list);
+ iter = get_list;
+
+ while (NULL != iter) {
+ int email_type = contacts_svc_value_get_int(iter->data, CTS_EMAIL_VAL_TYPE_INT);
+ const char *content = contacts_svc_value_get_str(iter->data, CTS_EMAIL_VAL_ADDR_STR);
+
+ D_MSG("[%d][%d]%s", index, email_type, content);
+
+ count++;
+
+ iter = g_slist_next(iter);
+ }
+
+ contacts_svc_struct_free(contact);
+ } else {
+ D_EMSG("Invalid contact_id = %d", contact_id);
+ }
+
+ contacts_svc_value_free(ct_value);
+ } else {
+ D_EMSG("contacts_svc_iter_get_info is failed");
+ }
+ }
+
+ contacts_svc_iter_remove(citer);
+
+ D_LEAVE;
+ if (count > 1)
+ return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+Eina_Bool IsValidNumber(const char *address)
+{
+ D_ENTER;
+
+ if (!address)
+ return EINA_FALSE;
+
+ int addrlen = strlen(address);
+
+ if (addrlen < ADDR_LEN_MIN) {
+ D_EMSG("Too short address");
+ return EINA_FALSE;
+ }
+
+ const char *oneChar = address;
+
+ if (*oneChar == '+')
+ ++oneChar;
+
+ if (!(*oneChar)) {
+ return EINA_FALSE;
+ }
+
+ while (*oneChar) {
+ if (!isdigit(*oneChar) && (*oneChar != '*') && (*oneChar != '#') && (*oneChar != '-'))
+ return EINA_FALSE;
+
+ ++oneChar;
+ }
+
+ D_LEAVE;
+ return EINA_TRUE;
+}
+
+Eina_Bool IsVaildEmailAddress(const char *address)
+{
+ D_ENTER;
+
+ char *oneChar;
+ Eina_Bool isPrefixCorrect = EINA_FALSE;
+ Eina_Bool isSurfixCorrect = EINA_FALSE;
+ Eina_Bool isExistAt = EINA_FALSE;
+
+ int addrlen;
+
+ if (address == NULL) {
+ D_EMSG("Input address is NULL");
+ return EINA_FALSE;
+ }
+
+ oneChar = (char *)address;
+ addrlen = strlen(address);
+
+ if (addrlen == 0 || addrlen > EMAIL_ADDR_LEN_MAX)
+ return EINA_FALSE;
+
+ for (; *oneChar != '\0'; ++oneChar) {
+ if (isExistAt == EINA_FALSE) {
+ if (isalnum(*oneChar) || *oneChar == '.' || *oneChar == '_' || *oneChar == '-') {
+ isPrefixCorrect = EINA_TRUE;
+ continue;
+ } else if (*oneChar == '@') {
+ if (isPrefixCorrect == EINA_FALSE)
+ return EINA_FALSE;
+ else
+ isExistAt = EINA_TRUE;
+ } else {
+ return EINA_FALSE;
+ }
+ } else {
+ if (isalnum(*oneChar) || *oneChar == '.' || *oneChar == '_' || *oneChar == '-') {
+ isSurfixCorrect = EINA_TRUE;
+ continue;
+ } else {
+ return EINA_FALSE;
+ }
+ }
+ }
+
+ D_LEAVE;
+ return (isPrefixCorrect && isSurfixCorrect && isExistAt);
+}
+
int get_contact_index_by_recipient(const char *phone_number)
{
int index;
- index = contacts_svc_find_contact_by(CTS_FIND_BY_NUMBER, phone_number);
+ index = contacts_svc_find_person_by(CTS_FIND_BY_NUMBER, phone_number);
if (index > 0)
return index;
- index = contacts_svc_find_contact_by(CTS_FIND_BY_EMAIL, phone_number);
+ index = contacts_svc_find_person_by(CTS_FIND_BY_EMAIL, phone_number);
return index;
}
int get_contact_index_by_name(const char *phone_number)
{
- return contacts_svc_find_contact_by(CTS_FIND_BY_NAME, phone_number);
+ return contacts_svc_find_person_by(CTS_FIND_BY_NAME, phone_number);
}
int get_contact_display_name_by_index(int index, char *dest, int dest_size)
{
- int error_code = CTS_SUCCESS;
- int ret = COMPOSER_RETURN_SUCCESS;
- CTSstruct *contact = NULL;
- CTSvalue *name = NULL;
- const char *first, *last;
- char *display = NULL;
+ D_MSG_RETVM_IF(dest == NULL, COMPOSER_RETURN_FAIL, "dest is NULL");
- error_code = contacts_svc_get_contact(index, &contact);
- error_code = contacts_svc_struct_get_value(contact, CTS_CF_NAME_VALUE, &name);
+ int ct_ret = CTS_SUCCESS;
+ int ret = COMPOSER_RETURN_SUCCESS;
+ const char *display = NULL;
+ CTSvalue *value = NULL;
- first = contacts_svc_value_get_str(name, CTS_NAME_VAL_FIRST_STR);
- last = contacts_svc_value_get_str(name, CTS_NAME_VAL_LAST_STR);
- display = make_display_name(first, last);
- if (!display) {
- D_EMSG("display name is NULL");
+ ct_ret = contacts_svc_get_person(index, &value);
+ if (ct_ret != CTS_SUCCESS) {
+ D_EMSG("contacts_svc_get_person is failed ct_ret = %d", ct_ret);
return COMPOSER_RETURN_FAIL;
}
- if (display) {
+ display = contacts_svc_value_get_str(value, CTS_PERSON_VAL_DISPLAY_NAME_STR);
+
+ if (!display) {
+ D_EMSG("display name is NULL");
+ ret = COMPOSER_RETURN_FAIL;
+ } else {
if(strlen(display)) {
strncpy(dest, display, dest_size);
+ } else {
+ ret = COMPOSER_RETURN_FAIL;
}
- g_free(display);
- } else {
- ret = COMPOSER_RETURN_FAIL;
}
- contacts_svc_value_free(name);
- contacts_svc_struct_free(contact);
+
+ contacts_svc_value_free(value);
+
return ret;
}
int get_contact_default_number_by_index(int index, char *dest, int dest_size)
{
+ D_MSG_RETVM_IF(dest == NULL, COMPOSER_RETURN_FAIL, "dest is NULL");
+
int ret = COMPOSER_RETURN_SUCCESS;
int ct_ret;
- CTSvalue *number = NULL;
char *default_num = NULL;
+ CTSvalue *value = NULL;
- ct_ret = contacts_svc_get_contact_value(CTS_GET_DEFAULT_NUMBER_VALUE, index, &number);
-
+ ct_ret = contacts_svc_get_person_value(CTS_GET_PERSON_DEFAULT_NUMBER_VALUE, index, &value);
if (CTS_SUCCESS == ct_ret) {
-
- default_num = g_strdup(contacts_svc_value_get_str(number, CTS_NUM_VAL_NUMBER_STR));
- contacts_svc_value_free(number);
+ default_num = g_strdup(contacts_svc_value_get_str(value, CTS_NUM_VAL_NUMBER_STR));
if (default_num) {
strncpy(dest, default_num, dest_size);
} else {
ret = COMPOSER_RETURN_FAIL;
}
+
+ contacts_svc_value_free(value);
+
} else {
+ D_EMSG("contacts_svc_get_person_value is failed ct_ret = %d", ct_ret);
ret = COMPOSER_RETURN_FAIL;
}
return ret;
int get_contact_default_email_by_index(int index, char *dest, int dest_size)
{
+ D_MSG_RETVM_IF(dest == NULL, COMPOSER_RETURN_FAIL, "dest is NULL");
+
int ret = COMPOSER_RETURN_SUCCESS;
int ct_ret;
- CTSvalue *number = NULL;
char *default_num = NULL;
+ CTSvalue *value = NULL;
- ct_ret = contacts_svc_get_contact_value(CTS_GET_DEFAULT_EMAIL_VALUE, index, &number);
-
+ ct_ret = contacts_svc_get_person_value(CTS_GET_PERSON_DEFAULT_EMAIL_VALUE, index, &value);
if (CTS_SUCCESS == ct_ret) {
- default_num = g_strdup(contacts_svc_value_get_str(number, CTS_EMAIL_VAL_ADDR_STR));
- contacts_svc_value_free(number);
+ default_num = g_strdup(contacts_svc_value_get_str(value, CTS_EMAIL_VAL_ADDR_STR));
if (default_num) {
strncpy(dest, default_num, dest_size);
} else {
ret = COMPOSER_RETURN_FAIL;
}
- } else
+
+ contacts_svc_value_free(value);
+ } else {
+ D_EMSG("contacts_svc_get_person_value is failed ct_ret = %d", ct_ret);
ret = COMPOSER_RETURN_FAIL;
+ }
return ret;
}
return ret;
}
-char *make_display_name(const char *first, const char *last)
+static bool __make_namecard(int person_id, char *file_path)
{
- char *ret_val = NULL;
-
- if (first != NULL && last != NULL) {
- if (CTS_ORDER_NAME_FIRSTLAST == contacts_svc_get_order(CTS_ORDER_OF_DISPLAY)) {
- ret_val = g_strconcat(first, " ", last, NULL);
- } else {
- ret_val = g_strconcat(last, " ", first, NULL);
- }
- } else if (first != NULL || last != NULL) {
- ret_val = (first != NULL) ? g_strdup(first) : g_strdup(last);
- }
-
- if (!ret_val) {
- D_MSG("No Display name");
- }
- return ret_val;
-}
-
-static bool __make_namecard(CTSstruct *contact, char *file_path)
-{
-
- int error_code = CTS_ERR_FAIL;
+ D_MSG_RETVM_IF(file_path == NULL, false, "file_path is NULL");
+ int ct_ret = CTS_ERR_FAIL;
char *vcard = NULL;
FILE *vcard_file = NULL;
- error_code = contacts_svc_get_vcard_from_contact(contact, &vcard);
- if (error_code == CTS_SUCCESS) {
+ ct_ret = contacts_svc_get_vcard_from_person(person_id, &vcard);
+ if (ct_ret == CTS_SUCCESS) {
vcard_file = fopen(file_path, "wt");
if (vcard_file == NULL) {
g_free(vcard);
g_free(vcard);
return true;
} else {
- D_EMSG("contacts_svc_get_vcard_from_contact Fail %d", error_code);
+ D_EMSG("contacts_svc_get_vcard_from_person is failed ct_ret = %d", ct_ret);
}
return false;
}
-bool msg_composer_get_vcf_file_by_index(int index, char *strpath, int sizepath)
+#ifdef SUPPORT_MULTI_SELECT_VCARD
+static char* __get_vcard_filepath(const char *path)
{
- D_ENTER;
- int error_code = CTS_SUCCESS;
- char filename[COMPOSER_FILEPATH_LEN_MAX + 1] = { 0, };
- bool ret = true;
- CTSstruct *contact = NULL;
+ time_t timer = 0;
+ struct tm *stime = NULL;
+ char buf[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
- error_code = contacts_svc_get_contact(index, &contact);
- if (error_code == CTS_SUCCESS) {
- snprintf(filename, sizeof(filename), "%s/vcard_%d.vcf", MSGC_UI_DAT_PATH, index);
- D_MSG("make vcard path [%s]", filename);
+ timer = time(NULL);
+ stime = localtime(&timer);
+ D_MSG_RETVM_IF(stime == NULL, NULL, "stime is NULL");
- if (__make_namecard(contact, filename) == false) {
- D_MSG("Fail of make namecard");
- ret = false;
- }
+ snprintf(buf, sizeof(buf), "%s/contacts_%02d%02d%02d%02d%02d%02d.vcf", path,
+ stime->tm_year-100, stime->tm_mon+1, stime->tm_mday,
+ stime->tm_hour, stime->tm_min, stime->tm_sec);
- strncpy(strpath, filename, sizepath);
- } else {
- D_EMSG("contacts_svc_get_contact Fail %d", error_code);
- ret = false;
- }
-
- contacts_svc_struct_free(contact);
- D_LEAVE;
- return ret;
+ return strdup(buf);
}
+#endif
-Eina_Bool IsMultipleNumber(int index)
+static char *__get_detail_vcard_filepath(int index, const char *path)
{
- D_ENTER;
- int error_code = CTS_SUCCESS;
- int count = 0;
+ int ct_ret = CTS_SUCCESS;
+ char temp[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
+ char display[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
+ char filepath[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
+ const char *display_name = NULL;
+ CTSvalue *value = NULL;
CTSstruct *contact = NULL;
- GSList *get_list = NULL;
- GSList *iter = NULL;
+ if (path == NULL)
+ path = MSGC_UI_DAT_PATH;
- error_code = contacts_svc_get_contact(index, &contact);
- if (error_code) {
- D_MSG("error_code %d", error_code);
- return EINA_FALSE;
- }
- contacts_svc_struct_get_list(contact, CTS_CF_NUMBER_LIST, &get_list);
- iter = get_list;
+ ct_ret = contacts_svc_get_contact(index, &contact);
- while (NULL != iter) {
- int phone_type = contacts_svc_value_get_int(iter->data, CTS_NUM_VAL_TYPE_INT);
+ if (ct_ret == CTS_SUCCESS) {
+ ct_ret = contacts_svc_struct_get_value(contact, CTS_CF_BASE_INFO_VALUE, &value);
- if (phone_type != CTS_NUM_TYPE_ASSISTANT) {
- const char *content = contacts_svc_value_get_str(iter->data, CTS_NUM_VAL_NUMBER_STR);
+ if (ct_ret == CTS_SUCCESS) {
+ display_name = contacts_svc_value_get_str(value, CTS_BASE_VAL_DISPLAY_NAME_STR);
- D_MSG("[%d][%d]%s", index, phone_type, content);
+ if (display_name && display_name[0] != '\0')
+ snprintf(temp, sizeof(temp), "%s", display_name);
- count++;
+ contacts_svc_value_free(value);
+ } else {
+ D_EMSG("contacts_svc_struct_get_value is failed ct_ret = %d", ct_ret);
}
- iter = g_slist_next(iter);
+ contacts_svc_struct_free(contact);
+ } else {
+ D_EMSG("contacts_svc_get_contact is failed ct_ret = %d, index = %d", ct_ret, index);
}
- get_list = NULL;
- contacts_svc_struct_get_list(contact, CTS_CF_EMAIL_LIST, &get_list);
- iter = get_list;
+ if (temp[0] != '\0')
+ snprintf(display, sizeof(display), "%s", temp);
+ else
+ snprintf(display, sizeof(display), "%s", _SYSSTR("IDS_COM_BODY_NO_NAME"));
- while (NULL != iter) {
- int email_type = contacts_svc_value_get_int(iter->data, CTS_EMAIL_VAL_TYPE_INT);
+ snprintf(filepath, sizeof(filepath), "%s/%s.vcf", path, display);
- const char *content = contacts_svc_value_get_str(iter->data, CTS_EMAIL_VAL_ADDR_STR);
+ return strdup(filepath);
+}
- D_MSG("[%d][%d]%s", index, email_type, content);
- count++;
+bool msg_composer_get_vcf_file_by_index(int index, char *strpath, int sizepath)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(strpath == NULL, false, "strpath is NULL");
+ bool ret = true;
+ char *filepath = NULL;
+
+ filepath = __get_detail_vcard_filepath(index, MSGC_UI_DAT_PATH);
+ D_MSG("make vcard path [%s]", filepath);
- iter = g_slist_next(iter);
+ if (filepath == NULL) {
+ char tmp_filepath[COMPOSER_FILEPATH_LEN_MAX + 1] = {0,};
+ snprintf(tmp_filepath, sizeof(tmp_filepath), "%s/vcard_%d.vcf", MSGC_UI_DAT_PATH, index);
+ filepath = strdup(tmp_filepath);
}
- D_LEAVE;
- if (count > 1)
- return EINA_TRUE;
+ if (__make_namecard(index, filepath) == false) {
+ D_EMSG("Fail of make namecard");
+ ret = false;
+ }
- return EINA_FALSE;
+ strncpy(strpath, filepath, sizepath);
+
+ if (filepath)
+ free(filepath);
+
+ D_LEAVE;
+ return ret;
}
-Eina_Bool IsValidNumber(const char *address)
+char *msg_composer_create_working_dir(void)
{
D_ENTER;
+ char *base_dir = "/tmp/message";
+ char working_path[DEF_PATH_MAX + 1] = {0,};
+ int i = 0;
- if (!address)
- return EINA_FALSE;
-
- int addrlen = strlen(address);
-
- if (addrlen < ADDR_LEN_MIN) {
- D_EMSG("Too short address");
- return EINA_FALSE;
+ /*Create base dir*/
+ if (ecore_file_exists(base_dir) == EINA_FALSE) {
+ if(ecore_file_mkdir(base_dir) == EINA_FALSE) {
+ return NULL;
+ }
}
- const char *oneChar = address;
+ /*Create work dir*/
+ do {
+ bzero(working_path, DEF_PATH_MAX);
+ snprintf(working_path, sizeof(working_path), "%s/composer_%d/", base_dir, i);
+ if (ecore_file_exists(working_path) == EINA_FALSE) {
+ if (ecore_file_mkdir(working_path) == EINA_FALSE) {
+ return NULL;
+ } else {
+ D_MSG("Success to create working path = %s", working_path);
+ return strdup(working_path);
+ }
+ break;
+ }
+ i++;
+ } while(i < 255);
- if (*oneChar == '+')
- ++oneChar;
+ return NULL;
+}
- if (!(*oneChar)) {
- return EINA_FALSE;
- }
+bool msg_composer_get_network_status(int *network_status)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(network_status == NULL, false, "param is NULL");
- while (*oneChar) {
- if (!isdigit(*oneChar) && (*oneChar != '*') && (*oneChar != '#') && (*oneChar != '-'))
- return EINA_FALSE;
+ int svc_type = -1;
- ++oneChar;
+ if (vconf_get_int(VCONFKEY_TELEPHONY_SVCTYPE, &svc_type) < 0) {
+ D_EMSG("vconf_get_int(svc_type) is failed !!");
+ return false;
+ } else {
+ D_MSG("network_status = %d", svc_type);
+ *network_status = svc_type;
}
- D_LEAVE;
- return EINA_TRUE;
+ return true;
}
-Eina_Bool IsVaildEmailAddress(const char *address)
+bool msg_composer_get_flight_mode(int *flight_mode)
{
D_ENTER;
+ D_MSG_RETVM_IF(flight_mode == NULL, false, "uri is NULL");
- char *oneChar;
- Eina_Bool isPrefixCorrect = EINA_FALSE;
- Eina_Bool isSurfixCorrect = EINA_FALSE;
- Eina_Bool isExistAt = EINA_FALSE;
-
- int addrlen;
-
- if (address == NULL) {
- D_EMSG("Input address is NULL");
- return EINA_FALSE;
+ if (vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, flight_mode) < 0) {
+ D_EMSG("vconf_get_int(flight_mode) is failed !!");
+ return false;
+ } else {
+ D_MSG("flight_mode = %d", *flight_mode);
}
- oneChar = (char *)address;
- addrlen = strlen(address);
-
- if (addrlen == 0 || addrlen > EMAIL_ADDR_LEN_MAX)
- return EINA_FALSE;
+ D_LEAVE;
+ return true;
+}
- for (; *oneChar != '\0'; ++oneChar) {
- if (isExistAt == EINA_FALSE) {
- if (isalnum(*oneChar) || *oneChar == '.' || *oneChar == '_' || *oneChar == '-') {
- isPrefixCorrect = EINA_TRUE;
- continue;
- } else if (*oneChar == '@') {
- if (isPrefixCorrect == EINA_FALSE)
- return EINA_FALSE;
- else
- isExistAt = EINA_TRUE;
- } else {
- return EINA_FALSE;
- }
- } else {
- if (isalnum(*oneChar) || *oneChar == '.' || *oneChar == '_' || *oneChar == '-') {
- isSurfixCorrect = EINA_TRUE;
- continue;
- } else {
- return EINA_FALSE;
- }
- }
+bool msg_composer_set_flight_mode(void *handle, int type, void *callback, void *user_data)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(handle == NULL, false, "handle is NULL");
+ TapiHandle *tapi_handle = (TapiHandle *)handle;
+ tapi_response_cb cb = (tapi_response_cb)callback;
+ tapi_power_flight_mode_type_t flight_mode_type = (tapi_power_flight_mode_type_t)type;
+ int err = TAPI_API_SUCCESS;
+
+ err = tel_set_flight_mode(tapi_handle, flight_mode_type, cb, user_data);
+ if (err != TAPI_API_SUCCESS) {
+ D_EMSG("tel_set_flight_mode is failed");
+ return false;
}
D_LEAVE;
- return (isPrefixCorrect && isSurfixCorrect && isExistAt);
+ return true;
}
Eina_List *make_tokenize_list(const char *ori_string, const char *sep)
return d_pos;
}
-int jpeg_image_get_resolution(const char *src_file_path, unsigned int *dst_w, unsigned int *dst_h)
+int jpeg_image_get_rotation(const char *src_file_path, int *rotation)
{
D_ENTER;
+ D_MSG_RETVM_IF(ecore_file_exists(src_file_path) == EINA_FALSE, COMPOSER_UTIL_RET_ERR, "There is not exist src file path = %s", src_file_path);
+ D_MSG_RETVM_IF(rotation == NULL, COMPOSER_UTIL_RET_ERR, "rotation is NULL");
- int ret = 0;
- char temp_src_file_path[DEF_BUF_LEN_L] = {0,};
- mm_util_jpeg_yuv_format jy_fmt = MM_UTIL_JPEG_FMT_RGB888;
+ int ret = COMPOSER_UTIL_RET_SUCCESS;
+ ExifData *exif_data = NULL;
- mm_util_jpeg_yuv_data decoded = {0,};
+ exif_data = exif_data_new_from_file(src_file_path);
+ if (exif_data) {
+ ExifEntry *exif_entry = NULL;
+ exif_entry = exif_data_get_entry(exif_data, EXIF_TAG_ORIENTATION);
- D_MSG_RETVM_IF(ecore_file_exists(src_file_path) == EINA_FALSE, COMPOSER_UTIL_ERR, "There is not exist src file path = %s", src_file_path);
- D_MSG_RETVM_IF((dst_w == NULL || dst_h == NULL), COMPOSER_UTIL_ERR, "Parameter is Invalid dst_w = %p, dst_h = %p", dst_w, dst_h);
+ if (exif_entry) {
+ ExifByteOrder byte_order = exif_data_get_byte_order(exif_data);
+ short exif_value = exif_get_short(exif_entry->data, byte_order);
+ D_MSG("value = %d", exif_value);
- strncpy(temp_src_file_path, src_file_path, sizeof(temp_src_file_path)-1);
+ if (exif_value >= MSGC_EXIF_NOT_AVAILABLE && exif_value <= MSGC_EXIF_ROT_270) {
+ *rotation = exif_value;
+ } else {
+ *rotation = 0;
+ }
+ } else {
+ D_EMSG("exif_entry is NULL");
+ ret = COMPOSER_UTIL_RET_ERR;
+ }
- /*decode jpeg file*/
- ret = mm_util_decode_from_jpeg_file(&decoded, temp_src_file_path, jy_fmt);
- if (ret) {
- D_EMSG("mm_util_decode_from_jpeg_file ret = %d", ret);
- return COMPOSER_UTIL_ERR;
+ exif_data_unref(exif_data);
+ } else {
+ D_MSG("There is not exif data");
+ ret = COMPOSER_UTIL_RET_ERR;
}
- D_MSG("Image Resolution is (%d x %d)", decoded.width, decoded.height);
+ D_LEAVE;
+ return ret;
+}
- *dst_w = decoded.width;
- *dst_h = decoded.height;
+int jpeg_image_get_resolution(const char *src_file_path, int *dst_w, int *dst_h)
+{
+ D_ENTER;
+ D_MSG_RETVM_IF(ecore_file_exists(src_file_path) == EINA_FALSE, COMPOSER_UTIL_RET_ERR, "There is not exist src file path = %s", src_file_path);
+ D_MSG_RETVM_IF((dst_w == NULL || dst_h == NULL), COMPOSER_UTIL_RET_ERR, "Parameter is Invalid dst_w = %p, dst_h = %p", dst_w, dst_h);
- if (decoded.data != NULL)
- free(decoded.data);
+ int ret = IMAGE_UTIL_ERROR_NONE;
+
+ /*decode jpeg file*/
+ unsigned char *image_buffer = NULL;
+ unsigned int buffer_size = 0;
+
+ ret = image_util_decode_jpeg(src_file_path, IMAGE_UTIL_COLORSPACE_RGB888, &image_buffer, dst_w, dst_h, &buffer_size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_decode_jpeg is failed ret = %d", ret);
+ return COMPOSER_UTIL_RET_ERR;
+ }
+
+ if (image_buffer)
+ free(image_buffer);
+
+ D_MSG("Image Resolution is (%d x %d)", *dst_w, *dst_h);
D_LEAVE;
- return COMPOSER_UTIL_ERR_NONE;
+ return COMPOSER_UTIL_RET_SUCCESS;
}
-int jpeg_image_resize(const char *src_file_path, unsigned int dst_w, unsigned int dst_h, const char *dst_file_path)
+int jpeg_image_rotate_image(const char *src_file_path, int rotation, const char *dst_file_path)
{
D_ENTER;
- int ret = 0;
- unsigned int dst_size;
- unsigned char *dst = NULL;
- char temp_src_file_path[DEF_BUF_LEN_L] = {0,};
- char temp_dst_file_path[DEF_BUF_LEN_L] = {0,};
+ D_MSG_RETVM_IF(src_file_path == NULL, COMPOSER_UTIL_RET_ERR, "src_file_path is NULL");
+ D_MSG_RETVM_IF(dst_file_path == NULL, COMPOSER_UTIL_RET_ERR, "dst_file_path is NULL");
- mm_util_jpeg_yuv_format jy_fmt = MM_UTIL_JPEG_FMT_RGB888;
- mm_util_img_format i_fmt = MM_UTIL_IMG_FMT_RGB888;
- mm_util_jpeg_yuv_data decoded = {0,};
+ int ret = IMAGE_UTIL_ERROR_NONE;
+ unsigned char *dst = NULL;
+ unsigned char *image_buffer = NULL;
+ int width = 0;
+ int height = 0;
+ int dest_width = 0;
+ int dest_height = 0;
+ unsigned int size = 0;
+ unsigned int dst_size = 0;
+ image_util_rotation_e rot = IMAGE_UTIL_ROTATION_NONE;
if (ecore_file_exists(src_file_path) == EINA_FALSE) {
D_EMSG("There is not exist src file path = %s", src_file_path);
- return COMPOSER_UTIL_ERR;
+ return COMPOSER_UTIL_RET_ERR;
}
- strncpy(temp_src_file_path, src_file_path, sizeof(temp_src_file_path)-1);
- if (!dst_file_path) {
- D_EMSG("There is not exist dst file path = %s", dst_file_path);
- return COMPOSER_UTIL_ERR;
+ if (rotation != MSGC_EXIF_ROT_90 && rotation != MSGC_EXIF_ROT_180 && rotation != MSGC_EXIF_ROT_270) {
+ D_EMSG("Rotation is not required rotation = %d", rotation);
+ return COMPOSER_UTIL_RET_ERR;
}
- strncpy(temp_dst_file_path, dst_file_path, sizeof(temp_dst_file_path)-1);
- if (dst_w <= 0 || dst_h <= 0) {
- D_EMSG("There is not valid dst width = %d, height = %d", dst_w, dst_h);
- return COMPOSER_UTIL_ERR;
+ /*decode jpeg file*/
+ ret = image_util_decode_jpeg(src_file_path, IMAGE_UTIL_COLORSPACE_RGB888, &image_buffer, &width, &height, &size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_decode_jpeg is failed ret = %d", ret);
+ return COMPOSER_UTIL_RET_ERR;
}
- /*decode jpeg file*/
- ret = mm_util_decode_from_jpeg_file(&decoded, temp_src_file_path, jy_fmt);
- if (ret) {
- D_EMSG("mm_util_decode_from_jpeg_file ret = %d", ret);
- return COMPOSER_UTIL_ERR;
+ if (rotation == MSGC_EXIF_ROT_90 || rotation == MSGC_EXIF_ROT_270) {
+ dest_width = height;
+ dest_height = width;
+ } else {
+ dest_width = width;
+ dest_height = height;
}
/*get size about resize img*/
- ret = mm_util_get_image_size(i_fmt, dst_w, dst_h, &dst_size);
- if (ret) {
- D_EMSG("mm_util_get_image_size ret = %d", ret);
+ ret = image_util_calculate_buffer_size(dest_width, dest_height, IMAGE_UTIL_COLORSPACE_RGB888, &dst_size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_calculate_buffer_size is failed ret = %d", ret);
goto err_return;
}
D_EMSG("fail of memory allocation size = %d", dst_size);
goto err_return;
}
-
} else {
D_EMSG("no data size = %d", dst_size);
goto err_return;
}
- /* resize image */
- D_MSG("[resize image] src = %s(%d x %d)->(%d x %d)", temp_src_file_path, decoded.width, decoded.height, dst_w, dst_h);
- ret = mm_util_resize_image(decoded.data, (unsigned int)decoded.width, (unsigned int)decoded.height,
- i_fmt, dst, &dst_w,&dst_h);
- if (ret) {
- D_EMSG("mm_util_resize_image ret = %d", ret);
+ /* convert rotation value */
+ if (rotation == MSGC_EXIF_ROT_90)
+ rot = IMAGE_UTIL_ROTATION_90;
+ else if (rotation == MSGC_EXIF_ROT_180)
+ rot = IMAGE_UTIL_ROTATION_180;
+ else if (rotation == MSGC_EXIF_ROT_270)
+ rot = IMAGE_UTIL_ROTATION_270;
+ else
+ rot = IMAGE_UTIL_ROTATION_NONE;
+
+ dest_width = 0;
+ dest_height = 0;
+
+ D_MSG("rotation : %d => rot : %d", rotation, rot);
+
+ /* rotate image */
+ image_util_rotate(dst, &dest_width, &dest_height, rot, image_buffer, width, height, IMAGE_UTIL_COLORSPACE_RGB888);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_rotate is failed ret = %d", ret);
goto err_return;
}
+ D_MSG("[rotate image] (%d x %d)->(%d x %d)", width, height, dest_width, dest_height);
/*save image to dst file path*/
- ret = mm_util_jpeg_encode_to_file(temp_dst_file_path, dst, dst_w, dst_h, jy_fmt, 100);
- if (ret) {
- D_EMSG("Fail mm_util_jpeg_encode_to_file ret = %d", ret);
+ ret = image_util_encode_jpeg(dst, dest_width, dest_height, IMAGE_UTIL_COLORSPACE_RGB888, 90, dst_file_path);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_encode_jpeg is failed ret = %d", ret);
goto err_return;
}
- if (dst)
- g_free(dst);
+ if (image_buffer)
+ free(image_buffer);
- if (decoded.data != NULL)
- free(decoded.data);
+ if (dst)
+ free(dst);
D_LEAVE;
- return COMPOSER_UTIL_ERR_NONE;
+ return COMPOSER_UTIL_RET_SUCCESS;
err_return:
- if (dst)
- g_free(dst);
+ if (image_buffer)
+ free(image_buffer);
- if (decoded.data != NULL)
- free(decoded.data);
+ if (dst)
+ free(dst);
- return COMPOSER_UTIL_ERR;
+ return COMPOSER_UTIL_RET_ERR;
}
-int jpeg_image_quality_set(const char *src_file_path, int quality, const char *dst_file_path)
+int jpeg_image_change_image(const char *src_file_path, MSGC_UTIL_CHANGE_IMAGE_S *req, const char *dst_file_path)
{
D_ENTER;
- int ret = 0;
- char temp_src_file_path[DEF_BUF_LEN_L] = {0,};
- char temp_dst_file_path[DEF_BUF_LEN_L] = {0,};
+ D_MSG_RETVM_IF(src_file_path == NULL, COMPOSER_UTIL_RET_ERR, "src_file_path is NULL");
+ D_MSG_RETVM_IF(dst_file_path == NULL, COMPOSER_UTIL_RET_ERR, "dst_file_path is NULL");
+ D_MSG_RETVM_IF(req == NULL, COMPOSER_UTIL_RET_ERR, "req is NULL");
- mm_util_jpeg_yuv_format jy_fmt = MM_UTIL_JPEG_FMT_RGB888;
- mm_util_jpeg_yuv_data decoded = {0,};
+ int ret = IMAGE_UTIL_ERROR_NONE;
+ unsigned char *dst = NULL;
+ unsigned char *image_buffer = NULL;
+ int width = 0;
+ int height = 0;
+ unsigned int size = 0;
+ unsigned int dst_size = 0;
+ int quality = 0;
if (ecore_file_exists(src_file_path) == EINA_FALSE) {
D_EMSG("There is not exist src file path = %s", src_file_path);
- return COMPOSER_UTIL_ERR;
+ return COMPOSER_UTIL_RET_ERR;
+ }
+
+ /*decode jpeg file*/
+ ret = image_util_decode_jpeg(src_file_path, IMAGE_UTIL_COLORSPACE_RGB888, &image_buffer, &width, &height, &size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_decode_jpeg is failed ret = %d", ret);
+ return COMPOSER_UTIL_RET_ERR;
}
- strncpy(temp_src_file_path, src_file_path, sizeof(temp_src_file_path)-1);
- if (!dst_file_path) {
- D_EMSG("There is not exist dst file path = %s", dst_file_path);
- return COMPOSER_UTIL_ERR;
+ /* resize image */
+ if (req->type & MSGC_IMAGE_CHANGE_RESIZE) {
+ D_MSG("MSGC_IMAGE_CHANGE_RESIZE image");
+ int dest_width = req->dest_width;
+ int dest_height = req->dest_height;
+
+ if (dest_width <= 0 || dest_height <= 0) {
+ D_EMSG("There is not valid dst width = %d, height = %d", dest_width, dest_height);
+ goto err_return;
+ }
+
+ /*get size about resize img*/
+ ret = image_util_calculate_buffer_size(dest_width, dest_height, IMAGE_UTIL_COLORSPACE_RGB888, &dst_size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_calculate_buffer_size is failed ret = %d", ret);
+ goto err_return;
+ }
+
+ if (dst_size > 0) {
+ D_MSG("dst_size = %d", dst_size);
+ dst = calloc(1, dst_size);
+ if (dst == NULL) {
+ D_EMSG("fail of memory allocation size = %d", dst_size);
+ goto err_return;
+ }
+ } else {
+ D_EMSG("no data size = %d", dst_size);
+ goto err_return;
+ }
+
+ dst_size = 0;
+
+ /* resize image */
+ D_MSG("[resize image] src = %s(%d x %d)->(%d x %d)", src_file_path, width, height, dest_width, dest_height);
+
+ ret = image_util_resize(dst, &dest_width, &dest_height, image_buffer, width, height, IMAGE_UTIL_COLORSPACE_RGB888);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_resize is failed ret = %d", ret);
+ goto err_return;
+ }
+
+ if (dest_width != req->dest_width || dest_height != req->dest_height)
+ D_EMSG("size is changed!! resized image (%d x %d)", dest_width, dest_height);
+
+ if (image_buffer) {
+ free(image_buffer);
+ image_buffer = NULL;
+ }
+
+ image_buffer = dst;
+ width = dest_width;
+ height = dest_height;
+ dst = NULL;
}
- strncpy(temp_dst_file_path, dst_file_path, sizeof(temp_dst_file_path)-1);
- if (quality > 100 || quality < 1) {
- D_EMSG("Invalid quality ! it should 0 < quality <= 100", dst_file_path);
- return COMPOSER_UTIL_ERR;
+ /* rotate image */
+ if (req->type & MSGC_IMAGE_CHANGE_ROTATION) {
+ D_MSG("MSGC_IMAGE_CHANGE_ROTATION image");
+ int rotation = req->rotation;
+
+ if (rotation != MSGC_EXIF_ROT_90 && rotation != MSGC_EXIF_ROT_180 && rotation != MSGC_EXIF_ROT_270) {
+ D_MSG("Rotation is not required rotation = %d", rotation);
+ } else {
+ int dest_width = 0;
+ int dest_height = 0;
+ image_util_rotation_e rot = IMAGE_UTIL_ROTATION_NONE;
+
+ if (rotation == MSGC_EXIF_ROT_90 || rotation == MSGC_EXIF_ROT_270) {
+ dest_width = height;
+ dest_height = width;
+ } else {
+ dest_width = width;
+ dest_height = height;
+ }
+
+ /*get size about resize img*/
+ ret = image_util_calculate_buffer_size(dest_width, dest_height, IMAGE_UTIL_COLORSPACE_RGB888, &dst_size);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_calculate_buffer_size is failed ret = %d", ret);
+ goto err_return;
+ }
+
+ if (dst_size > 0) {
+ D_MSG("dst_size = %d", dst_size);
+ dst = calloc(1, dst_size);
+ if (dst == NULL) {
+ D_EMSG("fail of memory allocation size = %d", dst_size);
+ goto err_return;
+ }
+ } else {
+ D_EMSG("no data size = %d", dst_size);
+ goto err_return;
+ }
+
+ /* convert rotation value */
+ if (rotation == MSGC_EXIF_ROT_90)
+ rot = IMAGE_UTIL_ROTATION_90;
+ else if (rotation == MSGC_EXIF_ROT_180)
+ rot = IMAGE_UTIL_ROTATION_180;
+ else if (rotation == MSGC_EXIF_ROT_270)
+ rot = IMAGE_UTIL_ROTATION_270;
+ else
+ rot = IMAGE_UTIL_ROTATION_NONE;
+
+ dest_width = 0;
+ dest_height = 0;
+
+ D_MSG("rotation : %d => rot : %d", rotation, rot);
+
+ /* rotate image */
+ image_util_rotate(dst, &dest_width, &dest_height, rot, image_buffer, width, height, IMAGE_UTIL_COLORSPACE_RGB888);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_rotate is failed ret = %d", ret);
+ goto err_return;
+ }
+
+ D_MSG("[rotate image] (%d x %d)->(%d x %d)", width, height, dest_width, dest_height);
+
+ if (image_buffer) {
+ free(image_buffer);
+ image_buffer = NULL;
+ }
+
+ image_buffer = dst;
+ width = dest_width;
+ height = dest_height;
+ dst = NULL;
+ }
}
- /*decode jpeg file*/
- ret = mm_util_decode_from_jpeg_file(&decoded, temp_src_file_path, jy_fmt);
- if (ret) {
- D_EMSG("mm_util_decode_from_jpeg_file ret = %d", ret);
- return COMPOSER_UTIL_ERR;
+ /* set quality */
+ if (req->type & MSGC_IMAGE_CHANGE_QUAILTY) {
+ D_MSG("MSGC_IMAGE_CHANGE_QUAILTY image");
+ quality = req->quality;
+ } else {
+ quality = 90;
}
- /*set quality save image to dst file path*/
- ret = mm_util_jpeg_encode_to_file(temp_dst_file_path, decoded.data, decoded.width, decoded.height, jy_fmt, quality);
- if (ret) {
- D_EMSG("Fail mm_util_jpeg_encode_to_file ret = %d", ret);
+ /* save image to dst file path*/
+ ret = image_util_encode_jpeg(image_buffer, width, height, IMAGE_UTIL_COLORSPACE_RGB888, quality, dst_file_path);
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ D_EMSG("image_util_encode_jpeg is failed ret = %d", ret);
goto err_return;
}
- if (decoded.data != NULL)
- free(decoded.data);
+ if (image_buffer) {
+ free(image_buffer);
+ image_buffer = NULL;
+ }
+
+ if (dst) {
+ free(dst);
+ dst = NULL;
+ }
D_LEAVE;
- return COMPOSER_UTIL_ERR_NONE;
+ return COMPOSER_UTIL_RET_SUCCESS;
err_return:
+ if (image_buffer) {
+ free(image_buffer);
+ image_buffer = NULL;
+ }
- if (decoded.data != NULL)
- free(decoded.data);
-
- return COMPOSER_UTIL_ERR;
+ if (dst) {
+ free(dst);
+ dst = NULL;
+ }
+ return COMPOSER_UTIL_RET_ERR;
}
-bool msg_composer_util_is_allow_creation_mode(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type)
+COMPOSER_UTIL_RETURN_E msg_composer_is_allowed_creation_mode(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int creation_mode)
{
D_ENTER;
- D_MSG_RETVM_IF(file_path == NULL , false, "Input parameter file_path is Invalid");
+ D_MSG_RETVM_IF(file_path == NULL, COMPOSER_UTIL_RET_ERR, "Input parameter file_path is Invalid");
char *ext = msg_common_get_file_ext(file_path);
- unsigned int dst_w = 0 , dst_h = 0;
+ int dst_w = 0;
+ int dst_h = 0;
if (media_type == COMPOSER_MEDIA_TYPE_IMAGE) {
if ((strcasecmp(ext, "jpg") != 0) && (strcasecmp(ext, "jpeg") != 0)
- && (strcasecmp(ext, "gif") != 0) && (strcasecmp(ext, "wbmp") != 0)
- && (strcasecmp(ext, "png") != 0)) {
- return false;
+ && (strcasecmp(ext, "gif") != 0) && (strcasecmp(ext, "wbmp") != 0)) {
+ return COMPOSER_UTIL_RET_NOT_ALLOWED;
} else {
/* Check High resoluton*/
jpeg_image_get_resolution(file_path, &dst_w, &dst_h);
if(dst_w > MSG_CREATION_MODE_LARGE_IMG_WIDTH || dst_h > MSG_CREATION_MODE_LARGE_IMG_HEIGHT) {
- return false;
+ if (creation_mode == MSG_CREATION_MODE_WARNING)
+ return COMPOSER_UTIL_RET_NOT_ALLOWED;
+ else
+ return COMPOSER_UTIL_RET_ALLOWED_WITH_RESIZE;
}
}
-
} else if (media_type == COMPOSER_MEDIA_TYPE_VIDEO) {
- if ((strcasecmp(ext, "3gp") != 0) && (strcasecmp(ext, "3g2") != 0) &&
- (strcasecmp(ext, "mp4") != 0) &&(strcasecmp(ext, "mpeg4") != 0) ){
- return false;
+ if ((strcasecmp(ext, "3gp") != 0) && (strcasecmp(ext, "3gpp") != 0)) {
+ return COMPOSER_UTIL_RET_NOT_ALLOWED;
}
} else if (media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
- if ((strcasecmp(ext, "amr") != 0) && (strcasecmp(ext, "mid") != 0) && (strcasecmp(ext, "midi") != 0))
- return false;
-
+ if ((strcasecmp(ext, "amr") != 0) && (strcasecmp(ext, "mid") != 0) && (strcasecmp(ext, "midi") != 0)) {
+ return COMPOSER_UTIL_RET_NOT_ALLOWED;
+ }
} else {
D_MSG("It check only Image, Video, Audio type, media_type[%d] is not need to check", media_type);
}
D_LEAVE;
- return true;
+ return COMPOSER_UTIL_RET_ALLOWED;
}
const char *search_markup_keyword(const char *string, char *searchword,
}\
} while(0)
+#define MSGC_IMAGE_CHANGE_RESIZE (0x0001)
+#define MSGC_IMAGE_CHANGE_ROTATION (0x0010)
+#define MSGC_IMAGE_CHANGE_QUAILTY (0x0100)
typedef enum {
COMPOSER_UTIL_ADDRTYPE_INVALID,
} COMPOSER_UTIL_ADDRTYPE_E;
typedef enum {
- COMPOSER_UTIL_ERR_NONE = 0,
- COMPOSER_UTIL_ERR = -1,
-} COMPOSER_UTIL_ERR_E;
+ COMPOSER_UTIL_RET_SUCCESS = 0,
+ COMPOSER_UTIL_RET_ERR = -1,
+ COMPOSER_UTIL_RET_ALLOWED = -2,
+ COMPOSER_UTIL_RET_ALLOWED_WITH_RESIZE = -3,
+ COMPOSER_UTIL_RET_NOT_ALLOWED = -4,
+} COMPOSER_UTIL_RETURN_E;
+
+
+
+/******************************
+ * structures
+ *******************************/
+typedef struct _MSGC_UTIL_CHANGE_IMAGE_S {
+ int type;
+ int dest_width;
+ int dest_height;
+ int rotation;
+ int quality;
+} MSGC_UTIL_CHANGE_IMAGE_S;
COMPOSER_UTIL_ADDRTYPE_E get_address_type(const char *address);
-
+Eina_Bool IsMultipleNumber(int index);
Eina_Bool IsValidNumber(const char *address);
Eina_Bool IsVaildEmailAddress(const char *address);
int get_contact_index_by_recipient(const char *phone_number);
-
int get_contact_index_by_name(const char *phone_number);
int get_contact_display_name_by_index(int index, char *dest, int dest_size);
int get_contact_default_recipient_by_index(int index, char *dest, int dest_size);
-
+int get_contact_default_number_by_index(int index, char *dest, int dest_size);
+int get_contact_default_email_by_index(int index, char *dest, int dest_size);
bool msg_composer_get_vcf_file_by_index(int index, char *strpath, int sizepath);
-Eina_Bool IsMultipleNumber(int index);
+char *msg_composer_create_working_dir(void);
-int get_contact_default_number_by_index(int index, char *dest, int dest_size);
-int get_contact_default_email_by_index(int index, char *dest, int dest_size);
+bool msg_composer_get_network_status(int *network_status);
+bool msg_composer_get_flight_mode(int *flight_mode);
+bool msg_composer_set_flight_mode(void *handle, int type, void *callback, void *user_data);
void convert_ps_to_br(char *input);
Eina_List *make_tokenize_list(const char *ori_string, const char *sep);
int remove_space(const char *src, char *dest, int dest_size);
-char *make_display_name(const char *first, const char *last);
-int jpeg_image_resize(const char *src_file_path, unsigned int dst_w, unsigned int dst_h, const char *dst_file_path);
-int jpeg_image_quality_set(const char *src_file_path, int quality, const char *dst_file_path);
-int jpeg_image_get_resolution(const char *src_file_path, unsigned int *dst_w, unsigned int *dst_h);
+int jpeg_image_get_rotation(const char *src_file_path, int *rotation);
+int jpeg_image_get_resolution(const char *src_file_path, int *dst_w, int *dst_h);
+int jpeg_image_rotate_image(const char *src_file_path, int rotation, const char *dst_file_path);
+int jpeg_image_change_image(const char *src_file_path, MSGC_UTIL_CHANGE_IMAGE_S *req, const char *dst_file_path);
+COMPOSER_UTIL_RETURN_E msg_composer_is_allowed_creation_mode(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type, int creation_mode);
const char *search_markup_keyword(const char *string, char *searchword, bool *result);
bool is_web_uri(const char *uri);
void print_geo(Evas_Object *obj, char *name);
void print_sc_geo(Evas_Object *obj, char *name);
void print_edje_geo(Evas_Object *obj, char *name);
-bool msg_composer_util_is_allow_creation_mode(const char *file_path, COMPOSER_MEDIA_TYPE_E media_type);
#endif /*__MSG_COMPOSER_UTIL_H__*/