3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.tizenopensource.org/license
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include "ViewDescriptForm.h"
20 using namespace Osp::Base;
21 using namespace Osp::Base::Collection;
22 using namespace Osp::Base::Utility;
23 using namespace Osp::Io;
24 using namespace Osp::App;
25 using namespace Osp::Graphics;
26 using namespace Osp::Ui::Controls;
28 ViewDescriptForm::ViewDescriptForm(void)
32 ViewDescriptForm::~ViewDescriptForm(void)
37 ViewDescriptForm::Construct(String* pstr)
39 __strDescription = *pstr;
41 Form::Construct(FORM_STYLE_HEADER | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
43 EditArea* pEaEditor = new (std::nothrow) EditArea;
44 TryReturn(pEaEditor != null, E_OUT_OF_MEMORY, "new EditArea() is null");
46 TryReturn(pEaEditor != null, E_OUT_OF_MEMORY, "new EditArea() is null");
48 Rectangle rect = Rectangle(10, 10, GetClientAreaBounds().width - 20, GetClientAreaBounds().height - 15);
49 result r = pEaEditor->Construct(rect);
50 TryReturn(r == E_SUCCESS, r, "FileViewForm - EditArea::Construct() is failed by %s", GetErrorMessage(r));
52 pEaEditor->SetKeypadEnabled(false);
53 pEaEditor->SetEnabled(false);
55 r = AddControl(*pEaEditor);
56 TryReturn(r == E_SUCCESS, r, "FileViewForm - AddControl() is failed by %s", GetErrorMessage(r));
58 pEaEditor->SetText(__strDescription);
60 Header* pHeader = GetHeader();
61 pHeader->SetTitleText(L"Description");