LibreOffice Module apple_remote (master) 1
RemoteControl.h
Go to the documentation of this file.
1/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*****************************************************************************
3 * RemoteControl.h
4 * RemoteControlWrapper
5 *
6 * Created by Martin Kahr on 11.03.06 under a MIT-style license.
7 * Copyright (c) 2006 martinkahr.com. All rights reserved.
8 *
9 * Code modified and adapted to OpenOffice.org
10 * by Eric Bachard on 11.08.2008 under the same License
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28 * THE SOFTWARE.
29 *
30 *****************************************************************************/
31
32#include <sal/config.h>
33
34#import <Cocoa/Cocoa.h>
35
36#include <sal/types.h>
37
38// notification names that are being used to signal that an application wants to
39// have access to the remote control device or if the application has finished
40// using the remote control device
43
44// keys used in user objects for distributed notifications
45extern NSString* kRemoteControlDeviceName;
46extern NSString* kApplicationIdentifier;
47extern NSString* kTargetApplicationIdentifier;
48
49// we have a 6 bit offset to make a hold event out of a normal event
50#define EVENT_TO_HOLD_EVENT_OFFSET 6
51
52@class RemoteControl;
53
54typedef enum {
55 // normal events
62
63 // hold events
70
71 // special events (not supported by all devices)
73
74 // New values for the "metallic" Remote (2009 model)
77
79
81
82- (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL) pressedDown remoteControl: (RemoteControl*) remoteControl;
83
84@end
85
86/*
87 Base Interface for Remote Control devices
88*/
89SAL_DLLPUBLIC_EXPORT @interface RemoteControl : NSObject {
91}
92
93// returns nil if the remote control device is not available
94- (id) initWithDelegate: (id) remoteControlDelegate;
95
96- (void) setListeningToRemote: (BOOL) value;
97- (BOOL) isListeningToRemote;
98
99- (BOOL) isOpenInExclusiveMode;
100- (void) setOpenInExclusiveMode: (BOOL) value;
101
102- (void) startListening: (id) sender;
103- (void) stopListening: (id) sender;
104
105// is this remote control sending the given event?
106- (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier;
107
108// sending of notifications between applications
109+ (void) sendFinishedNotificationForAppIdentifier: (NSString*) identifier;
110+ (void) sendRequestForRemoteControlNotification;
111
112// name of the device
113+ (const char*) remoteControlDeviceName;
114
115@end
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NSString * kRemoteControlDeviceName
Definition: RemoteControl.m:41
NSString * kTargetApplicationIdentifier
Definition: RemoteControl.m:45
RemoteControlEventIdentifier
Definition: RemoteControl.h:54
@ kRemoteControl_Switched
Definition: RemoteControl.h:72
@ kRemoteButtonRight_Hold
Definition: RemoteControl.h:68
@ kMetallicRemote2009ButtonMiddlePlay
Definition: RemoteControl.h:76
@ kRemoteButtonMinus
Definition: RemoteControl.h:57
@ kRemoteButtonRight
Definition: RemoteControl.h:60
@ kRemoteButtonPlay_Hold
Definition: RemoteControl.h:67
@ kRemoteButtonPlus_Hold
Definition: RemoteControl.h:64
@ kMetallicRemote2009ButtonPlay
Definition: RemoteControl.h:75
@ kRemoteButtonPlus
Definition: RemoteControl.h:56
@ kRemoteButtonMenu
Definition: RemoteControl.h:58
@ kRemoteButtonLeft
Definition: RemoteControl.h:61
@ kRemoteButtonPlay
Definition: RemoteControl.h:59
@ kRemoteButtonMenu_Hold
Definition: RemoteControl.h:66
@ kRemoteButtonMinus_Hold
Definition: RemoteControl.h:65
@ kRemoteButtonLeft_Hold
Definition: RemoteControl.h:69
NSString * kApplicationIdentifier
Definition: RemoteControl.m:42
NSString * REQUEST_FOR_REMOTE_CONTROL_NOTIFICATION
Definition: RemoteControl.m:37
NSString * FINISHED_USING_REMOTE_CONTROL_NOTIFICATION
Definition: RemoteControl.m:38
const wchar_t *typedef BOOL