Apply coding idiom
authorChoi Munseok <ms47.choi@samsung.com>
Mon, 21 Jan 2013 07:09:22 +0000 (16:09 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Mon, 21 Jan 2013 07:09:22 +0000 (16:09 +0900)
Change-Id: I1156f1c919919a7cbbad13f659becae6e0eeeb0e
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
12 files changed:
project/inc/LiveboxViewer.h
project/inc/LiveboxViewerFormFactory.h
project/inc/LiveboxViewerFrame.h
project/inc/LiveboxViewerMainForm.h
project/inc/LiveboxViewerPanelFactory.h
project/inc/ViewForm.h
project/src/LiveboxViewer.cpp
project/src/LiveboxViewerEntry.cpp
project/src/LiveboxViewerFormFactory.cpp
project/src/LiveboxViewerFrame.cpp
project/src/LiveboxViewerMainForm.cpp
project/src/LiveboxViewerPanelFactory.cpp

index b7909cd..2d72ea6 100644 (file)
@@ -1,5 +1,22 @@
-#ifndef _LIVEBOXVIEWER_H_
-#define _LIVEBOXVIEWER_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 _LIVEBOX_VIEWER_H_
+#define _LIVEBOX_VIEWER_H_
 
 #include <FApp.h>
 #include <FBase.h>
@@ -15,9 +32,6 @@ class LiveboxViewerApp
        , public Tizen::System::IScreenEventListener
 {
 public:
-       /**
-        * [Test] UiApp must have a factory method that creates an instance of itself.
-        */
        static Tizen::App::UiApp* CreateInstance(void);
 
 public:
@@ -56,6 +70,6 @@ public:
        void OnScreenOff(void);
 
        void PrintLiveboxProviderInfos();
-};
+}; // LiveboxViewerApp
 
-#endif //  _LIVEBOXVIEWER_H_
+#endif // _LIVEBOX_VIEWER_H_
index d57acfe..dacead1 100644 (file)
@@ -1,5 +1,22 @@
-#ifndef _LIVEBOXVIEWER_FORM_FACTORY_H_
-#define _LIVEBOXVIEWER_FORM_FACTORY_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 _LIVEBOX_VIEWER_FORM_FACTORY_H_
+#define _LIVEBOX_VIEWER_FORM_FACTORY_H_
 
 #include <FUi.h>
 
@@ -16,6 +33,6 @@ public:
        virtual ~LiveboxViewerFormFactory(void);
 
        virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId);
-};
+}; // LiveboxViewerFormFactory
 
-#endif // _LIVEBOXVIEWER_FORM_FACTORY_H_
+#endif // _LIVEBOX_VIEWER_FORM_FACTORY_H_
index 276c066..fda59c0 100644 (file)
@@ -1,10 +1,26 @@
-#ifndef _LIVEBOXVIEWERFRAME_H_
-#define _LIVEBOXVIEWERFRAME_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 _LIVEBOX_VIEWER_FRAME_H_
+#define _LIVEBOX_VIEWER_FRAME_H_
 
 #include <FBase.h>
 #include <FUi.h>
 
-
 class LiveboxViewerFrame
        : public Tizen::Ui::Controls::Frame
 {
@@ -15,6 +31,6 @@ public:
 public:
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
-};
+}; // LiveboxViewerFrame
 
-#endif //_LIVEBOXVIEWERFRAME_H_
+#endif // _LIVEBOX_VIEWER_FRAME_H_
index 783bed9..cf0b461 100644 (file)
@@ -1,10 +1,26 @@
-#ifndef _LIVEBOXVIEWER_MAIN_FORM_H_
-#define _LIVEBOXVIEWER_MAIN_FORM_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 _LIVEBOX_VIEWER_MAIN_FORM_H_
+#define _LIVEBOX_VIEWER_MAIN_FORM_H_
 
 #include <FBase.h>
 #include <FUi.h>
 
