[Libreoffice-commits] core.git: 6 commits - ios/iosremote

siqi me at siqi.fr
Tue Jun 4 04:50:29 PDT 2013


 ios/iosremote/iosremote.xcodeproj/project.pbxproj                 |  354 ++++++++++
 ios/iosremote/iosremote/Communication/.DS_Store                   |binary
 ios/iosremote/iosremote/Communication/Client.h                    |   24 
 ios/iosremote/iosremote/Communication/Client.m                    |  139 +++
 ios/iosremote/iosremote/Communication/CommunicationManager.h      |   13 
 ios/iosremote/iosremote/Communication/CommunicationManager.m      |   13 
 ios/iosremote/iosremote/Communication/Receiver.h                  |   13 
 ios/iosremote/iosremote/Communication/Receiver.m                  |   13 
 ios/iosremote/iosremote/Communication/Server.h                    |   23 
 ios/iosremote/iosremote/Communication/Server.m                    |   36 +
 ios/iosremote/iosremote/Default-568h at 2x.png                       |binary
 ios/iosremote/iosremote/Default.png                               |binary
 ios/iosremote/iosremote/Default at 2x.png                            |binary
 ios/iosremote/iosremote/en.lproj/InfoPlist.strings                |    2 
 ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard   |   72 ++
 ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard |   26 
 ios/iosremote/iosremote/iosremote-Info.plist                      |   49 +
 ios/iosremote/iosremote/iosremote-Prefix.pch                      |   14 
 ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.h         |   15 
 ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.m         |   46 +
 ios/iosremote/iosremote/libreoffice_sdremoteViewController.h      |   17 
 ios/iosremote/iosremote/libreoffice_sdremoteViewController.m      |   44 +
 ios/iosremote/iosremote/main.m                                    |   18 
 23 files changed, 931 insertions(+)

New commits:
commit 88f13ea2173bd203cfa0f97f0bef890dcc3f6262
Author: siqi <me at siqi.fr>
Date:   Tue Jun 4 13:47:12 2013 +0200

    communication files

