summaryrefslogtreecommitdiff
path: root/ios/shared/ios_sharedlo/objective_c/view_controllers/role/MLOAppRoleTileTester.m
blob: 743c0c113cde75534eb28f2e0753c5c79e47e24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// -*- Mode: ObjC; 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"


@implementation MLOAppRoleTileTester

-(void)initSubviews{
    NSLog(@"%@ initSubviews",self);
    self.renderer = [[MLOTestingTileRendererViewController alloc] initWithTester:self];
    self.params = [[MLOTestingTileParametersViewController alloc] initWithTester:self];
   
}

-(NSString *)description{
    return @"MLOAppRoleTileTester";
}


-(void)setWidth:(CGFloat) width height:(CGFloat) height{
    NSLog(@"%@ setWidth:height",self);
    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.params.view.frame =CGRectMake(0, 0, width, halfHeight);
        self.renderer.view.frame =CGRectMake(0,halfHeight, width, halfHeight);
    }
    [self.renderer resize];
    [self.params resize];

}
-(void)addSubviews{
    NSLog(@"%@ addSubviews",self);

    [self.renderer addToSuperview];
    [self.params addToSuperview];

    [self.mainViewController resize];
}

-(void)rotate{
    NSLog(@"%@ rotate",self);
    MLOMainViewController * main = [self mainViewController];
    
    [main resize];

    [main.topbar onRotate];

    [self.renderer resize];
    [self.params resize];
}


-(void)showLibreOffice{
    NSLog(@"%@ showLibreOffice",self);
}
-(void)hideLibreOffice{
    NSLog(@"%@ hideLibreOffice",self);
}

-(void)initWindow:(UIWindow *) window{
    NSLog(@"%@ initWindow",self);

}
@end