base: "font=Tizen:weight=Normal:width=Condensed font_size="ATTACHMENTS_TEXT_SIZE" text_class=tizen wrap=mixed color=#000 align=left";
tag: "match" "+ color=#006EFF";
}
+ style {
+ name: "style_bubble_content_sound_filename";
+ base: "font=Tizen:style=Regular font_size="20" color=#000 text_class=tizen align=left ellipsis=0.5";
+ }
}
group { name: "conv/list/1icon_1text";
parts {
}
}
}
+ group {
+ name: "conv/list/voice_item";
+ images {
+ image: "msg_received.#.png" COMP;
+ image: "msg_received_play.png" COMP;
+ image: "msg_received_pause.png" COMP;
+ }
+ parts {
+ part {
+ name: "progress.bg";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color_class: "AO052L1";
+ fixed: 0 1;
+ align: 0.5 0.5;
+ image.normal: "msg_received.#.png";
+ }
+ }
+ part {
+ name: "padding_top";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {relative: 0.0 0.0;}
+ rel2 {relative: 1.0 0.0;}
+ align: 0.0 0.0;
+ min: 0 8;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_bottom";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {relative: 0.0 1.0;}
+ rel2 {relative: 1.0 1.0;}
+ align: 0.0 1.0;
+ min: 0 7;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {relative: 0.0 0.0;}
+ rel2 {relative: 0.0 1.0;}
+ align: 0.0 0.0;
+ min: 10 0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "padding_right";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {relative: 1.0 0.0;}
+ rel2 {
+ relative: 1.0 1.0;
+ to: "progress.bg";
+ }
+ align: 1.0 1.0;
+ min: 15 0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "progress.step";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ fixed: 0 1;
+ min: 0 63;
+ align: 0.0 0.0;
+ rel1 {to: "progress.bg"; relative: 0.0 0.0; }
+ rel2 {to_x: "progress.circle"; to_y: "progress.bg"; relative: 0.5 1.0;}
+ image.normal: "msg_received.#.png";
+ color: 153 228 255 255;
+ }
+ }
+ part {
+ name: "progress.confine.rect";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 {to: "progress.bg"; relative: 0.0 0.0; }
+ rel2 {to: "progress.bg"; relative: 1.0 1.0; }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "progress.circle";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 14 63;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ rel1 {to_x: "rect.progress"; to_y: "progress.bg"; relative: 0.5 0.5;}
+ rel2 {to_x: "rect.progress"; to_y: "progress.bg"; relative: 0.5 0.5;}
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "rect.progress";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 0 63;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {to: "progress.bg"; relative: 0.0 0.0; }
+ rel2 {to: "progress.bg"; relative: 0.0 1.0; }
+ }
+ dragable {
+ confine: "progress.confine.rect";
+ x: 1 1 1;
+ }
+ }
+ part {
+ name: "icon";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {to_x: "padding_left"; to_y: "padding_top"; relative: 1.0 1.0;}
+ rel2 {to_x: "padding_left"; to_y: "padding_bottom"; relative: 0.0 0.0;}
+ fixed: 1 1;
+ align: 0.0 0.5;
+ min: 40 40;
+ max: 40 40;
+ image.normal: "msg_received_play.png";
+ color: 0 0 0 255;
+ }
+ description {
+ state: "play" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "msg_received_pause.png";
+ }
+ }
+ part {
+ name: "padding_icon";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { to_x: "icon"; relative: 1.0 0.0;}
+ rel2 { to_x: "icon"; relative: 1.0 1.0;}
+ align: 0.0 0.0;
+ min: 9 0;
+ max: 9 0;
+ fixed: 1 1;
+ }
+ }
+ part {
+ name: "text.filename";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {to_x: "padding_icon"; to_y: "padding_top"; relative: 1.0 1.0;}
+ rel2 {to_x: "padding_right"; to_y: "padding_top"; relative: 0.0 1.0;}
+ align: 0.0 0.0;
+ min: 166 24;
+ max: 166 24;
+ fixed: 0 1;
+ color: 0 0 0 153;
+ text {
+ min: 1 1;
+ ellipsis: -1;
+ style: "style_bubble_content_sound_filename";
+ }
+ }
+ }
+ part {
+ name: "text.time";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 {to_x: "padding_icon"; to_y: "text.filename"; relative: 1.0 1.0;}
+ rel2 {to_x: "padding_right"; to_y: "padding_bottom"; relative: 0.0 0.0;}
+ min: 166 24;
+ max: 166 24;
+ align: 0.0 0.0;
+ color: 0 0 0 153;
+ text {
+ style: "style_bubble_content_sound_filename";
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "play";
+ signal: "sound,play";
+ source: "";
+ action: STATE_SET "play" 0.0;
+ target: "icon";
+ }
+ program {
+ name: "pause";
+ signal: "sound,pause";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "icon";
+ }
+ }
+ }
}
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleAudioEntity_h_
+#define BubbleAudioEntity_h_
+
+#include "BubbleEntity.h"
+#include "BubbleIconTextLayoutItem.h"
+
+namespace Msg {
+ class BubbleAudioEntity
+ : public BubbleEntity {
+ public:
+ BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
+ virtual ~BubbleAudioEntity();
+
+ BubbleIconTextLayoutItem *createView(Evas_Object *parent) override;
+
+ private:
+ std::string m_FileName;
+ };
+ inline BubbleAudioEntity::BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
+ : BubbleEntity(AudioItem, direction, filePath)
+ , m_FileName(std::move(fileName))
+ {
+ }
+
+ inline BubbleAudioEntity::~BubbleAudioEntity()
+ {
+ }
+
+ inline BubbleIconTextLayoutItem *BubbleAudioEntity::createView(Evas_Object *parent)
+ {
+ auto *item = new BubbleIconTextLayoutItem(parent, *this);
+ item->setIcon(item->createIcon(ATTACH_MUSIC_ICON));
+ item->setMainText(m_FileName);
+ return item;
+ }
+}
+
+#endif /* BubbleAudioEntity_h_ */
class BubbleCalEventEntity
: public BubbleEntity {
public:
- BubbleCalEventEntity(const std::string &filePath, const std::string &fileName, Message::Direction direction);
+ BubbleCalEventEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
virtual ~BubbleCalEventEntity();
BubbleIconTextLayoutItem *createView(Evas_Object *parent) override;
SubjectItem,
TextItem,
ImageItem,
+ VoiceItem,
AudioItem,
VideoItem,
ContactItem,
class BubbleSubjectEntity
: public BubbleEntity {
public:
- BubbleSubjectEntity(const std::string &subject, Message::Direction direction);
+ BubbleSubjectEntity(const std::string subject, Message::Direction direction);
virtual ~BubbleSubjectEntity();
BubbleSubjectViewItem *createView(Evas_Object *parent) override;
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleVoiceEntity_h_
+#define BubbleVoiceEntity_h_
+
+#include "BubbleEntity.h"
+#include "BubbleVoiceViewItem.h"
+
+namespace Msg {
+ class BubbleVoiceEntity
+ : public BubbleEntity {
+ public:
+ BubbleVoiceEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
+ virtual ~BubbleVoiceEntity();
+
+ BubbleVoiceViewItem *createView(Evas_Object *parent) override;
+
+ private:
+ std::string m_FileName;
+ };
+ inline BubbleVoiceEntity::BubbleVoiceEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
+ : BubbleEntity(VoiceItem, direction, filePath)
+ , m_FileName(std::move(fileName))
+ {
+ }
+
+ inline BubbleVoiceEntity::~BubbleVoiceEntity()
+ {
+ }
+
+ inline BubbleVoiceViewItem *BubbleVoiceEntity::createView(Evas_Object *parent)
+ {
+ auto *item = new BubbleVoiceViewItem(parent, *this);
+ return item;
+ }
+}
+
+#endif /* BubbleVoiceEntity_h_ */
using namespace Msg;
-BubbleCalEventEntity::BubbleCalEventEntity(const std::string &filePath, const std::string &fileName, Message::Direction direction)
+BubbleCalEventEntity::BubbleCalEventEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
: BubbleEntity(CalendarEventItem, direction, filePath)
+ , m_Name(std::move(fileName))
{
- m_Name = fileName;
}
BubbleCalEventEntity::~BubbleCalEventEntity()
BubbleContactEntity::BubbleContactEntity(const std::string &filePath, std::string fileName, Message::Direction direction)
: BubbleEntity(ContactItem, direction, filePath)
+ , m_Name(std::move(fileName))
{
- m_Name = std::move(fileName);
}
BubbleContactEntity::~BubbleContactEntity()
using namespace Msg;
-BubbleSubjectEntity::BubbleSubjectEntity(const std::string &subject, Message::Direction direction)
+BubbleSubjectEntity::BubbleSubjectEntity(const std::string subject, Message::Direction direction)
: BubbleEntity(SubjectItem, direction)
- , m_Subject(subject)
+ , m_Subject(std::move(subject))
{
}
, m_WorkingDir(workingDir)
{
// TODO: when video player will be available
- m_ImgPath = filePath;
}
BubbleVideoEntity::~BubbleVideoEntity()
BubbleVideoViewItem *BubbleVideoEntity::createView(Evas_Object *parent)
{
- auto *item = new BubbleVideoViewItem(*this, parent, m_ImgPath);
+ auto *item = new BubbleVideoViewItem(*this, parent, getFilePath());
return item;
}
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BubbleVoiceViewItem_h_
+#define BubbleVoiceViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg {
+ class BubbleVoiceViewItem
+ : public BubbleViewItem {
+ public:
+ BubbleVoiceViewItem(Evas_Object *parent, BubbleEntity &entity);
+ virtual ~BubbleVoiceViewItem();
+
+ void setMainText(const std::string &text);
+ void setTimeText(const std::string &text);
+ void setProgress(const double progress);
+ void calculate() override;
+
+ private:
+ Evas_Object *m_pVoiceItemLayout;
+ };
+}
+
+#endif /* BubbleVoiceViewItem_h_ */
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "BubbleVoiceViewItem.h"
+#include "Resource.h"
+#include "TextDecorator.h"
+#include "PathUtils.h"
+
+using namespace Msg;
+
+BubbleVoiceViewItem::BubbleVoiceViewItem(Evas_Object *parent, BubbleEntity &entity)
+ : BubbleViewItem(parent, entity)
+ , m_pVoiceItemLayout(nullptr)
+{
+ m_pVoiceItemLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/voice_item");
+ setContent(m_pVoiceItemLayout);
+}
+
+BubbleVoiceViewItem::~BubbleVoiceViewItem()
+{
+}
+
+void BubbleVoiceViewItem::setMainText(const std::string &text)
+{
+ elm_object_part_text_set(m_pVoiceItemLayout, "text.filename", text.c_str());
+}
+
+void BubbleVoiceViewItem::setTimeText(const std::string &text)
+{
+ elm_object_part_text_set(m_pVoiceItemLayout, "text.time", text.c_str());
+}
+
+void BubbleVoiceViewItem::setProgress(const double progress)
+{
+ edje_object_part_drag_value_set(elm_layout_edje_get(m_pVoiceItemLayout), "rect.progress", progress, 0.0);
+}
+
+void BubbleVoiceViewItem::calculate()
+{
+ evas_object_smart_calculate(m_pVoiceItemLayout);
+ BubbleViewItem::calculate();
+}