2 // Open Service Platform
3 // Copyright (c) 2012-2013 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://floralicense.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 * @file FUiCtrlGalleryItem.cpp
19 * @brief This is the header file for the GalleryItem class.
21 * This header file contains the declarations of the GalleryItem class and its helper classes.
26 #include <FUiCtrlGalleryItem.h>
27 #include <FBaseSysLog.h>
28 #include "FUiCtrl_GalleryItemImpl.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::Io;
35 namespace Tizen { namespace Ui { namespace Controls
38 GalleryItem::GalleryItem(void)
44 GalleryItem::~GalleryItem(void)
50 GalleryItem::Construct(const Bitmap& bitmap, GalleryImageRotation rotation)
52 return Construct(bitmap, L"", rotation);
56 GalleryItem::Construct(const Bitmap& bitmap, const String& filePath, GalleryImageRotation rotation)
58 _GalleryItemImpl* pImpl = _GalleryItemImpl::GetInstance(*this);
59 SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
64 SysTryReturn(NID_UI_CTRL, File::IsFileExist(filePath), E_FILE_NOT_FOUND, E_FILE_NOT_FOUND, "[E_FILE_NOT_FOUND] File does not exist.");
67 String imagefilePath(filePath);
69 pImpl = _GalleryItemImpl::CreateGalleryItemImplN(this, bitmap, rotation, imagefilePath);
71 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
83 }}} // Tizen::Ui::Controls