-
 class LiveboxViewerMainForm
        : public Tizen::Ui::Controls::Form
        , public Tizen::Ui::IActionEventListener
@@ -42,6 +58,6 @@ private:
        static const int ID_FORMAT_STRING = 500;
        Tizen::Ui::Controls::ListView* __pList;
        Tizen::Base::Collection::IList* __pLiveboxProviderList;
-};
+}; // LiveboxViewerMainForm
 
-#endif //_LIVEBOXVIEWER_MAIN_FORM_H_
+#endif // _LIVEBOX_VIEWER_MAIN_FORM_H_
index 6ae6660..504edfa 100644 (file)
@@ -1,8 +1,24 @@
-#ifndef _LIVEBOXVIEWER_PANEL_FACTORY_H_
-#define _LIVEBOXVIEWER_PANEL_FACTORY_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 <FUi.h>
+#ifndef _LIVEBOX_VIEWER_PANEL_FACTORY_H_
+#define _LIVEBOX_VIEWER_PANEL_FACTORY_H_
 
+#include <FUi.h>
 
 class LiveboxViewerPanelFactory
        : public Tizen::Ui::Scenes::IPanelFactory
@@ -12,6 +28,6 @@ public:
        virtual ~LiveboxViewerPanelFactory(void);
 
        virtual Tizen::Ui::Controls::Panel* CreatePanelN(const Tizen::Base::String& panelId, const Tizen::Ui::Scenes::SceneId& sceneId);
-};
+}; // LiveboxViewerPanelFactory
 
-#endif // _LIVEBOXVIEWER_PANEL_FACTORY_H_
+#endif // _LIVEBOX_VIEWER_PANEL_FACTORY_H_
index fdf60d9..12cfb25 100644 (file)
@@ -1,6 +1,22 @@
-
-#ifndef _VIEWFORM_H_
-#define _VIEWFORM_H_
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 _VIEW_FORM_H_
+#define _VIEW_FORM_H_
 
 #include <FBase.h>
 #include <FUi.h>
@@ -8,7 +24,7 @@
 namespace Tizen { namespace Shell
 {
 class LiveboxView;
-}}
+}} // Tizen::Shell
 
 class ViewForm
        : public Tizen::Ui::Controls::Form
@@ -16,8 +32,6 @@ class ViewForm
        , public Tizen::Ui::Controls::IFormBackEventListener
        , public Tizen::Ui::Scenes::ISceneEventListener
 {
-
-// Construction
 public:
        ViewForm(void);
        virtual ~ViewForm(void);
@@ -37,6 +51,6 @@ private:
        Tizen::Ui::Controls::ContextMenu* __pContextMenu;
        Tizen::Base::Collection::IList* __pSizeInfoList;
        static const int ID_FOOTER_ITEM1 = 1001;
-};
+}; // ViewForm
 
-#endif
+#endif // _VIEW_FORM_H_
\ No newline at end of file
index 77c7420..5138169 100644 (file)
@@ -1,9 +1,19 @@
-/**
- * Name        : LiveboxViewer
- * Version     :
- * Vendor      :
- * Description :
- */
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 <unique_ptr.h>
 #include <FShellLiveboxManager.h>
 using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
+using namespace Tizen::Shell;
 using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
-using namespace Tizen::Shell;
-
 
 LiveboxViewerApp::LiveboxViewerApp(void)
 {
@@ -80,7 +89,9 @@ LiveboxViewerApp::OnAppInitialized(void)
 
        // Goto the scene.
        if (pSceneManager->GoForward(ForwardSceneTransition(MAIN_SCENE)) != E_SUCCESS)
+       {
                return false;
+       }
 
        return true;
 }
@@ -100,7 +111,10 @@ LiveboxViewerApp::PrintLiveboxProviderInfos()
                LiveboxProviderInfo* pProviderInfo = dynamic_cast<LiveboxProviderInfo*>(pLiveboxProviderInfos->GetAt(i) );
 
                std::unique_ptr<IList> pSizeInfos(pProviderInfo->GetSizeInfoListN() );
