#define MSG_BODY_EDJ_PATH EDJ_PATH"/msg_body.edj"
#define SEARCH_BAR_EDJ_PATH EDJ_PATH"/search_bar.edj"
#define CONV_GENLIST_THEME_EDJ_PATH EDJ_PATH"/conv_genlist_theme.edj"
+#define INPUT_LAYOUT_EDJ_PATH EDJ_PATH"/input_layout.edj"
#endif /* RESOURCE_H_ */
--- /dev/null
+#include "macros.inl"
+
+collections {
+ BASE_SCALE;
+ group {
+ name: "main";
+ parts {
+ PADDING_TOP("entry.top.pad", 20);
+ PADDING_LEFT("entry.left.pad", 65);
+ PADDING_RIGHT("entry.right.pad", 65);
+ PADDING_BOTTOM("padding_text_bottom", 5);
+ part {
+ name: "entry.swl";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative : 1.0 1.0; to_x: "entry.left.pad"; to_y: "entry.top.pad"; }
+ rel2 { relative : 0.0 0.0; to_x: "entry.right.pad"; to_y: "predic_bar.swl"; }
+ align: 0.0 0.5;
+ fixed: 1 1;
+ max: 250 -1;
+ }
+ }
+ part {
+ name: "predic_bar.swl";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 1.0; }
+ rel2 { relative: 1.0 2.0; }
+ align: 0.5 0.0;
+ visible: 0;
+ min: 200 50;
+ max: -1 50;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default";
+ visible: 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ align: 0.5 1.0;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default";
+ }
+ }
+ }
+ programs {
+ SIG("show_predic_bar", "show", "predic_bar.swl");
+ SIG("hide_predic_bar", "hide", "predic_bar.swl");
+ }
+ }
+}
styles {
style {
name: "predictive_style";
- base: "font=Tizen:style=Regular font_size=34 color=#FAFAFAFF align=left";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=34 color=#FAFAFAFF align=left";
tag: "br" "\n";
tag: "hilight" "+ font=Tizen:style=Bold";
tag: "b" "+ font=Tizen:style=Bold";
}
style {
name: "pressed_predictive_style";
- base: "font=Tizen:style=Regular font_size=34 color=#FAFAFA66 align=left";
+ base: "font=Tizen:weight=Normal:width=Condensed font_size=34 color=#FAFAFA66 align=left";
tag: "br" "\n";
tag: "hilight" "+ font=Tizen:style=Bold";
tag: "b" "+ font=Tizen:style=Bold";
color: 46 46 46 128;
}
}
- PADDING_TOP("padding_top", 0);
+ PADDING_TOP("padding_text_top", 6);
PADDING_LEFT("padding_left", 48);
PADDING_RIGHT("padding_right", 43);
- PADDING_BOTTOM("padding_text_bottom", 5);
+ PADDING_BOTTOM("padding_text_bottom", 2);
part {
name: "swl.button";
type: SWALLOW;
description {
state: "default" 0.0;
min: 42 42;
- min: 42 42;
+ max: 42 42;
fixed: 1 0;
rel1 { relative : 0.0 0.0; to_x: "padding_right"; }
rel2 { relative : 0.0 1.0; to_x: "padding_right"; }
min: 0 42;
max: -1 42;
fixed: 1 1;
- rel1 { relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_top"; }
+ rel1 { relative: 1.0 1.0; to_x: "padding_left"; to_y: "padding_text_top"; }
rel2 { relative: 0.0 0.0; to_x: "divider"; to_y: "padding_text_bottom"; }
align: 0.0 0.5;
text {
align: 0.0 0.5;
ellipsis: -1.0;
fade_ellipsis: 1.0;
- text: "text text text text text text";
}
}
description {
--- /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 InputFrame_h_
+#define InputFrame_h_
+
+#include "FrameController.h"
+#include "InputLayout.h"
+
+namespace Msg {
+ class InputFrame
+ : public FrameController {
+
+ public:
+ InputFrame(NaviFrameController &parent);
+ virtual ~InputFrame();
+
+ Entry &getEntry();
+ void setPredictBar(Evas_Object *obj);
+ void showPredictBar(bool value);
+ InputLayout &getLayout();
+
+ protected:
+ // NaviFrameItem
+ void onAttached(ViewItem &item) override;
+
+ private:
+ void onHwBackButtonPreessed(Evas_Object *obj, void *event_info);
+ void onInputPanelEvent(Ecore_IMF_Context *ctx, int value);
+
+ void prepareLayout();
+ void prepareEntry();
+
+ private:
+ InputLayout *m_pLayout;
+ Entry *m_pEntry;
+ };
+}
+
+#endif /* InputFrame_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 "InputFrame.h"
+
+using namespace Msg;
+
+InputFrame::InputFrame(NaviFrameController &parent)
+ : FrameController(parent)
+ , m_pLayout(nullptr)
+ , m_pEntry(nullptr)
+{
+ prepareLayout();
+ prepareEntry();
+}
+
+InputFrame::~InputFrame()
+{
+ // TODO: check this
+ m_pEntry->delInputPanelEventCb(ECORE_IMF_INPUT_PANEL_STATE_EVENT, makeCbFirst(&InputFrame::onInputPanelEvent));
+}
+
+void InputFrame::onAttached(ViewItem &item)
+{
+ FrameController::onAttached(item);
+ setContent(*m_pLayout);
+}
+
+Entry &InputFrame::getEntry()
+{
+ return *m_pEntry;
+}
+
+void InputFrame::setPredictBar(Evas_Object *obj)
+{
+ m_pLayout->setPredictBar(obj);
+}
+
+void InputFrame::showPredictBar(bool value)
+{
+ m_pLayout->showPredictBar(value);
+}
+
+InputLayout &InputFrame::getLayout()
+{
+ return *m_pLayout;
+}
+
+void InputFrame::prepareLayout()
+{
+ if (!m_pLayout) {
+ m_pLayout = new InputLayout(getParent());
+ }
+}
+
+void InputFrame::prepareEntry()
+{
+ if (!m_pEntry) {
+ m_pEntry = new Entry(*m_pLayout);
+ m_pEntry->addHwButtonEvent(EEXT_CALLBACK_BACK, makeCbFirst(&InputFrame::onHwBackButtonPreessed), this);
+ m_pEntry->addInputPanelEventCb(ECORE_IMF_INPUT_PANEL_STATE_EVENT, makeCbFirst(&InputFrame::onInputPanelEvent), this);
+ m_pEntry->setSingleLine(true);
+ m_pEntry->setFocus(true);
+ m_pEntry->setScrollable(true);
+ m_pEntry->setScrollerPolicy(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
+ m_pLayout->setEntry(*m_pEntry);
+ }
+}
+
+void InputFrame::onHwBackButtonPreessed(Evas_Object *obj, void *event_info)
+{
+ MSG_LOG("");
+ // Empty callback for back button
+}
+
+void InputFrame::onInputPanelEvent(Ecore_IMF_Context *ctx, int value)
+{
+ switch (value) {
+ case ECORE_IMF_INPUT_PANEL_STATE_HIDE:
+ if (!isPause())
+ pop();
+ break;
+ }
+}
--- /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 Entry_h_
+#define Entry_h_
+
+#include "View.h"
+
+namespace Msg {
+ class Entry
+ : public View {
+
+ public:
+ typedef void (*InputPanelEventCb) (void *data, Ecore_IMF_Context *ctx, int value);
+
+ public:
+ Entry(Evas_Object *parent);
+ virtual ~Entry();
+
+ void setInputPanelReturnType(Elm_Input_Panel_Return_Key_Type retType);
+ void setGuideText(const TText &text);
+ std::string getText() const;
+ const char *getEntry() const;
+ void setEditable(bool value);
+ void enabledInputPanel(bool value);
+ void setScrollerPolicy(Elm_Scroller_Policy policyH, Elm_Scroller_Policy policyV);
+ void setAutocapitalType(Elm_Autocapital_Type type);
+ void setScrollable(bool value);
+ void setSingleLine(bool value);
+ void setCursorPos(int pos);
+ int getCursorPos() const;
+ void setEditInfo(Entry &entry);
+ bool isEmpty() const;
+ void clear();
+
+ void addInputPanelEventCb(Ecore_IMF_Input_Panel_Event type, InputPanelEventCb cb, const void *data);
+ void delInputPanelEventCb(Ecore_IMF_Input_Panel_Event type, InputPanelEventCb cb);
+ };
+}
+
+#endif /* Entry_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 InputLayout_h_
+#define InputLayout_h_
+
+#include "Entry.h"
+
+namespace Msg {
+ class InputLayout
+ : public View {
+
+ public:
+ InputLayout(Evas_Object *parent);
+ virtual ~InputLayout();
+
+ void setPredictBar(Evas_Object *obj);
+ void setEntry(Evas_Object *obj);
+ void showPredictBar(bool value);
+ };
+}
+
+#endif /* InputLayout_h_ */
friend class NaviFrameView;
public:
- /**
- * @brief An identifiers of buttons that can be shown on the top naviframe-item.
- */
- enum NaviButtonId
- {
- NaviCancelButtonId = 0,/**< Cancel-button */
- NaviOkButtonId, /**< OK-button */
- NaviCenterButtonId, /**< Central-button */
- NaviPrevButtonId, /**< "Previous"-button */
- NaviExpandButtonId, /**< "Expand"-button */
- NaviButtonMax
- };
+ typedef void (*PopCb)(NaviFrameItem &, void *);
public:
/**
*/
bool isPopping() const;
+ /**
+ * @brief Set pop callback (called before start pop)
+ * @param cb pop callback
+ * @param data user data
+ */
+ void setOnPopCb(PopCb cb, void *data);
+
protected:
- virtual void onButtonClicked(NaviFrameItem &item, NaviButtonId buttonId) {};
+ virtual bool onRequestPop();
//ViewItem
void onAttached(ViewItem &item) override;
virtual void onTransitionFinished(NaviFrameItem &item) {};
+ void notifyOnPop();
+
private:
NaviFrameView &m_Parent;
bool m_IsPopping;
+ PopCb m_pPopCb;
+ void *m_pPopCbData;
};
}
*/
void setSizeHintAlign(double x, double y);
- /**
- * @brief Make the scroller minimum size limited to the minimum size of the view's content
- *
- * @param[in] w Enable limiting minimum size horizontally
- * @param[in] h Enable limiting minimum size vertically
- */
- void setScrollerContentMinLimit(Eina_Bool w, Eina_Bool h);
-
/**
* @brief Sets size-weight and size-align hints in order to make view expanded.
*/
static void setText(Evas_Object *obj, const TText &text, const char *part = nullptr);
static void setText(Evas_Object *obj, const std::string &text, const char *part = nullptr);
+ static void setText(Evas_Object *obj, const char *text, const char *part = nullptr);
static Evas_Object *addLayout(Evas_Object *parent, const std::string &edjePath, const std::string &group);
static Evas_Object *addIconButton(Evas_Object *parent, const std::string &iconName, Evas_Smart_Cb clickedCb = nullptr, void *cbData = nullptr);
evas_object_size_hint_align_set(m_pEo, x, y);
}
- inline void View::setScrollerContentMinLimit(Eina_Bool w, Eina_Bool h)
- {
- elm_scroller_content_min_limit(m_pEo, w, h);
- }
-
inline void View::setSizeHintMin(Evas_Coord w, Evas_Coord h)
{
evas_object_size_hint_min_set(m_pEo, w, h);
inline void View::setText(const char *text, const char *part)
{
- elm_object_part_text_set(m_pEo, part, text);
+ const char *notNullText = text ? text : "";
+ elm_object_part_text_set(m_pEo, part, notNullText);
}
inline void View::setText(const std::string &text, const char *part)
inline void View::setText(Evas_Object *obj, const std::string &text, const char *part)
{
- elm_object_part_text_set(obj, part, text.c_str());
+ setText(obj, part, text.c_str());
+ }
+
+ inline void View::setText(Evas_Object *obj, const char *text, const char *part)
+ {
+ elm_object_part_text_set(obj, part, text);
}
inline std::string View::getText(const char *part) const
--- /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 "Entry.h"
+
+using namespace Msg;
+
+Entry::Entry(Evas_Object *parent)
+{
+ setEo(elm_entry_add(parent));
+ // Default settings:
+ setEditable(true);
+ setAutocapitalType(ELM_AUTOCAPITAL_TYPE_NONE);
+ elm_entry_cnp_mode_set(getEo(), ELM_CNP_MODE_PLAINTEXT);
+ elm_entry_context_menu_disabled_set(getEo(), true);
+ elm_entry_end_visible_set(getEo(), false);
+ eext_entry_selection_back_event_allow_set(getEo(), true);
+}
+
+Entry::~Entry()
+{
+}
+
+void Entry::setEditable(bool value)
+{
+ elm_entry_editable_set(getEo(), value);
+}
+
+void Entry::enabledInputPanel(bool value)
+{
+ elm_entry_input_panel_enabled_set(getEo(), value);
+}
+
+void Entry::setInputPanelReturnType(Elm_Input_Panel_Return_Key_Type retType)
+{
+ elm_entry_input_panel_return_key_type_set(getEo(), retType);
+}
+
+void Entry::setGuideText(const TText &text)
+{
+ View::setText(getEo(), text, "elm.guide");
+}
+
+std::string Entry::getText() const
+{
+ return markupToUtf8(getEntry());
+}
+
+const char *Entry::getEntry() const
+{
+ return elm_entry_entry_get(getEo());
+}
+
+void Entry::setScrollerPolicy(Elm_Scroller_Policy policyH, Elm_Scroller_Policy policyV)
+{
+ elm_scroller_policy_set(getEo(), policyH, policyV);
+}
+
+void Entry::setAutocapitalType(Elm_Autocapital_Type type)
+{
+ elm_entry_autocapital_type_set(getEo(), type);
+}
+
+void Entry::setScrollable(bool value)
+{
+ elm_entry_scrollable_set(getEo(), value);
+}
+
+void Entry::setSingleLine(bool value)
+{
+ elm_entry_single_line_set(getEo(), value);
+}
+
+void Entry::setCursorPos(int pos)
+{
+ elm_entry_cursor_pos_set(getEo(), pos);
+}
+
+int Entry::getCursorPos() const
+{
+ return elm_entry_cursor_pos_get(getEo());
+}
+
+void Entry::setEditInfo(Entry &entry)
+{
+ setText(entry.getEntry());
+ setCursorPos(getCursorPos());
+}
+
+bool Entry::isEmpty() const
+{
+ const char *text = getEntry();
+ return text ? text[0] == '\0' : true;
+}
+
+void Entry::clear()
+{
+ View::setText(getEo(), "");
+}
+
+void Entry::addInputPanelEventCb(Ecore_IMF_Input_Panel_Event type, InputPanelEventCb cb, const void *data)
+{
+ Ecore_IMF_Context *imf = (Ecore_IMF_Context*)elm_entry_imf_context_get(getEo());
+ if (imf)
+ ecore_imf_context_input_panel_event_callback_add(imf, type, cb, data);
+}
+
+void Entry::delInputPanelEventCb(Ecore_IMF_Input_Panel_Event type, InputPanelEventCb cb)
+{
+ Ecore_IMF_Context *imf = (Ecore_IMF_Context*)elm_entry_imf_context_get(getEo());
+ if (imf)
+ ecore_imf_context_input_panel_event_callback_del(imf, type, cb);
+}
--- /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 "InputLayout.h"
+
+using namespace Msg;
+
+InputLayout::InputLayout(Evas_Object *parent)
+{
+ setEo(addLayout(parent, INPUT_LAYOUT_EDJ_PATH, "main"));
+}
+
+InputLayout::~InputLayout()
+{
+}
+
+void InputLayout::setPredictBar(Evas_Object *obj)
+{
+ setContent(obj, "predic_bar.swl");
+}
+
+void InputLayout::setEntry(Evas_Object *obj)
+{
+ setContent(obj, "entry.swl");
+}
+
+void InputLayout::showPredictBar(bool value)
+{
+ const char *sig = value ? "show_predic_bar" : "hide_predic_bar";
+ emitSignal(sig);
+}
: ViewItem()
, m_Parent(parent)
, m_IsPopping(false)
+ , m_pPopCb(nullptr)
+ , m_pPopCbData(nullptr)
{
}
return m_IsPopping;
}
+void NaviFrameItem::setOnPopCb(PopCb cb, void *data)
+{
+ m_pPopCb = cb;
+ m_pPopCbData = data;
+}
+
+void NaviFrameItem::notifyOnPop()
+{
+ if (m_pPopCb)
+ m_pPopCb(*this, m_pPopCbData);
+}
+
+bool NaviFrameItem::onRequestPop()
+{
+ return true;
+}
+
void NaviFrameItem::onAttached(ViewItem &item)
{
ViewItem::onAttached(item);
void NaviFrameView::pop(NaviFrameItem &item)
{
- // Workaround solution to avoid rejected JIRA issue: http://suprem.sec.samsung.net/jira/browse/TSAM-6776
+ if (item.m_IsPopping || !item.onRequestPop())
+ return;
+
item.m_IsPopping = true;
+ item.notifyOnPop();
+
+ // Workaround solution to avoid rejected JIRA issue: http://suprem.sec.samsung.net/jira/browse/TSAM-6776
if (getTransitionStatus())
{
m_ItemsToDelete.push_back(&item);
#ifndef RecipFrame_h_
#define RecipFrame_h_
+#include "RecipFieldView.h"
#include "FrameController.h"
#include "DefaultLayout.h"
#include "BottomButton.h"
#include "RecipLayout.h"
-#include "RecipEntryView.h"
+#include "RecipInputFrame.h"
namespace Msg {
class RecipFrame
- : public FrameController {
+ : public FrameController
+ , private IRecipFieldViewListener {
public:
RecipFrame(NaviFrameController &parent);
// Bottom Button:
void onNextButtonClicked(Evas_Object *obj, void *event);
+ // IRecipFieldViewListener:
+ void onFieldClicked(RecipFieldView &obj) override;
+ void onClearButtonClicked(RecipFieldView &obj) override;
+ void onContactButtonClicked(RecipFieldView &obj) override;
+
+ void onInputFramePop(NaviFrameItem &item);
+
private:
void prepareLayouts();
void prepareNextButton();
void prepareEntry();
+ void showInputFrame();
private:
DefaultLayout *m_pBaseLayout;
RecipLayout *m_pLayout;
BottomButton *m_pNextButton;
- RecipEntryView *m_pEntry;
+ RecipFieldView *m_pRecipField;
+ RecipInputFrame *m_pInputFrame;
};
}
--- /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 RecipInputFrame_h_
+#define RecipInputFrame_h_
+
+#include "InputFrame.h"
+#include "SearchBar.h"
+
+namespace Msg {
+
+ class RecipInputFrame
+ : public InputFrame {
+
+ public:
+ RecipInputFrame(NaviFrameController &parent);
+ virtual ~RecipInputFrame();
+
+ private:
+ // NaviFrameItem:
+ void onAttached(ViewItem &item) override;
+ bool onRequestPop() override;
+
+ private:
+ SearchBar *m_pSearchBar;
+ };
+}
+
+#endif /* RecipInputFrame_h_ */
, m_pBaseLayout(nullptr)
, m_pLayout(nullptr)
, m_pNextButton(nullptr)
- , m_pEntry(nullptr)
+ , m_pRecipField(nullptr)
+ , m_pInputFrame(nullptr)
{
MSG_LOG("");
prepareLayouts();
void RecipFrame::prepareEntry()
{
- if (!m_pEntry) {
- m_pEntry = new RecipEntryView(*m_pLayout);
- m_pLayout->setEntry(*m_pEntry);
+ if (!m_pRecipField) {
+ m_pRecipField = new RecipFieldView(*m_pLayout);
+ m_pRecipField->setListener(this);
+ m_pLayout->setEntry(*m_pRecipField);
+ }
+}
+
+void RecipFrame::showInputFrame()
+{
+ if (!m_pInputFrame) {
+ m_pInputFrame = new RecipInputFrame(getParent());
+ m_pInputFrame->setOnPopCb(makeCbLast(&RecipFrame::onInputFramePop), this);
+ getParent().push(*m_pInputFrame);
}
}
auto *composerFrame = new ComposerFrame(getParent());
getParent().push(*composerFrame);
}
+
+void RecipFrame::onFieldClicked(RecipFieldView &obj)
+{
+ MSG_LOG("");
+ showInputFrame();
+}
+
+void RecipFrame::onClearButtonClicked(RecipFieldView &obj)
+{
+ MSG_LOG("");
+}
+
+void RecipFrame::onContactButtonClicked(RecipFieldView &obj)
+{
+ MSG_LOG("");
+}
+
+void RecipFrame::onInputFramePop(NaviFrameItem &item)
+{
+ MSG_LOG("");
+ m_pInputFrame = nullptr;
+}
--- /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 "RecipInputFrame.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+RecipInputFrame::RecipInputFrame(NaviFrameController &parent)
+ : InputFrame(parent)
+ , m_pSearchBar(nullptr)
+{
+ m_pSearchBar = new SearchBar(getLayout());
+ setPredictBar(*m_pSearchBar);
+ showPredictBar(true);
+}
+
+RecipInputFrame::~RecipInputFrame()
+{
+}
+
+void RecipInputFrame::onAttached(ViewItem &item)
+{
+ MSG_LOG("");
+ InputFrame::onAttached(item);
+}
+
+bool RecipInputFrame::onRequestPop()
+{
+ MSG_LOG("");
+ return true;
+}
#ifndef MsgBodyView_h_
#define MsgBodyView_h_
-#include "View.h"
-
+#include "Entry.h"
#include "Logger.h"
void prepareSendButton();
private:
- Evas_Object *m_pEntry;
+ Entry *m_pEntry;
Evas_Object *m_pSendButton;
};
}
+++ /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 RecipEntryView_h_
-#define RecipEntryView_h_
-
-#include "View.h"
-
-namespace Msg {
- class RecipEntryView
- : public View {
-
- public:
- enum ButtonId {
- NoneButtonId,
- ContactButtonId,
- ClearButtonId
- };
-
- public:
- RecipEntryView(Evas_Object *parent);
- virtual ~RecipEntryView();
-
- std::string getText() const;
- void clear();
- void showButton(ButtonId id);
-
- private:
- void onClearButtonClicked(Evas_Object *obj, void *event);
- void onContactButtonClicked(Evas_Object *obj, void *event);
-
- private:
- void prepareEntry();
- Evas_Object *createButton(const char *icon);
- Evas_Object *prepareClearButton();
- Evas_Object *prepareContactButton();
-
- private:
- Evas_Object *m_pEntry;
- Evas_Object *m_pClearButton;
- Evas_Object *m_pContactButton;
- };
-}
-
-#endif /* RecipEntryView_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 RecipFieldView_h_
+#define RecipFieldView_h_
+
+#include "Entry.h"
+
+namespace Msg {
+
+ class IRecipFieldViewListener;
+
+ class RecipFieldView
+ : public View {
+
+ public:
+ enum ButtonId {
+ NoneButtonId,
+ ContactButtonId,
+ ClearButtonId
+ };
+
+ public:
+ RecipFieldView(Evas_Object *parent);
+ virtual ~RecipFieldView();
+
+ void setListener(IRecipFieldViewListener *l);
+ void showButton(ButtonId id);
+ Entry &getEntry();
+
+ private:
+ void onClearButtonClicked(Evas_Object *obj, void *event);
+ void onContactButtonClicked(Evas_Object *obj, void *event);
+ void onEntryClicked(Evas_Object *obj, void *event);
+
+ private:
+ void prepareEntry();
+ Evas_Object *createButton(const char *icon);
+ Evas_Object *prepareClearButton();
+ Evas_Object *prepareContactButton();
+
+ private:
+ IRecipFieldViewListener *m_pListener;
+ Entry *m_pEntry;
+ Evas_Object *m_pClearButton;
+ Evas_Object *m_pContactButton;
+ };
+
+ class IRecipFieldViewListener {
+ public:
+ virtual ~IRecipFieldViewListener() {};
+
+ virtual void onFieldClicked(RecipFieldView &) {};
+ virtual void onClearButtonClicked(RecipFieldView &) {};
+ virtual void onContactButtonClicked(RecipFieldView &) {};
+ };
+}
+
+#endif /* RecipFieldView_h_ */
{
}
-std::string MsgBodyView::getText() const
-{
- return markupToUtf8(elm_entry_entry_get(m_pEntry));;
-}
-
-void MsgBodyView::clear()
-{
-
-}
-
void MsgBodyView::disabledSendButton(bool value)
{
elm_object_disabled_set(m_pSendButton, value);
void MsgBodyView::prepareEntry()
{
- m_pEntry = elm_entry_add(getEo());
- elm_entry_single_line_set(m_pEntry, false);
- elm_entry_autocapital_type_set(m_pEntry, ELM_AUTOCAPITAL_TYPE_SENTENCE);
- elm_entry_input_panel_return_key_type_set(m_pEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT);
- elm_entry_context_menu_disabled_set(m_pEntry, true);
- elm_entry_select_allow_set(m_pEntry, false);
- elm_object_focus_allow_set(m_pEntry, true);
- eext_entry_selection_back_event_allow_set(m_pEntry, false);
- elm_entry_cnp_mode_set(m_pEntry, ELM_CNP_MODE_PLAINTEXT);
- View::setText(m_pEntry, msgt("WDS_MSG_NPBODY_ENTER_MESSAGE_ABB"), "elm.guide");
- setContent(m_pEntry, "swl.entry");
+ m_pEntry = new Entry(getEo());
+ m_pEntry->setSingleLine(false);
+ m_pEntry->setAutocapitalType(ELM_AUTOCAPITAL_TYPE_SENTENCE);
+ m_pEntry->setInputPanelReturnType(ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND);
+ m_pEntry->setFocusAllow(true);
+ m_pEntry->setGuideText(msgt("WDS_MSG_NPBODY_ENTER_MESSAGE_ABB"));
+ setContent(*m_pEntry, "swl.entry");
}
void MsgBodyView::prepareSendButton()
+++ /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 "RecipEntryView.h"
-#include "Callback.h"
-#include <efl_extension.h>
-
-using namespace Msg;
-
-RecipEntryView::RecipEntryView(Evas_Object *parent)
- : m_pEntry(nullptr)
- , m_pClearButton(nullptr)
- , m_pContactButton(nullptr)
-{
- setEo(addLayout(parent, RECIP_ENTRY_EDJ_PATH, "main"));
- prepareEntry();
- showButton(ContactButtonId);
-}
-
-RecipEntryView::~RecipEntryView()
-{
-}
-
-void RecipEntryView::prepareEntry()
-{
- m_pEntry = elm_entry_add(getEo());
- elm_entry_cnp_mode_set(m_pEntry, ELM_CNP_MODE_PLAINTEXT);
- elm_entry_editable_set(m_pEntry, true);
- elm_entry_single_line_set(m_pEntry, true);
- elm_entry_scrollable_set(m_pEntry, true);
- eext_entry_selection_back_event_allow_set(m_pEntry, true);
- elm_scroller_policy_set(m_pEntry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_entry_autocapital_type_set(m_pEntry, ELM_AUTOCAPITAL_TYPE_NONE);
- elm_entry_input_panel_return_key_type_set(m_pEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH);
- setText(m_pEntry, msgt("WDS_MSG_NPBODY_ENTER_RECIPIENT_ABB"), "elm.guide");
- setContent(m_pEntry, "swl.entry");
-}
-
-Evas_Object *RecipEntryView::createButton(const char *icon)
-{
- Evas_Object *button = addIconButton(getEo(), icon);
- return button;
-}
-
-Evas_Object *RecipEntryView::prepareClearButton()
-{
- if (!m_pClearButton) {
- m_pClearButton = createButton("recip/del_icon");
- addSmartCb(m_pClearButton, "clicked", makeCbFirst(&RecipEntryView::onClearButtonClicked), this);
- }
- return m_pClearButton;
-}
-
-Evas_Object *RecipEntryView::prepareContactButton()
-{
- if (!m_pContactButton) {
- m_pContactButton = createButton("recip/contact_icon");
- addSmartCb(m_pContactButton, "clicked", makeCbFirst(&RecipEntryView::onContactButtonClicked), this);
- }
- return m_pContactButton;
-}
-
-std::string RecipEntryView::getText() const
-{
- return markupToUtf8(elm_entry_entry_get(m_pEntry));
-}
-
-void RecipEntryView::clear()
-{
- setText(m_pEntry, "");
-}
-
-void RecipEntryView::showButton(ButtonId id)
-{
- Evas_Object *curButton = getContent("swl.icon");
- Evas_Object *targetButton = nullptr;
-
- switch (id) {
- case ContactButtonId:
- targetButton = prepareContactButton();
- break;
- case ClearButtonId:
- targetButton = prepareClearButton();
- break;
- default:
- break;
- }
-
- if (curButton != targetButton) {
- Evas_Object *oldButton = setContent(targetButton, "swl.icon", true);
- if (oldButton)
- evas_object_hide(oldButton);
- }
-}
-
-void RecipEntryView::onClearButtonClicked(Evas_Object *obj, void *event)
-{
-}
-
-void RecipEntryView::onContactButtonClicked(Evas_Object *obj, void *event)
-{
-}
--- /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 "RecipFieldView.h"
+#include "Callback.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+RecipFieldView::RecipFieldView(Evas_Object *parent)
+ : m_pListener(nullptr)
+ , m_pEntry(nullptr)
+ , m_pClearButton(nullptr)
+ , m_pContactButton(nullptr)
+{
+ setEo(addLayout(parent, RECIP_ENTRY_EDJ_PATH, "main"));
+ prepareEntry();
+ showButton(ContactButtonId);
+}
+
+RecipFieldView::~RecipFieldView()
+{
+}
+
+void RecipFieldView::setListener(IRecipFieldViewListener *l)
+{
+ m_pListener = l;
+}
+
+void RecipFieldView::prepareEntry()
+{
+ m_pEntry = new Entry(getEo());
+ m_pEntry->enabledInputPanel(false);
+ m_pEntry->setEditable(false);
+ m_pEntry->setSingleLine(true);
+ m_pEntry->setScrollable(true);
+ m_pEntry->setScrollerPolicy(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ m_pEntry->setAutocapitalType(ELM_AUTOCAPITAL_TYPE_NONE);
+ m_pEntry->setInputPanelReturnType(ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH);
+ m_pEntry->setGuideText(msgt("WDS_MSG_NPBODY_ENTER_RECIPIENT_ABB"));
+ m_pEntry->addSmartCb("clicked", makeCbFirst(&RecipFieldView::onEntryClicked), this);
+ setContent(*m_pEntry, "swl.entry");
+}
+
+Evas_Object *RecipFieldView::createButton(const char *icon)
+{
+ Evas_Object *button = addIconButton(getEo(), icon);
+ return button;
+}
+
+Evas_Object *RecipFieldView::prepareClearButton()
+{
+ if (!m_pClearButton) {
+ m_pClearButton = createButton("recip/del_icon");
+ addSmartCb(m_pClearButton, "clicked", makeCbFirst(&RecipFieldView::onClearButtonClicked), this);
+ }
+ return m_pClearButton;
+}
+
+Evas_Object *RecipFieldView::prepareContactButton()
+{
+ if (!m_pContactButton) {
+ m_pContactButton = createButton("recip/contact_icon");
+ addSmartCb(m_pContactButton, "clicked", makeCbFirst(&RecipFieldView::onContactButtonClicked), this);
+ }
+ return m_pContactButton;
+}
+
+Entry &RecipFieldView::getEntry()
+{
+ return *m_pEntry;
+}
+
+void RecipFieldView::showButton(ButtonId id)
+{
+ Evas_Object *curButton = getContent("swl.icon");
+ Evas_Object *targetButton = nullptr;
+
+ switch (id) {
+ case ContactButtonId:
+ targetButton = prepareContactButton();
+ break;
+ case ClearButtonId:
+ targetButton = prepareClearButton();
+ break;
+ default:
+ break;
+ }
+
+ if (curButton != targetButton) {
+ Evas_Object *oldButton = setContent(targetButton, "swl.icon", true);
+ if (oldButton)
+ evas_object_hide(oldButton);
+ }
+}
+
+void RecipFieldView::onClearButtonClicked(Evas_Object *obj, void *event)
+{
+ if (m_pListener)
+ m_pListener->onClearButtonClicked(*this);
+}
+
+void RecipFieldView::onContactButtonClicked(Evas_Object *obj, void *event)
+{
+ if (m_pListener)
+ m_pListener->onContactButtonClicked(*this);
+}
+
+void RecipFieldView::onEntryClicked(Evas_Object *obj, void *event)
+{
+ if (m_pListener)
+ m_pListener->onFieldClicked(*this);
+}