diff --git a/ios/iosremote/iosremote/Communication/.DS_Store b/ios/iosremote/iosremote/Communication/.DS_Store
new file mode 100644
index 0000000..bbb5276
Binary files /dev/null and b/ios/iosremote/iosremote/Communication/.DS_Store differ
diff --git a/ios/iosremote/iosremote/Communication/Client.h b/ios/iosremote/iosremote/Communication/Client.h
new file mode 100644
index 0000000..3827b2f
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Client.h
@@ -0,0 +1,24 @@
+//
+//  Client.h
+//  
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "Server.h"
+#import "CommunicationManager.h"
+#import "Receiver.h"
+
+ at interface Client : NSObject
+
+-(void) connect;
+
+- (id) initWithServer:(Server*)server
+            managedBy:(CommunicationManager*)manager
+        interpretedBy:(Receiver*)receiver;
+
+-(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;
+
+ at end
\ No newline at end of file
diff --git a/ios/iosremote/iosremote/Communication/Client.m b/ios/iosremote/iosremote/Communication/Client.m
new file mode 100644
index 0000000..b90c9d9
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Client.m
@@ -0,0 +1,139 @@
+//
+//  Client.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Client.h"
+#import "Server.h"
+#import "Receiver.h"
+#import "CommunicationManager.h"
+
+ at interface Client() <NSStreamDelegate>
+
+ at property (nonatomic, strong) NSInputStream* mInputStream;
+ at property (nonatomic, strong) NSOutputStream* mOutputStream;
+
+ at property (nonatomic, strong) NSString* mPin;
+ at property (nonatomic, strong) NSString* mName;
+ at property uint mPort;
+
+ at property (nonatomic, weak) Server* mServer;
+ at property (nonatomic, weak) Receiver* mReceiver;
+ at property (nonatomic, weak) CommunicationManager* mComManager;
+
+ at property (nonatomic, retain) NSMutableData* mData;
+
+ at property BOOL mReady;
+
+ at end
+
+
+
+ at implementation Client
+
+ at synthesize mInputStream = _mInputStream;
+ at synthesize mOutputStream = _mOutputStream;
+ at synthesize mPin = _mPin;
+ at synthesize mName = _mName;
+ at synthesize mServer = _mServer;
+ at synthesize mComManager = _mComManager;
+ at synthesize mData = _mData;
+ at synthesize mReady = _mReady;
+
+NSString * const CHARSET = @"UTF-8";
+
+- (id) initWithServer:(Server*)server
+            managedBy:(CommunicationManager*)manager
+        interpretedBy:(Receiver*)receiver
+{
+    self.mPin = @"";
+    self.mName = server.serverName;
+    self.mComManager = manager;
+    self.mReceiver = receiver;
+    // hardcoded here to test the communication TODO
+    self.mPort = 1599;
+    
+    return self;
+}
+
+- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
+{
+    NSLog(@"Connecting to %@:%u", ip, portNumber);
+    CFReadStreamRef readStream;
+    CFWriteStreamRef writeStream;
+    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
+    
+    if(readStream && writeStream)
+    {
+        CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        
+        //Setup mInputStream
+        self.mInputStream = (__bridge NSInputStream *)readStream;
+        [self.mInputStream setDelegate:self];
+        [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mInputStream open];
+        
+        //Setup outputstream
+        self.mOutputStream = (__bridge NSOutputStream *)writeStream;
+        [self.mOutputStream setDelegate:self];
+        [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mOutputStream open];
+    }
+    NSLog(@"Connected");
+}
+
+- (void) sendCommand:(NSString *)aCommand
+{
+    // UTF-8 as speficied in specification
+    NSData * data = [aCommand dataUsingEncoding:NSUTF8StringEncoding];
+    
+    [self.mOutputStream write:(uint8_t *)[data bytes] maxLength:[data length]];
+}
+
+- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
+    
+    switch(eventCode) {
+        case NSStreamEventHasBytesAvailable:
+        {
+            if(!self.mData) {
+                self.mData = [NSMutableData data];
+            }
+            uint8_t buf[1024];
+            unsigned int len = 0;
+            len = [(NSInputStream *)stream read:buf maxLength:1024];
+            if(len) {
+                [self.mData appendBytes:(const void *)buf length:len];
+                int bytesRead = 0;
+                // bytesRead is an instance variable of type NSNumber.
+                bytesRead += len;
+            } else {
+                NSLog(@"No data but received event for whatever reasons!");
+            }
+            
+            NSString *str = [[NSString alloc] initWithData:self.mData
+                                                  encoding:NSUTF8StringEncoding];
+            NSLog(@"Data Received: %@", str);
+            
+            self.mData = nil;
+        } break;
+        default:
+        {
+        
+        }
+    
+    }
+}
+
+
+- (void) connect
+{
+    [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
+}
+
+
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/CommunicationManager.h b/ios/iosremote/iosremote/Communication/CommunicationManager.h
new file mode 100644
index 0000000..d649e3c
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/CommunicationManager.h
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface CommunicationManager : NSObject
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/CommunicationManager.m b/ios/iosremote/iosremote/Communication/CommunicationManager.m
new file mode 100644
index 0000000..c91b2f5
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/CommunicationManager.m
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "CommunicationManager.h"
+
+ at implementation CommunicationManager
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/Receiver.h b/ios/iosremote/iosremote/Communication/Receiver.h
new file mode 100644
index 0000000..9889ec7
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Receiver.h
@@ -0,0 +1,13 @@
+//
+//  Receiver.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface Receiver : NSObject
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/Receiver.m b/ios/iosremote/iosremote/Communication/Receiver.m
new file mode 100644
index 0000000..30a48c6
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Receiver.m
@@ -0,0 +1,13 @@
+//
+//  Receiver.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Receiver.h"
+
+ at implementation Receiver
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/Server.h b/ios/iosremote/iosremote/Communication/Server.h
new file mode 100644
index 0000000..1cf483d
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Server.h
@@ -0,0 +1,23 @@
+//
+//  Server.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum protocol {NETWORK} Protocol_t;
+
+ at interface Server : NSObject
+
+ at property (nonatomic) Protocol_t protocol;
+ at property (nonatomic, strong) NSString* serverName;
+ at property (nonatomic, strong) NSString* serverAddress;
+
+- (id)initWithProtocol:(Protocol_t)protocal
+             atAddress:(NSString*) address
+                ofName:(NSString*) name;
+
+ at end
diff --git a/ios/iosremote/iosremote/Communication/Server.m b/ios/iosremote/iosremote/Communication/Server.m
new file mode 100644
index 0000000..d7bf1ad
--- /dev/null
+++ b/ios/iosremote/iosremote/Communication/Server.m
@@ -0,0 +1,36 @@
+//
+//  Server.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Server.h"
+
+ at interface Server()
+
+ at end
+
+ at implementation Server
+
+ at synthesize protocol = _protocol;
+ at synthesize serverName = _serverName;
+ at synthesize serverAddress = _serverAddress;
+
+- (id)initWithProtocol:(Protocol_t)protocal
+           atAddress:(NSString*) address
+              ofName:(NSString*) name
+{
+    self = [self init];
+    self.protocol = protocal;
+    self.serverAddress = address;
+    self.serverName = name;
+    return self;
+}
+
+- (NSString *)description{
+    return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
+}
+
+ at end
commit 85be4cc4cd33bbc0e9a0d9fe1c362000c972dbdd
Author: siqi <me at siqi.fr>
Date:   Tue Jun 4 13:46:30 2013 +0200

    communication files

diff --git a/ios/iosremote/Communication/.DS_Store b/ios/iosremote/Communication/.DS_Store
deleted file mode 100644
index bbb5276..0000000
Binary files a/ios/iosremote/Communication/.DS_Store and /dev/null differ
diff --git a/ios/iosremote/Communication/Client.h b/ios/iosremote/Communication/Client.h
deleted file mode 100644
index 3827b2f..0000000
--- a/ios/iosremote/Communication/Client.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-//  Client.h
-//  
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "Server.h"
-#import "CommunicationManager.h"
-#import "Receiver.h"
-
- at interface Client : NSObject
-
--(void) connect;
-
-- (id) initWithServer:(Server*)server
-            managedBy:(CommunicationManager*)manager
-        interpretedBy:(Receiver*)receiver;
-
--(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;
-
- at end
\ No newline at end of file
diff --git a/ios/iosremote/Communication/Client.m b/ios/iosremote/Communication/Client.m
deleted file mode 100644
index b90c9d9..0000000
--- a/ios/iosremote/Communication/Client.m
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-//  Client.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Client.h"
-#import "Server.h"
-#import "Receiver.h"
-#import "CommunicationManager.h"
-
- at interface Client() <NSStreamDelegate>
-
- at property (nonatomic, strong) NSInputStream* mInputStream;
- at property (nonatomic, strong) NSOutputStream* mOutputStream;
-
- at property (nonatomic, strong) NSString* mPin;
- at property (nonatomic, strong) NSString* mName;
- at property uint mPort;
-
- at property (nonatomic, weak) Server* mServer;
- at property (nonatomic, weak) Receiver* mReceiver;
- at property (nonatomic, weak) CommunicationManager* mComManager;
-
- at property (nonatomic, retain) NSMutableData* mData;
-
- at property BOOL mReady;
-
- at end
-
-
-
- at implementation Client
-
- at synthesize mInputStream = _mInputStream;
- at synthesize mOutputStream = _mOutputStream;
- at synthesize mPin = _mPin;
- at synthesize mName = _mName;
- at synthesize mServer = _mServer;
- at synthesize mComManager = _mComManager;
- at synthesize mData = _mData;
- at synthesize mReady = _mReady;
-
-NSString * const CHARSET = @"UTF-8";
-
-- (id) initWithServer:(Server*)server
-            managedBy:(CommunicationManager*)manager
-        interpretedBy:(Receiver*)receiver
-{
-    self.mPin = @"";
-    self.mName = server.serverName;
-    self.mComManager = manager;
-    self.mReceiver = receiver;
-    // hardcoded here to test the communication TODO
-    self.mPort = 1599;
-    
-    return self;
-}
-
-- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
-{
-    NSLog(@"Connecting to %@:%u", ip, portNumber);
-    CFReadStreamRef readStream;
-    CFWriteStreamRef writeStream;
-    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
-    
-    if(readStream && writeStream)
-    {
-        CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        
-        //Setup mInputStream
-        self.mInputStream = (__bridge NSInputStream *)readStream;
-        [self.mInputStream setDelegate:self];
-        [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        [self.mInputStream open];
-        
-        //Setup outputstream
-        self.mOutputStream = (__bridge NSOutputStream *)writeStream;
-        [self.mOutputStream setDelegate:self];
-        [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        [self.mOutputStream open];
-    }
-    NSLog(@"Connected");
-}
-
-- (void) sendCommand:(NSString *)aCommand
-{
-    // UTF-8 as speficied in specification
-    NSData * data = [aCommand dataUsingEncoding:NSUTF8StringEncoding];
-    
-    [self.mOutputStream write:(uint8_t *)[data bytes] maxLength:[data length]];
-}
-
-- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
-    
-    switch(eventCode) {
-        case NSStreamEventHasBytesAvailable:
-        {
-            if(!self.mData) {
-                self.mData = [NSMutableData data];
-            }
-            uint8_t buf[1024];
-            unsigned int len = 0;
-            len = [(NSInputStream *)stream read:buf maxLength:1024];
-            if(len) {
-                [self.mData appendBytes:(const void *)buf length:len];
-                int bytesRead = 0;
-                // bytesRead is an instance variable of type NSNumber.
-                bytesRead += len;
-            } else {
-                NSLog(@"No data but received event for whatever reasons!");
-            }
-            
-            NSString *str = [[NSString alloc] initWithData:self.mData
-                                                  encoding:NSUTF8StringEncoding];
-            NSLog(@"Data Received: %@", str);
-            
-            self.mData = nil;
-        } break;
-        default:
-        {
-        
-        }
-    
-    }
-}
-
-
-- (void) connect
-{
-    [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
-}
-
-
-
- at end
diff --git a/ios/iosremote/Communication/CommunicationManager.h b/ios/iosremote/Communication/CommunicationManager.h
deleted file mode 100644
index d649e3c..0000000
--- a/ios/iosremote/Communication/CommunicationManager.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  CommunicationManager.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface CommunicationManager : NSObject
-
- at end
diff --git a/ios/iosremote/Communication/CommunicationManager.m b/ios/iosremote/Communication/CommunicationManager.m
deleted file mode 100644
index c91b2f5..0000000
--- a/ios/iosremote/Communication/CommunicationManager.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  CommunicationManager.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "CommunicationManager.h"
-
- at implementation CommunicationManager
-
- at end
diff --git a/ios/iosremote/Communication/Receiver.h b/ios/iosremote/Communication/Receiver.h
deleted file mode 100644
index 9889ec7..0000000
--- a/ios/iosremote/Communication/Receiver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Receiver.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface Receiver : NSObject
-
- at end
diff --git a/ios/iosremote/Communication/Receiver.m b/ios/iosremote/Communication/Receiver.m
deleted file mode 100644
index 30a48c6..0000000
--- a/ios/iosremote/Communication/Receiver.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Receiver.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Receiver.h"
-
- at implementation Receiver
-
- at end
diff --git a/ios/iosremote/Communication/Server.h b/ios/iosremote/Communication/Server.h
deleted file mode 100644
index 1cf483d..0000000
--- a/ios/iosremote/Communication/Server.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-//  Server.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef enum protocol {NETWORK} Protocol_t;
-
- at interface Server : NSObject
-
- at property (nonatomic) Protocol_t protocol;
- at property (nonatomic, strong) NSString* serverName;
- at property (nonatomic, strong) NSString* serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
-             atAddress:(NSString*) address
-                ofName:(NSString*) name;
-
- at end
diff --git a/ios/iosremote/Communication/Server.m b/ios/iosremote/Communication/Server.m
deleted file mode 100644
index d7bf1ad..0000000
--- a/ios/iosremote/Communication/Server.m
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-//  Server.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Server.h"
-
- at interface Server()
-
- at end
-
- at implementation Server
-
- at synthesize protocol = _protocol;
- at synthesize serverName = _serverName;
- at synthesize serverAddress = _serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
-           atAddress:(NSString*) address
-              ofName:(NSString*) name
-{
-    self = [self init];
-    self.protocol = protocal;
-    self.serverAddress = address;
-    self.serverName = name;
-    return self;
-}
-
-- (NSString *)description{
-    return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
-}
-
- at end
diff --git a/ios/iosremote/iosremote.xcodeproj/project.pbxproj b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
index 4a2aaa5..bcb64f4 100644
--- a/ios/iosremote/iosremote.xcodeproj/project.pbxproj
+++ b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
@@ -19,6 +19,10 @@
 		57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */; };
 		57C6E40F175E06E800E8BC5F /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40D175E06E800E8BC5F /* MainStoryboard_iPad.storyboard */; };
 		57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */; };
+		57C6E42E175E076900E8BC5F /* Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E427175E076900E8BC5F /* Client.m */; };
+		57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E429175E076900E8BC5F /* CommunicationManager.m */; };
+		57C6E430175E076900E8BC5F /* Receiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42B175E076900E8BC5F /* Receiver.m */; };
+		57C6E431175E076900E8BC5F /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42D175E076900E8BC5F /* Server.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -39,6 +43,14 @@
 		57C6E40E175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
 		57C6E410175E06E800E8BC5F /* libreoffice_sdremoteViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libreoffice_sdremoteViewController.h; sourceTree = "<group>"; };
 		57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libreoffice_sdremoteViewController.m; sourceTree = "<group>"; };
+		57C6E426175E076900E8BC5F /* Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Client.h; path = ../iosremote/Communication/Client.h; sourceTree = "<group>"; };
+		57C6E427175E076900E8BC5F /* Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Client.m; path = ../iosremote/Communication/Client.m; sourceTree = "<group>"; };
+		57C6E428175E076900E8BC5F /* CommunicationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommunicationManager.h; path = ../iosremote/Communication/CommunicationManager.h; sourceTree = "<group>"; };
+		57C6E429175E076900E8BC5F /* CommunicationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommunicationManager.m; path = ../iosremote/Communication/CommunicationManager.m; sourceTree = "<group>"; };
+		57C6E42A175E076900E8BC5F /* Receiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Receiver.h; path = ../iosremote/Communication/Receiver.h; sourceTree = "<group>"; };
+		57C6E42B175E076900E8BC5F /* Receiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Receiver.m; path = ../iosremote/Communication/Receiver.m; sourceTree = "<group>"; };
+		57C6E42C175E076900E8BC5F /* Server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Server.h; path = ../iosremote/Communication/Server.h; sourceTree = "<group>"; };
+		57C6E42D175E076900E8BC5F /* Server.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Server.m; path = ../iosremote/Communication/Server.m; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -58,6 +70,7 @@
 		57C6E3E6175E06E800E8BC5F = {
 			isa = PBXGroup;
 			children = (
+				57C6E425175E076900E8BC5F /* Communication */,
 				57C6E3F8175E06E800E8BC5F /* iosremote */,
 				57C6E3F1175E06E800E8BC5F /* Frameworks */,
 				57C6E3F0175E06E800E8BC5F /* Products */,
