fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / apple_remote / RemoteControl.h
blob6e2c67765890f6ea9fc94c4968956d607f0bb740
1 /* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*****************************************************************************
3 * RemoteControl.h
4 * RemoteControlWrapper
6 * Created by Martin Kahr on 11.03.06 under a MIT-style license.
7 * Copyright (c) 2006 martinkahr.com. All rights reserved.
9 * Code modified and adapted to OpenOffice.org
10 * by Eric Bachard on 11.08.2008 under the same License
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:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
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.
30 *****************************************************************************/
32 #import <Cocoa/Cocoa.h>
34 // notifaction names that are being used to signal that an application wants to
35 // have access to the remote control device or if the application has finished
36 // using the remote control device
37 extern NSString* REQUEST_FOR_REMOTE_CONTROL_NOTIFCATION;
38 extern NSString* FINISHED_USING_REMOTE_CONTROL_NOTIFICATION;
40 // keys used in user objects for distributed notifications
41 extern NSString* kRemoteControlDeviceName;
42 extern NSString* kApplicationIdentifier;
43 extern NSString* kTargetApplicationIdentifier;
45 // we have a 6 bit offset to make a hold event out of a normal event
46 #define EVENT_TO_HOLD_EVENT_OFFSET 6
48 @class RemoteControl;
50 typedef enum _RemoteControlEventIdentifier {
51 // normal events
52 kRemoteButtonPlus =1<<1,
53 kRemoteButtonMinus =1<<2,
54 kRemoteButtonMenu =1<<3,
55 kRemoteButtonPlay =1<<4,
56 kRemoteButtonRight =1<<5,
57 kRemoteButtonLeft =1<<6,
59 // hold events
60 kRemoteButtonPlus_Hold =1<<7,
61 kRemoteButtonMinus_Hold =1<<8,
62 kRemoteButtonMenu_Hold =1<<9,
63 kRemoteButtonPlay_Hold =1<<10,
64 kRemoteButtonRight_Hold =1<<11,
65 kRemoteButtonLeft_Hold =1<<12,
67 // special events (not supported by all devices)
68 kRemoteControl_Switched =1<<13,
70 // New values for the "metallic" Remote (2009 model)
71 kMetallicRemote2009ButtonPlay =1<<14,
72 kMetallicRemote2009ButtonMiddlePlay =1<<15
74 } RemoteControlEventIdentifier;
76 @interface NSObject(RemoteControlDelegate)
78 - (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL) pressedDown remoteControl: (RemoteControl*) remoteControl;
80 @end
83 Base Interface for Remote Control devices
85 @interface RemoteControl : NSObject {
86 id delegate;
89 // returns nil if the remote control device is not available
90 - (id) initWithDelegate: (id) remoteControlDelegate;
92 - (void) setListeningToRemote: (BOOL) value;
93 - (BOOL) isListeningToRemote;
95 - (BOOL) isOpenInExclusiveMode;
96 - (void) setOpenInExclusiveMode: (BOOL) value;
98 - (void) startListening: (id) sender;
99 - (void) stopListening: (id) sender;
101 // is this remote control sending the given event?
102 - (BOOL) sendsEventForButtonIdentifier: (RemoteControlEventIdentifier) identifier;
104 // sending of notifications between applications
105 + (void) sendFinishedNotifcationForAppIdentifier: (NSString*) identifier;
106 + (void) sendRequestForRemoteControlNotification;
108 // name of the device
109 + (const char*) remoteControlDeviceName;
111 @end
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */