FreeRDP
Loading...
Searching...
No Matches
Utils.h
1/*
2 Utility functions
3
4 Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9 */
10
11#import <Foundation/Foundation.h>
12#import <CoreGraphics/CoreGraphics.h>
13#import "TSXTypes.h"
14
15// helper macro to encode a table path into a tag value (used to identify controls in their delegate
16// handlers)
17#define GET_TAG(section, row) ((((int)section) << 16) | ((int)(row)))
18#define GET_TAG_FROM_PATH(path) ((((int)path.section) << 16) | ((int)(path.row)))
19
20BOOL ScanHostNameAndPort(NSString *address, NSString **host, unsigned short *port);
21
22#pragma mark -
23#pragma mark Screen Resolutions
24
25NSString *ScreenResolutionDescription(TSXScreenOptions type, int width, int height);
26BOOL ScanScreenResolution(NSString *description, int *width, int *height, TSXScreenOptions *type);
27BOOL IsFitScreenOption(TSXScreenOptions type);
28CGFloat FitScreenScale(TSXScreenOptions type);
29
30NSDictionary *SelectionForColorSetting(void);
31NSArray *ResolutionModes(void);
32
33#pragma mark Security Protocol
34
35NSString *ProtocolSecurityDescription(TSXProtocolSecurityOptions type);
36BOOL ScanProtocolSecurity(NSString *description, TSXProtocolSecurityOptions *type);
37NSDictionary *SelectionForSecuritySetting(void);
38
39#pragma mark Bookmarks
40@class BookmarkBase;
41NSMutableArray *FilterBookmarks(NSArray *bookmarks, NSArray *filter_words);
42NSMutableArray *FilterHistory(NSArray *history, NSString *filterStr);
43
44#pragma mark iPad/iPhone detection
45
46BOOL IsPad(void);
47BOOL IsPhone(void);
48
49#pragma mark Version Info
50NSString *TSXAppFullVersion(void);
51
52#pragma mark Touch/Mouse handling
53
54// set mouse buttons swapped flag
55void SetSwapMouseButtonsFlag(BOOL swapped);
56
57// set invert scrolling flag
58void SetInvertScrollingFlag(BOOL invert);
59
60// return event value for left mouse button
61int GetLeftMouseButtonClickEvent(BOOL down);
62
63// return event value for right mouse button
64int GetRightMouseButtonClickEvent(BOOL down);
65
66// return event value for mouse move event
67int GetMouseMoveEvent(void);
68
69// return mouse wheel event
70int GetMouseWheelEvent(BOOL down);
71
72// scrolling gesture detection delta
73CGFloat GetScrollGestureDelta(void);
74
75#pragma mark Connectivity tools
76// activates the iphone's WWAN interface in case it is offline
77void WakeUpWWAN(void);
78
79#pragma mark System Info functions
80NSString *TSXGetPlatform(void);
81BOOL TSXDeviceHasJailBreak(void);
82NSString *TSXGetPrimaryMACAddress(NSString *sep);