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

CDVCommandDelegate.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 "CDVAvailability.h"
  18. #import "CDVInvokedUrlCommand.h"
  19. @class CDVPlugin;
  20. @class CDVPluginResult;
  21. @class CDVWhitelist;
  22. typedef NSURL* (^ UrlTransformerBlock)(NSURL*);
  23. @protocol CDVCommandDelegate <NSObject>
  24. @property (nonatomic, readonly) NSDictionary* settings;
  25. @property (nonatomic, copy) UrlTransformerBlock urlTransformer;
  26. - (NSString*)pathForResource:(NSString*)resourcepath;
  27. - (id)getCommandInstance:(NSString*)pluginName;
  28. // Sends a plugin result to the JS. This is thread-safe.
  29. - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
  30. // Evaluates the given JS. This is thread-safe.
  31. - (void)evalJs:(NSString*)js;
  32. // Can be used to evaluate JS right away instead of scheduling it on the run-loop.
  33. // This is required for dispatch resign and pause events, but should not be used
  34. // without reason. Without the run-loop delay, alerts used in JS callbacks may result
  35. // in dead-lock. This method must be called from the UI thread.
  36. - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
  37. // Runs the given block on a background thread using a shared thread-pool.
  38. - (void)runInBackground:(void (^)(void))block;
  39. @end