Removing no-longer-working and generally-unused `diagnose_project` script
[cordova-ios.git] / CordovaLib / Classes / CDVPlugin.h
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
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 */
19
20 #import <Foundation/Foundation.h>
21 #import <UIKit/UIKit.h>
22 #import "CDVPluginResult.h"
23 #import "NSMutableArray+QueueAdditions.h"
24 #import "CDVCommandDelegate.h"
25
26 #define CDVPluginHandleOpenURLNotification @"CDVPluginHandleOpenURLNotification"
27
28 #define VERIFY_ARGUMENTS(args, expectedCount, callbackId) if (![self verifyArguments:args withExpectedCount:expectedCount andCallbackId:callbackId \
29 callerFileName:__FILE__ callerFunctionName:__PRETTY_FUNCTION__]) { return; }
30
31
32 @interface CDVPlugin : NSObject {
33 }
34
35 @property (nonatomic, retain) UIWebView* webView;
36 @property (nonatomic, retain) NSDictionary* settings;
37 @property (nonatomic, retain) UIViewController* viewController;
38 @property (nonatomic, retain) id<CDVCommandDelegate> commandDelegate;
39
40 - (CDVPlugin*) initWithWebView:(UIWebView*)theWebView settings:(NSDictionary*)classSettings;
41 - (CDVPlugin*) initWithWebView:(UIWebView*)theWebView;
42
43 - (void) handleOpenURL:(NSNotification*)notification;
44 - (void) onAppTerminate;
45 - (void) onMemoryWarning;
46
47 /*
48 // see initWithWebView implementation
49 - (void) onPause {}
50 - (void) onResume {}
51 - (void) onOrientationWillChange {}
52 - (void) onOrientationDidChange {}
53 */
54
55 - (id) appDelegate;
56 - (UIViewController*) appViewController __attribute__((deprecated)); /* just use the .viewController property in the future */
57
58 - (NSString*) writeJavascript:(NSString*)javascript;
59 - (NSString*) success:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId;
60 - (NSString*) error:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId;
61
62 - (BOOL) verifyArguments:(NSMutableArray*)arguments withExpectedCount:(NSUInteger)expectedCount andCallbackId:(NSString*)callbackId
63 callerFileName:(const char*)callerFileName callerFunctionName:(const char*)callerFunctionName;
64
65 @end

Copyright 2016, The Apache Software Foundation.