//
//  main.m
//  OTCTestApp
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "OTCTestAppApp.h"
#import "TelephonyNotificationManagerImpl.h"
#import "TelephonyNotificationListener.h"

@class TelephonyNotificationManagerImpl;
@class SMSListener;

int main(int argc, char *argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    //Initializing the TelephonyNotificationManagerImpl
    TelephonyNotificationManagerImpl *manager = [[TelephonyNotificationManagerImpl alloc] init];
    
    //Start listening to the telephony notifications
    [manager startListeningToTelephonyNotifications];
    
    //Initializing listener for notifications
    TelephonyNotificationListener *telephonyNotificationListener = [[TelephonyNotificationListener alloc] init];
    //Adding listeners for notftication generated by TelephonyNotificationsManager
    [telephonyNotificationListener addListeners:manager];
    
    //Starting run loop
    CFRunLoopRun();
    
    //Cleaning up
    [telephonyNotificationListener cleanUp];

    [manager stopListeningToTelephonyNotifications];
    
    [telephonyNotificationListener release];
    [manager release];
    
    
    [pool release];
    return 0;
}
