Manages PopupAttachments for a Popup. More...
Header: | #include <PopupAttachmentManager.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object |
Properties
- attachmentsModel : PopupAttachmentListModel* const
Public Functions
virtual | ~PopupAttachmentManager() override |
QUuid | addAttachment(const QUrl &localFilePath, const QString &contentType, const QString &name) |
Esri::ArcGISRuntime::PopupAttachment * | addAttachment(const QImage &image, const QString &contentType, const QString &name) |
Esri::ArcGISRuntime::PopupAttachment * | addAttachment(const QByteArray &data, const QString &contentType, const QString &name) |
QUuid | applyChanges() |
QList<Esri::ArcGISRuntime::PopupAttachment *> | attachments() const |
Esri::ArcGISRuntime::PopupAttachmentListModel * | attachmentsModel() const |
void | deleteAttachment(Esri::ArcGISRuntime::PopupAttachment *popupAttachment) |
QUuid | fetchAttachments() |
QList<Esri::ArcGISRuntime::PopupAttachment *> | filterAttachments() const |
void | revertChanges() |
Signals
void | addAttachmentCompleted(const QUuid &taskId, Esri::ArcGISRuntime::PopupAttachment *popupAttachment) |
void | applyChangesCompleted(const QUuid &taskId, const Esri::ArcGISRuntime::Error &error) |
void | fetchAttachmentsCompleted(const QUuid &taskId, const QList<Esri::ArcGISRuntime::PopupAttachment *> &popupAttachments) |
Detailed Description
In addition to the available constructors on PopupAttachmentManager, you can obtain a PopupAttachmentManager from PopupManager::attachmentManager.
Property Documentation
[read-only]
attachmentsModel : PopupAttachmentListModel * const
This property holds the PopupAttachmentListModel for this PopupAttachmentManager (read-only).
Access functions:
Esri::ArcGISRuntime::PopupAttachmentListModel * | attachmentsModel() const |
Member Function Documentation
[override virtual]
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.
Esri::ArcGISRuntime::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.
Esri::ArcGISRuntime::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 (const 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 (const QUuid &taskId , const 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<Esri::ArcGISRuntime::PopupAttachment *> PopupAttachmentManager::attachments() const
Returns a list of all the PopupAttachments in the PopupAttachmentManager.
[since Esri::ArcGISRuntime 100.1]
Esri::ArcGISRuntime::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.
Note: Getter function for property attachmentsModel.
This function was introduced in Esri::ArcGISRuntime 100.1.
void PopupAttachmentManager::deleteAttachment (Esri::ArcGISRuntime::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 (const QUuid &taskId , const QList<Esri::ArcGISRuntime::PopupAttachment *> &popupAttachments )
Signal emitted when the attachments have been fetched from the ArcGISFeature.
- taskId - The task ID for the asynchronous operation.
- popupAttachments - A list of PopupAttachments obtained from the ArcGISFeature.
The returned PopupAttachment objects have the PopupAttachmentManager as their parent.
See also Returned QObjects Parenting.
QList<Esri::ArcGISRuntime::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.