From: Hermet Park Date: Tue, 5 Jul 2016 11:44:27 +0000 (+0900) Subject: c++: use explicit keyword for secure code. X-Git-Tag: accepted/tizen/common/20160708.140253~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=526be915897ad88ecaf37b38dc5372fe0c8f003d;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git c++: use explicit keyword for secure code. to prevent the implicit casting by a mistake, we use this keyword for more secure. Change-Id: I91a5e9cf51cd1727944ce090a907396968f94895 --- diff --git a/src/include/efl/UiBaseKeyListener.h b/src/include/efl/UiBaseKeyListener.h index 77cfc71..1e66bb0 100644 --- a/src/include/efl/UiBaseKeyListener.h +++ b/src/include/efl/UiBaseKeyListener.h @@ -40,7 +40,7 @@ protected: * * @param viewmgr The instance of UiBaseViewmgr. */ - UiBaseKeyListener(UiBaseViewmgr *viewmgr); + explicit UiBaseKeyListener(UiBaseViewmgr *viewmgr); ///Destructor. virtual ~UiBaseKeyListener(); diff --git a/src/include/efl/UiBaseOverlay.h b/src/include/efl/UiBaseOverlay.h index ce8a413..125e985 100644 --- a/src/include/efl/UiBaseOverlay.h +++ b/src/include/efl/UiBaseOverlay.h @@ -40,7 +40,7 @@ protected: * * @param view The instance of UiBaseView. */ - UiBaseOverlay(UiBaseView *view); + explicit UiBaseOverlay(UiBaseView *view); ///Destructor. virtual ~UiBaseOverlay(); diff --git a/src/include/efl/UiBaseView.h b/src/include/efl/UiBaseView.h index ea2d9a1..a268766 100644 --- a/src/include/efl/UiBaseView.h +++ b/src/include/efl/UiBaseView.h @@ -36,7 +36,7 @@ public: * * @param name view name. */ - UiBaseView(const char *name = NULL); + explicit UiBaseView(const char *name = NULL); ///Destructor. virtual ~UiBaseView(); diff --git a/src/include/efl/UiBaseViewmgr.h b/src/include/efl/UiBaseViewmgr.h index 25b4e13..688bf8f 100644 --- a/src/include/efl/UiBaseViewmgr.h +++ b/src/include/efl/UiBaseViewmgr.h @@ -199,7 +199,7 @@ protected: * * @param pkg The name of package. */ - UiBaseViewmgr(const char *pkg); + explicit UiBaseViewmgr(const char *pkg); ///Destructor. virtual ~UiBaseViewmgr(); diff --git a/src/include/efl/mobile/UiKeyListener.h b/src/include/efl/mobile/UiKeyListener.h index f1ec8e6..bff6289 100644 --- a/src/include/efl/mobile/UiKeyListener.h +++ b/src/include/efl/mobile/UiKeyListener.h @@ -37,7 +37,7 @@ public: * * @param The instance of UiViewmgr. */ - UiKeyListener(UiViewmgr *viewmgr); + explicit UiKeyListener(UiViewmgr *viewmgr); /** * @brief Init H/W key listener to grab key event(menu key). diff --git a/src/include/efl/mobile/UiMenu.h b/src/include/efl/mobile/UiMenu.h index 09b1c06..0fd484a 100644 --- a/src/include/efl/mobile/UiMenu.h +++ b/src/include/efl/mobile/UiMenu.h @@ -105,7 +105,7 @@ protected: * * @param The instance of UiView. */ - UiMenu(UiView *view); + explicit UiMenu(UiView *view); ///Destructor. virtual ~UiMenu(); diff --git a/src/include/efl/mobile/UiPopup.h b/src/include/efl/mobile/UiPopup.h index 40dcff7..dd83573 100644 --- a/src/include/efl/mobile/UiPopup.h +++ b/src/include/efl/mobile/UiPopup.h @@ -43,7 +43,7 @@ public: * * @param The instance of UiView. */ - UiPopup(UiView *view); + explicit UiPopup(UiView *view); ///Destructor. virtual ~UiPopup(); diff --git a/src/include/efl/mobile/UiStandardView.h b/src/include/efl/mobile/UiStandardView.h index f04bc6d..96381bf 100644 --- a/src/include/efl/mobile/UiStandardView.h +++ b/src/include/efl/mobile/UiStandardView.h @@ -41,7 +41,7 @@ public: * * @param name view name. */ - UiStandardView(const char *name = NULL); + explicit UiStandardView(const char *name = NULL); ///Destructor. virtual ~UiStandardView(); diff --git a/src/include/efl/mobile/UiView.h b/src/include/efl/mobile/UiView.h index fdc89c6..ff82bc4 100644 --- a/src/include/efl/mobile/UiView.h +++ b/src/include/efl/mobile/UiView.h @@ -43,7 +43,7 @@ public: * * @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name() */ - UiView(const char *name = NULL); + explicit UiView(const char *name = NULL); ///Destructor. virtual ~UiView(); diff --git a/src/include/efl/mobile/UiViewmgr.h b/src/include/efl/mobile/UiViewmgr.h index f613ba3..722f1e7 100644 --- a/src/include/efl/mobile/UiViewmgr.h +++ b/src/include/efl/mobile/UiViewmgr.h @@ -41,7 +41,7 @@ protected: * * @param pkg The name of package. */ - UiViewmgr(const char *pkg); + explicit UiViewmgr(const char *pkg); ///Destructor. virtual ~UiViewmgr(); diff --git a/src/include/interface/UiIfaceOverlay.h b/src/include/interface/UiIfaceOverlay.h index 377affe..a1d7170 100644 --- a/src/include/interface/UiIfaceOverlay.h +++ b/src/include/interface/UiIfaceOverlay.h @@ -114,7 +114,7 @@ protected: * * @param view The instance of UiIfaceView. */ - UiIfaceOverlay(UiIfaceView *view); + explicit UiIfaceOverlay(UiIfaceView *view); ///Destructor. virtual ~UiIfaceOverlay(); diff --git a/src/include/interface/UiIfaceRotatable.h b/src/include/interface/UiIfaceRotatable.h index 97a8150..f3688c3 100644 --- a/src/include/interface/UiIfaceRotatable.h +++ b/src/include/interface/UiIfaceRotatable.h @@ -30,6 +30,15 @@ namespace ui_viewmanager */ class UiIfaceRotatable { + +public: + /** + * @brief Get current view's degree. + * + * @return Current rotation degree, -1 if it fails to get degree information. + */ + virtual int getDegree() { return 0; } + protected: /** * @brief View portrait state. @@ -62,14 +71,6 @@ protected: * @see on_landscpae() */ virtual void onRotate(int degree) {} - -public: - /** - * @brief Get current view's degree. - * - * @return Current rotation degree, -1 if it fails to get degree information. - */ - virtual int getDegree() { return 0; } }; } diff --git a/src/include/interface/UiIfaceView.h b/src/include/interface/UiIfaceView.h index e9b2776..f1c642e 100644 --- a/src/include/interface/UiIfaceView.h +++ b/src/include/interface/UiIfaceView.h @@ -47,7 +47,7 @@ public: * * @warning if you don't set a view name, you could not look up the view with its name. @see ui_viewmgr_view_get_by_name() */ - UiIfaceView(const char *name = NULL); + explicit UiIfaceView(const char *name = NULL); ///Destructor. virtual ~UiIfaceView(); diff --git a/src/lib/efl/mobile/UiStandardView.cpp b/src/lib/efl/mobile/UiStandardView.cpp index b37c080..e343e0c 100644 --- a/src/lib/efl/mobile/UiStandardView.cpp +++ b/src/lib/efl/mobile/UiStandardView.cpp @@ -41,7 +41,7 @@ private: bool _destroyLayout(); public: - UiStandardViewImpl(UiStandardView *view); + explicit UiStandardViewImpl(UiStandardView *view); ~UiStandardViewImpl(); bool setContent(Evas_Object *content, const char *title = NULL); diff --git a/src/lib/efl/mobile/UiView.cpp b/src/lib/efl/mobile/UiView.cpp index ee74d31..ba37119 100644 --- a/src/lib/efl/mobile/UiView.cpp +++ b/src/lib/efl/mobile/UiView.cpp @@ -51,7 +51,7 @@ protected: bool onBack(); public: - UiViewImpl(UiView *view); + explicit UiViewImpl(UiView *view); ~UiViewImpl(); const UiMenu *getMenu() diff --git a/src/lib/interface/UiIfaceViewmgr.cpp b/src/lib/interface/UiIfaceViewmgr.cpp index f7d0f15..9fcb674 100644 --- a/src/lib/interface/UiIfaceViewmgr.cpp +++ b/src/lib/interface/UiIfaceViewmgr.cpp @@ -59,7 +59,7 @@ public: UiIfaceView *getLastView(); int getViewIndex(const UiIfaceView *view); - UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr); + explicit UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr); ~UiIfaceViewmgrImpl(); bool activate();