We don't need to throw exceptions becaus we have own exception specification (tizen error values).
This noexcept keyword may help compiler to optmize op code better.
Change-Id: Ied8f110bdbe846fa73f4b546f76c731cd9ea654a
~UiBaseKeyListenerImpl() {}
int init();
- int term();
+ int term() noexcept;
void eventProc(Evas_Event_Key_Down *ev);
- UiBaseViewmgr *getViewmgr() { return this->viewmgr; }
- Eo *getKeygrabObj() { return this->keyGrabber; }
+ UiBaseViewmgr *getViewmgr() noexcept { return this->viewmgr; }
+ Eo *getKeygrabObj() noexcept { return this->keyGrabber; }
};
}
view->onBack();
}
-int UiBaseKeyListenerImpl::term()
+int UiBaseKeyListenerImpl::term() noexcept
{
evas_object_del(this->keyGrabber);
Elm_Layout *_setTransitionLayout(string transitionStyle);
- bool _createConformant(Elm_Win *win);
- bool _createScroller(Elm_Conformant *conform);
+ bool _createConformant(Elm_Win *win) noexcept;
+ bool _createScroller(Elm_Conformant *conform) noexcept;
bool _createBaseLayout(Elm_Scroller *scroller, const char *style);
- void _setIndicator(UiViewIndicator indicator);
- void _setAvailableRotations(UiBaseView *view);
+ void _setIndicator(UiViewIndicator indicator) noexcept;
+ void _setAvailableRotations(UiBaseView *view) noexcept;
void _activateTopView();
bool _init();
bool _term();
UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, UiBaseKeyListener *keyListener);
~UiBaseViewmgrImpl();
- void activate();
- void deactivate();
+ void activate() noexcept;
+ void deactivate() noexcept;
void pushView(UiBaseView *view);
void popView();
//FIXME: How to deal with indicator in other UI framework? Dali? Volt?
//Is it possible make this interface common?
-void UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator)
+void UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator) noexcept
{
if (this->_indicator == indicator) return;
this->_indicator = indicator;
}
}
-void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view)
+void UiBaseViewmgrImpl::_setAvailableRotations(UiBaseView *view) noexcept
{
const int *rotations = nullptr;
unsigned int count = 0;
elm_win_wm_rotation_available_rotations_set(this->getWindow(), rotations, count);
}
-bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win)
+bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win) noexcept
{
Elm_Conformant *conform = elm_conformant_add(win);
if (!conform) return false;
return true;
}
-bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform)
+bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform) noexcept
{
Elm_Scroller *scroller = elm_scroller_add(conform);
if (!scroller) return false;
return this->_keyListener->term();
}
-void UiBaseViewmgrImpl::activate()
+void UiBaseViewmgrImpl::activate() noexcept
{
this->_activateTopView();
evas_object_show(this->_win);
}
-void UiBaseViewmgrImpl::deactivate()
+void UiBaseViewmgrImpl::deactivate() noexcept
{
//FIXME: based on the profile, we should app to go behind or terminate.
if (true) {
Elm_Button *_titleRightBtn = nullptr; //Title right button
bool _titleVisible = true;
- bool _createLayout();
- bool _destroyLayout();
+ bool _createLayout() noexcept;
+ bool _destroyLayout() noexcept;
public:
explicit UiStandardViewImpl(UiStandardView *view);
~UiStandardViewImpl();
- int setContent(Eo *content);
- int setTitleBadge(const char *text);
- int setSubtitle(const char *text);
- int setTitleLeftBtn(Elm_Button *titleLeftBtn);
- int setTitleRightBtn(Elm_Button *titleRightBtn);
- int setTitle(const char *text);
- int setToolbar(Elm_Toolbar *toolbar);
- int setTitleVisible(bool visible, bool anim);
- int unsetContent();
- Elm_Button *unsetTitleLeftBtn();
- Elm_Button *unsetTitleRightBtn();
- Elm_Toolbar *unsetToolbar();
- Eo *getBase() const;
-
- Elm_Button *getTitleLeftBtn() const {
+ int setContent(Eo *content) noexcept;
+ int setTitleBadge(const char *text) noexcept;
+ int setSubtitle(const char *text) noexcept;
+ int setTitleLeftBtn(Elm_Button *titleLeftBtn) noexcept;
+ int setTitleRightBtn(Elm_Button *titleRightBtn) noexcept;
+ int setTitle(const char *text) noexcept;
+ int setToolbar(Elm_Toolbar *toolbar) noexcept;
+ int setTitleVisible(bool visible, bool anim) noexcept;
+ int unsetContent() noexcept;
+ Elm_Button *unsetTitleLeftBtn() noexcept;
+ Elm_Button *unsetTitleRightBtn() noexcept;
+ Elm_Toolbar *unsetToolbar() noexcept;
+ Eo *getBase() const noexcept;
+
+ Elm_Button *getTitleLeftBtn() const noexcept {
return this->_titleLeftBtn;
}
- Elm_Button *getTitleRightBtn()const {
+ Elm_Button *getTitleRightBtn()const noexcept {
return this->_titleRightBtn;
}
- Elm_Toolbar *getToolbar() const {
+ Elm_Toolbar *getToolbar() const noexcept {
return this->_toolbar;
}
};
view->unsetToolbar();
}
-bool UiStandardViewImpl::_destroyLayout()
+bool UiStandardViewImpl::_destroyLayout() noexcept
{
if (!this->_layout) return false;
return true;
}
-bool UiStandardViewImpl::_createLayout()
+bool UiStandardViewImpl::_createLayout() noexcept
{
if (this->_layout) return false;
_destroyLayout();
}
-int UiStandardViewImpl::setContent(Eo *content)
+int UiStandardViewImpl::setContent(Eo *content) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setSubtitle(const char *text)
+int UiStandardViewImpl::setSubtitle(const char *text) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn)
+int UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn)
+int UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn) noexcept
{
Elm_Layout *layout = this->getBase();
Elm_Button *pbtn;
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setTitleBadge(const char *text)
+int UiStandardViewImpl::setTitleBadge(const char *text) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setTitle(const char *text)
+int UiStandardViewImpl::setTitle(const char *text) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar)
+int UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar) noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-int UiStandardViewImpl::unsetContent()
+int UiStandardViewImpl::unsetContent() noexcept
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
return UI_VIEWMGR_ERROR_NONE;
}
-Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
+Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn() noexcept
{
Elm_Button *btn = this->_titleLeftBtn;
if (!btn) {
return btn;
}
-Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
+Elm_Button *UiStandardViewImpl::unsetTitleRightBtn() noexcept
{
Elm_Button *btn = this->_titleRightBtn;
if (!btn) {
return btn;
}
-Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
+Elm_Toolbar *UiStandardViewImpl::unsetToolbar() noexcept
{
Elm_Toolbar *toolbar = this->_toolbar;
if (!toolbar) {
return toolbar;
}
-Eo *UiStandardViewImpl::getBase() const
+Eo *UiStandardViewImpl::getBase() const noexcept
{
if (!this->_layout) {
const_cast<UiStandardViewImpl*>(this)->_createLayout();
return this->_layout;
}
-int UiStandardViewImpl::setTitleVisible(bool visible, bool anim)
+int UiStandardViewImpl::setTitleVisible(bool visible, bool anim) noexcept
{
this->_titleVisible = visible;
UiMenu *_menu = nullptr;
list<UiPopup *> _popupList;
- void _connectPopup(UiPopup *popup);
- void _disconnectPopup(UiPopup *popup);
+ void _connectPopup(UiPopup *popup) noexcept;
+ void _disconnectPopup(UiPopup *popup) noexcept;
bool _deactivatePopup(bool topOne);
protected:
explicit UiViewImpl(UiView *view);
~UiViewImpl();
- const UiMenu *getMenu() const
+ const UiMenu *getMenu() const noexcept
{
return this->_menu;
}
- UiViewOrientationMode getOrientationMode() const;
+ UiViewOrientationMode getOrientationMode() const noexcept;
};
}
-void UiViewImpl::_connectPopup(UiPopup *popup)
+void UiViewImpl::_connectPopup(UiPopup *popup) noexcept
{
this->_popupList.push_back(popup);
}
-void UiViewImpl::_disconnectPopup(UiPopup *popup)
+void UiViewImpl::_disconnectPopup(UiPopup *popup) noexcept
{
this->_popupList.remove(popup);
}
this->_menu->onLandscape();
}
-UiViewOrientationMode UiViewImpl::getOrientationMode() const
+UiViewOrientationMode UiViewImpl::getOrientationMode() const noexcept
{
switch (this->_view->getDegree()) {
case 0:
{
}
- bool set_event_cb(ui_application_event_type_e event_type, ui_application_event_cb event_cb, void *user_data)
+ bool set_event_cb(ui_application_event_type_e event_type, ui_application_event_cb event_cb, void *user_data) noexcept
{
this->event_cb[event_type] = event_cb;
this->user_data[event_type] = user_data;
T _content = nullptr;
public:
- int setContent(T content);
- T unsetContent();
- UiIfaceView *getView() const;
- T getContent() const;
+ int setContent(T content) noexcept;
+ T unsetContent() noexcept;
+ UiIfaceView *getView() const noexcept;
+ T getContent() const noexcept;
UiIfaceOverlayImpl(UiIfaceOverlay *overlay, UiIfaceView *view);
~UiIfaceOverlayImpl();
{
}
-int UiIfaceOverlayImpl::setContent(T content)
+int UiIfaceOverlayImpl::setContent(T content) noexcept
{
this->_content = content;
return UI_VIEWMGR_ERROR_NONE;
}
-T UiIfaceOverlayImpl::unsetContent()
+T UiIfaceOverlayImpl::unsetContent() noexcept
{
T prev = this->_content;
this->_content = nullptr;
return prev;
}
-T UiIfaceOverlayImpl::getContent() const
+T UiIfaceOverlayImpl::getContent() const noexcept
{
return this->_content;
}
-UiIfaceView *UiIfaceOverlayImpl::getView() const
+UiIfaceView *UiIfaceOverlayImpl::getView() const noexcept
{
return this->_view;
}
bool _popping = false;
public:
- int setEventBlock(bool block);
- void onLoad();
- void onUnload();
- void onActivate();
- void onDeactivate();
- void onPause();
- void onResume();
- void onDestroy();
- bool getEventBlock() const;
- int setContent(T content);
- T unsetContent();
+ int setEventBlock(bool block) noexcept;
+ void onLoad() noexcept;
+ void onUnload() noexcept;
+ void onActivate() noexcept;
+ void onDeactivate() noexcept;
+ void onPause() noexcept;
+ void onResume() noexcept;
+ void onDestroy() noexcept;
+ bool getEventBlock() const noexcept;
+ int setContent(T content) noexcept;
+ T unsetContent() noexcept;
UiIfaceViewImpl(UiIfaceView *view, const char *name);
~UiIfaceViewImpl();
int setTransitionStyle(const char *style);
- void setRemovableContent(bool removable);
- int setIndicator(UiViewIndicator indicator);
- int setAvailableRotations(const int *rotations, unsigned int count);
- const int *getAvailableRotations(unsigned int *count) const;
- const char *getTransitionStyle() const;
- const char *getName() const;
- T getContent() const;
- UiViewState getState() const;
- bool getRemovableContent() const;
- UiViewIndicator getIndicator() const;
+ void setRemovableContent(bool removable) noexcept;
+ int setIndicator(UiViewIndicator indicator) noexcept;
+ int setAvailableRotations(const int *rotations, unsigned int count) noexcept;
+ const int *getAvailableRotations(unsigned int *count) const noexcept;
+ const char *getTransitionStyle() const noexcept;
+ const char *getName() const noexcept;
+ T getContent() const noexcept;
+ UiViewState getState() const noexcept;
+ bool getRemovableContent() const noexcept;
+ UiViewIndicator getIndicator() const noexcept;
void onBack();
};
#define MAX_NUM_OF_AVAILABLE_ROTATIONS 4
-bool UiIfaceViewImpl::getEventBlock() const
+bool UiIfaceViewImpl::getEventBlock() const noexcept
{
return this->_eventBlock;
}
-int UiIfaceViewImpl::setEventBlock(bool block)
+int UiIfaceViewImpl::setEventBlock(bool block) noexcept
{
this->_eventBlock = block;
return UI_VIEWMGR_ERROR_NONE;
}
-void UiIfaceViewImpl::onLoad()
+void UiIfaceViewImpl::onLoad() noexcept
{
this->_state = UI_VIEW_STATE_LOAD;
}
-void UiIfaceViewImpl::onUnload()
+void UiIfaceViewImpl::onUnload() noexcept
{
this->_state = UI_VIEW_STATE_UNLOAD;
if (this->getRemovableContent()) {
}
}
-void UiIfaceViewImpl::onActivate()
+void UiIfaceViewImpl::onActivate() noexcept
{
this->_state = UI_VIEW_STATE_ACTIVATE;
}
-void UiIfaceViewImpl::onDeactivate()
+void UiIfaceViewImpl::onDeactivate() noexcept
{
this->_state = UI_VIEW_STATE_DEACTIVATE;
}
-void UiIfaceViewImpl::onPause()
+void UiIfaceViewImpl::onPause() noexcept
{
this->_state = UI_VIEW_STATE_PAUSE;
}
-void UiIfaceViewImpl::onResume()
+void UiIfaceViewImpl::onResume() noexcept
{
this->_state = UI_VIEW_STATE_ACTIVATE;
}
-void UiIfaceViewImpl::onDestroy()
+void UiIfaceViewImpl::onDestroy() noexcept
{
}
if (this->_rotations) delete[](this->_rotations);
}
-int UiIfaceViewImpl::setContent(T content)
+int UiIfaceViewImpl::setContent(T content) noexcept
{
this->_content = content;
return UI_VIEWMGR_ERROR_NONE;
}
-T UiIfaceViewImpl::unsetContent()
+T UiIfaceViewImpl::unsetContent() noexcept
{
T prev = this->_content;
this->_content = nullptr;
return UI_VIEWMGR_ERROR_NONE;
}
-void UiIfaceViewImpl::setRemovableContent(bool removable)
+void UiIfaceViewImpl::setRemovableContent(bool removable) noexcept
{
this->_removableContent = removable;
//FIXME: If this api is called on unload state? should we remove content right now?
}
-int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator)
+int UiIfaceViewImpl::setIndicator(UiViewIndicator indicator) noexcept
{
if (indicator <= UI_VIEW_INDICATOR_UNKNOWN || indicator >= _NUM_OF_UI_VIEW_INDICATOR)
return UI_VIEWMGR_ERROR_INVALID_PARAMETER;
return UI_VIEWMGR_ERROR_NONE;
}
-int UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int count)
+int UiIfaceViewImpl::setAvailableRotations(const int *rotations, unsigned int count) noexcept
{
if (!rotations)
{
return UI_VIEWMGR_ERROR_NONE;
}
-const int *UiIfaceViewImpl::getAvailableRotations(unsigned int *count) const
+const int *UiIfaceViewImpl::getAvailableRotations(unsigned int *count) const noexcept
{
if (!count) {
set_last_result(UI_VIEWMGR_ERROR_INVALID_PARAMETER);
}
}
-const char *UiIfaceViewImpl::getTransitionStyle() const
+const char *UiIfaceViewImpl::getTransitionStyle() const noexcept
{
return this->_transitionStyle.c_str();
}
-const char *UiIfaceViewImpl::getName() const
+const char *UiIfaceViewImpl::getName() const noexcept
{
return this->_name.c_str();
}
-T UiIfaceViewImpl::getContent() const
+T UiIfaceViewImpl::getContent() const noexcept
{
return this->_content;
}
-UiViewState UiIfaceViewImpl::getState() const
+UiViewState UiIfaceViewImpl::getState() const noexcept
{
return this->_state;
}
-bool UiIfaceViewImpl::getRemovableContent() const
+bool UiIfaceViewImpl::getRemovableContent() const noexcept
{
return this->_removableContent;
}
-UiViewIndicator UiIfaceViewImpl::getIndicator() const
+UiViewIndicator UiIfaceViewImpl::getIndicator() const noexcept
{
return this->_indicator;
}
bool _destroying = false; //True, if viewmgr is on destroying.
public:
- int connectView(UiIfaceView *view);
- int disconnectView(UiIfaceView *view);
- void setEventBlock(UiIfaceView *view, bool block);
+ int connectView(UiIfaceView *view) noexcept;
+ int disconnectView(UiIfaceView *view) noexcept;
+ void setEventBlock(UiIfaceView *view, bool block) noexcept;
void pushViewFinished(UiIfaceView *view);
void popViewFinished(UiIfaceView *view);
int popView();
int insertViewBefore(UiIfaceView *view, UiIfaceView *before);
int insertViewAfter(UiIfaceView *view, UiIfaceView *after);
- int removeView(UiIfaceView *view);
- UiIfaceView *getView(unsigned int idx);
- UiIfaceView *getView(const char *name);
- UiIfaceView *getLastView();
- int getViewIndex(const UiIfaceView *view);
+ int removeView(UiIfaceView *view) noexcept;
+ UiIfaceView *getView(unsigned int idx) noexcept;
+ UiIfaceView *getView(const char *name) noexcept;
+ UiIfaceView *getLastView() noexcept;
+ int getViewIndex(const UiIfaceView *view) noexcept;
explicit UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
~UiIfaceViewmgrImpl();
int activate();
int deactivate();
- bool isActivated();
- unsigned int getViewCount();
- static bool needSoftKey();
- static UiIfaceViewmgr* getInstance();
+ bool isActivated() noexcept;
+ unsigned int getViewCount() noexcept;
+ static bool needSoftKey() noexcept;
+ static UiIfaceViewmgr* getInstance() noexcept;
};
}
return this->pushView(view);
}
-bool UiIfaceViewmgrImpl::needSoftKey()
+bool UiIfaceViewmgrImpl::needSoftKey() noexcept
{
return UiIfaceViewmgrImpl::_softKey;
}
-int UiIfaceViewmgrImpl::connectView(UiIfaceView *view)
+int UiIfaceViewmgrImpl::connectView(UiIfaceView *view) noexcept
{
//TODO: Perform this only in debug mode?
//Check whether the same name of this view is already existed in this viewmgr?
return UI_VIEWMGR_ERROR_NONE;
}
-int UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view)
+int UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view) noexcept
{
if (!view->_getViewmgr()) return UI_VIEWMGR_ERROR_NOT_PERMITTED;
view->_setViewmgr(nullptr);
return UI_VIEWMGR_ERROR_NONE;
}
-void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block)
+void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block) noexcept
{
if (!UiIfaceViewmgrImpl::_eventBlock) return;
view->setEventBlock(block);
return this->pushView(view);
}
-int UiIfaceViewmgrImpl::removeView(UiIfaceView *view)
+int UiIfaceViewmgrImpl::removeView(UiIfaceView *view) noexcept
{
if (this->_destroying) return UI_VIEWMGR_ERROR_NONE;
return this->disconnectView(view);
}
-UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx)
+UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) noexcept
{
if (idx >= this->_viewList.size()) {
LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1);
return *it;
}
-int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view)
+int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view) noexcept
{
int idx = 0;
return UI_VIEWMGR_ERROR_INVALID_PARAMETER;
}
-UiIfaceView *UiIfaceViewmgrImpl::getLastView()
+UiIfaceView *UiIfaceViewmgrImpl::getLastView() noexcept
{
int cnt = this->getViewCount();
return UI_VIEWMGR_ERROR_NONE;
}
-UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name)
+UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name) noexcept
{
if (!name)
{
return nullptr;
}
-bool UiIfaceViewmgrImpl::isActivated()
+bool UiIfaceViewmgrImpl::isActivated() noexcept
{
return this->_activated;
}
-unsigned int UiIfaceViewmgrImpl::getViewCount()
+unsigned int UiIfaceViewmgrImpl::getViewCount() noexcept
{
return this->_viewList.size();
}
-UiIfaceViewmgr* UiIfaceViewmgrImpl::getInstance()
+UiIfaceViewmgr* UiIfaceViewmgrImpl::getInstance() noexcept
{
return UiIfaceViewmgrImpl::_inst;
}