diff options
author | Ptyl Dragon <ptyl@cloudon.com> | 2013-10-17 17:01:35 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-10-17 17:02:44 +0200 |
commit | 76a9ae801bcc252947da991e9bf6dc3ebfde5ebf (patch) | |
tree | 8597088c5545e54c99aa732f7af4b9d652d476ca /ios | |
parent | ae549ad1e66283b641e27c3a3743b468b9ff1c43 (diff) |
added for infrastructure for ios tile testing app
Change-Id: Ie8ac64769c01c5e967a56844a69747ef4d4f20af
Diffstat (limited to 'ios')
18 files changed, 478 insertions, 0 deletions
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h new file mode 100644 index 000000000000..fbb5af8bd501 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Friend.h @@ -0,0 +1,18 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOMainViewController.h" + +static const CGFloat TOP_BAR_HEIGHT =40.0f; + +@class MLOGestureEngine,MLORenderManager; +@interface MLOMainViewController () +@property MLOGestureEngine * gestureEngine; +@property MLORenderManager * renderManager; +-(void) toggleExpand; +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h new file mode 100644 index 000000000000..dceb410a665f --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOMainViewController_Private.h @@ -0,0 +1,22 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOMainViewController_Friend.h" + +@class MLOAppRoleBase,MLOToolbarButton,MLOTopbarViewController,MLOToolbarViewController; +@interface MLOMainViewController () +@property BOOL focused; +@property CGFloat topBarHeight; +@property UIView * flasher; +@property MLOTopbarViewController * topbar; +@property MLOToolbarViewController * toolbar; +@property MLOAppRoleBase * role; + +-(void)resize; +-(void)resetSubviews; +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.h new file mode 100644 index 000000000000..7475f489dbf4 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.h @@ -0,0 +1,16 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOViewController.h" +#import "MLOAppRoleProtocol.h" +@class MLOMainViewController,MLOAppRoleBase; +@interface MLOAppRoleBase : MLOViewController<MLOAppRoleProtocol> + +@property MLOMainViewController * mainViewController; + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m new file mode 100644 index 000000000000..e46c46e13ed2 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleBase.m @@ -0,0 +1,13 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleBase.h" + +@implementation MLOAppRoleBase + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.h new file mode 100644 index 000000000000..2fed97f2831b --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.h @@ -0,0 +1,14 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOObject.h" + +@class MLOAppRoleBase,MLOMainViewController; +@interface MLOAppRoleFactory : MLOObject ++(MLOAppRoleBase *) getInstanceWithMainViewController:(MLOMainViewController *) mainViewController; +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m new file mode 100644 index 000000000000..3594ecf85c93 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleFactory.m @@ -0,0 +1,35 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleFactory.h" +#import "MLOAppRoleLoApp.h" +#import "MLOAppRoleTileTester.h" +#import "MLOMainViewController.h" + +@implementation MLOAppRoleFactory + ++(MLOAppRoleBase *) getInstanceWithMainViewController:(MLOMainViewController *) mainViewController{ + MLOAppRoleBase * role; + + switch (APP_ROLE) { + case LO_APP: + { + role = [MLOAppRoleLoApp new]; + break; + } + case TILE_TESTER: + { + role= [MLOAppRoleTileTester new]; + break; + } + } + role.mainViewController = mainViewController; + return role; +} + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h new file mode 100644 index 000000000000..99d6d13afc43 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.h @@ -0,0 +1,13 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleBase.h" + +@interface MLOAppRoleLoApp : MLOAppRoleBase + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m new file mode 100644 index 000000000000..12a19106bbbd --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleLoApp.m @@ -0,0 +1,107 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleLoApp.h" +#import "MLOMainViewController_Private.h" +#import "MLORenderManager.h" +#import "MLOGestureEngine.h" +#import "MLOToolbarViewController.h" +#import "MLOSelectionViewController.h" +#import "MLOScrollerViewController.h" +#import "MLOTopbarViewController.h" +#import "MLOKeyboardManager.h" + +static const NSTimeInterval ROTATE_FLASH_DURATION=0.5f; + +@implementation MLOAppRoleLoApp + +-(void)initSubviews{ + MLOMainViewController * main = [self mainViewController]; + main.scroller = [[MLOScrollerViewController alloc] initWithMainViewController:main]; + main.selection = [[MLOSelectionViewController alloc] initWithMainViewController: main]; + main.toolbar = [[MLOToolbarViewController alloc] initWithMainViewController:main]; + main.keyboard = [[MLOKeyboardManager alloc]initWithMainViewController:main]; + main.flasher =[[UIView alloc] initWithFrame:CGRECT_ZERO]; + main.flasher.alpha = 0.0f; + main.flasher.backgroundColor = [UIColor whiteColor]; + main.gestureEngine = nil; +} + +-(void)setWidth:(CGFloat) width height:(CGFloat) height{ + + [[self mainViewController].renderManager setWidth:width height:height]; +} + +-(void)addSubviews{ + + MLOMainViewController * main = [self mainViewController]; + main.renderManager = [MLORenderManager getInstance]; + + [main resize]; + + [main.canvas addSubview: main.renderManager.view]; + + main.gestureEngine = [[MLOGestureEngine alloc] initWithMainViewController:main]; + [main.toolbar addToMainViewController]; + [main.scroller addToMainViewController]; + [main.selection addToMainViewController]; + [main.keyboard addToMainViewController]; +} + +-(void)rotate{ + + MLOMainViewController * main = self.mainViewController; + + NSLog(@"MLO rotate"); + + main.renderManager.view.alpha= 0.0f; + + [main resize]; + + [main.gestureEngine onRotate]; + + [main.topbar onRotate]; + + [main.scroller reset]; + + [main.scroller showLibreOffice]; + + [main.selection onRotate]; + + [main.toolbar onRotate]; + + [UIView animateWithDuration:ROTATE_FLASH_DURATION animations:^(void){ + main.renderManager.view.alpha=1.0f; + }]; +} + + +-(void)showLibreOffice{ + + [self.mainViewController.toolbar showLibreOffice]; +} + +-(void)hideLibreOffice{ + MLOMainViewController * main = self.mainViewController; + + [main.toolbar hideLibreOffice]; + [main resetSubviews]; + [main.gestureEngine hideLibreOffice]; + [main.scroller hideLibreOffice]; + [main.selection reset]; + [main.keyboard hide]; +} + +-(void)initWindow:(UIWindow *) window{ + MLOMainViewController * main = self.mainViewController; + [main.renderManager setWidth:main.view.frame.size.width height:main.view.frame.size.height]; + + [main.gestureEngine showLibreOffice:window]; +} + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h new file mode 100644 index 000000000000..d44435e52823 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleProtocol.h @@ -0,0 +1,21 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import <Foundation/Foundation.h> + +@protocol MLOAppRoleProtocol <NSObject> + +@optional +-(void)initSubviews; +-(void)setWidth:(CGFloat) width height:(CGFloat) height; +-(void)addSubviews; +-(void)rotate; +-(void)initWindow:(UIWindow *) window; +-(void)showLibreOffice; +-(void)hideLibreOffice; +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h new file mode 100644 index 000000000000..1d0a49805e8d --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.h @@ -0,0 +1,13 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleBase.h" + +@interface MLOAppRoleTileTester : MLOAppRoleBase + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m new file mode 100644 index 000000000000..0486331ed14e --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m @@ -0,0 +1,70 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOAppRoleTileTester.h" +#import "MLOMainViewController_Private.h" +#import "MLOTopbarViewController.h" +#import "MLOTestingTileRendererViewController.h" +#import "MLOTestingTileParametersViewController.h" + +@interface MLOAppRoleTileTester () +@property MLOTestingTileRendererViewController * renderer; +@property MLOTestingTileParametersViewController * params; +@end + +@implementation MLOAppRoleTileTester + +-(void)initSubviews{ + + self.renderer = [[MLOTestingTileRendererViewController alloc] initWithTester:self]; + self.params = [[MLOTestingTileParametersViewController alloc] initWithTester:self]; + +} + + +-(void)setWidth:(CGFloat) width height:(CGFloat) height{ + if(width > height){ + CGFloat halfWidth = width/2.0f; + self.renderer.view.frame =CGRectMake(0, 0, halfWidth, height); + self.params.view.frame =CGRectMake(halfWidth,0, halfWidth, height); + }else{ + CGFloat halfHeight = height/2.0f; + self.renderer.view.frame =CGRectMake(0, 0, width, halfHeight); + self.params.view.frame =CGRectMake(width,halfHeight, width, halfHeight); + } + [self.renderer resize]; + [self.params resize]; +} +-(void)addSubviews{ + + [self.renderer addToMainViewController]; + [self.params addToMainViewController]; + + [self.mainViewController resize]; +} + +-(void)rotate{ + + MLOMainViewController * main = [self mainViewController]; + + [main resize]; + + [main.topbar onRotate]; +} + + +-(void)showLibreOffice{ + +} +-(void)hideLibreOffice{ +} + +-(void)initWindow:(UIWindow *) window{ + +} +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h new file mode 100644 index 000000000000..c5f536ad9e28 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.h @@ -0,0 +1,14 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOViewController.h" +#import "MLOTestingTileSubviewControllerProtocol.h" + +@interface MLOTestingTileParametersViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol> + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m new file mode 100644 index 000000000000..4c3626ad0279 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileParametersViewController.m @@ -0,0 +1,31 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOTestingTileParametersViewController.h" + +@interface MLOTestingTileParametersViewController () +@property MLOAppRoleTileTester * tester; +@end + +@implementation MLOTestingTileParametersViewController + +-(id)initWithTester:(MLOAppRoleTileTester *)tester{ + self = [self init]; + if(self){ + self.tester = tester; + + } + return self; +} +-(void)resize{ + +} +-(void)addToMainViewController{ + +} +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h new file mode 100644 index 000000000000..e2e0215e2361 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.h @@ -0,0 +1,14 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOViewController.h" +#import "MLOTestingTileSubviewControllerProtocol.h" + +@interface MLOTestingTileRendererViewController : MLOViewController<MLOTestingTileSubviewControllerProtocol> + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m new file mode 100644 index 000000000000..daeb8111b1ef --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileRendererViewController.m @@ -0,0 +1,32 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import "MLOTestingTileRendererViewController.h" +#import "MLOAppRoleTileTester.h" + +@interface MLOTestingTileRendererViewController () +@property MLOAppRoleTileTester * tester; +@end + +@implementation MLOTestingTileRendererViewController + +-(id)initWithTester:(MLOAppRoleTileTester *)tester{ + self = [self init]; + if(self){ + self.tester = tester; + + } + return self; +} +-(void)resize{ + +} +-(void)addToMainViewController{ + +} +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h new file mode 100644 index 000000000000..b8bc3f34c937 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewControllerProtocol.h @@ -0,0 +1,16 @@ +// -*- Mode: Objective-C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// +// This file is part of the LibreOffice project. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#import <Foundation/Foundation.h> + +@class MLOAppRoleTileTester; +@protocol MLOTestingTileSubviewControllerProtocol <NSObject> +-(id)initWithTester:(MLOAppRoleTileTester *)tester; +-(void)addToMainViewController; +-(void)resize; +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h new file mode 100644 index 000000000000..6631fcb1259e --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.h @@ -0,0 +1,15 @@ +// +// MLOTestingTileSubviewViewController.h +// ios_sharedlo +// +// Created by ptyl on 10/17/13. +// Copyright (c) 2013 LibreOffice.org. All rights reserved. +// + +#import "MLOViewController.h" + +@class MLOAppRoleTileTester; +@interface MLOTestingTileSubviewViewController : MLOViewController +@property MLOAppRoleTileTester * tester; + +@end diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m new file mode 100644 index 000000000000..070bfed9a577 --- /dev/null +++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/testing_tiles/MLOTestingTileSubviewViewController.m @@ -0,0 +1,14 @@ +// +// MLOTestingTileSubviewViewController.m +// ios_sharedlo +// +// Created by ptyl on 10/17/13. +// Copyright (c) 2013 LibreOffice.org. All rights reserved. +// + +#import "MLOTestingTileSubviewViewController.h" + +@implementation MLOTestingTileSubviewViewController + + +@end |