/usr/share/doc/libjuce/apiref/classRuntimePermissions.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: RuntimePermissions Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classRuntimePermissions-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">RuntimePermissions Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Class to handle app runtime permissions for certain functionality on some platforms.
<a href="classRuntimePermissions.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ae35d63b8c00dab34a1546fd1eef90878"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> { <a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878a56b38b114bf52a5b212b87b4a5c9b535">recordAudio</a> = 1,
<a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878af9db427de56e5cc282cea35e58f47959">bluetoothMidi</a> = 2
}</td></tr>
<tr class="separator:ae35d63b8c00dab34a1546fd1eef90878"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f6900b6b019de4abbbd073ccd9004ea"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="classRuntimePermissions.html#a2f6900b6b019de4abbbd073ccd9004ea">Callback</a>) (bool)</td></tr>
<tr class="memdesc:a2f6900b6b019de4abbbd073ccd9004ea"><td class="mdescLeft"> </td><td class="mdescRight">Function type of runtime permission request callbacks. <a href="#a2f6900b6b019de4abbbd073ccd9004ea">More...</a><br /></td></tr>
<tr class="separator:a2f6900b6b019de4abbbd073ccd9004ea"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9b45f4bb7ea1cc3bf5693fa2ec33b7c3"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRuntimePermissions.html#a9b45f4bb7ea1cc3bf5693fa2ec33b7c3">request</a> (<a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> permission, <a class="el" href="classRuntimePermissions.html#a2f6900b6b019de4abbbd073ccd9004ea">Callback</a> callback)</td></tr>
<tr class="memdesc:a9b45f4bb7ea1cc3bf5693fa2ec33b7c3"><td class="mdescLeft"> </td><td class="mdescRight">Call this method to request a runtime permission. <a href="#a9b45f4bb7ea1cc3bf5693fa2ec33b7c3">More...</a><br /></td></tr>
<tr class="separator:a9b45f4bb7ea1cc3bf5693fa2ec33b7c3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a895f15741378bada300fbe409775d0d8"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classRuntimePermissions.html#a895f15741378bada300fbe409775d0d8">isRequired</a> (<a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> permission)</td></tr>
<tr class="memdesc:a895f15741378bada300fbe409775d0d8"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether a runtime request is required to obtain the permission on the current platform. <a href="#a895f15741378bada300fbe409775d0d8">More...</a><br /></td></tr>
<tr class="separator:a895f15741378bada300fbe409775d0d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a88697ee964654de2fea2eac5ed048979"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classRuntimePermissions.html#a88697ee964654de2fea2eac5ed048979">isGranted</a> (<a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> permission)</td></tr>
<tr class="memdesc:a88697ee964654de2fea2eac5ed048979"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the app has been already granted this permission, either via a previous runtime request or otherwise, or no permission is necessary. <a href="#a88697ee964654de2fea2eac5ed048979">More...</a><br /></td></tr>
<tr class="separator:a88697ee964654de2fea2eac5ed048979"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Class to handle app runtime permissions for certain functionality on some platforms. </p>
<p>The use of this class is currently only required if the app should run on Android API level 23 and higher.</p>
<p>On lower API levels, the permissions are specified in the app manifest. On iOS, runtime permission requests are handled automatically by the Apple APIs and not manually in the app code. On Windows, OS X, and Linux, runtime permissions are not used at all. In all these cases, <a class="el" href="classRuntimePermissions.html#a9b45f4bb7ea1cc3bf5693fa2ec33b7c3" title="Call this method to request a runtime permission. ">request()</a> will simply call through to the callback with no overhead and pass true (making it safe to use on all platforms).</p>
<p>For example, to enable audio recording on Android in your cross-platform app, you could modify your code as follows:</p>
<p>Old code: </p><pre class="fragment">audioDeviceManager.initialise (2, 2, nullptr, true, String(), nullptr);
</pre><p>New code: </p><pre class="fragment">RuntimePermissions::request (
RuntimePermissions::audioRecording,
[this] (bool wasGranted)
{
if (! wasGranted)
{
</pre><p> e.g. display an error or initialise with 0 input channels return; }</p>
<p>audioDeviceManager.initialise (2, 2, nullptr, true, <a class="el" href="classString.html" title="The JUCE String class! ">String()</a>, nullptr); } ); </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a2f6900b6b019de4abbbd073ccd9004ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f6900b6b019de4abbbd073ccd9004ea">§ </a></span>Callback</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* RuntimePermissions::Callback) (bool)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Function type of runtime permission request callbacks. </p>
</div>
</div>
<h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ae35d63b8c00dab34a1546fd1eef90878"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae35d63b8c00dab34a1546fd1eef90878">§ </a></span>PermissionID</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">RuntimePermissions::PermissionID</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ae35d63b8c00dab34a1546fd1eef90878a56b38b114bf52a5b212b87b4a5c9b535"></a>recordAudio </td><td class="fielddoc"><p>Permission to access the microphone (required on Android). </p>
<p>You need to request this, for example, to initialise an <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices. ">AudioDeviceManager</a> with a non-zero number of input channels, and to open the default audio input device. </p>
</td></tr>
<tr><td class="fieldname"><a id="ae35d63b8c00dab34a1546fd1eef90878af9db427de56e5cc282cea35e58f47959"></a>bluetoothMidi </td><td class="fielddoc"><p>Permission to scan for and pair to Bluetooth MIDI devices (required on Android). </p>
<p>You need to request this before calling <a class="el" href="classBluetoothMidiDevicePairingDialogue.html#a475ec8a971d17bd84c21047d143066b5" title="Opens the Bluetooth MIDI pairing dialogue, if it is available. ">BluetoothMidiDevicePairingDialogue::open()</a>, otherwise no devices will be found. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9b45f4bb7ea1cc3bf5693fa2ec33b7c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b45f4bb7ea1cc3bf5693fa2ec33b7c3">§ </a></span>request()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void RuntimePermissions::request </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> </td>
<td class="paramname"><em>permission</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classRuntimePermissions.html#a2f6900b6b019de4abbbd073ccd9004ea">Callback</a> </td>
<td class="paramname"><em>callback</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Call this method to request a runtime permission. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">permission</td><td>The PermissionID of the permission you want to request.</td></tr>
<tr><td class="paramname">callback</td><td>The callback to be called after the request has been granted or denied; the argument passed will be true if the permission has been granted and false otherwise.</td></tr>
</table>
</dd>
</dl>
<p>If no runtime request is required or possible to obtain the permission, the callback will be called immediately. The argument passed in will be true if the permission is granted or no permission is required on this platform, and false otherwise.</p>
<p>If a runtime request is required to obtain the permission, the callback will be called asynchronously after the OS has granted or denied the requested permission (typically by displaying a dialog box to the user and waiting until the user has responded). </p>
</div>
</div>
<a id="a895f15741378bada300fbe409775d0d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a895f15741378bada300fbe409775d0d8">§ </a></span>isRequired()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool RuntimePermissions::isRequired </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> </td>
<td class="paramname"><em>permission</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns whether a runtime request is required to obtain the permission on the current platform. </p>
</div>
</div>
<a id="a88697ee964654de2fea2eac5ed048979"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88697ee964654de2fea2eac5ed048979">§ </a></span>isGranted()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool RuntimePermissions::isGranted </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classRuntimePermissions.html#ae35d63b8c00dab34a1546fd1eef90878">PermissionID</a> </td>
<td class="paramname"><em>permission</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if the app has been already granted this permission, either via a previous runtime request or otherwise, or no permission is necessary. </p>
<p>Note that this can be false even if isRequired returns false. In this case, the permission can not be obtained at all at runtime. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__RuntimePermissions_8h.html">juce_RuntimePermissions.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|