@@ -110,6 +123,21 @@
 			name = "Supporting Files";
 			sourceTree = "<group>";
 		};
+		57C6E425175E076900E8BC5F /* Communication */ = {
+			isa = PBXGroup;
+			children = (
+				57C6E426175E076900E8BC5F /* Client.h */,
+				57C6E427175E076900E8BC5F /* Client.m */,
+				57C6E428175E076900E8BC5F /* CommunicationManager.h */,
+				57C6E429175E076900E8BC5F /* CommunicationManager.m */,
+				57C6E42A175E076900E8BC5F /* Receiver.h */,
+				57C6E42B175E076900E8BC5F /* Receiver.m */,
+				57C6E42C175E076900E8BC5F /* Server.h */,
+				57C6E42D175E076900E8BC5F /* Server.m */,
+			);
+			path = Communication;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -181,6 +209,10 @@
 				57C6E3FF175E06E800E8BC5F /* main.m in Sources */,
 				57C6E403175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m in Sources */,
 				57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */,
+				57C6E42E175E076900E8BC5F /* Client.m in Sources */,
+				57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */,
+				57C6E430175E076900E8BC5F /* Receiver.m in Sources */,
+				57C6E431175E076900E8BC5F /* Server.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -278,6 +310,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
 				INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 5.1;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				WRAPPER_EXTENSION = app;
 			};
@@ -289,6 +322,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
 				INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 5.1;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				WRAPPER_EXTENSION = app;
 			};
diff --git a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
index 683f452..7796088 100644
--- a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
+++ b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
@@ -1,23 +1,69 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2519" systemVersion="12A206j" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12D78" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="KFV-Ae-zm8">
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1856"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
     </dependencies>
     <scenes>
-        <!--class Prefix:identifier View Controller-->
+        <!--Libreoffice sdremote View Controller-->
         <scene sceneID="4">
             <objects>
                 <viewController id="2" customClass="libreoffice_sdremoteViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="5">
-                        <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+                        <rect key="frame" x="0.0" y="64" width="768" height="960"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="IP Address" borderStyle="roundedRect" minimumFontSize="17" id="9w1-Ym-HcF">
+                                <rect key="frame" x="234" y="402" width="301" height="30"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
+                        </subviews>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                     </view>
+                    <navigationItem key="navigationItem" id="7ye-Vv-ZD0">
+                        <barButtonItem key="rightBarButtonItem" title="Connect" id="ZJB-Ei-Sa9">
+                            <connections>
+                                <action selector="connectToServer:" destination="2" id="58D-7s-OuE"/>
+                            </connections>
+                        </barButtonItem>
+                    </navigationItem>
+                    <connections>
+                        <outlet property="ipAddressTextEdit" destination="9w1-Ym-HcF" id="hab-JH-3Lf"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
             </objects>
+            <point key="canvasLocation" x="1618" y="-293"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="00H-XM-3gJ">
+            <objects>
+                <navigationController id="KFV-Ae-zm8" sceneMemberID="viewController">
+                    <toolbarItems/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="QnQ-yW-KgX">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <nil name="viewControllers"/>
+                    <connections>
+                        <segue destination="2" kind="relationship" relationship="rootViewController" id="nce-OO-TOv"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="sOJ-6b-jVh" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="721" y="-301"/>
         </scene>
     </scenes>
+    <classes>
+        <class className="libreoffice_sdremoteViewController" superclassName="UIViewController">
+            <source key="sourceIdentifier" type="project" relativePath="./Classes/libreoffice_sdremoteViewController.h"/>
+            <relationships>
+                <relationship kind="action" name="connectToServer:"/>
+                <relationship kind="outlet" name="ipAddressTextEdit" candidateClass="UITextField"/>
+            </relationships>
+        </class>
+    </classes>
     <simulatedMetricsContainer key="defaultSimulatedMetrics">
         <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
         <simulatedOrientationMetrics key="orientation"/>
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
index 695964b..fdeaf69 100644
--- a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
@@ -10,4 +10,8 @@
 
 @interface libreoffice_sdremoteViewController : UIViewController
 
+- (IBAction)connectToServer:(id)sender;
+
+ at property (weak, nonatomic) IBOutlet UITextField *ipAddressTextEdit;
+
 @end
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
index d6af7fe..823c703 100644
--- a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
@@ -7,6 +7,8 @@
 //
 
 #import "libreoffice_sdremoteViewController.h"
+#import "Server.h"
+#import "Client.h"
 
 @interface libreoffice_sdremoteViewController ()
 
@@ -26,4 +28,17 @@
     // Dispose of any resources that can be recreated.
 }
 
+
+- (IBAction)connectToServer:(id)sender {
+    NSString * address = [self.ipAddressTextEdit text];
+    Server * server = [[Server alloc] initWithProtocol:NETWORK atAddress:address ofName:@"Server"];
+    Client * client = [[Client alloc] initWithServer:server managedBy:nil interpretedBy:nil];
+    [client connect];
+}
+
+
+- (void)viewDidUnload {
+    [self setIpAddressTextEdit:nil];
+    [super viewDidUnload];
+}
 @end
diff --git a/ios/sdremote/sdremote/Communication/Client.h b/ios/sdremote/sdremote/Communication/Client.h
deleted file mode 100644
index 03a7a5a..0000000
--- a/ios/sdremote/sdremote/Communication/Client.h
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-//  Client.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface Client : NSObject <NSStreamDelegate>
-
-
-+(void) connect;
-
-
- at end
\ No newline at end of file
diff --git a/ios/sdremote/sdremote/Communication/Client.m b/ios/sdremote/sdremote/Communication/Client.m
deleted file mode 100644
index c48ec12..0000000
--- a/ios/sdremote/sdremote/Communication/Client.m
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-//  Client.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Client.h"
-#import "Server.h"
-#import "Receiver.h"
-#import "CommunicationManager.h"
-
- at interface Client()
-
- at property (nonatomic, strong) NSInputStream* mInputStream;
- at property (nonatomic, strong) NSOutputStream* mOutputStream;
-
- at property (nonatomic, strong) NSString* mPin;
- at property (nonatomic, strong) NSString* mName;
- at property const uint mPort;
-
- at property (nonatomic, weak) Server* mServer;
- at property (nonatomic, weak) Receiver* mReceiver;
- at property (nonatomic, weak) CommunicationManager* mComManager;
-
- at property (nonatomic, retain) NSMutableData* mData;
-
- at end
-
-
-
- at implementation Client
-
- at synthesize mInputStream = _mInputStream;
- at synthesize mOutputStream = _mOutputStream;
- at synthesize mPin = _mPin;
- at synthesize mName = _mName;
- at synthesize mServer = _mServer;
- at synthesize mComManager = _mComManager;
- at synthesize mData = _mData;
-
-NSString * const CHARSET = @"UTF-8";
-
-- (id) initWithServer:(Server*)server
-           managedBy:(CommunicationManager*)manager
-       interpretedBy:(Receiver*)receiver
-{
-    self.mPin = @"";
-    self.mName = server.serverName;
-    self.mComManager = manager;
-    self.mReceiver = receiver;
-    // hardcoded here to test the communication TODO
-    self.mPort = 1599;
-    
-    return self;
-}
-
-- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
-{
-    CFReadStreamRef readStream;
-    CFWriteStreamRef writeStream;
-    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
-    
-    if(readStream && writeStream)
-    {
-        CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        
-        //Setup mInputStream
-        self.mInputStream = (__bridge NSInputStream *)readStream;
-        [self.mInputStream setDelegate:self];
-        [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        [self.mInputStream open];
-        
-        //Setup outputstream
-        self.mOutputStream = (__bridge NSOutputStream *)writeStream;
-        [self.mOutputStream setDelegate:self];
-        [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        [self.mOutputStream open];
-    }
-}
-
-- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
-    
-    switch(eventCode) {
-        case NSStreamEventHasBytesAvailable:
-        {
-            if(!self.mData) {
-                self.mData = [NSMutableData data];
-            }
-            uint8_t buf[1024];
-            unsigned int len = 0;
-            len = [(NSInputStream *)stream read:buf maxLength:1024];
-            if(len) {
-                [self.mData appendBytes:(const void *)buf length:len];
-                // bytesRead is an instance variable of type NSNumber.
-                [bytesRead setIntValue:[bytesRead intValue]+len];
-            } else {
-                NSLog(@"no buffer!");
-            }
-            break;
-        }
-            
-    }
-}
-
-
-- (void) connect
-{
-    [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
-    
-}
-
-
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.h b/ios/sdremote/sdremote/Communication/CommunicationManager.h
deleted file mode 100644
index d649e3c..0000000
--- a/ios/sdremote/sdremote/Communication/CommunicationManager.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  CommunicationManager.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface CommunicationManager : NSObject
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.m b/ios/sdremote/sdremote/Communication/CommunicationManager.m
deleted file mode 100644
index c91b2f5..0000000
--- a/ios/sdremote/sdremote/Communication/CommunicationManager.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  CommunicationManager.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "CommunicationManager.h"
-
- at implementation CommunicationManager
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.h b/ios/sdremote/sdremote/Communication/Receiver.h
deleted file mode 100644
index 9889ec7..0000000
--- a/ios/sdremote/sdremote/Communication/Receiver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Receiver.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface Receiver : NSObject
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.m b/ios/sdremote/sdremote/Communication/Receiver.m
deleted file mode 100644
index 30a48c6..0000000
--- a/ios/sdremote/sdremote/Communication/Receiver.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Receiver.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Receiver.h"
-
- at implementation Receiver
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/Server.h b/ios/sdremote/sdremote/Communication/Server.h
deleted file mode 100644
index 2cf720e..0000000
--- a/ios/sdremote/sdremote/Communication/Server.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-//  Server.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef enum protocol {NETWORK} Protocol_t;
-
- at interface Server : NSObject
-
- at property (nonatomic) Protocol_t protocol;
- at property (nonatomic, strong) NSString* serverName;
- at property (nonatomic, strong) NSString* serverAddress;
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/Server.m b/ios/sdremote/sdremote/Communication/Server.m
deleted file mode 100644
index d7bf1ad..0000000
--- a/ios/sdremote/sdremote/Communication/Server.m
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-//  Server.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Server.h"
-
- at interface Server()
-
- at end
-
- at implementation Server
-
- at synthesize protocol = _protocol;
- at synthesize serverName = _serverName;
- at synthesize serverAddress = _serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
-           atAddress:(NSString*) address
-              ofName:(NSString*) name
-{
-    self = [self init];
-    self.protocol = protocal;
-    self.serverAddress = address;
-    self.serverName = name;
-    return self;
-}
-
-- (NSString *)description{
-    return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
-}
-
- at end
diff --git a/ios/sdremote/sdremote/Default-568h at 2x.png b/ios/sdremote/sdremote/Default-568h at 2x.png
deleted file mode 100644
index 0891b7a..0000000
Binary files a/ios/sdremote/sdremote/Default-568h at 2x.png and /dev/null differ
diff --git a/ios/sdremote/sdremote/Default.png b/ios/sdremote/sdremote/Default.png
deleted file mode 100644
index 4c8ca6f..0000000
Binary files a/ios/sdremote/sdremote/Default.png and /dev/null differ
diff --git a/ios/sdremote/sdremote/Default at 2x.png b/ios/sdremote/sdremote/Default at 2x.png
deleted file mode 100644
index 35b84cf..0000000
Binary files a/ios/sdremote/sdremote/Default at 2x.png and /dev/null differ
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
deleted file mode 100644
index 2d16876..0000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  libreoffice_sdremoteAppDelegate.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
- at interface libreoffice_sdremoteAppDelegate : UIResponder <UIApplicationDelegate>
-
- at property (strong, nonatomic) UIWindow *window;
-
- at end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
deleted file mode 100644
index 2e13f91..0000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-//  libreoffice_sdremoteAppDelegate.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "libreoffice_sdremoteAppDelegate.h"
-
- at implementation libreoffice_sdremoteAppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
-    // Override point for customization after application launch.
-    return YES;
-}
-							
-- (void)applicationWillResignActive:(UIApplication *)application
-{
-    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
-    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
-    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
-    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
-    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
-    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
- at end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
deleted file mode 100644
index f120e0f..0000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  libreoffice_sdremoteViewController.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
- at interface libreoffice_sdremoteViewController : UIViewController
- at property (weak, nonatomic) IBOutlet UIBarButtonItem *connect;
-
- at end
-
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
deleted file mode 100644
index ed11a73..0000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//  libreoffice_sdremoteViewController.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "libreoffice_sdremoteViewController.h"
-
- at interface libreoffice_sdremoteViewController ()
-
- at end
-
- at implementation libreoffice_sdremoteViewController
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    
-	// Do any additional setup after loading the view, typically from a nib.
-}
-
-- (void)didReceiveMemoryWarning
-{
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-
-- (void)viewDidUnload {
-    [self setConnect:nil];
-    [super viewDidUnload];
-}
- at end
diff --git a/ios/sdremote/sdremote/main.m b/ios/sdremote/sdremote/main.m
deleted file mode 100644
index 33135de..0000000
--- a/ios/sdremote/sdremote/main.m
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-//  main.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "libreoffice_sdremoteAppDelegate.h"
-
-int main(int argc, char *argv[])
-{
-    @autoreleasepool {
-        return UIApplicationMain(argc, argv, nil, NSStringFromClass([libreoffice_sdremoteAppDelegate class]));
-    }
-}
diff --git a/ios/sdremote/sdremote/sdremote-Info.plist b/ios/sdremote/sdremote/sdremote-Info.plist
deleted file mode 100644
index f2b1ca6..0000000
--- a/ios/sdremote/sdremote/sdremote-Info.plist
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>en</string>
-	<key>CFBundleDisplayName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundleExecutable</key>
-	<string>${EXECUTABLE_NAME}</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>${PRODUCT_NAME}</string>
-	<key>CFBundlePackageType</key>
-	<string>APPL</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSignature</key>
-	<string>????</string>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>LSRequiresIPhoneOS</key>
-	<true/>
-	<key>UIMainStoryboardFile</key>
-	<string>MainStoryboard_iPhone</string>
-	<key>UIMainStoryboardFile~ipad</key>
-	<string>MainStoryboard_iPad</string>
-	<key>UIRequiredDeviceCapabilities</key>
-	<array>
-		<string>armv7</string>
-	</array>
-	<key>UISupportedInterfaceOrientations</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-	<key>UISupportedInterfaceOrientations~ipad</key>
-	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationPortraitUpsideDown</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
-	</array>
-</dict>
-</plist>
diff --git a/ios/sdremote/sdremote/sdremote-Prefix.pch b/ios/sdremote/sdremote/sdremote-Prefix.pch
deleted file mode 100644
index 5f37a4d..0000000
--- a/ios/sdremote/sdremote/sdremote-Prefix.pch
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// Prefix header for all source files of the 'sdremote' target in the 'sdremote' project
-//
-
-#import <Availability.h>
-
-#ifndef __IPHONE_5_0
-#warning "This project uses features only available in iOS SDK 5.0 and later."
-#endif
-
-#ifdef __OBJC__
-    #import <UIKit/UIKit.h>
-    #import <Foundation/Foundation.h>
-#endif
commit ee96b94dfb5f7957524f7b3e20eeed44de005b97
Author: siqi <me at siqi.fr>
Date:   Tue Jun 4 13:41:55 2013 +0200

    initial commit

diff --git a/ios/iosremote/Communication/.DS_Store b/ios/iosremote/Communication/.DS_Store
new file mode 100644
index 0000000..bbb5276
Binary files /dev/null and b/ios/iosremote/Communication/.DS_Store differ
diff --git a/ios/iosremote/Communication/Client.h b/ios/iosremote/Communication/Client.h
new file mode 100644
index 0000000..3827b2f
--- /dev/null
+++ b/ios/iosremote/Communication/Client.h
@@ -0,0 +1,24 @@
+//
+//  Client.h
+//  
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "Server.h"
+#import "CommunicationManager.h"
+#import "Receiver.h"
+
+ at interface Client : NSObject
+
+-(void) connect;
+
+- (id) initWithServer:(Server*)server
+            managedBy:(CommunicationManager*)manager
+        interpretedBy:(Receiver*)receiver;
+
+-(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;
+
+ at end
\ No newline at end of file
diff --git a/ios/iosremote/Communication/Client.m b/ios/iosremote/Communication/Client.m
new file mode 100644
index 0000000..b90c9d9
--- /dev/null
+++ b/ios/iosremote/Communication/Client.m
@@ -0,0 +1,139 @@
+//
+//  Client.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Client.h"
+#import "Server.h"
+#import "Receiver.h"
+#import "CommunicationManager.h"
+
+ at interface Client() <NSStreamDelegate>
+
+ at property (nonatomic, strong) NSInputStream* mInputStream;
+ at property (nonatomic, strong) NSOutputStream* mOutputStream;
+
+ at property (nonatomic, strong) NSString* mPin;
+ at property (nonatomic, strong) NSString* mName;
+ at property uint mPort;
+
+ at property (nonatomic, weak) Server* mServer;
+ at property (nonatomic, weak) Receiver* mReceiver;
+ at property (nonatomic, weak) CommunicationManager* mComManager;
+
+ at property (nonatomic, retain) NSMutableData* mData;
+
+ at property BOOL mReady;
+
+ at end
+
+
+
+ at implementation Client
+
+ at synthesize mInputStream = _mInputStream;
+ at synthesize mOutputStream = _mOutputStream;
+ at synthesize mPin = _mPin;
+ at synthesize mName = _mName;
+ at synthesize mServer = _mServer;
+ at synthesize mComManager = _mComManager;
+ at synthesize mData = _mData;
+ at synthesize mReady = _mReady;
+
+NSString * const CHARSET = @"UTF-8";
+
+- (id) initWithServer:(Server*)server
+            managedBy:(CommunicationManager*)manager
+        interpretedBy:(Receiver*)receiver
+{
+    self.mPin = @"";
+    self.mName = server.serverName;
+    self.mComManager = manager;
+    self.mReceiver = receiver;
+    // hardcoded here to test the communication TODO
+    self.mPort = 1599;
+    
+    return self;
+}
+
+- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
+{
+    NSLog(@"Connecting to %@:%u", ip, portNumber);
+    CFReadStreamRef readStream;
+    CFWriteStreamRef writeStream;
+    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
+    
+    if(readStream && writeStream)
+    {
+        CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        
+        //Setup mInputStream
+        self.mInputStream = (__bridge NSInputStream *)readStream;
+        [self.mInputStream setDelegate:self];
+        [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mInputStream open];
+        
+        //Setup outputstream
+        self.mOutputStream = (__bridge NSOutputStream *)writeStream;
+        [self.mOutputStream setDelegate:self];
+        [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mOutputStream open];
+    }
+    NSLog(@"Connected");
+}
+
+- (void) sendCommand:(NSString *)aCommand
+{
+    // UTF-8 as speficied in specification
+    NSData * data = [aCommand dataUsingEncoding:NSUTF8StringEncoding];
+    
+    [self.mOutputStream write:(uint8_t *)[data bytes] maxLength:[data length]];
+}
+
+- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
+    
+    switch(eventCode) {
+        case NSStreamEventHasBytesAvailable:
+        {
+            if(!self.mData) {
+                self.mData = [NSMutableData data];
+            }
+            uint8_t buf[1024];
+            unsigned int len = 0;
+            len = [(NSInputStream *)stream read:buf maxLength:1024];
+            if(len) {
+                [self.mData appendBytes:(const void *)buf length:len];
+                int bytesRead = 0;
+                // bytesRead is an instance variable of type NSNumber.
+                bytesRead += len;
+            } else {
+                NSLog(@"No data but received event for whatever reasons!");
+            }
+            
+            NSString *str = [[NSString alloc] initWithData:self.mData
+                                                  encoding:NSUTF8StringEncoding];
+            NSLog(@"Data Received: %@", str);
+            
+            self.mData = nil;
+        } break;
+        default:
+        {
+        
+        }
+    
+    }
+}
+
+
+- (void) connect
+{
+    [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
+}
+
+
+
+ at end
diff --git a/ios/iosremote/Communication/CommunicationManager.h b/ios/iosremote/Communication/CommunicationManager.h
new file mode 100644
index 0000000..d649e3c
--- /dev/null
+++ b/ios/iosremote/Communication/CommunicationManager.h
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface CommunicationManager : NSObject
+
+ at end
diff --git a/ios/iosremote/Communication/CommunicationManager.m b/ios/iosremote/Communication/CommunicationManager.m
new file mode 100644
index 0000000..c91b2f5
--- /dev/null
+++ b/ios/iosremote/Communication/CommunicationManager.m
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "CommunicationManager.h"
+
+ at implementation CommunicationManager
+
+ at end
diff --git a/ios/iosremote/Communication/Receiver.h b/ios/iosremote/Communication/Receiver.h
new file mode 100644
index 0000000..9889ec7
--- /dev/null
+++ b/ios/iosremote/Communication/Receiver.h
@@ -0,0 +1,13 @@
+//
+//  Receiver.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface Receiver : NSObject
+
+ at end
diff --git a/ios/iosremote/Communication/Receiver.m b/ios/iosremote/Communication/Receiver.m
new file mode 100644
index 0000000..30a48c6
--- /dev/null
+++ b/ios/iosremote/Communication/Receiver.m
@@ -0,0 +1,13 @@
+//
+//  Receiver.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Receiver.h"
+
+ at implementation Receiver
+
+ at end
diff --git a/ios/iosremote/Communication/Server.h b/ios/iosremote/Communication/Server.h
new file mode 100644
index 0000000..1cf483d
--- /dev/null
+++ b/ios/iosremote/Communication/Server.h
@@ -0,0 +1,23 @@
+//
+//  Server.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum protocol {NETWORK} Protocol_t;
+
+ at interface Server : NSObject
+
+ at property (nonatomic) Protocol_t protocol;
+ at property (nonatomic, strong) NSString* serverName;
+ at property (nonatomic, strong) NSString* serverAddress;
+
+- (id)initWithProtocol:(Protocol_t)protocal
+             atAddress:(NSString*) address
+                ofName:(NSString*) name;
+
+ at end
diff --git a/ios/iosremote/Communication/Server.m b/ios/iosremote/Communication/Server.m
new file mode 100644
index 0000000..d7bf1ad
--- /dev/null
+++ b/ios/iosremote/Communication/Server.m
@@ -0,0 +1,36 @@
+//
+//  Server.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Server.h"
+
+ at interface Server()
+
+ at end
+
+ at implementation Server
+
+ at synthesize protocol = _protocol;
+ at synthesize serverName = _serverName;
+ at synthesize serverAddress = _serverAddress;
+
+- (id)initWithProtocol:(Protocol_t)protocal
+           atAddress:(NSString*) address
+              ofName:(NSString*) name
+{
+    self = [self init];
+    self.protocol = protocal;
+    self.serverAddress = address;
+    self.serverName = name;
+    return self;
+}
+
+- (NSString *)description{
+    return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
+}
+
+ at end
diff --git a/ios/iosremote/iosremote.xcodeproj/project.pbxproj b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..4a2aaa5
--- /dev/null
+++ b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
@@ -0,0 +1,320 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		57C6E3F3175E06E800E8BC5F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57C6E3F2175E06E800E8BC5F /* UIKit.framework */; };
+		57C6E3F5175E06E800E8BC5F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57C6E3F4175E06E800E8BC5F /* Foundation.framework */; };
+		57C6E3F7175E06E800E8BC5F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57C6E3F6175E06E800E8BC5F /* CoreGraphics.framework */; };
+		57C6E3FD175E06E800E8BC5F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E3FB175E06E800E8BC5F /* InfoPlist.strings */; };
+		57C6E3FF175E06E800E8BC5F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E3FE175E06E800E8BC5F /* main.m */; };
+		57C6E403175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E402175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m */; };
+		57C6E405175E06E800E8BC5F /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E404175E06E800E8BC5F /* Default.png */; };
+		57C6E407175E06E800E8BC5F /* Default at 2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E406175E06E800E8BC5F /* Default at 2x.png */; };
+		57C6E409175E06E800E8BC5F /* Default-568h at 2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E408175E06E800E8BC5F /* Default-568h at 2x.png */; };
+		57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */; };
+		57C6E40F175E06E800E8BC5F /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40D175E06E800E8BC5F /* MainStoryboard_iPad.storyboard */; };
+		57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		57C6E3EF175E06E800E8BC5F /* iosremote.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosremote.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		57C6E3F2175E06E800E8BC5F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+		57C6E3F4175E06E800E8BC5F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+		57C6E3F6175E06E800E8BC5F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+		57C6E3FA175E06E800E8BC5F /* iosremote-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iosremote-Info.plist"; sourceTree = "<group>"; };
+		57C6E3FC175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		57C6E3FE175E06E800E8BC5F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+		57C6E400175E06E800E8BC5F /* iosremote-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iosremote-Prefix.pch"; sourceTree = "<group>"; };
+		57C6E401175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libreoffice_sdremoteAppDelegate.h; sourceTree = "<group>"; };
+		57C6E402175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libreoffice_sdremoteAppDelegate.m; sourceTree = "<group>"; };
+		57C6E404175E06E800E8BC5F /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
+		57C6E406175E06E800E8BC5F /* Default at 2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default at 2x.png"; sourceTree = "<group>"; };
+		57C6E408175E06E800E8BC5F /* Default-568h at 2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h at 2x.png"; sourceTree = "<group>"; };
+		57C6E40B175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
+		57C6E40E175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
+		57C6E410175E06E800E8BC5F /* libreoffice_sdremoteViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libreoffice_sdremoteViewController.h; sourceTree = "<group>"; };
+		57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libreoffice_sdremoteViewController.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		57C6E3EC175E06E800E8BC5F /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				57C6E3F3175E06E800E8BC5F /* UIKit.framework in Frameworks */,
+				57C6E3F5175E06E800E8BC5F /* Foundation.framework in Frameworks */,
+				57C6E3F7175E06E800E8BC5F /* CoreGraphics.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		57C6E3E6175E06E800E8BC5F = {
+			isa = PBXGroup;
+			children = (
+				57C6E3F8175E06E800E8BC5F /* iosremote */,
+				57C6E3F1175E06E800E8BC5F /* Frameworks */,
+				57C6E3F0175E06E800E8BC5F /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		57C6E3F0175E06E800E8BC5F /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				57C6E3EF175E06E800E8BC5F /* iosremote.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		57C6E3F1175E06E800E8BC5F /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				57C6E3F2175E06E800E8BC5F /* UIKit.framework */,
+				57C6E3F4175E06E800E8BC5F /* Foundation.framework */,
+				57C6E3F6175E06E800E8BC5F /* CoreGraphics.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		57C6E3F8175E06E800E8BC5F /* iosremote */ = {
+			isa = PBXGroup;
+			children = (
+				57C6E401175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.h */,
+				57C6E402175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m */,
+				57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */,
+				57C6E40D175E06E800E8BC5F /* MainStoryboard_iPad.storyboard */,
+				57C6E410175E06E800E8BC5F /* libreoffice_sdremoteViewController.h */,
+				57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */,
+				57C6E3F9175E06E800E8BC5F /* Supporting Files */,
+			);
+			path = iosremote;
+			sourceTree = "<group>";
+		};
+		57C6E3F9175E06E800E8BC5F /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				57C6E3FA175E06E800E8BC5F /* iosremote-Info.plist */,
+				57C6E3FB175E06E800E8BC5F /* InfoPlist.strings */,
+				57C6E3FE175E06E800E8BC5F /* main.m */,
+				57C6E400175E06E800E8BC5F /* iosremote-Prefix.pch */,
+				57C6E404175E06E800E8BC5F /* Default.png */,
+				57C6E406175E06E800E8BC5F /* Default at 2x.png */,
+				57C6E408175E06E800E8BC5F /* Default-568h at 2x.png */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		57C6E3EE175E06E800E8BC5F /* iosremote */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 57C6E415175E06E800E8BC5F /* Build configuration list for PBXNativeTarget "iosremote" */;
+			buildPhases = (
+				57C6E3EB175E06E800E8BC5F /* Sources */,
+				57C6E3EC175E06E800E8BC5F /* Frameworks */,
+				57C6E3ED175E06E800E8BC5F /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = iosremote;
+			productName = iosremote;
+			productReference = 57C6E3EF175E06E800E8BC5F /* iosremote.app */;
+			productType = "com.apple.product-type.application";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		57C6E3E7175E06E800E8BC5F /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				CLASSPREFIX = libreoffice.sdremote;
+				LastUpgradeCheck = 0460;
+				ORGANIZATIONNAME = libreoffice;
+			};
+			buildConfigurationList = 57C6E3EA175E06E800E8BC5F /* Build configuration list for PBXProject "iosremote" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = 57C6E3E6175E06E800E8BC5F;
+			productRefGroup = 57C6E3F0175E06E800E8BC5F /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				57C6E3EE175E06E800E8BC5F /* iosremote */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		57C6E3ED175E06E800E8BC5F /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				57C6E3FD175E06E800E8BC5F /* InfoPlist.strings in Resources */,
+				57C6E405175E06E800E8BC5F /* Default.png in Resources */,
+				57C6E407175E06E800E8BC5F /* Default at 2x.png in Resources */,
+				57C6E409175E06E800E8BC5F /* Default-568h at 2x.png in Resources */,
+				57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */,
+				57C6E40F175E06E800E8BC5F /* MainStoryboard_iPad.storyboard in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		57C6E3EB175E06E800E8BC5F /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				57C6E3FF175E06E800E8BC5F /* main.m in Sources */,
+				57C6E403175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m in Sources */,
+				57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+		57C6E3FB175E06E800E8BC5F /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				57C6E3FC175E06E800E8BC5F /* en */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+		57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				57C6E40B175E06E800E8BC5F /* en */,
+			);
+			name = MainStoryboard_iPhone.storyboard;
+			sourceTree = "<group>";
+		};
+		57C6E40D175E06E800E8BC5F /* MainStoryboard_iPad.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				57C6E40E175E06E800E8BC5F /* en */,
+			);
+			name = MainStoryboard_iPad.storyboard;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		57C6E413175E06E800E8BC5F /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		57C6E414175E06E800E8BC5F /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 6.1;
+				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		57C6E416175E06E800E8BC5F /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
+				INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Debug;
+		};
+		57C6E417175E06E800E8BC5F /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
+				INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				WRAPPER_EXTENSION = app;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		57C6E3EA175E06E800E8BC5F /* Build configuration list for PBXProject "iosremote" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				57C6E413175E06E800E8BC5F /* Debug */,
+				57C6E414175E06E800E8BC5F /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		57C6E415175E06E800E8BC5F /* Build configuration list for PBXNativeTarget "iosremote" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				57C6E416175E06E800E8BC5F /* Debug */,
+				57C6E417175E06E800E8BC5F /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 57C6E3E7175E06E800E8BC5F /* Project object */;
+}
diff --git a/ios/iosremote/iosremote/Default-568h at 2x.png b/ios/iosremote/iosremote/Default-568h at 2x.png
new file mode 100644
index 0000000..0891b7a
Binary files /dev/null and b/ios/iosremote/iosremote/Default-568h at 2x.png differ
diff --git a/ios/iosremote/iosremote/Default.png b/ios/iosremote/iosremote/Default.png
new file mode 100644
index 0000000..4c8ca6f
Binary files /dev/null and b/ios/iosremote/iosremote/Default.png differ
diff --git a/ios/iosremote/iosremote/Default at 2x.png b/ios/iosremote/iosremote/Default at 2x.png
new file mode 100644
index 0000000..35b84cf
Binary files /dev/null and b/ios/iosremote/iosremote/Default at 2x.png differ
diff --git a/ios/iosremote/iosremote/en.lproj/InfoPlist.strings b/ios/iosremote/iosremote/en.lproj/InfoPlist.strings
new file mode 100644
index 0000000..477b28f
--- /dev/null
+++ b/ios/iosremote/iosremote/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
new file mode 100644
index 0000000..683f452
--- /dev/null
+++ b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2519" systemVersion="12A206j" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1856"/>
+    </dependencies>
+    <scenes>
+        <!--class Prefix:identifier View Controller-->
+        <scene sceneID="4">
+            <objects>
+                <viewController id="2" customClass="libreoffice_sdremoteViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="5">
+                        <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
+            </objects>
+        </scene>
+    </scenes>
+    <simulatedMetricsContainer key="defaultSimulatedMetrics">
+        <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
+        <simulatedOrientationMetrics key="orientation"/>
+        <simulatedScreenMetrics key="destination"/>
+    </simulatedMetricsContainer>
+</document>
\ No newline at end of file
diff --git a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard
new file mode 100644
index 0000000..dd21c31
--- /dev/null
+++ b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPhone.storyboard
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2519" systemVersion="12A206j" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1856"/>
+    </dependencies>
+    <scenes>
+        <!--class Prefix:identifier View Controller-->
+        <scene sceneID="5">
+            <objects>
+                <viewController id="2" customClass="libreoffice_sdremoteViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="3">
+                        <rect key="frame" x="0.0" y="20" width="320" height="460"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
+            </objects>
+        </scene>
+    </scenes>
+    <simulatedMetricsContainer key="defaultSimulatedMetrics">
+        <simulatedStatusBarMetrics key="statusBar"/>
+        <simulatedOrientationMetrics key="orientation"/>
+        <simulatedScreenMetrics key="destination" type="retina4"/>
+    </simulatedMetricsContainer>
+</document>
\ No newline at end of file
diff --git a/ios/iosremote/iosremote/iosremote-Info.plist b/ios/iosremote/iosremote/iosremote-Info.plist
new file mode 100644
index 0000000..f2b1ca6
--- /dev/null
+++ b/ios/iosremote/iosremote/iosremote-Info.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleDisplayName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+	<key>LSRequiresIPhoneOS</key>
+	<true/>
+	<key>UIMainStoryboardFile</key>
+	<string>MainStoryboard_iPhone</string>
+	<key>UIMainStoryboardFile~ipad</key>
+	<string>MainStoryboard_iPad</string>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>armv7</string>
+	</array>
+	<key>UISupportedInterfaceOrientations</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+</dict>
+</plist>
diff --git a/ios/iosremote/iosremote/iosremote-Prefix.pch b/ios/iosremote/iosremote/iosremote-Prefix.pch
new file mode 100644
index 0000000..b60bc65
--- /dev/null
+++ b/ios/iosremote/iosremote/iosremote-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'iosremote' target in the 'iosremote' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_5_0
+#warning "This project uses features only available in iOS SDK 5.0 and later."
+#endif
+
+#ifdef __OBJC__
+    #import <UIKit/UIKit.h>
+    #import <Foundation/Foundation.h>
+#endif
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.h b/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.h
new file mode 100644
index 0000000..1507d06
--- /dev/null
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.h
@@ -0,0 +1,15 @@
+//
+//  libreoffice_sdremoteAppDelegate.h
+//  iosremote
+//
+//  Created by Liu Siqi on 6/4/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+ at interface libreoffice_sdremoteAppDelegate : UIResponder <UIApplicationDelegate>
+
+ at property (strong, nonatomic) UIWindow *window;
+
+ at end
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.m b/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.m
new file mode 100644
index 0000000..eab5461
--- /dev/null
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteAppDelegate.m
@@ -0,0 +1,46 @@
+//
+//  libreoffice_sdremoteAppDelegate.m
+//  iosremote
+//
+//  Created by Liu Siqi on 6/4/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "libreoffice_sdremoteAppDelegate.h"
+
+ at implementation libreoffice_sdremoteAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+    // Override point for customization after application launch.
+    return YES;
+}
+							
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+ at end
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
new file mode 100644
index 0000000..695964b
--- /dev/null
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
@@ -0,0 +1,13 @@
+//
+//  libreoffice_sdremoteViewController.h
+//  iosremote
+//
+//  Created by Liu Siqi on 6/4/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+ at interface libreoffice_sdremoteViewController : UIViewController
+
+ at end
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
new file mode 100644
index 0000000..d6af7fe
--- /dev/null
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
@@ -0,0 +1,29 @@
+//
+//  libreoffice_sdremoteViewController.m
+//  iosremote
+//
+//  Created by Liu Siqi on 6/4/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "libreoffice_sdremoteViewController.h"
+
+ at interface libreoffice_sdremoteViewController ()
+
+ at end
+
+ at implementation libreoffice_sdremoteViewController
+
+- (void)viewDidLoad
+{
+    [super viewDidLoad];
+	// Do any additional setup after loading the view, typically from a nib.
+}
+
+- (void)didReceiveMemoryWarning
+{
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+ at end
diff --git a/ios/iosremote/iosremote/main.m b/ios/iosremote/iosremote/main.m
new file mode 100644
index 0000000..126838a
--- /dev/null
+++ b/ios/iosremote/iosremote/main.m
@@ -0,0 +1,18 @@
+//
+//  main.m
+//  iosremote
+//
+//  Created by Liu Siqi on 6/4/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "libreoffice_sdremoteAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+    @autoreleasepool {
+        return UIApplicationMain(argc, argv, nil, NSStringFromClass([libreoffice_sdremoteAppDelegate class]));
+    }
+}
commit c40c00c1a3f33b1bda30342f2efa1b08626134d5
Author: siqi <me at siqi.fr>
Date:   Tue Jun 4 10:22:50 2013 +0200

    minor

