aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorGravatar Jonathan Willing <jwilling@me.com>2013-04-08 23:45:13 -0500
committerGravatar Jonathan Willing <jwilling@me.com>2013-04-08 23:45:16 -0500
commit6d2d5664f1c9d24034f8a7c339aceed42292bda3 (patch)
tree553daa85f1198f1aaebc39385f2e3d91647a7116 /example
parentc8bc94b4640bd2d370af69b446d3edd0c97264de (diff)
begin implenting some operations
Diffstat (limited to 'example')
-rw-r--r--example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj12
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/Application.h13
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/Application.m20
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/MasterViewController.m32
-rw-r--r--example/ios/iOS UI Test/iOS UI Test/main.m3
5 files changed, 77 insertions, 3 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj b/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
index 28e68040..a4668c48 100644
--- a/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
+++ b/example/ios/iOS UI Test/iOS UI Test.xcodeproj/project.pbxproj
@@ -10,6 +10,7 @@
AB665BCD17134336007F2151 /* FXKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = AB665BCB17134336007F2151 /* FXKeychain.m */; };
AB7BA446171389CC00104953 /* libMailCore-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7BA43D1713898B00104953 /* libMailCore-ios.a */; };
AB7BA4481713913F00104953 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7BA4471713913F00104953 /* CFNetwork.framework */; };
+ AB7BA4511713CE3300104953 /* Application.m in Sources */ = {isa = PBXBuildFile; fileRef = AB7BA4501713CE3300104953 /* Application.m */; };
AB9EAE06170368F000D750C7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE05170368F000D750C7 /* UIKit.framework */; };
AB9EAE08170368F000D750C7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE07170368F000D750C7 /* Foundation.framework */; };
AB9EAE0A170368F000D750C7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9EAE09170368F000D750C7 /* CoreGraphics.framework */; };
@@ -78,6 +79,8 @@
AB665BCC17134336007F2151 /* FXKeychain_LICENCE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FXKeychain_LICENCE.md; sourceTree = "<group>"; };
AB7BA4321713898B00104953 /* mailcore2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mailcore2.xcodeproj; path = "../../../../build-mac/mailcore2.xcodeproj"; sourceTree = "<group>"; };
AB7BA4471713913F00104953 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ AB7BA44F1713CE3300104953 /* Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Application.h; sourceTree = "<group>"; };
+ AB7BA4501713CE3300104953 /* Application.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Application.m; sourceTree = "<group>"; };
AB9EAE02170368F000D750C7 /* iOS UI Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS UI Test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
AB9EAE05170368F000D750C7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
AB9EAE07170368F000D750C7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -145,7 +148,6 @@
AB9EADF9170368F000D750C7 = {
isa = PBXGroup;
children = (
- AB7BA4471713913F00104953 /* CFNetwork.framework */,
AB9EAE0B170368F000D750C7 /* iOS UI Test */,
AB9EAE04170368F000D750C7 /* Frameworks */,
AB9EAE03170368F000D750C7 /* Products */,
@@ -163,6 +165,7 @@
AB9EAE04170368F000D750C7 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ AB7BA4471713913F00104953 /* CFNetwork.framework */,
AB9EAE3F170374D900D750C7 /* Security.framework */,
AB9EAE05170368F000D750C7 /* UIKit.framework */,
AB9EAE07170368F000D750C7 /* Foundation.framework */,
@@ -175,6 +178,9 @@
isa = PBXGroup;
children = (
AB7BA4321713898B00104953 /* mailcore2.xcodeproj */,
+ AB9EAE11170368F000D750C7 /* main.m */,
+ AB7BA44F1713CE3300104953 /* Application.h */,
+ AB7BA4501713CE3300104953 /* Application.m */,
AB9EAE14170368F000D750C7 /* AppDelegate.h */,
AB9EAE15170368F000D750C7 /* AppDelegate.m */,
AB9EAE1D170368F000D750C7 /* MainStoryboard.storyboard */,
@@ -196,7 +202,6 @@
children = (
AB9EAE0D170368F000D750C7 /* iOS UI Test-Info.plist */,
AB9EAE0E170368F000D750C7 /* InfoPlist.strings */,
- AB9EAE11170368F000D750C7 /* main.m */,
AB9EAE13170368F000D750C7 /* iOS UI Test-Prefix.pch */,
AB9EAE17170368F000D750C7 /* Default.png */,
AB9EAE19170368F000D750C7 /* Default@2x.png */,
@@ -323,6 +328,7 @@
AB9EAE25170368F000D750C7 /* DetailViewController.m in Sources */,
AB9EAE3617036FD700D750C7 /* SettingsViewController.m in Sources */,
AB665BCD17134336007F2151 /* FXKeychain.m in Sources */,
+ AB7BA4511713CE3300104953 /* Application.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -418,6 +424,7 @@
CLANG_CXX_LIBRARY = "libstdc++";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iOS UI Test/iOS UI Test-Prefix.pch";
+ HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "iOS UI Test/iOS UI Test-Info.plist";
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../Externals/libetpan-ios/lib\"",
@@ -450,6 +457,7 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iOS UI Test/iOS UI Test-Prefix.pch";
+ HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "iOS UI Test/iOS UI Test-Info.plist";
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../Externals/libetpan-ios/lib\"",
diff --git a/example/ios/iOS UI Test/iOS UI Test/Application.h b/example/ios/iOS UI Test/iOS UI Test/Application.h
new file mode 100644
index 00000000..a0c525a6
--- /dev/null
+++ b/example/ios/iOS UI Test/iOS UI Test/Application.h
@@ -0,0 +1,13 @@
+//
+// Application.h
+// iOS UI Test
+//
+// Created by Jonathan Willing on 4/8/13.
+// Copyright (c) 2013 AppJon. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface Application : UIApplication
+
+@end
diff --git a/example/ios/iOS UI Test/iOS UI Test/Application.m b/example/ios/iOS UI Test/iOS UI Test/Application.m
new file mode 100644
index 00000000..d9a6c292
--- /dev/null
+++ b/example/ios/iOS UI Test/iOS UI Test/Application.m
@@ -0,0 +1,20 @@
+//
+// Application.m
+// iOS UI Test
+//
+// Created by Jonathan Willing on 4/8/13.
+// Copyright (c) 2013 AppJon. All rights reserved.
+//
+
+#import "Application.h"
+#import <mailcore/mailcore.h>
+
+@implementation Application
+
+- (void)sendEvent:(UIEvent *)event {
+ //mailcore::AutoreleasePool * pool = new mailcore::AutoreleasePool();
+ [super sendEvent:event];
+
+}
+
+@end
diff --git a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
index 7a76efa7..bc8fbbbe 100644
--- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
+++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m
@@ -16,6 +16,7 @@
}
@property (nonatomic, strong) MCOIMAPOperation *imapCheckOp;
@property (nonatomic, strong) MCOIMAPSession *imapSession;
+@property (nonatomic, strong) MCOIMAPFetchMessagesOperation *imapMessagesFetchOp;
@end
@implementation MasterViewController
@@ -33,6 +34,37 @@
self.imapSession.username = username;
self.imapSession.password = password;
self.imapSession.connectionType = MCOConnectionTypeTLS;
+
+ NSLog(@"checking account");
+ __weak MasterViewController *weakSelf = self;
+ self.imapCheckOp = [self.imapSession checkAccountOperation];
+ [self.imapCheckOp start:^(NSError *error) {
+ MasterViewController *strongSelf = weakSelf;
+ NSLog(@"finished checking account.");
+ if (error == nil) {
+ [strongSelf loadEmails];
+ } else {
+ NSLog(@"error loading account: %@", error);
+ }
+
+ strongSelf.imapCheckOp = nil;
+ }];
+}
+
+- (void)loadEmails {
+ MCOIMAPMessagesRequestKind requestKind = (MCOIMAPMessagesRequestKind)
+ (MCOIMAPMessagesRequestKindHeaders | MCOIMAPMessagesRequestKindStructure |
+ MCOIMAPMessagesRequestKindInternalDate | MCOIMAPMessagesRequestKindHeaderSubject |
+ MCOIMAPMessagesRequestKindFlags);
+ self.imapMessagesFetchOp = [self.imapSession fetchMessagesByUIDOperationWithFolder:@"INBOX"
+ requestKind:requestKind
+ uids:[MCOIndexSet indexSetWithRange:MCORangeMake(1, UINT64_MAX)]];
+ [self.imapMessagesFetchOp setProgress:^(unsigned int progress) {
+ NSLog(@"progress: %u", progress);
+ }];
+ [self.imapMessagesFetchOp start:^(NSError *error, NSArray *messages, MCOIndexSet *vanishedMessages) {
+ NSLog(@"DONE");
+ }];
}
- (void)didReceiveMemoryWarning {
diff --git a/example/ios/iOS UI Test/iOS UI Test/main.m b/example/ios/iOS UI Test/iOS UI Test/main.m
index 479c71e4..d4efdd26 100644
--- a/example/ios/iOS UI Test/iOS UI Test/main.m
+++ b/example/ios/iOS UI Test/iOS UI Test/main.m
@@ -9,10 +9,11 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
+#import "Application.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ return UIApplicationMain(argc, argv, NSStringFromClass([Application class]), NSStringFromClass([AppDelegate class]));
}
}