Skip To Content ArcGIS for Developers Sign In Dashboard

PopupAttachmentManager Class

(Esri::ArcGISRuntime::PopupAttachmentManager)

Manages PopupAttachments for a Popup. More...

Header: #include <PopupAttachmentManager>
Since: Esri::ArcGISRuntime 100.0
Inherits: Object

Properties

  • 1 property inherited from QObject

Public Functions

PopupAttachmentManager(ArcGISFeature *arcGISFeature, QObject *parent = nullptr)
~PopupAttachmentManager()
QUuid addAttachment(const QUrl &localFilePath, const QString &contentType, const QString &name)
PopupAttachment *addAttachment(const QImage &image, const QString &contentType, const QString &name)
PopupAttachment *addAttachment(const QByteArray &data, const QString &contentType, const QString &name)
QUuid applyChanges()
QList<PopupAttachment *> attachments() const
PopupAttachmentListModel *attachmentsModel() const
void deleteAttachment(PopupAttachment *popupAttachment)
QUuid fetchAttachments()
QList<PopupAttachment *> filterAttachments() const
void revertChanges()
  • 31 public functions inherited from QObject

Signals

void addAttachmentCompleted(QUuid taskId, Esri::ArcGISRuntime::PopupAttachment *popupAttachment)
void applyChangesCompleted(QUuid taskId, Esri::ArcGISRuntime::Error error)
void fetchAttachmentsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::PopupAttachment *> &popupAttachments)

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Manages PopupAttachments for a Popup.

In addition to the available constructors on PopupAttachmentManager, you can obtain a PopupAttachmentManager from PopupManager::attachmentManager.

Property Documentation

attachmentsModel : PopupAttachmentListModel * const

This property holds the PopupAttachmentListModel for this PopupAttachmentManager (read-only).

Access functions:

PopupAttachmentListModel *attachmentsModel() const

Member Function Documentation

PopupAttachmentManager::PopupAttachmentManager(ArcGISFeature *arcGISFeature, QObject *parent = nullptr)

Constructor that takes an arcGISFeature with an optional parent.

PopupAttachmentManager::~PopupAttachmentManager()

Destructor.

QUuid PopupAttachmentManager::addAttachment(const QUrl &localFilePath, const QString &contentType, const QString &name)

Asynchronously adds an attachment to the PopupAttachmentManager.

You must call applyChanges to apply the edits from the PopupAttachmentManager to the associated ArcGISFeatureTable. To undo any edits, call revertChanges.

  • localFilePath - The URL to the local data.
  • contentType - The type of data.
  • name - The name of the attachment.

The addAttachmentCompleted signal emits when this asynchronous operation completes. Use the returned QUuid to keep track of concurrent operations.

PopupAttachment *PopupAttachmentManager::addAttachment(const QImage &image, const QString &contentType, const QString &name)

Adds an attachment image to the PopupAttachmentManager.

You must call applyChanges to apply the edits from the PopupAttachmentManager to the associated ArcGISFeatureTable. To undo any edits, call revertChanges.

  • image - The image to add as an attachment.
  • contentType - The type of data.
  • name - The name of the attachment.

Note: This is a synchronous operation.

PopupAttachment *PopupAttachmentManager::addAttachment(const QByteArray &data, const QString &contentType, const QString &name)

Adds an attachment to the PopupAttachmentManager.

You must call applyChanges to apply the edits from the PopupAttachmentManager to the associated ArcGISFeatureTable. To undo any edits, call revertChanges.

  • data - The byte array of the data.
  • contentType - The type of data.
  • name - The name of the attachment.

Note: This is a synchronous operation.

[signal] void PopupAttachmentManager::addAttachmentCompleted(QUuid taskId, Esri::ArcGISRuntime::PopupAttachment *popupAttachment)

Signal emitted when an attachment from a local file has been added.

  • taskId - The task ID for the asynchronous operation.
  • popupAttachment - The PopupAttachment that has been added.

The returned PopupAttachment object has the PopupAttachmentManager as its parent.

See also Returned QObjects Parenting.

QUuid PopupAttachmentManager::applyChanges()

Applies the current changes in the PopupAttachmentManager to the ArcGISFeature in its ArcGISFeatureTable.

The applyChangesCompleted signal emits when this asynchronous operation completes. Use the returned QUuid to keep track of concurrent operations.

[signal] void PopupAttachmentManager::applyChangesCompleted(QUuid taskId, Esri::ArcGISRuntime::Error error)

Signal emitted when attachment changes are applied from the PopupAttachmentManager to the ArcGISFeature in the ArcGISFeatureTable.

  • taskId - The task ID for the asynchronous operation.
  • error - The Error object.

QList<PopupAttachment *> PopupAttachmentManager::attachments() const

Returns a list of all the PopupAttachments in the PopupAttachmentManager.

PopupAttachmentListModel *PopupAttachmentManager::attachmentsModel() const

A model that can be used to display popup attachment information in a view.

Any changes made by the PopupAttachmentManager will be reflected immediately by the model.

This function was introduced in Esri::ArcGISRuntime 100.1.

Note: Getter function for property attachmentsModel.

void PopupAttachmentManager::deleteAttachment(PopupAttachment *popupAttachment)

Deletes the given popupAttachment from the PopupAttachmentManager.

You must call applyChanges to apply the edits from the PopupAttachmentManager to the associated ArcGISFeatureTable. To undo any edits, call revertChanges.

QUuid PopupAttachmentManager::fetchAttachments()

Fetches the Attachments from the ArcGISFeature and creates PopupAttachments from them.

The fetchAttachmentsCompleted signal emits when this asynchronous operation completes. Use the returned QUuid to keep track of concurrent operations.

[signal] void PopupAttachmentManager::fetchAttachmentsCompleted(QUuid taskId, const QList<Esri::ArcGISRuntime::PopupAttachment *> &popupAttachments)

Signal emitted when the attachments have been fetched from the ArcGISFeature.

The returned PopupAttachment objects have the PopupAttachmentManager as their parent.

See also Returned QObjects Parenting.

QList<PopupAttachment *> PopupAttachmentManager::filterAttachments() const

Returns a filtered list of popup attachments in the PopupAttachmentManager in an alphabetically ascending order by name (read-only).

This list only includes attachments with specific content types, which are:

  • "image/jpg"
  • "image/jpeg"
  • "image/pjpeg"
  • "image/png"
  • "image/gif"
  • "video/quicktime"
  • "application/pdf"
  • "application/vnd.ms-excel"
  • "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  • "application/msword"
  • "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  • "application/vnd.ms-powerpoint"
  • "application/vnd.openxmlformats-officedocument.presentationml.presentation"
  • "text/html"

void PopupAttachmentManager::revertChanges()

Reverts the current working changes made to the Popup's attachments (such as addAttachment and deleteAttachment).

This does not reverse a call to applyChanges.


Feedback on this topic?