diff --git a/ios/sdremote/sdremote/Communication/Client.m b/ios/sdremote/sdremote/Communication/Client.m
index 5637f96..c48ec12 100644
--- a/ios/sdremote/sdremote/Communication/Client.m
+++ b/ios/sdremote/sdremote/Communication/Client.m
@@ -18,7 +18,7 @@
 
 @property (nonatomic, strong) NSString* mPin;
 @property (nonatomic, strong) NSString* mName;
- at property const int mPort;
+ at property const uint mPort;
 
 @property (nonatomic, weak) Server* mServer;
 @property (nonatomic, weak) Receiver* mReceiver;
@@ -56,7 +56,7 @@ NSString * const CHARSET = @"UTF-8";
     return self;
 }
 
-- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(int)portNumber
+- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
 {
     CFReadStreamRef readStream;
     CFWriteStreamRef writeStream;
commit 3b097454b5660c8b0bfba42aec0eee8d20115414
Author: Siqi LIU <me at siqi.fr>
Date:   Tue Jun 4 09:31:57 2013 +0200

    initial commit

diff --git a/ios/sdremote/sdremote/Client.h b/ios/sdremote/sdremote/Client.h
deleted file mode 100644
index 4cb809d..0000000
--- a/ios/sdremote/sdremote/Client.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Client.h
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
- at interface Client : NSObject
-
- at end
diff --git a/ios/sdremote/sdremote/Client.m b/ios/sdremote/sdremote/Client.m
deleted file mode 100644
index 917b357..0000000
--- a/ios/sdremote/sdremote/Client.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  Client.m
-//  sdremote
-//
-//  Created by Liu Siqi on 6/3/13.
-//  Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Client.h"
-
- at implementation Client
-
- at end
diff --git a/ios/sdremote/sdremote/Communication/Client.m b/ios/sdremote/sdremote/Communication/Client.m
index 386b7a6..5637f96 100644
--- a/ios/sdremote/sdremote/Communication/Client.m
+++ b/ios/sdremote/sdremote/Communication/Client.m
@@ -18,12 +18,14 @@
 
 @property (nonatomic, strong) NSString* mPin;
 @property (nonatomic, strong) NSString* mName;
- at property int mPort;
+ at property const int mPort;
 
 @property (nonatomic, weak) Server* mServer;
 @property (nonatomic, weak) Receiver* mReceiver;
 @property (nonatomic, weak) CommunicationManager* mComManager;
 
+ at property (nonatomic, retain) NSMutableData* mData;
+
 @end
 
 
@@ -36,6 +38,7 @@
 @synthesize mName = _mName;
 @synthesize mServer = _mServer;
 @synthesize mComManager = _mComManager;
+ at synthesize mData = _mData;
 
 NSString * const CHARSET = @"UTF-8";
 
@@ -78,6 +81,30 @@ NSString * const CHARSET = @"UTF-8";
     }
 }
 
+- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
+    
+    switch(eventCode) {
+        case NSStreamEventHasBytesAvailable:
+        {
+            if(!self.mData) {
+                self.mData = [NSMutableData data];
+            }
+            uint8_t buf[1024];
+            unsigned int len = 0;
+            len = [(NSInputStream *)stream read:buf maxLength:1024];
+            if(len) {
+                [self.mData appendBytes:(const void *)buf length:len];
+                // bytesRead is an instance variable of type NSNumber.
+                [bytesRead setIntValue:[bytesRead intValue]+len];
+            } else {
+                NSLog(@"no buffer!");
+            }
+            break;
+        }
+            
+    }
+}
+
 
 - (void) connect
 {
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
index 2e56b7a..f120e0f 100644
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
@@ -9,5 +9,7 @@
 #import <UIKit/UIKit.h>
 
 @interface libreoffice_sdremoteViewController : UIViewController
+ at property (weak, nonatomic) IBOutlet UIBarButtonItem *connect;
 
 @end
+
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
index a955d8d..ed11a73 100644
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
@@ -28,4 +28,8 @@
     // Dispose of any resources that can be recreated.
 }
 
+- (void)viewDidUnload {
+    [self setConnect:nil];
+    [super viewDidUnload];
+}
 @end
commit deac1594da2db18a7e393206e73329a5891269f6
Author: Siqi LIU <me at siqi.fr>
Date:   Tue Jun 4 00:30:36 2013 +0200

    initial commit

