ArcGIS Runtime SDK for iOS: AGSPopupManager.h Source File
ArcGIS Runtime SDK for iOS  100.15
AGSPopupManager.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2022 ESRI
3 
4  All rights reserved under the copyright laws of the United States
5  and applicable international laws, treaties, and conventions.
6 
7  This material is licensed for use under the Esri Master License
8  Agreement (MLA), and is bound by the terms of that agreement.
9  You may redistribute and use this code without modification,
10  provided you adhere to the terms of the MLA and include this
11  copyright notice.
12 
13  See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
14 
15  For additional information, contact:
16  Environmental Systems Research Institute, Inc.
17  Attn: Contracts and Legal Services Department
18  380 New York Street
19  Redlands, California, 92373
20  USA
21 
22  email: contracts@esri.com
23  */
24  //Required for Globals API doc
26 
27 #import <Foundation/Foundation.h>
28 #import <ArcGIS/AGSDefines.h>
29 #import <ArcGIS/AGSField.h>
30 #import <ArcGIS/AGSCancelable.h>
31 
32 
33 
39 
45 typedef NS_ENUM(NSInteger, AGSPopupFeatureTypeChangeMode) {
48 };
49 
55 typedef NS_ENUM(NSInteger, AGSPopupValidationErrorCode) {
65 };
66 
68 @class AGSPopupField;
69 @class AGSPopup;
70 @class AGSFeatureType;
71 @class AGSDomain;
72 @class AGSFeatureTemplate;
73 @class AGSSymbol;
74 @class AGSSketchEditor;
77 @class AGSPopupElement;
78 
79 @protocol AGSPopupManagerDelegate;
80 
81 #pragma mark -
82 #pragma mark Notifications / (Events)
83 #pragma mark -
84 
89 
94 
99 
104 
109 
116 @interface AGSPopupManager : NSObject
117 
118 #pragma mark -
119 #pragma mark initializers
120 #pragma mark -
121 
122 
128 -(instancetype)initWithPopup:(AGSPopup *)popup;
129 
130 
131 #pragma mark -
132 #pragma mark properties
133 #pragma mark -
134 
138 @property (nullable, nonatomic, weak, readwrite) id<AGSPopupManagerDelegate> delegate;
139 
147 @property (nonatomic, unsafe_unretained, readonly) AGSPopup *popup;
148 
152 @property (nullable, nonatomic, strong, readonly) AGSPopupAttachmentManager *attachmentManager;
153 
172 @property (nonatomic, copy, readonly) NSArray<AGSPopupElement *> *evaluatedElements;
173 
174 
175 #pragma mark display properties
176 
177 
181 @property (nullable, nonatomic, strong, readonly) AGSFeatureType *featureType;
182 
186 @property (nonatomic, copy, readonly) NSArray<AGSPopupField*> *editableDisplayFields;
187 
191 @property (nonatomic, copy, readonly) NSArray<AGSPopupField*> *displayFields;
192 
193 
194 #pragma mark Strings that the popup view controller will use in the UI
195 
196 
200 @property (nullable, nonatomic, copy, readonly) NSString *title;
201 
209 @property (nullable, nonatomic, copy, readonly) NSString *customDescriptionHTML;
210 
214 @property (nullable, nonatomic, copy, readonly) NSString *editSummary;
215 
219 @property (nullable, nonatomic, strong, readonly) AGSSymbol *symbol;
220 
221 #pragma mark Properties for what UI the popup view controller should show
222 
223 
231 @property (nonatomic, assign, readonly) BOOL shouldAllowEdit;
232 
239 @property (nonatomic, assign, readonly) BOOL shouldAllowDelete;
240 
247 @property (nonatomic, assign, readonly) BOOL shouldAllowEditGeometry;
248 
255 @property (nonatomic, assign, readonly) BOOL shouldAllowEditAttachments;
256 
263 @property (nonatomic, assign, readonly) BOOL shouldShowAttachments;
264 
269 @property (nonatomic, assign, readonly) BOOL shouldShowMedia;
270 
275 @property (nonatomic, assign, readonly) BOOL shouldShowEditSummary;
276 
281 @property (nonatomic, assign, readonly) BOOL shouldShowCustomDescriptionHTML;
282 
283 #pragma mark editing properties
284 
288 @property (nonatomic, assign, readonly, getter=isEditing) BOOL editing;
289 
295 @property (nullable, nonatomic, strong, readonly) AGSSketchEditor *currentSketchEditor;
296 
300 @property (nonatomic, assign, readonly, getter=isGeoElementValid) BOOL geoElementValid;
301 
302 
307 @property (nonatomic, copy, readonly) NSDictionary<NSString *, NSError *> *contingencyValidationErrors;
308 
313 @property (nonatomic, copy, readonly) NSDictionary<NSString *, NSError *> *contingencyValidationWarnings;
314 
315 #pragma mark -
316 #pragma mark methods
317 #pragma mark -
318 
319 
320 #pragma mark Value Helper Methods
321 
332 -(nullable NSString*)stringForTemplatedString:(NSString*)templatedString;
333 
339 -(nullable NSNumber*)numberFromString:(NSString*)stringValue field:(AGSPopupField*)popupField ;
340 
349 -(nullable NSNumber*)numberFromString:(NSString *)stringValue field:(AGSPopupField *)popupField error:(NSError**)error;
350 
361 -(NSString*)formattedValueForField:(AGSPopupField*)popupField;
362 
371 -(nullable id)valueForField:(AGSPopupField*)popupField;
372 
387 - (nullable id)valueForFieldName:(NSString *)fieldName
388  popupElement:(AGSPopupElement *)popupElement;
389 
390 #pragma mark Field Helper Methods
391 
392 
396 -(nullable AGSPopupField*)fieldForName:(NSString*)fieldName;
397 
401 -(AGSFieldType)fieldTypeForField:(AGSPopupField*)popupField;
402 
406 -(nullable AGSDomain*)domainForField:(AGSPopupField*)popupField;
407 
411 -(NSInteger)lengthForField:(AGSPopupField*)popupField;
412 
416 -(BOOL)fieldIsNullable:(AGSPopupField*)popupField;
417 
421 -(BOOL)fieldIsTypeIDField:(AGSPopupField*)popupField;
422 
426 -(NSString *)labelForField:(AGSPopupField *)popupField;
427 
428 #pragma mark Contingent Value Helper Methods
429 
433 - (BOOL)isFieldInFieldGroup:(AGSPopupField *)popupField;
434 
441 - (nullable AGSContingentValuesResult *)contingentValuesResultForField:(AGSPopupField *)popupField;
442 
443 #pragma mark Async Methods
444 
456 - (id<AGSCancelable>)evaluateExpressionsWithCompletion:(void(^)(NSArray<AGSPopupExpressionEvaluation *> * __nullable results, NSError * __nullable error))completion;
457 
458 #pragma mark -
459 #pragma mark Editing Methods
460 #pragma mark -
461 
462 
463 #pragma mark methods for starting, cancelling, finishing editing
464 
465 
470 -(BOOL)startEditing;
471 
476 -(void)cancelEditing;
477 
482 -(void)finishEditingWithCompletion:(void(^)(NSError * __nullable error))completion;
483 
484 
485 #pragma mark methods for updating the value in the geoelement when user changes values
486 
494 -(BOOL)updateValue:(nullable id)newValue field:(AGSPopupField*)popupField validationError:(NSError**)validationError;
495 
501 -(BOOL)featureTypeChangeRequiresUserNoficationForTemplate:(nullable AGSFeatureTemplate*)featureTemplate ;
502 
507 -(BOOL)featureTypeChangeRequiresUserNotificationForTemplate:(nullable AGSFeatureTemplate*)featureTemplate;
508 
513 -(BOOL)updateFeatureTypeWithTemplate:(nullable AGSFeatureTemplate*)featureTemplate changeMode:(AGSPopupFeatureTypeChangeMode)changeMode validationError:(NSError**)validationError;
514 
515 
516 #pragma mark methods for getting validation errors and messages
517 
518 
522 -(nullable NSError*)validationErrorForField:(AGSPopupField*)popupField;
523 
527 -(nullable NSError*)validationWarningForField:(AGSPopupField*)popupField;
528 
533 -(nullable NSString*)rangeValidationTextForField:(AGSPopupField*)popupField;
534 
535 @end
536 
544 @optional
545 
549 -(nullable AGSSketchEditor*)sketchEditorForPopupManager:(AGSPopupManager*)popupManager;
550 
554 -(void)popupManager:(AGSPopupManager*)popupManager validityDidChange:(BOOL)geoElementValid;
555 
559 -(void)popupManager:(AGSPopupManager*)popupManager featureTypeDidChange:(nullable AGSFeatureType*)featureType;
560 
561 @end
562 
563 
#define AGS_EXTERN
Definition: AGSDefines.h:28
AGSFieldType
Definition: AGSField.h:37
AGSPopupFeatureTypeChangeMode
Definition: AGSPopupManager.h:45
@ AGSPopupFeatureTypeChangeModeResetDefaultValues
Definition: AGSPopupManager.h:46
@ AGSPopupFeatureTypeChangeModeKeepValues
Definition: AGSPopupManager.h:47
AGSPopupValidationErrorCode
Definition: AGSPopupManager.h:55
@ AGSPopupValidationErrorContingencyValidationFailure
Definition: AGSPopupManager.h:64
@ AGSPopupValidationErrorExceedsMaxLength
Definition: AGSPopupManager.h:59
@ AGSPopupValidationErrorExceedsNumericMaximum
Definition: AGSPopupManager.h:61
@ AGSPopupValidationErrorInvalidNumericString
Definition: AGSPopupManager.h:60
@ AGSPopupValidationErrorLessThanNumericMinimum
Definition: AGSPopupManager.h:62
@ AGSPopupValidationErrorCodeInvalidGeoElement
Definition: AGSPopupManager.h:56
@ AGSPopupValidationErrorCodeNullNotAllowed
Definition: AGSPopupManager.h:57
@ AGSPopupValidationErrorIllegalDomainCode
Definition: AGSPopupManager.h:63
@ AGSPopupValidationErrorCodeValueOutOfRange
Definition: AGSPopupManager.h:58
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerGeoElementWarningsDidChangeNotification
Definition: AGSPopupManager.h:98
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerGeoElementContingencyValidationWarningsDidChangeNotification
Definition: AGSPopupManager.h:108
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerGeoElementContingencyValidationErrorsDidChangeNotification
Definition: AGSPopupManager.h:103
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerFeatureTypeDidChangeNotification
Definition: AGSPopupManager.h:93
AGS_EXTERN NSString *const AGSPopupValidationErrorDomain
Definition: AGSPopupManager.h:38
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerGeoElementValidityDidChangeNotification
Definition: AGSPopupManager.h:79
An object that defines possible values for a field in the context of the contingent field groups it p...
Definition: AGSContingentValuesResult.h:39
information about a field's domain
Definition: AGSDomain.h:37
Represents all of the information needed to create a feature.
Definition: AGSFeatureTemplate.h:64
Encapsulates properties of types of features in a feature layer.
Definition: AGSFeatureType.h:41
Manages attachments belonging to a popup.
Definition: AGSPopupAttachmentManager.h:46
Represents an element that is displayed in a pop-up for a geoelement.
Definition: AGSPopupElement.h:37
The result of an attempt to evaluate popup expression.
Definition: AGSPopupExpressionEvaluation.h:41
Information about a field in a popup.
Definition: AGSPopupField.h:51
A popup which displays a geo-element's information.
Definition: AGSPopup.h:44
A popup manager.
Definition: AGSPopupManager.h:117
AGSFeatureType * featureType
Definition: AGSPopupManager.h:181
NSString * title
Definition: AGSPopupManager.h:200
NSDictionary< NSString *, NSError * > * contingencyValidationErrors
Definition: AGSPopupManager.h:307
BOOL shouldShowEditSummary
Definition: AGSPopupManager.h:275
BOOL shouldShowAttachments
Definition: AGSPopupManager.h:263
AGSPopup * popup
Definition: AGSPopupManager.h:147
BOOL shouldAllowEdit
Definition: AGSPopupManager.h:231
BOOL editing
Definition: AGSPopupManager.h:288
AGSSymbol * symbol
Definition: AGSPopupManager.h:219
BOOL shouldShowCustomDescriptionHTML
Definition: AGSPopupManager.h:281
AGSPopupAttachmentManager * attachmentManager
Definition: AGSPopupManager.h:152
NSArray< AGSPopupField * > * editableDisplayFields
Definition: AGSPopupManager.h:186
NSArray< AGSPopupField * > * displayFields
Definition: AGSPopupManager.h:191
BOOL shouldAllowEditGeometry
Definition: AGSPopupManager.h:247
BOOL shouldAllowEditAttachments
Definition: AGSPopupManager.h:255
NSDictionary< NSString *, NSError * > * contingencyValidationWarnings
Definition: AGSPopupManager.h:313
NSArray< AGSPopupElement * > * evaluatedElements
Definition: AGSPopupManager.h:172
BOOL shouldAllowDelete
Definition: AGSPopupManager.h:239
AGSSketchEditor * currentSketchEditor
Definition: AGSPopupManager.h:295
NSString * customDescriptionHTML
Definition: AGSPopupManager.h:209
BOOL shouldShowMedia
Definition: AGSPopupManager.h:269
BOOL geoElementValid
Definition: AGSPopupManager.h:300
NSString * editSummary
Definition: AGSPopupManager.h:214
id< AGSPopupManagerDelegate > delegate
Definition: AGSPopupManager.h:138
A class that allows the user to sketch geometries on the map.
Definition: AGSSketchEditor.h:75
A symbol used to display a graphic or a feature.
Definition: AGSSymbol.h:93
A protocol exposed by operations that allow cancellation.
Definition: AGSCancelable.h:38
A delegate of AGSPopupManager.
Definition: AGSPopupManager.h:543