Sha256: 31f2c7b5dc0a9d3ad1c2e3bbcf9858f37584476fb1ef324f82b743369e9191cc

Contents?: true

Size: 1.74 KB

Versions: 17

Compression:

Stored size: 1.74 KB

Contents

//
//  RhoExtManagerImpl.m
//  RhoAppBaseLib
//
//  Created by Dmitry Soldatenkov on 12.05.14.
//
//

#import "RhoExtManagerImpl.h"

@implementation RhoExtManagerImpl

@synthesize mExtensions;

-(id) init {
    self = [super init];
    
    self.mExtensions = [NSMutableSet setWithCapacity:32];
    
    
    return self;
}


-(void) registerExtension:(id<IRhoExtension>)extension {
    [mExtensions addObject:extension];
}

-(void) unregisterExtension:(id<IRhoExtension>)extension {
    [mExtensions removeObject:extension];
}

-(BOOL) onBeforeNavigate:(NSString*)url tabIndex:(int)tabIndex {
    BOOL res = NO;
    
    NSEnumerator* enumerator = [self.mExtensions objectEnumerator];
    
    id<IRhoExtension> ext = [enumerator nextObject];
    while (ext != nil) {
        res = res || [ext onBeforeNavigate:url tabIndex:tabIndex];
        
        ext = [enumerator nextObject];
    }
    
    return res;
}

- (void) applicationDidBecomeActive:(UIApplication *)application
{
    NSEnumerator* enumerator = [self.mExtensions objectEnumerator];
    
    id<IRhoExtension> ext = [enumerator nextObject];
    while (ext != nil) {
        [ext applicationDidBecomeActive:application];
        
        ext = [enumerator nextObject];
    }
    
}

- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    BOOL res = NO;
    
    NSEnumerator* enumerator = [self.mExtensions objectEnumerator];
    
    id<IRhoExtension> ext = [enumerator nextObject];
    while (ext != nil) {
        res = res || [ext application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
        
        ext = [enumerator nextObject];
    }
    
    return res;
}



@end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rhodes-7.6.0 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-7.5.1 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-7.4.1 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-7.1.17 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-6.2.0 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-6.0.11 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.18 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.17 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.15 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.0.22 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.2 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.0.7 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.0.3 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
rhodes-5.5.0 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
tauplatform-1.0.3 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
tauplatform-1.0.2 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m
tauplatform-1.0.1 platform/iphone/Classes/RhoExtManager/RhoExtManagerImpl.m