--- /dev/null
+/*
+ * Copyright 2017 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.
+ */
+
+group { "elm/layout/callui/keypad";
+ parts {
+ rect { "bg";
+ scale;
+ desc { "default";
+ color: 0 0 0 255;
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 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 __CALLUI_PRESENTERS_KEYPAD_PAGE_H__
+#define __CALLUI_PRESENTERS_KEYPAD_PAGE_H__
+
+#include "Page.h"
+
+#include "ucl/gui/Layout.h"
+
+#include "types.h"
+
+namespace callui {
+
+ class KeypadPage final : public Page {
+ public:
+ class Builder {
+ public:
+ Builder();
+ ~Builder();
+ Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+ KeypadPageSRef build(const ExitRequestHandler onExitRequest) const;
+ private:
+ ucl::NaviframeSRef m_navi;
+ };
+
+ private:
+ friend class ucl::RefCountObj<KeypadPage>;
+ KeypadPage(ucl::RefCountObjBase &rc,
+ const ucl::NaviframeSRef &navi,
+ const ExitRequestHandler onExitRequest);
+ virtual ~KeypadPage();
+
+ ucl::Result prepare();
+
+ private:
+ ucl::LayoutSRef m_widget;
+ };
+}
+
+#endif // __CALLUI_PRESENTERS_KEYPAD_PAGE_H__
#include "ucl/gui/Layout.h"
#include "ucl/gui/StyledWidget.h"
+#include "ucl/gui/Naviframe.h"
+
+#include "Page.h"
#include "types.h"
Builder();
Builder &setCallManager(const ICallManagerSRef &cm);
Builder &setSoundManager(const ISoundManagerSRef &sm);
+ Builder &setNaviframe(const ucl::NaviframeSRef &navi);
MoreOptionsPresenterSRef build(ucl::ElmWidget &parent) const;
private:
ICallManagerSRef m_cm;
ISoundManagerSRef m_sm;
+ ucl::NaviframeSRef m_navi;
};
public:
friend class ucl::RefCountObj<MoreOptionsPresenter>;
MoreOptionsPresenter(ucl::RefCountObjBase &rc,
const ICallManagerSRef &cm,
- const ISoundManagerSRef &sm);
+ const ISoundManagerSRef &sm,
+ const ucl::NaviframeSRef &navi);
virtual ~MoreOptionsPresenter();
ucl::Result prepare(ucl::ElmWidget &parent);
void unsetPanelContent(const ucl::EdjePart &part);
void setPanelContent(ucl::StyledWidgetSRef &widget, const ucl::EdjePart &part);
+ void onPageExitRequest(Page &page);
+
private:
ucl::LayoutSRef m_widget;
ucl::StyledWidgetSRef m_panel;
ucl::StyledWidgetSRef m_btnPhone;
ucl::StyledWidgetSRef m_btnKeypad;
ucl::StyledWidgetSRef m_btnGear;
+ PageWRef m_keypad;
ICallManagerSRef m_cm;
ISoundManagerSRef m_sm;
+ ucl::NaviframeWRef m_navi;
+
ICallInfoWCRef m_info;
Ecore_Timer *m_timer;
UCL_DECLARE_REF_ALIASES(Page);
UCL_DECLARE_REF_ALIASES(MainPage);
+ UCL_DECLARE_REF_ALIASES(KeypadPage);
UCL_DECLARE_REF_ALIASES(AcceptRejectPresenter);
UCL_DECLARE_REF_ALIASES(AcceptDialog);
#include "../../edc/volume_control.edc"
#include "../../edc/accessory.edc"
#include "../../edc/more_option.edc"
-
+ #include "../../edc/keypad.edc"
}
--- /dev/null
+/*
+ * Copyright 2017 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 "presenters/KeypadPage.h"
+
+#include "common.h"
+
+namespace callui { namespace { namespace impl {
+
+ using namespace ucl;
+
+ constexpr LayoutTheme LAYOUT_KEYPAD_WIDGET
+ {"layout", "callui", "keypad"};
+
+}}}
+
+namespace callui {
+
+ using namespace ucl;
+
+ // KeypadPage::Builder
+
+ KeypadPage::Builder::Builder()
+ {
+ }
+
+ KeypadPage::Builder::~Builder()
+ {
+ }
+
+ KeypadPage::Builder &KeypadPage::Builder::setNaviframe(
+ const NaviframeSRef &navi)
+ {
+ m_navi = navi;
+ return *this;
+ }
+
+ KeypadPageSRef KeypadPage::Builder::build(
+ const ExitRequestHandler onExitRequest) const
+ {
+ if (!onExitRequest) {
+ LOG_RETURN_VALUE(RES_INVALID_ARGUMENTS, {},
+ "onExitRequest is NULL");
+ }
+ if (!m_navi) {
+ LOG_RETURN_VALUE(RES_INVALID_ARGUMENTS, {},
+ "m_navi is NULL");
+ }
+
+ auto result = makeShared<KeypadPage>(m_navi, onExitRequest);
+
+ FAIL_RETURN_VALUE(result->prepare(), {},
+ "result->prepare() failed!");
+
+ return result;
+ }
+
+ // KeypadPage
+
+ KeypadPage::KeypadPage(RefCountObjBase &rc,
+ const NaviframeSRef &navi,
+ const ExitRequestHandler onExitRequest):
+ Page(rc, navi, onExitRequest)
+ {
+ }
+
+ KeypadPage::~KeypadPage()
+ {
+ }
+
+ Result KeypadPage::prepare()
+ {
+ m_widget = Layout::Builder().
+ setTheme(impl::LAYOUT_KEYPAD_WIDGET).
+ setIsOwner(true).
+ build(getNaviframe());
+ if (!m_widget) {
+ LOG_RETURN(RES_FAIL, "Layout::build() failed!");
+ }
+
+ return Page::prepare([this]() {
+ return getNaviframe().push(*m_widget);
+ });
+ }
+
+}
#include "presenters/MainPage.h"
#include "ucl/gui/Window.h"
-#include "ucl/gui/Layout.h"
#include "ucl/gui/Widget.h"
#include "model/ICall.h"
processKeyPress();
}
- void MainPage::onPowerKeyUp(ucl::Widget &widget, void *eventInfo)
+ void MainPage::onPowerKeyUp(Widget &widget, void *eventInfo)
{
if (isActive()) {
processKeyPress();
m_moreOptions = MoreOptionsPresenter::Builder().
setCallManager(m_cm).
setSoundManager(m_call->getSoundManager()).
+ setNaviframe(asShared(getNaviframe())).
build(*m_widget);
if (!m_moreOptions) {
#include "model/ICallInfo.h"
#include "model/ISoundManager.h"
+#include "presenters/KeypadPage.h"
+
#include "resources.h"
#include "common.h"
return *this;
}
+ MoreOptionsPresenter::Builder &
+ MoreOptionsPresenter::Builder::setNaviframe(const NaviframeSRef &navi)
+ {
+ m_navi = navi;
+ return *this;
+ }
+
MoreOptionsPresenterSRef
MoreOptionsPresenter::Builder::build(ElmWidget &parent) const
{
- if (!m_cm || !m_sm) {
+ if (!m_cm || !m_sm || !m_navi) {
LOG_RETURN_VALUE(RES_FAIL, {}, "Main params are not set");
}
- auto result = makeShared<MoreOptionsPresenter>(m_cm, m_sm);
+ auto result = makeShared<MoreOptionsPresenter>(m_cm, m_sm, m_navi);
FAIL_RETURN_VALUE(result->prepare(parent), {},
"result->prepare() failed!");
MoreOptionsPresenter::MoreOptionsPresenter(RefCountObjBase &rc,
const ICallManagerSRef &cm,
- const ISoundManagerSRef &sm):
+ const ISoundManagerSRef &sm,
+ const NaviframeSRef &navi):
Presenter(rc),
m_cm(cm),
m_sm(sm),
+ m_navi(navi),
m_timer(nullptr)
{
}
m_sm->removeAudioStateHandler(DELEGATE(
MoreOptionsPresenter::onAudioStateChanged, this));
+
+ if (m_keypad) {
+ m_keypad->exitNoTransition();
+ }
}
Result MoreOptionsPresenter::prepare(ElmWidget &parent)
void MoreOptionsPresenter::onKeypadBtnClick(Widget &sender, void *eventInfo)
{
- ELOG("Not implemented");
+ KeypadPage::Builder builder;
+ if (m_navi) {
+ builder.setNaviframe(m_navi);
+ } else {
+ LOG_RETURN_VOID(RES_FAIL, "Naviframe is NULL");
+ }
+ m_keypad = builder.build(DELEGATE(
+ MoreOptionsPresenter::onPageExitRequest, this));
+ }
+
+ void MoreOptionsPresenter::onPageExitRequest(Page &page)
+ {
+ m_keypad.reset();
+ page.exit();
}
void MoreOptionsPresenter::onGearBtnClick(Widget &sender, void *eventInfo)