2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FCntImageContentInfo.cpp
18 * @brief This is the implementation file for the %ImageContentInfo class.
20 * This file contains implementation of the %ImageContentInfo class.
23 #include <FBaseSysLog.h>
24 #include <FCntImageContentInfo.h>
25 #include "FCnt_ImageContentInfoImpl.h"
26 #include "FCnt_ContentInfoHelper.h"
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Content
33 ImageContentInfo::ImageContentInfo(void)
34 : __pImageContentData(null)
35 , __pImageContentInfoImpl(null)
40 ImageContentInfo::~ImageContentInfo(void)
42 delete __pImageContentInfoImpl;
46 ImageContentInfo::Construct(const String& contentPath, const String& thumbnailPath, bool setGps)
50 SysAssertf(__pImageContentInfoImpl == null,
51 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
53 _ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
54 SysTryReturnResult(NID_CNT, pImageContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
56 r = pImageContentInfoImpl->Construct(contentPath, thumbnailPath, setGps);
57 SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
59 _ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
61 __pImageContentInfoImpl = pImageContentInfoImpl;
66 delete pImageContentInfoImpl;
72 ImageContentInfo::Construct(const String* pContentPath)
76 SysAssertf(__pImageContentInfoImpl == null,
77 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
79 _ImageContentInfoImpl* pImageContentInfoImpl = new (std::nothrow) _ImageContentInfoImpl();
80 SysTryReturnResult(NID_CNT, pImageContentInfoImpl != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Construct failed.");
82 r = pImageContentInfoImpl->Construct(pContentPath);
83 SysTryCatch(NID_CNT, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
85 _ContentInfoHelper::SetContentInfoImpl(this, pImageContentInfoImpl);
87 __pImageContentInfoImpl = pImageContentInfoImpl;
92 delete pImageContentInfoImpl;
98 ImageContentInfo::GetWidth(void) const
100 SysAssertf(__pImageContentInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
102 return __pImageContentInfoImpl->GetWidth();
106 ImageContentInfo::GetHeight(void) const
108 SysAssertf(__pImageContentInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
110 return __pImageContentInfoImpl->GetHeight();
114 ImageContentInfo::GetOrientation(void) const
116 SysAssertf(__pImageContentInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
118 return __pImageContentInfoImpl->GetOrientation();
122 ImageContentInfo::GetTitle(void) const
124 SysAssertf(__pImageContentInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
126 return __pImageContentInfoImpl->GetTitle();