FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
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);
27
28NSDictionary *SelectionForColorSetting(void);
29NSArray *ResolutionModes(void);
30
31#pragma mark Security Protocol
32
33NSString *ProtocolSecurityDescription(TSXProtocolSecurityOptions type);
34BOOL ScanProtocolSecurity(NSString *description, TSXProtocolSecurityOptions *type);
35NSDictionary *SelectionForSecuritySetting(void);
36
37#pragma mark Bookmarks
38@class BookmarkBase;
39NSMutableArray *FilterBookmarks(NSArray *bookmarks, NSArray *filter_words);
40NSMutableArray *FilterHistory(NSArray *history, NSString *filterStr);
41
42#pragma mark iPad/iPhone detection
43
44BOOL IsPad(void);
45BOOL IsPhone(void);
46
47#pragma mark Version Info
48NSString *TSXAppFullVersion(void);
49
50#pragma mark Touch/Mouse handling
51
52// set mouse buttons swapped flag
53void SetSwapMouseButtonsFlag(BOOL swapped);
54
55// set invert scrolling flag
56void SetInvertScrollingFlag(BOOL invert);
57
58// return event value for left mouse button
59int GetLeftMouseButtonClickEvent(BOOL down);
60
61// return event value for right mouse button
62int GetRightMouseButtonClickEvent(BOOL down);
63
64// return event value for mouse move event
65int GetMouseMoveEvent(void);
66
67// return mouse wheel event
68int GetMouseWheelEvent(BOOL down);
69
70// scrolling gesture detection delta
71CGFloat GetScrollGestureDelta(void);
72
73#pragma mark Connectivity tools
74// activates the iphone's WWAN interface in case it is offline
75void WakeUpWWAN(void);
76
77#pragma mark System Info functions
78NSString *TSXGetPlatform(void);
79BOOL TSXDeviceHasJailBreak(void);
80NSString *TSXGetPrimaryMACAddress(NSString *sep);