<option id="gnu.cpp.compiler.option.include.paths.2037910591" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/Main/Controller/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Composer/View/inc}""/>
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Conversation/ConvList/Controller/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Composer/Controller/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/MsgThread/View/inc}""/>
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Settings/Controller/inc}""/>
--- /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 BubbleEntity_h_
+#define BubbleEntity_h_
+
+#include "View.h"
+#include "BubbleViewItem.h"
+#include "MsgConvMedia.h"
+#include "FileUtils.h"
+#include "Message.h"
+
+#include <string>
+
+namespace Msg {
+ class BubbleEntity {
+ public:
+ enum Type {
+ TextItem,
+ ImageItem,
+ AudioItem,
+ VideoItem,
+ ContactItem,
+ CalendarEventItem,
+ UnknownFileItem,
+ DownloadButtonItem
+ };
+
+ public:
+ BubbleEntity(Type type, Message::Direction direction, const std::string &filePath = "");
+ virtual ~BubbleEntity();
+
+ Type getType() const;
+ Message::Direction getDirection() const;
+ const std::string &getFilePath() const;
+ void setFilePath(std::string file);
+ long long getFileSize() const;
+ virtual BubbleViewItem *createView(Evas_Object *parent) = 0;
+
+ private:
+ Type m_Type;
+ Message::Direction m_Direction;
+ std::string m_FilePath;
+ long long m_FileSize;
+ };
+
+ inline BubbleEntity::BubbleEntity(Type type, Message::Direction direction, const std::string &filePath)
+ : m_Type(type)
+ , m_Direction(direction)
+ , m_FilePath(filePath)
+ , m_FileSize(!filePath.empty() ? FileUtils::getFileSize(filePath) : 0)
+ {
+ }
+
+ inline BubbleEntity::~BubbleEntity()
+ {
+ }
+
+ inline BubbleEntity::Type BubbleEntity::getType() const
+ {
+ return m_Type;
+ }
+
+ inline Message::Direction BubbleEntity::getDirection() const
+ {
+ return m_Direction;
+ }
+
+ inline const std::string &BubbleEntity::getFilePath() const
+ {
+ return m_FilePath;
+ }
+
+ inline void BubbleEntity::setFilePath(std::string file)
+ {
+ m_FilePath = std::move(file);
+ }
+
+ inline long long BubbleEntity::getFileSize() const
+ {
+ return m_FileSize;
+ }
+
+}
+
+#endif /* BubbleEntity_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.
+ */
+
+#ifndef BubbleItemContainer_h_
+#define BubbleItemContainer_h_
+
+#include "Message.h"
+#include "BubbleViewItem.h"
+
+namespace Msg {
+ class BubbleItemContainer
+ : public View {
+ public:
+ BubbleItemContainer(Evas_Object *parent);
+ virtual ~BubbleItemContainer();
+
+ void append(BubbleViewItem &item, Message::Direction direction);
+ void go();
+ };
+}
+
+#endif /* BubbleItemContainer_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.
+ */
+
+#ifndef BubbleViewItem_h_
+#define BubbleViewItem_h_
+
+#include "View.h"
+#include <string>
+
+namespace Msg {
+ class IBubbleViewItemListener;
+ class BubbleEntity;
+
+ class BubbleViewItem
+ : public View {
+ public:
+ static const int maxWidth = 240;
+
+ BubbleViewItem(BubbleEntity &entity);
+ virtual ~BubbleViewItem();
+
+ virtual void calculate();
+ void setListener(IBubbleViewItemListener *l);
+ BubbleEntity &getEntity();
+
+ protected:
+ void emitActionEvent();
+ void attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj);
+
+ private:
+ BubbleEntity &m_Entity;
+ IBubbleViewItemListener *m_pListener;
+ };
+
+ class IBubbleViewItemListener {
+ public:
+ virtual ~IBubbleViewItemListener() {};
+ virtual void onAction(BubbleViewItem &item) {}; // Tap or Click
+ };
+}
+
+#endif /* BubbleViewItem_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 "BubbleItemContainer.h"
+#include "Logger.h"
+
+#include <string.h>
+
+using namespace Msg;
+
+namespace {
+ const int verticalBoxPads = 12;
+ const int horizontalBoxPads = 0;
+}
+
+BubbleItemContainer::BubbleItemContainer(Evas_Object *parent)
+{
+ Evas_Object *box = elm_box_add(parent);
+ elm_box_homogeneous_set(box, false);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(horizontalBoxPads), ELM_SCALE_SIZE(verticalBoxPads));
+ setEo(box);
+ expand();
+ show();
+}
+
+BubbleItemContainer::~BubbleItemContainer()
+{
+}
+
+void BubbleItemContainer::append(BubbleViewItem &item, Message::Direction direction)
+{
+ const char *itemType = evas_object_type_get(item);
+ if (strcmp(itemType, "elm_button") == 0)
+ expand(item);
+ else
+ evas_object_size_hint_align_set(item, 0.0, EVAS_HINT_FILL);
+
+ item.calculate();
+ item.show();
+ elm_box_pack_end(getEo(), item);
+}
+
+void BubbleItemContainer::go()
+{
+ elm_box_recalculate(getEo());
+}
--- /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 "BubbleViewItem.h"
+#include "Resource.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+BubbleViewItem::BubbleViewItem(BubbleEntity &entity)
+ : m_Entity(entity)
+ , m_pListener(nullptr)
+{
+}
+
+BubbleViewItem::~BubbleViewItem()
+{
+}
+
+void BubbleViewItem::setListener(IBubbleViewItemListener *l)
+{
+ m_pListener = l;
+}
+
+BubbleEntity &BubbleViewItem::getEntity()
+{
+ return m_Entity;
+}
+
+void BubbleViewItem::attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj)
+{
+ const int tapFingerSize = 12;
+
+ Evas_Object *layer = elm_gesture_layer_add(parent);
+ evas_object_show(layer);
+ elm_gesture_layer_attach(layer, obj);
+ elm_gesture_layer_tap_finger_size_set(layer, ELM_SCALE_SIZE(tapFingerSize));
+
+ elm_gesture_layer_cb_add(
+ layer,
+ ELM_GESTURE_N_TAPS,
+ ELM_GESTURE_STATE_END,
+ [](void *data, void *event_info)->Evas_Event_Flags
+ {
+ auto *self = static_cast<BubbleViewItem*>(data);
+ if (self)
+ self->emitActionEvent();
+ return EVAS_EVENT_FLAG_NONE;
+ },
+ this);
+}
+
+void BubbleViewItem::calculate()
+{
+ evas_object_smart_calculate(getEo());
+}
+
+void BubbleViewItem::emitActionEvent()
+{
+ if (m_pListener)
+ m_pListener->onAction(*this);
+}
+