Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

CDVInvokedUrlCommand.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. */
  17. #import <Foundation/Foundation.h>
  18. @interface CDVInvokedUrlCommand : NSObject {
  19. NSString* _callbackId;
  20. NSString* _className;
  21. NSString* _methodName;
  22. NSArray* _arguments;
  23. }
  24. @property (nonatomic, readonly) NSArray* arguments;
  25. @property (nonatomic, readonly) NSString* callbackId;
  26. @property (nonatomic, readonly) NSString* className;
  27. @property (nonatomic, readonly) NSString* methodName;
  28. + (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry;
  29. - (id)initWithArguments:(NSArray*)arguments
  30. callbackId:(NSString*)callbackId
  31. className:(NSString*)className
  32. methodName:(NSString*)methodName;
  33. - (id)initFromJson:(NSArray*)jsonEntry;
  34. // Returns the argument at the given index.
  35. // If index >= the number of arguments, returns nil.
  36. // If the argument at the given index is NSNull, returns nil.
  37. - (id)argumentAtIndex:(NSUInteger)index;
  38. // Same as above, but returns defaultValue instead of nil.
  39. - (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue;
  40. // Same as above, but returns defaultValue instead of nil, and if the argument is not of the expected class, returns defaultValue
  41. - (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass;
  42. @end