diff --git a/ios/sdremote/sdremote/Client.h b/ios/sdremote/sdremote/Client.h
new file mode 100644
index 0000000..4cb809d
--- /dev/null
+++ b/ios/sdremote/sdremote/Client.h
@@ -0,0 +1,13 @@
+//
+//  Client.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface Client : NSObject
+
+ at end
diff --git a/ios/sdremote/sdremote/Client.m b/ios/sdremote/sdremote/Client.m
new file mode 100644
index 0000000..917b357
--- /dev/null
+++ b/ios/sdremote/sdremote/Client.m
@@ -0,0 +1,13 @@
+//
+//  Client.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Client.h"
+
+ at implementation Client
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/Client.h b/ios/sdremote/sdremote/Communication/Client.h
new file mode 100644
index 0000000..03a7a5a
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Client.h
@@ -0,0 +1,17 @@
+//
+//  Client.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface Client : NSObject <NSStreamDelegate>
+
+
++(void) connect;
+
+
+ at end
\ No newline at end of file
diff --git a/ios/sdremote/sdremote/Communication/Client.m b/ios/sdremote/sdremote/Communication/Client.m
new file mode 100644
index 0000000..386b7a6
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Client.m
@@ -0,0 +1,90 @@
+//
+//  Client.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Client.h"
+#import "Server.h"
+#import "Receiver.h"
+#import "CommunicationManager.h"
+
+ at interface Client()
+
+ at property (nonatomic, strong) NSInputStream* mInputStream;
+ at property (nonatomic, strong) NSOutputStream* mOutputStream;
+
+ at property (nonatomic, strong) NSString* mPin;
+ at property (nonatomic, strong) NSString* mName;
+ at property int mPort;
+
+ at property (nonatomic, weak) Server* mServer;
+ at property (nonatomic, weak) Receiver* mReceiver;
+ at property (nonatomic, weak) CommunicationManager* mComManager;
+
+ at end
+
+
+
+ at implementation Client
+
+ at synthesize mInputStream = _mInputStream;
+ at synthesize mOutputStream = _mOutputStream;
+ at synthesize mPin = _mPin;
+ at synthesize mName = _mName;
+ at synthesize mServer = _mServer;
+ at synthesize mComManager = _mComManager;
+
+NSString * const CHARSET = @"UTF-8";
+
+- (id) initWithServer:(Server*)server
+           managedBy:(CommunicationManager*)manager
+       interpretedBy:(Receiver*)receiver
+{
+    self.mPin = @"";
+    self.mName = server.serverName;
+    self.mComManager = manager;
+    self.mReceiver = receiver;
+    // hardcoded here to test the communication TODO
+    self.mPort = 1599;
+    
+    return self;
+}
+
+- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(int)portNumber
+{
+    CFReadStreamRef readStream;
+    CFWriteStreamRef writeStream;
+    CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
+    
+    if(readStream && writeStream)
+    {
+        CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
+        
+        //Setup mInputStream
+        self.mInputStream = (__bridge NSInputStream *)readStream;
+        [self.mInputStream setDelegate:self];
+        [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mInputStream open];
+        
+        //Setup outputstream
+        self.mOutputStream = (__bridge NSOutputStream *)writeStream;
+        [self.mOutputStream setDelegate:self];
+        [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [self.mOutputStream open];
+    }
+}
+
+
+- (void) connect
+{
+    [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
+    
+}
+
+
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.h b/ios/sdremote/sdremote/Communication/CommunicationManager.h
new file mode 100644
index 0000000..d649e3c
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/CommunicationManager.h
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface CommunicationManager : NSObject
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.m b/ios/sdremote/sdremote/Communication/CommunicationManager.m
new file mode 100644
index 0000000..c91b2f5
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/CommunicationManager.m
@@ -0,0 +1,13 @@
+//
+//  CommunicationManager.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "CommunicationManager.h"
+
+ at implementation CommunicationManager
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.h b/ios/sdremote/sdremote/Communication/Receiver.h
new file mode 100644
index 0000000..9889ec7
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Receiver.h
@@ -0,0 +1,13 @@
+//
+//  Receiver.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at interface Receiver : NSObject
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.m b/ios/sdremote/sdremote/Communication/Receiver.m
new file mode 100644
index 0000000..30a48c6
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Receiver.m
@@ -0,0 +1,13 @@
+//
+//  Receiver.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Receiver.h"
+
+ at implementation Receiver
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/Server.h b/ios/sdremote/sdremote/Communication/Server.h
new file mode 100644
index 0000000..2cf720e
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Server.h
@@ -0,0 +1,19 @@
+//
+//  Server.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum protocol {NETWORK} Protocol_t;
+
+ at interface Server : NSObject
+
+ at property (nonatomic) Protocol_t protocol;
+ at property (nonatomic, strong) NSString* serverName;
+ at property (nonatomic, strong) NSString* serverAddress;
+
+ at end
diff --git a/ios/sdremote/sdremote/Communication/Server.m b/ios/sdremote/sdremote/Communication/Server.m
new file mode 100644
index 0000000..d7bf1ad
--- /dev/null
+++ b/ios/sdremote/sdremote/Communication/Server.m
@@ -0,0 +1,36 @@
+//
+//  Server.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "Server.h"
+
+ at interface Server()
+
+ at end
+
+ at implementation Server
+
+ at synthesize protocol = _protocol;
+ at synthesize serverName = _serverName;
+ at synthesize serverAddress = _serverAddress;
+
+- (id)initWithProtocol:(Protocol_t)protocal
+           atAddress:(NSString*) address
+              ofName:(NSString*) name
+{
+    self = [self init];
+    self.protocol = protocal;
+    self.serverAddress = address;
+    self.serverName = name;
+    return self;
+}
+
+- (NSString *)description{
+    return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
+}
+
+ at end
diff --git a/ios/sdremote/sdremote/Default-568h at 2x.png b/ios/sdremote/sdremote/Default-568h at 2x.png
new file mode 100644
index 0000000..0891b7a
Binary files /dev/null and b/ios/sdremote/sdremote/Default-568h at 2x.png differ
diff --git a/ios/sdremote/sdremote/Default.png b/ios/sdremote/sdremote/Default.png
new file mode 100644
index 0000000..4c8ca6f
Binary files /dev/null and b/ios/sdremote/sdremote/Default.png differ
diff --git a/ios/sdremote/sdremote/Default at 2x.png b/ios/sdremote/sdremote/Default at 2x.png
new file mode 100644
index 0000000..35b84cf
Binary files /dev/null and b/ios/sdremote/sdremote/Default at 2x.png differ
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
new file mode 100644
index 0000000..2d16876
--- /dev/null
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
@@ -0,0 +1,15 @@
+//
+//  libreoffice_sdremoteAppDelegate.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+ at interface libreoffice_sdremoteAppDelegate : UIResponder <UIApplicationDelegate>
+
+ at property (strong, nonatomic) UIWindow *window;
+
+ at end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
new file mode 100644
index 0000000..2e13f91
--- /dev/null
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
@@ -0,0 +1,46 @@
+//
+//  libreoffice_sdremoteAppDelegate.m
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import "libreoffice_sdremoteAppDelegate.h"
+
+ at implementation libreoffice_sdremoteAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+    // Override point for customization after application launch.
+    return YES;
+}
+							
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+ at end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
new file mode 100644
index 0000000..2e56b7a
--- /dev/null
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
@@ -0,0 +1,13 @@
+//
+//  libreoffice_sdremoteViewController.h
+//  sdremote
+//
+//  Created by Liu Siqi on 6/3/13.
+//  Copyright (c) 2013 libreoffice. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+ at interface libreoffice_sdremoteViewController : UIViewController
+
+ at end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
new file mode 100644
index 0000000..a955d8d
--- /dev/null
+++ b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
@@ -0,0 +1,31 @@
+//
+//  libreoffice_sdremoteViewController.m

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list