Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::ContentStoreItem Class Reference

ContentStoreItem object. More...

Inheritance diagram for gem::ContentStoreItem:
Collaboration diagram for gem::ContentStoreItem:

Public Member Functions

 ContentStoreItem (const ContentStoreItem &v)
 Default copy constructor.
 ContentStoreItem (ContentStoreItem &&v)=default
 Default move constructor noexcept is deduced.
ContentStoreItem & operator= (const ContentStoreItem &v)
 Default copy assignment.
ContentStoreItem & operator= (ContentStoreItem &&v)=default
 Default move assignment noexcept is deduced.
bool operator== (const ContentStoreItem &obj) const
 Comparison operator equal.
bool operator!= (const ContentStoreItem &obj) const
 Comparison operator not equal.
const StringRef getName () const noexcept
 Get the name of the associated product.
LargeInteger getId () const noexcept
 Get the unique id of the item in the content store.
const StringRef getChapterName () const noexcept
 Get the product chapter name translated to interface language.
const StringListRef getCountryCodes () const noexcept
 Get the country code (ISO 3166-1 alpha-3) list of the product as text.
const LanguageRef getLanguage () const noexcept
 Get the full language code for the product.
EContentType getType () const noexcept
 Get the type of the product as a EContentType value.
const StringRef getFileName () const noexcept
 Get the full path to the content data file when available.
Version getClientVersion () const noexcept
 Get the client version of the content.
LargeInteger getTotalSize () const noexcept
 Get the size of the content in bytes.
LargeInteger getAvailableSize () const noexcept
 Get the available size of the content in bytes.
bool isCompleted () const noexcept
 Check if the item is completed downloaded.
int asyncDownload (ProgressListener listener, EDataSavePolicy savePolicy=EDataSavePolicy::UseDefault, bool allowChargedNetworks=false, EContentDownloadThreadPriority priority=CDP_Default) noexcept
 Asynchronous start/resume the download of the content store product content.
EContentStoreItemStatus getStatus () const noexcept
 Gets current item status.
int pauseDownload () noexcept
 Pause a previous download operation.
int cancelDownload () noexcept
 Cancel a previous download operation.
void setProgressListener (ProgressListener listener) noexcept
 Sets the item progress listener.
ProgressListener getProgressListener () const noexcept
 Gets the item progress listener.
int getDownloadProgress () const noexcept
 Get current download progress.
bool canDeleteContent () const noexcept
 Check if associated content can be deleted.
int deleteContent () noexcept
 Delete the associated content.
bool isImagePreviewAvailable () const noexcept
 Check if there is an image preview available on the client.
Image getImagePreview () const noexcept
 Get the image preview if available.
const SearchableParameterListRef getContentParameters () const noexcept
 Get additional parameters for the content.
const ContentStoreItemRef getUpdateItem () const noexcept
 Get corresponding update item.
bool isUpdatable () const noexcept
 Check if item is updatable, i.e.
LargeInteger getUpdateSize () const noexcept
 Get update size ( if an update is available for this item ).
Version getUpdateVersion () const noexcept
 Gets update version ( if an update is available for this item ).
 operator bool () const
 Boolean operator, true if class wraps a valid content store item.

Detailed Description

ContentStoreItem object.

Implements share-read / share-write Api object over IContentStoreItem.

Constructor & Destructor Documentation

◆ ContentStoreItem() [1/2]

gem::ContentStoreItem::ContentStoreItem ( const ContentStoreItem & v)
inline

Default copy constructor.

Parameters
vThe object to copy

◆ ContentStoreItem() [2/2]

gem::ContentStoreItem::ContentStoreItem ( ContentStoreItem && v)
default

Default move constructor noexcept is deduced.

Parameters
vThe object to move

Member Function Documentation

◆ asyncDownload()

int gem::ContentStoreItem::asyncDownload ( ProgressListener listener,
EDataSavePolicy savePolicy = EDataSavePolicy::UseDefault,
bool allowChargedNetworks = false,
EContentDownloadThreadPriority priority = CDP_Default )
inlinenoexcept

