openEventsPlatformApp/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m
plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.mRaw
1/*
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 */
19
20#import <UIKit/UIKit.h>
21#import "ImageNameTestDelegates.h"
22
23@implementation PortraitOnly
24
25- (NSUInteger)supportedInterfaceOrientations {
26 return UIInterfaceOrientationMaskPortrait;
27}
28
29- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
30 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
31}
32
33- (BOOL)shouldAutorotate {
34 return YES;
35}
36
37@end
38
39@implementation PortraitUpsideDownOnly
40
41- (NSUInteger)supportedInterfaceOrientations {
42 return UIInterfaceOrientationMaskPortraitUpsideDown;
43}
44
45- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
46 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
47}
48
49- (BOOL)shouldAutorotate {
50 return YES;
51}
52
53@end
54
55@implementation AllPortraitOnly
56
57- (NSUInteger)supportedInterfaceOrientations {
58 return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
59}
60
61- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
62 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
63}
64
65- (BOOL)shouldAutorotate {
66 return YES;
67}
68
69@end
70
71
72@implementation LandscapeLeftOnly
73
74- (NSUInteger)supportedInterfaceOrientations {
75 return UIInterfaceOrientationMaskLandscapeLeft;
76}
77
78- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
79 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
80}
81
82- (BOOL)shouldAutorotate {
83 return YES;
84}
85
86@end
87
88@implementation LandscapeRightOnly
89
90- (NSUInteger)supportedInterfaceOrientations {
91 return UIInterfaceOrientationMaskLandscapeRight;
92}
93
94- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
95 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
96}
97
98- (BOOL)shouldAutorotate {
99 return YES;
100}
101
102@end
103
104@implementation AllLandscapeOnly
105
106- (NSUInteger)supportedInterfaceOrientations {
107 return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
108}
109
110- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
111 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
112}
113
114- (BOOL)shouldAutorotate {
115 return YES;
116}
117
118@end
119
120
121@implementation AllOrientations
122
123- (NSUInteger)supportedInterfaceOrientations {
124 return UIInterfaceOrientationMaskAll;
125}
126
127- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
128 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
129}
130
131- (BOOL)shouldAutorotate {
132 return YES;
133}
134
135@end
136
137@implementation PortraitAndLandscapeLeftOnly
138
139- (NSUInteger)supportedInterfaceOrientations {
140 return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
141}
142
143- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
144 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
145}
146
147- (BOOL)shouldAutorotate {
148 return YES;
149}
150
151@end
152
153@implementation PortraitAndLandscapeRightOnly
154
155- (NSUInteger)supportedInterfaceOrientations {
156 return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
157}
158
159- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
160 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
161}
162
163- (BOOL)shouldAutorotate {
164 return YES;
165}
166
167@end
168
169@implementation PortraitUpsideDownAndLandscapeLeftOnly
170
171- (NSUInteger)supportedInterfaceOrientations {
172 return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeLeft;
173}
174
175- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
176 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
177}
178
179- (BOOL)shouldAutorotate {
180 return YES;
181}
182
183@end
184
185@implementation PortraitUpsideDownAndLandscapeRightOnly
186
187- (NSUInteger)supportedInterfaceOrientations {
188 return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeRight;
189}
190
191- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
192 return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
193}
194
195- (BOOL)shouldAutorotate {
196 return YES;
197}
198
199@end
200