diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..227cba8 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,37 @@ + + + + Mobile Accessibility + PhoneGap Mobile Accessibility Plugin + Apache 2.0 + phonegap, mobile accessibility + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ios/CDVMobileAccessibility.h b/src/ios/CDVMobileAccessibility.h new file mode 100644 index 0000000..2d5bc1c --- /dev/null +++ b/src/ios/CDVMobileAccessibility.h @@ -0,0 +1,27 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import + +@interface CDVMobileAccessibility : CDVPlugin { +} + +- (void) isVoiceOverRunning:(CDVInvokedUrlCommand*)command; + +@end diff --git a/src/ios/CDVMobileAccessibility.m b/src/ios/CDVMobileAccessibility.m new file mode 100644 index 0000000..38dbd68 --- /dev/null +++ b/src/ios/CDVMobileAccessibility.m @@ -0,0 +1,64 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + */ + +#import "CDVMobileAccessibility.h" +#import + +@interface CDVMobileAccessibility () +// add any property overrides +@end + +@implementation CDVMobileAccessibility + +// ////////////////////////////////////////////////// + +- (id)settingForKey:(NSString*)key +{ + return [self.commandDelegate.settings objectForKey:[key lowercaseString]]; +} + +- (void)pluginInitialize +{ + // SETTINGS //////////////////////// + + NSString* setting = nil; + + setting = @"YourConfigXmlSettingHere"; + if ([self settingForKey:setting]) { + // set your setting, other init here + } +} + +// ////////////////////////////////////////////////// + +- (void)dealloc +{ + // since this is ARC, remove observers only +} + +// ////////////////////////////////////////////////// + +#pragma Plugin interface + +- (void) isVoiceOverRunning:(CDVInvokedUrlCommand*)command +{ + // TODO: +} + +@end diff --git a/www/mobile-accessibility.js b/www/mobile-accessibility.js new file mode 100644 index 0000000..5944e47 --- /dev/null +++ b/www/mobile-accessibility.js @@ -0,0 +1,33 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var argscheck = require('cordova/argscheck'), + utils = require('cordova/utils'), + exec = require('cordova/exec'); + +var MobileAccessibility = function() { +}; + +MobileAccessibility.isVoiceOverRunning = function() { + exec(null, null, "MobileAccessibility", "isVoiceOverRunning", []); +}; + +module.exports = MobileAccessibility;