Asynchronous start/resume the download of the content store product content.

Parameters
[in]listenerObject that implements notification events associated with this operation. Cannot be empty.
See also
ProgressListener for more information.
Parameters
[in]savePolicySpecify where updated data will be stored. Default is UseDefault meaning the savePolicy from SDK::initialize will be used
[in]allowChargedNetworksFlag whether to allow charged networks. If true, it will override SdkSettings::setAllowOffboardServiceOnExtraChargedNetwork( EServiceGroupType::ContentService, false )
[in]priorityDownload thread priority, default OS value
See also
SdkSettings::setAllowOffboardServiceOnExtraChargedNetwork( EServiceGroupType::ContentService, ... ) to enable / disable content data download over extra charged networks
Returns
KNoError when success.

If KNoConnection is returned, get more details about online restrictions with SdkSettings::getOnlineServiceRestriction

◆ cancelDownload()

int gem::ContentStoreItem::cancelDownload ( )
inlinenoexcept

Cancel a previous download operation.

The partially downloaded content is deleted.

Operation is executed immediately, i.e. no notifications are thrown

Returns
KNoError when success.

◆ canDeleteContent()

bool gem::ContentStoreItem::canDeleteContent ( ) const
inlinenoexcept

Check if associated content can be deleted.

Note
Content can be deleted if it has partially or complete local data and is not marked as SDK resource ( see ContentStorePredefinedParams::SDKResource predefined parameter )
Returns
true if the content can be deleted

◆ deleteContent()

int gem::ContentStoreItem::deleteContent ( )
inlinenoexcept

Delete the associated content.

Operation is executed immediately, i.e. no notifications are thrown

Returns
KNoError when success.

◆ getAvailableSize()

LargeInteger gem::ContentStoreItem::getAvailableSize ( ) const
inlinenoexcept

Get the available size of the content in bytes.

Returns
The size of the downloaded content. This may or may not be equal with GetTotalSize.

◆ getChapterName()

const StringRef gem::ContentStoreItem::getChapterName ( ) const
inlinenoexcept

Get the product chapter name translated to interface language.

Items with same chapter name are considered to be part of the same group

Returns
The chapter name of the product.

◆ getClientVersion()

Version gem::ContentStoreItem::getClientVersion ( ) const
inlinenoexcept

Get the client version of the content.

Requires the content available size greater than zero.

Returns
The client version of the content if available, 0 otherwise.

◆ getContentParameters()

const SearchableParameterListRef gem::ContentStoreItem::getContentParameters ( ) const
inlinenoexcept

Get additional parameters for the content.

This is not available for all content types.

Returns
The additional parameters for the content.

◆ getCountryCodes()

const StringListRef gem::ContentStoreItem::getCountryCodes ( ) const
inlinenoexcept

Get the country code (ISO 3166-1 alpha-3) list of the product as text.

Remarks
Country code can be empty. This information can be used to render a country flag using MapDetails::getCountryFlag()
Returns
Country code(ISO 3166-1 alpha-3) of the product as text (empty for none).

◆ getDownloadProgress()

int gem::ContentStoreItem::getDownloadProgress ( ) const
inlinenoexcept

Get current download progress.

Returns
Current download progress

◆ getFileName()

const StringRef gem::ContentStoreItem::getFileName ( ) const
inlinenoexcept

Get the full path to the content data file when available.

Returns
The full path to the content data file.

◆ getId()

LargeInteger gem::ContentStoreItem::getId ( ) const
inlinenoexcept

Get the unique id of the item in the content store.

Returns
The content store item id.

◆ getImagePreview()

Image gem::ContentStoreItem::getImagePreview ( ) const
inlinenoexcept

Get the image preview if available.

Available only if isImagePreviewAvailable() returns true.

Returns
The resulting image

◆ getLanguage()

