Call CFPreferencesAppSynchronize (for iOS << 8.0).
[veency.git] / SpringBoardAccess.h
1 /*
2 * Copyright (C) 2009 by Matthias Ringwald
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the copyright holders nor the names of
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
21 * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 */
31
32 /*
33 * SpringBoardAccess.h
34 *
35 * Allows to add and remove images to/from status bar
36 *
37 * The images must be installed in:
38 * /System/Library/CoreServices/SpringBoard.app/
39 *
40 * Only the base name is required, e.g., Bluetooth instead of Default_Bluetooth.png
41 * Created by Matthias Ringwald on 9/20/09.
42 *
43 */
44 #pragma once
45
46 #define SBA_MessagePortName "SpringBoardAccess"
47
48 #define SBAC_nop
49 #define SBAC_addStatusBarImage 1
50 #define SBAC_removeStatusBarImage 2
51 #define SBAC_getBluetoothEnabled 3
52 #define SBAC_setBluetoothEnabled 4
53
54 /**
55 * Enables named status bar icon in Springboard
56 * @returns CFMessagePortSendRequest error: 0 = ok
57 */
58 int SBA_addStatusBarImage(char *name);
59
60 /**
61 * Disables named status bar icon in Springboard
62 * @returns CFMessagePortSendRequest error: 0 = ok
63 */
64 int SBA_removeStatusBarImage(char *name);
65
66 /**
67 * Get Bluetoot enabled property
68 * @returns < 0 error: 0 = OFF, 1 = ON
69 */
70 int SBA_getBluetoothEnabled();
71
72 /**
73 * Set Bluetooth enable property: 0 for OFF, otherwise on
74 * @returns CFMessagePortSendRequest error: 0 = ok
75 */
76 int SBA_setBluetoothEnabled(int on);
77
78 /**
79 * Tests if SpringBoardAccess server is available
80 */
81 int SBA_available();