ArcGIS Runtime SDK for iOS: AGSPopupManager.h Source File
ArcGIS Runtime SDK for iOS  100.11
AGSPopupManager.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2021 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 
31 
32 
38 
44 typedef NS_ENUM(NSInteger, AGSPopupFeatureTypeChangeMode) {
47 };
48 
54 typedef NS_ENUM(NSInteger, AGSPopupValidationErrorCode) {
63 };
64 
66 @class AGSPopupField;
67 @class AGSPopup;
68 @class AGSFeatureType;
69 @class AGSDomain;
70 @class AGSFeatureTemplate;
71 @class AGSSymbol;
72 @class AGSSketchEditor;
74 
75 @protocol AGSPopupManagerDelegate;
76 @protocol AGSCancelable;
77 
78 #pragma mark -
79 #pragma mark Notifications / (Events)
80 #pragma mark -
81 
86 
91 
98 @interface AGSPopupManager : NSObject
99 
100 #pragma mark -
101 #pragma mark initializers
102 #pragma mark -
103 
104 
110 -(instancetype)initWithPopup:(AGSPopup *)popup;
111 
112 
113 #pragma mark -
114 #pragma mark properties
115 #pragma mark -
116 
120 @property (nullable, nonatomic, weak, readwrite) id<AGSPopupManagerDelegate> delegate;
121 
129 @property (nonatomic, unsafe_unretained, readonly) AGSPopup *popup;
130 
134 @property (nullable, nonatomic, strong, readonly) AGSPopupAttachmentManager *attachmentManager;
135 
136 
137 #pragma mark display properties
138 
139 
143 @property (nullable, nonatomic, strong, readonly) AGSFeatureType *featureType;
144 
148 @property (nonatomic, copy, readonly) NSArray<AGSPopupField*> *editableDisplayFields;
149 
153 @property (nonatomic, copy, readonly) NSArray<AGSPopupField*> *displayFields;
154 
155 
156 #pragma mark Strings that the popup view controller will use in the UI
157 
158 
162 @property (nullable, nonatomic, copy, readonly) NSString *title;
163 
171 @property (nullable, nonatomic, copy, readonly) NSString *customDescriptionHTML;
172 
176 @property (nullable, nonatomic, copy, readonly) NSString *editSummary;
177 
181 @property (nullable, nonatomic, strong, readonly) AGSSymbol *symbol;
182 
183 #pragma mark Properties for what UI the popup view controller should show
184 
185 
193 @property (nonatomic, assign, readonly) BOOL shouldAllowEdit;
194 
201 @property (nonatomic, assign, readonly) BOOL shouldAllowDelete;
202 
209 @property (nonatomic, assign, readonly) BOOL shouldAllowEditGeometry;
210 
217 @property (nonatomic, assign, readonly) BOOL shouldAllowEditAttachments;
218 
225 @property (nonatomic, assign, readonly) BOOL shouldShowAttachments;
226 
231 @property (nonatomic, assign, readonly) BOOL shouldShowMedia;
232 
237 @property (nonatomic, assign, readonly) BOOL shouldShowEditSummary;
238 
243 @property (nonatomic, assign, readonly) BOOL shouldShowCustomDescriptionHTML;
244 
245 #pragma mark editing properties
246 
250 @property (nonatomic, assign, readonly, getter=isEditing) BOOL editing;
251 
257 @property (nullable, nonatomic, strong, readonly) AGSSketchEditor *currentSketchEditor;
258 
262 @property (nonatomic, assign, readonly, getter=isGeoElementValid) BOOL geoElementValid;
263 
264 
265 #pragma mark -
266 #pragma mark methods
267 #pragma mark -
268 
269 
270 #pragma mark Value Helper Methods
271 
282 -(nullable NSString*)stringForTemplatedString:(NSString*)templatedString;
283 
289 -(nullable NSNumber*)numberFromString:(NSString*)stringValue field:(AGSPopupField*)popupField ;
290 
299 -(nullable NSNumber*)numberFromString:(NSString *)stringValue field:(AGSPopupField *)popupField error:(NSError**)error;
300 
311 -(NSString*)formattedValueForField:(AGSPopupField*)popupField;
312 
318 -(nullable id)valueForField:(AGSPopupField*)popupField;
319 
320 
321 #pragma mark Field Helper Methods
322 
323 
327 -(nullable AGSPopupField*)fieldForName:(NSString*)fieldName;
328 
332 -(AGSFieldType)fieldTypeForField:(AGSPopupField*)popupField;
333 
337 -(nullable AGSDomain*)domainForField:(AGSPopupField*)popupField;
338 
342 -(NSInteger)lengthForField:(AGSPopupField*)popupField;
343 
347 -(BOOL)fieldIsNullable:(AGSPopupField*)popupField;
348 
352 -(BOOL)fieldIsTypeIDField:(AGSPopupField*)popupField;
353 
357 -(NSString *)labelForField:(AGSPopupField *)popupField;
358 
359 #pragma mark Async Methods
360 
372 - (id<AGSCancelable>)evaluateExpressionsWithCompletion:(void(^)(NSArray<AGSPopupExpressionEvaluation *> * __nullable results, NSError * __nullable error))completion;
373 
374 #pragma mark -
375 #pragma mark Editing Methods
376 #pragma mark -
377 
378 
379 #pragma mark methods for starting, cancelling, finishing editing
380 
381 
386 -(BOOL)startEditing;
387 
392 -(void)cancelEditing;
393 
398 -(void)finishEditingWithCompletion:(void(^)(NSError * __nullable error))completion;
399 
400 
401 #pragma mark methods for updating the value in the geo-element when user changes values
402 
410 -(BOOL)updateValue:(nullable id)newValue field:(AGSPopupField*)popupField validationError:(NSError**)validationError;
411 
417 -(BOOL)featureTypeChangeRequiresUserNoficationForTemplate:(nullable AGSFeatureTemplate*)featureTemplate ;
418 
423 -(BOOL)featureTypeChangeRequiresUserNotificationForTemplate:(nullable AGSFeatureTemplate*)featureTemplate;
424 
429 -(BOOL)updateFeatureTypeWithTemplate:(nullable AGSFeatureTemplate*)featureTemplate changeMode:(AGSPopupFeatureTypeChangeMode)changeMode validationError:(NSError**)validationError;
430 
431 
432 #pragma mark methods for getting validation errors and messages
433 
434 
438 -(nullable NSError*)validationErrorForField:(AGSPopupField*)popupField;
439 
443 -(nullable NSError*)validationWarningForField:(AGSPopupField*)popupField;
444 
449 -(nullable NSString*)rangeValidationTextForField:(AGSPopupField*)popupField;
450 
451 @end
452 
460 @optional
461 
465 -(nullable AGSSketchEditor*)sketchEditorForPopupManager:(AGSPopupManager*)popupManager;
466 
470 -(void)popupManager:(AGSPopupManager*)popupManager validityDidChange:(BOOL)geoElementValid;
471 
475 -(void)popupManager:(AGSPopupManager*)popupManager featureTypeDidChange:(nullable AGSFeatureType*)featureType;
476 
477 @end
478 
479 
#define AGS_EXTERN
Definition: AGSDefines.h:28
AGSFieldType
Definition: AGSField.h:37
AGSPopupFeatureTypeChangeMode
Definition: AGSPopupManager.h:44
@ AGSPopupFeatureTypeChangeModeResetDefaultValues
Definition: AGSPopupManager.h:45
@ AGSPopupFeatureTypeChangeModeKeepValues
Definition: AGSPopupManager.h:46
AGSPopupValidationErrorCode
Definition: AGSPopupManager.h:54
@ AGSPopupValidationErrorExceedsMaxLength
Definition: AGSPopupManager.h:58
@ AGSPopupValidationErrorExceedsNumericMaximum
Definition: AGSPopupManager.h:60
@ AGSPopupValidationErrorInvalidNumericString
Definition: AGSPopupManager.h:59
@ AGSPopupValidationErrorLessThanNumericMinimum
Definition: AGSPopupManager.h:61
@ AGSPopupValidationErrorCodeInvalidGeoElement
Definition: AGSPopupManager.h:55
@ AGSPopupValidationErrorCodeNullNotAllowed
Definition: AGSPopupManager.h:56
@ AGSPopupValidationErrorIllegalDomainCode
Definition: AGSPopupManager.h:62
@ AGSPopupValidationErrorCodeValueOutOfRange
Definition: AGSPopupManager.h:57
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerFeatureTypeDidChangeNotification
Definition: AGSPopupManager.h:90
AGS_EXTERN NSString *const AGSPopupValidationErrorDomain
Definition: AGSPopupManager.h:37
AGS_EXTERN NSNotificationName _Nonnull const AGSPopupManagerGeoElementValidityDidChangeNotification
Definition: AGSPopupManager.h:76
information about a field's domain
Definition: AGSDomain.h:36
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:47
An object that represents the result of an attempt to evaluate popup expression.
Definition: AGSPopupExpressionEvaluation.h:39
Information about a field in a popup.
Definition: AGSPopupField.h:51
A popup which displays a geo-element's information.
Definition: AGSPopup.h:43
A popup manager.
Definition: AGSPopupManager.h:99
AGSFeatureType * featureType
Definition: AGSPopupManager.h:143
NSString * title
Definition: AGSPopupManager.h:162
BOOL shouldShowEditSummary
Definition: AGSPopupManager.h:237
BOOL shouldShowAttachments
Definition: AGSPopupManager.h:225
AGSPopup * popup
Definition: AGSPopupManager.h:129
BOOL shouldAllowEdit
Definition: AGSPopupManager.h:193
BOOL editing
Definition: AGSPopupManager.h:250
AGSSymbol * symbol
Definition: AGSPopupManager.h:181
BOOL shouldShowCustomDescriptionHTML
Definition: AGSPopupManager.h:243
AGSPopupAttachmentManager * attachmentManager
Definition: AGSPopupManager.h:134
NSArray< AGSPopupField * > * editableDisplayFields
Definition: AGSPopupManager.h:148
NSArray< AGSPopupField * > * displayFields
Definition: AGSPopupManager.h:153
BOOL shouldAllowEditGeometry
Definition: AGSPopupManager.h:209
BOOL shouldAllowEditAttachments
Definition: AGSPopupManager.h:217
BOOL shouldAllowDelete
Definition: AGSPopupManager.h:201
AGSSketchEditor * currentSketchEditor
Definition: AGSPopupManager.h:257
NSString * customDescriptionHTML
Definition: AGSPopupManager.h:171
BOOL shouldShowMedia
Definition: AGSPopupManager.h:231
BOOL geoElementValid
Definition: AGSPopupManager.h:262
NSString * editSummary
Definition: AGSPopupManager.h:176
id< AGSPopupManagerDelegate > delegate
Definition: AGSPopupManager.h:120
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:91
A protocol exposed by operations that allow cancellation.
Definition: AGSCancelable.h:38
A delegate of AGSPopupManager.
Definition: AGSPopupManager.h:459