const LanguageRef gem::ContentStoreItem::getLanguage ( ) const
inlinenoexcept

Get the full language code for the product.

Remarks
Language code can be empty.
Returns
Full language code of the product (empty for none).

◆ getName()

const StringRef gem::ContentStoreItem::getName ( ) const
inlinenoexcept

Get the name of the associated product.

Remarks
The name is automatically translated based on the interface language.
Returns
The name of the product.

◆ getProgressListener()

ProgressListener gem::ContentStoreItem::getProgressListener ( ) const
inlinenoexcept

Gets the item progress listener.

Returns
The progress listener

◆ getStatus()

EContentStoreItemStatus gem::ContentStoreItem::getStatus ( ) const
inlinenoexcept

Gets current item status.

Returns
The current item status.

◆ getTotalSize()

LargeInteger gem::ContentStoreItem::getTotalSize ( ) const
inlinenoexcept

Get the size of the content in bytes.

Returns
The real size of the content. If the content is not available then it returns 0.

◆ getType()

EContentType gem::ContentStoreItem::getType ( ) const
inlinenoexcept

Get the type of the product as a EContentType value.

Returns
The type of the product.

◆ getUpdateItem()

const ContentStoreItemRef gem::ContentStoreItem::getUpdateItem ( ) const
inlinenoexcept

Get corresponding update item.

function will return a valid item only if an update is in progress for that item

Returns
The update item

◆ getUpdateSize()

LargeInteger gem::ContentStoreItem::getUpdateSize ( ) const
inlinenoexcept

Get update size ( if an update is available for this item ).

function will return a valid size ( != 0 ) only if item has a newer version in store

this function doesn't request an update to be started for the item

Returns
The update size

◆ getUpdateVersion()

Version gem::ContentStoreItem::getUpdateVersion ( ) const
inlinenoexcept

Gets update version ( if an update is available for this item ).

function will return a valid version ( != 0 ) only if item has a newer version in store

this function doesn't request an update to be started for the item

Returns
The update version

◆ isCompleted()

bool gem::ContentStoreItem::isCompleted ( ) const
inlinenoexcept

Check if the item is completed downloaded.

Returns
true if the download is completed

◆ isImagePreviewAvailable()

bool gem::ContentStoreItem::isImagePreviewAvailable ( ) const
inlinenoexcept

Check if there is an image preview available on the client.

Returns
true if an image preview is available.

◆ isUpdatable()

bool gem::ContentStoreItem::isUpdatable ( ) const
inlinenoexcept

Check if item is updatable, i.e.

it has a newer version available

Returns
true if the item is updatable

◆ operator!=()

bool gem::ContentStoreItem::operator!= ( const ContentStoreItem & obj) const
inline

Comparison operator not equal.

Parameters
objThe object to compare with
Returns
true if the objects are not equal

◆ operator=() [1/2]

ContentStoreItem & gem::ContentStoreItem::operator= ( const ContentStoreItem & v)
inline

Default copy assignment.

Parameters
vThe object to copy
Returns
The object that was copied

◆ operator=() [2/2]

ContentStoreItem & gem::ContentStoreItem::operator= ( ContentStoreItem && v)
default

Default move assignment noexcept is deduced.

Parameters
vThe object to move
Returns
The object that was moved

◆ operator==()

bool gem::ContentStoreItem::operator== ( const ContentStoreItem & obj) const
inline

Comparison operator equal.

Parameters
objThe object to compare with
Returns
true if the objects are equal

◆ pauseDownload()

int gem::ContentStoreItem::pauseDownload ( )
inlinenoexcept

Pause a previous download operation.

User will receive a onNotifyComplete( error::KSuspended )

Returns
KNoError when success.

◆ setProgressListener()

void gem::ContentStoreItem::setProgressListener ( ProgressListener listener)
inlinenoexcept

Sets the item progress listener.

Previous registered progress listener will not receive notifications anymore

Parameters
listenerThe listener object that implements the notification events associated with this operation