Files
FreeRDP/client/iOS/Views/TouchPointerView.h

76 lines
2.2 KiB
C
Raw Permalink Normal View History

/*
2019-11-06 15:24:51 +01:00
RDP Touch Pointer View
2013-12-04 11:37:57 +01:00
Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
2019-11-06 15:24:51 +01:00
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 <UIKit/UIKit.h>
// protocol for touch pointer callbacks
@protocol TouchPointerDelegate
// callback if touch pointer should be closed
2019-11-06 15:24:51 +01:00
- (void)touchPointerClose;
// callback for a left click action
2019-11-06 15:24:51 +01:00
- (void)touchPointerLeftClick:(CGPoint)pos down:(BOOL)down;
// callback for a right click action
2019-11-06 15:24:51 +01:00
- (void)touchPointerRightClick:(CGPoint)pos down:(BOOL)down;
// callback for pointer move action
2019-11-06 15:24:51 +01:00
- (void)touchPointerMove:(CGPoint)pos;
// callback if scrolling is performed
2019-11-06 15:24:51 +01:00
- (void)touchPointerScrollDown:(BOOL)down;
// callback for toggling the standard keyboard
2019-11-06 15:24:51 +01:00
- (void)touchPointerToggleKeyboard;
// callback for toggling the extended keyboard
2019-11-06 15:24:51 +01:00
- (void)touchPointerToggleExtendedKeyboard;
// callback for reset session view
2019-11-06 15:24:51 +01:00
- (void)touchPointerResetSessionView;
@end
@interface TouchPointerView : UIView
{
2019-11-06 15:24:51 +01:00
// transformation and image currently drawn
CGAffineTransform _pointer_transformation;
UIImage *_cur_pointer_img;
// action images
UIImage *_default_pointer_img;
UIImage *_active_pointer_img;
UIImage *_lclick_pointer_img;
UIImage *_rclick_pointer_img;
UIImage *_scroll_pointer_img;
UIImage *_extkeyboard_pointer_img;
UIImage *_keyboard_pointer_img;
UIImage *_reset_pointer_img;
// predefined areas for all actions
CGRect _pointer_areas[9];
2019-11-06 15:24:51 +01:00
// scroll/drag n drop handling
CGPoint _prev_touch_location;
BOOL _pointer_moving;
BOOL _pointer_scrolling;
2019-11-06 15:24:51 +01:00
NSObject<TouchPointerDelegate> *_delegate;
}
2019-11-06 15:24:51 +01:00
@property(assign) IBOutlet NSObject<TouchPointerDelegate> *delegate;
2019-11-06 15:24:51 +01:00
// positions the pointer on screen if it got offscreen after an orentation change or after
// displaying the keyboard
- (void)ensurePointerIsVisible;
2019-11-06 15:24:51 +01:00
// returns the extent required for the scrollview to use the touch pointer near the edges of the
// session view
- (UIEdgeInsets)getEdgeInsets;
// return pointer dimension and position information
- (CGPoint)getPointerPosition;
- (int)getPointerWidth;
- (int)getPointerHeight;
@end