Safe Browsing Incident Reporting Service.
[chromium-blink-merge.git] / remoting / ios / utility.h
blobac6a2a43e24222c684a08e59b941573786569aa7
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_IOS_UTILITY_H_
6 #define REMOTING_IOS_UTILITY_H_
8 #import <Foundation/Foundation.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
14 #import "remoting/ios/bridge/host_proxy.h"
16 typedef struct {
17 scoped_ptr<webrtc::BasicDesktopFrame> image;
18 scoped_ptr<webrtc::DesktopVector> offset;
19 } GLRegion;
21 @interface Utility : NSObject
23 + (BOOL)isPad;
25 + (BOOL)isInLandscapeMode;
27 // Return the resolution in respect to orientation
28 + (CGSize)getOrientatedSize:(CGSize)size
29 shouldWidthBeLongestSide:(BOOL)shouldWidthBeLongestSide;
31 + (void)showAlert:(NSString*)title message:(NSString*)message;
33 + (NSString*)appVersionNumberDisplayString;
35 // GL Binding Context requires some specific flags for the type of textures
36 // being drawn
37 + (void)bindTextureForIOS:(GLuint)glName;
39 // Sometimes its necessary to read gl errors. This is called in various places
40 // while working in the GL Context
41 + (void)logGLErrorCode:(NSString*)funcName;
43 + (void)drawSubRectToGLFromRectOfSize:(const webrtc::DesktopSize&)rectSize
44 subRect:(const webrtc::DesktopRect&)subRect
45 data:(const uint8_t*)data;
47 + (void)moveMouse:(HostProxy*)controller at:(const webrtc::DesktopVector&)point;
49 + (void)leftClickOn:(HostProxy*)controller
50 at:(const webrtc::DesktopVector&)point;
52 + (void)middleClickOn:(HostProxy*)controller
53 at:(const webrtc::DesktopVector&)point;
55 + (void)rightClickOn:(HostProxy*)controller
56 at:(const webrtc::DesktopVector&)point;
58 + (void)mouseScroll:(HostProxy*)controller
59 at:(const webrtc::DesktopVector&)point
60 delta:(const webrtc::DesktopVector&)delta;
62 @end
64 #endif // REMOTING_IOS_UTILITY_H_