/usr/share/doc/unity-scopes-api/previewwidgets.html is in libunity-scopes-doc 0.4.2+14.04.20140408-0ubuntu1.
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 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | <!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.6"/>
<title>Unity Scopes API: Preview widget types</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="padding-left: 0.5em;">
<div id="projectname">Unity Scopes API
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('previewwidgets.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></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 class="header">
<div class="headertitle">
<div class="title">Preview widget types </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="previewtypes"></a>
Recognized preview widget types</h1>
<p>The following widget types are recognized by Unity: </p>
<ul>
<li><code>audio</code> </li>
<li><code>video</code> </li>
<li><code>image</code> </li>
<li><code>gallery</code> </li>
<li><code>header</code> </li>
<li><code>actions</code> </li>
<li><code>progress</code> </li>
<li><code>text</code> </li>
<li><code>rating-input</code> </li>
<li><code>reviews</code> </li>
</ul>
<h2><a class="anchor" id="audio"></a>
audio widget</h2>
<p>The audio widget displays a list of tracks with play/pause controls.</p>
<p>List of attributes:</p>
<ul>
<li><code>tracks</code> A composite attribute containing an array of tuples, where each tuple has up to four fields: <code>title</code> (mandatory string), <code>subtitle</code> (optional string), <code>source</code> (mandatory URI), and <code>length</code> (optional integer specifying the track length in seconds)</li>
</ul>
<p>You can construct composite attributes with <a class="el" href="classunity_1_1scopes_1_1_variant_builder.html" title="Helper class for creating and populating Variant containers. ">unity::scopes::VariantBuilder</a>:</p>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"tracks"</span>, <span class="stringliteral">"audio"</span>);</div>
<div class="line"></div>
<div class="line"> VariantBuilder builder;</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"title"</span>, Variant(<span class="stringliteral">"Track #1"</span>)},</div>
<div class="line"> {<span class="stringliteral">"source"</span>, Variant(<span class="stringliteral">"file:///tmp/song1.mp3"</span>)},</div>
<div class="line"> {<span class="stringliteral">"length"</span>, Variant(194)}</div>
<div class="line"> });</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"title"</span>, Variant(<span class="stringliteral">"Track #2"</span>)},</div>
<div class="line"> {<span class="stringliteral">"source"</span>, Variant(<span class="stringliteral">"file:///tmp/song2.mp3"</span>)},</div>
<div class="line"> {<span class="stringliteral">"length"</span>, Variant(207)}</div>
<div class="line"> });</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"tracks"</span>, builder.end());</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="video"></a>
video widget</h2>
<p>The video widget displays a still from a video and allows playing the video.</p>
<p>List of attributes:</p>
<ul>
<li><code>source</code> A URI pointing to the video </li>
<li><code>screenshot</code> A URI pointing to a screenshot of the video (optional)</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"video1"</span>, <span class="stringliteral">"video"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"source"</span>, Variant(<span class="stringliteral">"file:///tmp/video1.mp4"</span>));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="image"></a>
image widget</h2>
<p>The image widget displays a single image.</p>
<p>List of attributes:</p>
<ul>
<li><code>source</code> A URI pointing to the image </li>
<li><code>zoomable</code> A boolean specifying whether the image is zoomable (default: <code>false</code>)</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"img1"</span>, <span class="stringliteral">"image"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"source"</span>, Variant(<span class="stringliteral">"file:///tmp/image.jpg"</span>));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="gallery"></a>
gallery widget</h2>
<p>The gallery widget displays a set of images.</p>
<p>List of attributes:</p>
<ul>
<li><code>sources</code> An array of image URIs</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"gal"</span>, <span class="stringliteral">"gallery"</span>);</div>
<div class="line"></div>
<div class="line"> <a class="code" href="namespaceunity_1_1scopes.html#aa3bf32d584efd902bca79698a07dd934">VariantArray</a> arr;</div>
<div class="line"> arr.push_back(Variant(<span class="stringliteral">"file:///tmp/image1.jpg"</span>));</div>
<div class="line"> arr.push_back(Variant(<span class="stringliteral">"file:///tmp/image2.jpg"</span>));</div>
<div class="line"> arr.push_back(Variant(<span class="stringliteral">"file:///tmp/image3.jpg"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"sources"</span>, Variant(arr));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="header"></a>
header widget</h2>
<p>The header widget displays basic infomation about the result.</p>
<p>List of attributes:</p>
<ul>
<li><code>title</code> A string specifying the title </li>
<li><code>subtitle</code> A string specifying the subtitle </li>
<li><code>mascot</code> A URI specifying the mascot </li>
<li><code>emblem</code> A URI specifying the emblem</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"hdr"</span>, <span class="stringliteral">"header"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"title"</span>, Variant(<span class="stringliteral">"Result item"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"mascot"</span>, Variant(<span class="stringliteral">"file:///tmp/mascot.png"</span>));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="actions"></a>
actions widget</h2>
<p>The actions widget displays one or more buttons.</p>
<p>List of attributes:</p>
<ul>
<li><code>actions</code> A composite attribute containing an array of tuples, where each tuple has at least these fields: <code>id</code> (a mandatory string that is passed to unity::scopes::ScopeBase::activate_preview_action()), <code>label</code> (mandatory string), and <code>icon</code> (optional URI).</li>
</ul>
<p>You can construct composite attributes with <a class="el" href="classunity_1_1scopes_1_1_variant_builder.html" title="Helper class for creating and populating Variant containers. ">unity::scopes::VariantBuilder</a>:</p>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"buttons"</span>, <span class="stringliteral">"actions"</span>);</div>
<div class="line"></div>
<div class="line"> VariantBuilder builder;</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"id"</span>, Variant(<span class="stringliteral">"open"</span>)},</div>
<div class="line"> {<span class="stringliteral">"label"</span>, Variant(<span class="stringliteral">"Open"</span>)}</div>
<div class="line"> });</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"id"</span>, Variant(<span class="stringliteral">"download"</span>)},</div>
<div class="line"> {<span class="stringliteral">"label"</span>, Variant(<span class="stringliteral">"Download"</span>)}</div>
<div class="line"> });</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"actions"</span>, builder.end());</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="progress"></a>
progress widget</h2>
<p>The progress widget displays the progress of an action, such as download progress.</p>
<p>On completion, the scope receives a preview action activation with the id <code>"finished"</code> or <code>"failed"</code>, depending on the outcome of the operation.</p>
<p>List of attributes:</p>
<ul>
<li><code>source</code> A tuple with keys understood by a progress provider</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"download"</span>, <span class="stringliteral">"progress"</span>);</div>
<div class="line"></div>
<div class="line"> <a class="code" href="namespaceunity_1_1scopes.html#ad5d8ccfa11a327fca6f3e4cee11f4c10">VariantMap</a> tuple;</div>
<div class="line"> tuple[<span class="stringliteral">"dbus-name"</span>] = <span class="stringliteral">"com.canonical.DownloadManager"</span>;</div>
<div class="line"> tuple[<span class="stringliteral">"dbus-object"</span>] = <span class="stringliteral">"/com/canonical/download/obj1"</span>;</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"source"</span>, Variant(tuple));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="text"></a>
text widget</h2>
<p>A text widget can be used for text of any length (without formatting).</p>
<p>List of attributes:</p>
<ul>
<li><code>title</code> Optional string </li>
<li><code>text</code> A string containing the text</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"summary"</span>, <span class="stringliteral">"text"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"text"</span>, Variant(<span class="stringliteral">"Lorem Ipsum ..."</span>));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="rating-input"></a>
rating-input widget</h2>
<p>The rating-input widget allows users to rate content. It consists of two types of widget: a star-based rating and an input field for the user to enter his/her review. It is possible to hide each widget as well as to require them to be filled in.</p>
<p>When a user presses the "Send" button, the scope receives a preview action activation with the id <code>"rated"</code>.</p>
<p>List of attributes:</p>
<ul>
<li><code>rating-label</code> String for the star-based rating (default: "Rate this") </li>
<li><code>review-label</code> String for the review input (default: "Add a review") </li>
<li><code>submit-label</code> String for the confirmation button (default: "Send") </li>
<li><code>rating-icon-empty</code> URI for an empty rating icon </li>
<li><code>rating-icon-full</code> URI for a full rating icon </li>
<li><code>visible</code> String specifying which of the two widgets are visible (<code>"rating"</code>, <code>"review"</code> or default:<code>"both"</code>) </li>
<li><code>required</code> String specifying which of the two widgets are required to be filled in (<code>"rating"</code>, <code>"review"</code> or default:<code>"both"</code>)</li>
</ul>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"rating"</span>, <span class="stringliteral">"rating-input"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"visible"</span>, Variant(<span class="stringliteral">"rating"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"required"</span>, Variant(<span class="stringliteral">"rating"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"rating-icon-empty"</span>, Variant(<span class="stringliteral">"file:///tmp/star-empty.svg"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"rating-icon-full"</span>, Variant(<span class="stringliteral">"file:///tmp/star-full.svg"</span>));</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --><h2><a class="anchor" id="reviews"></a>
reviews widget</h2>
<p>The reviews widget is used to display previously-rated content.</p>
<p>List of attributes:</p>
<ul>
<li><code>rating-icon-empty</code> URI for an empty rating icon </li>
<li><code>rating-icon-half</code> URI for an half-full rating icon </li>
<li><code>rating-icon-full</code> URI for a full rating icon </li>
<li><code>reviews</code> A composite attribute containing an array of tuples, where each tuple has up to three fields: <code>rating</code> (optional integer specifying the number of stars), <code>author</code> (mandatory string) and <code>review</code> (optional string).</li>
</ul>
<p>You can construct composite attributes with <a class="el" href="classunity_1_1scopes_1_1_variant_builder.html" title="Helper class for creating and populating Variant containers. ">unity::scopes::VariantBuilder</a>:</p>
<div class="fragment"><div class="line">{</div>
<div class="line"> PreviewWidget w1(<span class="stringliteral">"summary"</span>, <span class="stringliteral">"reviews"</span>);</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"rating-icon-empty"</span>, Variant(<span class="stringliteral">"file:///tmp/star-empty.svg"</span>));</div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"rating-icon-full"</span>, Variant(<span class="stringliteral">"file:///tmp/star-full.svg"</span>));</div>
<div class="line"></div>
<div class="line"> VariantBuilder builder;</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"author"</span>, Variant(<span class="stringliteral">"John Doe"</span>)},</div>
<div class="line"> {<span class="stringliteral">"rating"</span>, Variant(3)}</div>
<div class="line"> });</div>
<div class="line"> builder.add_tuple({</div>
<div class="line"> {<span class="stringliteral">"author"</span>, Variant(<span class="stringliteral">"Mr. Smith"</span>)},</div>
<div class="line"> {<span class="stringliteral">"rating"</span>, Variant(5)}</div>
<div class="line"> });</div>
<div class="line"></div>
<div class="line"> w1.add_attribute_value(<span class="stringliteral">"reviews"</span>, builder.end());</div>
<div class="line"> ...</div>
<div class="line">}</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Tue Apr 8 2014 14:04:47 for Unity Scopes API by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>
|