ContentStoreObject

Objective-C


@interface ContentStoreObject : NSObject

Swift

class ContentStoreObject : NSObject

This class encapsulates position information.

  • Initializes and returns a newly allocated object using the model data.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithModelData:(nonnull void *)data;
  • Returns the model data.

    Declaration

    Objective-C

    - (nullable void *)getModelData;

    Swift

    func getModelData() -> UnsafeMutableRawPointer?
  • The delegate for the content store object.

    Declaration

    Objective-C

    @property (nonatomic, weak) NSObject<ContentStoreObjectDelegate> *_Nullable delegate;

    Swift

    weak var delegate: (any ContentStoreObjectDelegate)? { get set }
  • Returns the identifier of the content store object.

    Declaration

    Objective-C

    - (NSInteger)getIdentifier;

    Swift

    func getIdentifier() -> Int
  • Returns the name of the content store object.

    Declaration

    Objective-C

    - (nonnull NSString *)getName;

    Swift

    func getName() -> String
  • Returns the type of the content store object.

    Declaration

    Objective-C

    - (ContentStoreOnlineType)getType;

    Swift

    func getType() -> ContentStoreOnlineType
  • Returns the image preview of the content store object.

    Declaration

    Objective-C

    - (nullable UIImage *)getImagePreview:(CGFloat)width;

    Swift

    func getImagePreview(_ width: CGFloat) -> UIImage?

    Parameters

    width

    The desired image width in pixels.

  • Async returns the image preview of the content store object on the completion handler. In case the image preview is already available the method will return the image immediately.

    Declaration

    Objective-C

    - (nullable UIImage *)getAsyncImagePreview:(CGFloat)width
                             completionHandler:
                                 (nonnull void (^)(UIImage *_Nullable))handler;

    Swift

    func getAsyncImagePreview(_ width: CGFloat, completionHandler handler: @escaping (UIImage?) -> Void) -> UIImage?

    Parameters

    width

    The desired image width in pixels.

    handler

    The async completion handler.

  • Returns true if the image preview is available.

    Declaration

    Objective-C

    - (BOOL)isImagePreviewAvailable;

    Swift

    func isImagePreviewAvailable() -> Bool
  • Returns the product chapter name translated to interface language.

    Declaration

    Objective-C

    - (nonnull NSString *)getChapterName;

    Swift

    func getChapterName() -> String
  • Returns the country code (ISO 3166-1 alpha-3 ) list of the product as text.

    Declaration

    Objective-C

    - (nonnull NSArray<NSString *> *)getCountryCodes;

    Swift

    func getCountryCodes() -> [String]
  • Returns the full path to the content data file when available.

    Declaration

    Objective-C

    - (nonnull NSString *)getFileName;

    Swift

    func getFileName() -> String
  • Returns the client version of the content.

    Declaration

    Objective-C

    - (nonnull NSString *)getClientVersion;

    Swift

    func getClientVersion() -> String
  • Returns the size of the content in bytes.

    Declaration

    Objective-C

    - (NSInteger)getTotalSize;

    Swift

    func getTotalSize() -> Int
  • Returns the size of the content formatted.

    Declaration

    Objective-C

    - (nonnull NSString *)getTotalSizeFormatted;

    Swift

    func getTotalSizeFormatted() -> String
  • Returns the available size of the content in bytes. The size of the downloaded content.

    Declaration

    Objective-C

    - (NSInteger)getAvailableSize;

    Swift

    func getAvailableSize() -> Int
  • Returns true if the item is completed downloaded.

    Declaration

    Objective-C

    - (BOOL)isCompleted;

    Swift

    func isCompleted() -> Bool
  • Asynchronous start / resume the download of the content store object.

    Declaration

    Objective-C

    - (void)downloadWithAllowCellularNetwork:(BOOL)allowCellularNetwork
                           completionHandler:(nonnull void (^)(BOOL))handler;

    Swift

    func download(withAllowCellularNetwork allowCellularNetwork: Bool) async -> Bool

    Parameters

    allowCellularNetwork

    The flag whether to allow charged networks.

    handler

    The block to execute asynchronously with the result.

  • Asynchronous start / resume the download of the content store object.

    Declaration

    Objective-C

    - (void)downloadWithAllowCellularNetwork:(BOOL)allowCellularNetwork
                             progressHandler:(nonnull void (^)(int))progressHandler
                           completionHandler:
                               (nonnull void (^)(BOOL))completionHandler;

    Swift

    func download(withAllowCellularNetwork allowCellularNetwork: Bool, progressHandler: @escaping (Int32) -> Void) async -> Bool

    Parameters

    allowCellularNetwork

    The flag whether to allow charged networks.

    progressHandler

    The block to execute asynchronously with the progress download.

    completionHandler

    The block to execute asynchronously with the result.

  • Asynchronous start / resume the download of the content store object.

    Declaration

    Objective-C

    - (void)downloadWithAllowCellularNetwork:(BOOL)allowCellularNetwork
                             progressHandler:(nonnull void (^)(int))progressHandler
                                    priority:(ContentDownloadThreadPriority)priority
                           completionHandler:
                               (nonnull void (^)(BOOL))completionHandler;

    Swift

    func download(withAllowCellularNetwork allowCellularNetwork: Bool, progressHandler: @escaping (Int32) -> Void, priority: ContentDownloadThreadPriority) async -> Bool

    Parameters

    allowCellularNetwork

    The flag whether to allow charged networks.

    progressHandler

    The block to execute asynchronously with the progress download.

    priority

    Download thread priority, default OS value.

    completionHandler

    The block to execute asynchronously with the result.

  • Returns the current item status.

    Declaration

    Objective-C

    - (ContentStoreObjectStatus)getStatus;

    Swift

    func getStatus() -> ContentStoreObjectStatus
  • Pause a previous download operation.

    Declaration

    Objective-C

    - (void)pauseDownload;

    Swift

    func pauseDownload()
  • Cancel a previous download operation. The partially downloaded content is deleted.

    Declaration

    Objective-C

    - (void)cancelDownload;

    Swift

    func cancelDownload()
  • Returns the current download progress.

    Declaration

    Objective-C

    - (int)getDownloadProgress;

    Swift

    func getDownloadProgress() -> Int32
  • Returns true if content can be deleted.

    Declaration

    Objective-C

    - (BOOL)canDeleteContent;

    Swift

    func canDeleteContent() -> Bool
  • Delete the associated content.

    Declaration

    Objective-C

    - (void)deleteContent;

    Swift

    func deleteContent()
  • Returns the corresponding update item. @details The function will return an valid item only if an update is in progress for that item.

    Declaration

    Objective-C

    - (nullable ContentStoreObject *)getUpdateItem;

    Swift

    func getUpdateItem() -> ContentStoreObject?
  • Check if item is updatable, i.e. it has a newer version available.

    Declaration

    Objective-C

    - (BOOL)isUpdatable;

    Swift

    func isUpdatable() -> Bool
  • Returns the update size ( if an update is available for this item ). @details The function will return a valid size ( != 0 ) only if item has a newer version in store. @details This function doesn’t request an update to be started for the item.

    Declaration

    Objective-C

    - (NSInteger)getUpdateSize;

    Swift

    func getUpdateSize() -> Int
  • Returns the update size string formatted ( if an update is available for this item ). @details The function will return a valid size ( != 0 ) only if item has a newer version in store. @details This function doesn’t request an update to be started for the item.

    Declaration

    Objective-C

    - (nonnull NSString *)getUpdateSizeFormatted;

    Swift

    func getUpdateSizeFormatted() -> String
  • Returns the update version string ( if an update is available for this item ). @details The function will return a valid version ( != 0 ) only if item has a newer version in store. @details The function doesn’t request an update to be started for the item

    Declaration

    Objective-C

    - (nonnull NSString *)getUpdateVersion;

    Swift

    func getUpdateVersion() -> String
  • Returns true if the content store object style is dark.

    Declaration

    Objective-C

    - (BOOL)isNightStyle;

    Swift

    func isNightStyle() -> Bool