* @brief This is the implementation for the NotificationFrame class.
*/
+#include <unique_ptr.h>
#include <FShlQuickPanelFrame.h>
#include <FBaseSysLog.h>
#include <FSec_AccessController.h>
#include "FUi_UiBuilder.h"
#include "FShl_QuickPanelFrameImpl.h"
+using namespace std;
using namespace Osp::Security;
using namespace Osp::Ui;
using namespace Osp::Ui::Controls;
result
QuickPanelFrame::Construct(const Osp::Base::String& resourceId)
{
- result r = _AccessController::CheckUserPrivilege(_PRV_NOTIFICATION);
- SysTryReturnResult(NID_LOC, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
-
ClearLastResult();
// Parse UiBuilder XML file
- _UiBuilder* pBuilder = new _UiBuilder();
- if (pBuilder == null)
- {
- return E_OUT_OF_MEMORY;
- }
- pBuilder->Construct(resourceId, this);
+ unique_ptr<_UiBuilder> pBuilder(new _UiBuilder());
+ SysTryReturn(NID_UI_CTRL, pBuilder, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+ result r = pBuilder->Construct(resourceId, this);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = pBuilder->Parse();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- delete pBuilder;
return r;
}