2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0/
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 * @file FUiCtrlGalleryItem.cpp
19 * @brief This file contains implementation of GalleryItem class.
24 #include <FUiCtrlGalleryItem.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_GalleryItemImpl.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Io;
33 namespace Tizen { namespace Ui { namespace Controls
36 GalleryItem::GalleryItem(void)
42 GalleryItem::~GalleryItem(void)
48 GalleryItem::Construct(const Bitmap& bitmap, GalleryImageRotation rotation)
50 return Construct(bitmap, L"", rotation);
54 GalleryItem::Construct(const Bitmap& bitmap, const String& filePath, GalleryImageRotation rotation)
56 _GalleryItemImpl* pImpl = _GalleryItemImpl::GetInstance(*this);
57 SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
62 SysTryReturn(NID_UI_CTRL, File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] File does not exist.");
65 String imagefilePath(filePath);
67 pImpl = _GalleryItemImpl::CreateGalleryItemImplN(this, bitmap, rotation, imagefilePath);
69 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
81 }}} // Tizen::Ui::Controls