Public Member Functions
Osp::Content::ImageContentInfo Class Reference
Inheritance diagram for Osp::Content::ImageContentInfo:
Osp::Content::ContentInfo Osp::Base::Object

Since:
1.0

The ImageContentInfo class provides the methods to access the image content information. Before the image content information can be retrieved, ContentManager must be used to create the content.

For more information on the different types of content information, see Device Content Management.

The following example demonstrates how to use the ImageContentInfo class.

 result
 MyClass::TestImageContentInfo(void)
 {
        result r = E_SUCCESS;

        ContentId contentId;
        ContentManager contentManager;
        r = contentManager.Construct();
        TryReturn(!IsFailed(r), r, "Construct failed.");

        Osp::Base::String inputPath(L"/Media/Images/Flower1.jpg");
        ImageContentInfo imageContentInfo;
        r = imageContentInfo.Construct(&inputPath);
        TryReturn(!IsFailed(r), r, "Construct failed.");

        contentId = contentManager.CreateContent(imageContentInfo);
        TryReturn(Osp::Base::UuId::INVALID_UUID != contentId, GetLastResult(), "CreateContent failed.");

        // Contents information
        Osp::Base::String contentPath = imageContentInfo.GetContentPath();

        // Metadata
        Osp::Base::String title = imageContentInfo.GetTitle();

        return r;
 }

List of all members.

Public Member Functions

result Construct (const Osp::Base::String &contentPath, const Osp::Base::String &thumbnailPath=L"", bool setGps=false)
result Construct (const Osp::Base::String *pContentPath)
int GetHeight (void) const
Osp::Base::String GetTitle (void) const
int GetWidth (void) const
 ImageContentInfo (void)
virtual ~ImageContentInfo (void)

Constructor & Destructor Documentation

Osp::Content::ImageContentInfo::ImageContentInfo ( void  )

This is the default constructor for this class.

Since:
1.0
Remarks:
After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
virtual Osp::Content::ImageContentInfo::~ImageContentInfo ( void  ) [virtual]

This is the destructor for this class.

Since:
1.0

Member Function Documentation

result Osp::Content::ImageContentInfo::Construct ( const Osp::Base::String contentPath,
const Osp::Base::String thumbnailPath = L"",
bool  setGps = false 
) [virtual]

Initializes this instance of ImageContentInfo with the specified parameters.

Deprecated:
This method is deprecated as there is a problem in managing the user-defined thumbnail and device coordinates.
Instead of using this method, use Construct(const Osp::Base::String* pContentPath). To set the coordinates in the ContentInfo instance, use SetCoordinates(const Osp::Locations::Coordinates& coordinates) of the ContentInfo class.
Since:
1.0
Returns:
An error code
Parameters:
[in]contentPathThe content path
[in]thumbnailPathThe thumbnail path
[in]setGpsSet to true to save the device's last known coordinates in the ContentInfo instance,
else false
The coordinate information may be incorrect if it is outdated or has never been updated. To update the coordinate information or to get the exact value, use RequestLocationUpdates() of the Osp::Locations::LocationProvider class, before calling this method.
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has already been constructed.
E_FILE_NOT_FOUNDThe specified file cannot be found or accessed.
E_IOAn I/O error has occurred.
E_INVALID_ARGA specified input parameter is invalid, or the length of the input data exceeds the maximum limit of 256 characters.
E_LOCATIONThe location provider is currently out of service.
Remarks:
The content path should start with '/Media' or '/Storagecard/Media'.
The thumbnail path should start with '/Home', '/Media', or '/Storagecard/Media'.
The permitted format for a thumbnail image is Bitmap (bmp).

Implements Osp::Content::ContentInfo.

result Osp::Content::ImageContentInfo::Construct ( const Osp::Base::String pContentPath)

Initializes this instance of ImageContentInfo with the specified parameter.

Since:
2.0
Returns:
An error code
Parameters:
[in]pContentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has already been constructed.
E_FILE_NOT_FOUNDThe specified file cannot be found or accessed.
E_INVALID_ARGThe specified content path is invalid or its length exceeds the maximum limit of 256 characters.
E_OUT_OF_MEMORYThe memory is insufficient.
E_IOAn I/O error has occurred.
E_SYSTEMAn internal error has occurred.
Remarks:
The content path should start with '/Media' or '/Storagecard/Media'.
If the content has coordinates as metadata, they are automatically set. If the specified pContentPath is null, use CreateContent() of the ContentManager class.
CreateContent(const Osp::Base::ByteBuffer& byteBuffer, const Osp::Base::String& destinationPath, const ContentInfo* pContentInfo = null)
CreateContent(const Osp::Base::String& sourcePath, const Osp::Base::String& destinationPath, bool deleteSource, const ContentInfo* pContentInfo = null)
int Osp::Content::ImageContentInfo::GetHeight ( void  ) const

Gets the height of the image.

Since:
1.0
Returns:
The height of the image
Osp::Base::String Osp::Content::ImageContentInfo::GetTitle ( void  ) const

Gets the title of the image.

Since:
1.0
Returns:
The title of the image
int Osp::Content::ImageContentInfo::GetWidth ( void  ) const

Gets the width of the image.

Since:
1.0
Returns:
The width of the image

The documentation for this class was generated from the following file:

Copyright © 2011 Samsung Electronics Co., Ltd. All rights reserved.