-               if(pSizeInfos.get() == null) continue;
+               if (pSizeInfos.get() == null)
+               {
+                       continue;
+               }
                AppLog("appId(%ls), Name(%ls), DisplayName(%ls), iconPath(%ls) support (%d) sizes", pProviderInfo->GetAppId().GetPointer(), pProviderInfo->GetName().GetPointer(), pProviderInfo->GetDisplayName().GetPointer(), pProviderInfo->GetIconPath().GetPointer(),  pSizeInfos->GetCount() );
 
                for(int j = 0; j < pSizeInfos->GetCount(); j ++)
index ba75067..c89e009 100644 (file)
@@ -1,6 +1,24 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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.
+//
+
 /**
  * This file contains the Tizen application entry point.
  */
+
 #include "LiveboxViewer.h"
 
 using namespace Tizen::Base;
@@ -19,29 +37,27 @@ _EXPORT_ int OspMain(int argc, char *pArgv[]);
 int
 OspMain(int argc, char *pArgv[])
 {
-       result r = E_SUCCESS;
-
        AppLog("Application started.");
-       ArrayList* pArgs = new ArrayList();
-       pArgs->Construct();
+       ArrayList args;
+       args.Construct();
        for (int i = 0; i < argc; i++)
        {
-               pArgs->Add(*(new String(pArgv[i])));
+               args.Add(*(new (std::nothrow) String(pArgv[i])));
        }
 
-       r = Tizen::App::UiApp::Execute(LiveboxViewerApp::CreateInstance, pArgs);
+       result r = Tizen::App::UiApp::Execute(LiveboxViewerApp::CreateInstance, &args);
        if (IsFailed(r))
        {
                AppLogException("Application execution failed-[%s].", GetErrorMessage(r));
                r &= 0x0000FFFF;
        }
 
-       pArgs->RemoveAll(true);
-       delete pArgs;
+       args.RemoveAll(true);
        AppLog("Application finished.");
 
        return static_cast<int>(r);
 }
+
 #ifdef __cplusplus
 }
 #endif // __cplusplus
index a220d3e..312798a 100644 (file)
@@ -1,3 +1,20 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 "LiveboxViewerFormFactory.h"
 #include "LiveboxViewerMainForm.h"
 #include "ViewForm.h"
@@ -9,7 +26,6 @@ const wchar_t* VIEW_SCENE = L"SceneView";
 
 using namespace Tizen::Ui::Scenes;
 
-
 LiveboxViewerFormFactory::LiveboxViewerFormFactory(void)
 {
 }
index 6e3823e..6c1c329 100644 (file)
@@ -1,3 +1,20 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 "LiveboxViewerFrame.h"
 
 using namespace Tizen::Base;
@@ -32,4 +49,3 @@ LiveboxViewerFrame::OnTerminating(void)
        return r;
 }
 
-
index 500a6ff..1c056fd 100644 (file)
@@ -1,7 +1,25 @@
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 <FApp.h>
 #include <FShellLiveboxProviderInfo.h>
 #include <FShellLiveboxManager.h>
 #include <FShellLiveboxSizeInfo.h>
+
 #include "LiveboxViewerMainForm.h"
 #include "LiveboxViewerFormFactory.h"
 
index 9d23611..ccaa588 100644 (file)
@@ -1,8 +1,25 @@
-#include "LiveboxViewerPanelFactory.h"
+//
+// Tizen C++ SDK
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (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 <FUi.h>
 
-using namespace Tizen::Ui::Scenes;
+#include "LiveboxViewerPanelFactory.h"
 
+using namespace Tizen::Ui::Scenes;
 
 LiveboxViewerPanelFactory::LiveboxViewerPanelFactory(void)
 {