unity-webapps-qml-0.1+16.04.20160114/0000755000015600001650000000000012645741276017325 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/project-deployment.pri0000644000015600001650000000000012645740734023651 0ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/docs/0000755000015600001650000000000012645741276020255 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/docs/docs.pri0000644000015600001650000000035312645740734021720 0ustar pbuserpbgroup00000000000000QDOC = /usr/lib/*/qt5/bin/qdoc system($$QDOC $$PWD/unity-webapps-qml.qdocconf) install_docs.files = $$PWD/html install_docs.path = /usr/share/unity-webapps-qml/doc INSTALLS += install_docs OTHER_FILES += \ $$system(ls ./html/*) unity-webapps-qml-0.1+16.04.20160114/docs/html/0000755000015600001650000000000012645741276021221 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/docs/unity-webapps-qml.qdocconf0000644000015600001650000000124012645740734025364 0ustar pbuserpbgroup00000000000000project = Unity WebApps QML Component description = Unity WebApps QML Component Documentation sourcedirs = ../src/Ubuntu/UnityWebApps headerdirs = ../src/Ubuntu/UnityWebApps/plugin sources.fileextensions = "*.qml *.qdoc *.cpp" headers.fileextensions = "*.h" outputdir = html outputformats = HTML version = 0.1 syntaxhighlighting = true sourceencoding = UTF-8 outputencoding = UTF-8 HTML.templatedir = . HTML.nobreadcrumbs = "true" HTML.stylesheets = qtquick.css HTML.headerstyles = " \n" HTML.endheader = "\n" HTML.footer = "
Copyright (C) 2013 Canonical Ltd.
\n" unity-webapps-qml-0.1+16.04.20160114/docs/getting-started/0000755000015600001650000000000012645741276023362 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/docs/getting-started/js/0000755000015600001650000000000012645741276023776 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/docs/getting-started/js/sh.js0000644000015600001650000001227112645740734024747 0ustar pbuserpbgroup00000000000000/* Copyright (C) 2007, 2008 gnombat@users.sourceforge.net */ /* License: http://shjs.sourceforge.net/doc/gplv3.html */ if(!this.sh_languages){this.sh_languages={}}var sh_requests={};function sh_isEmailAddress(a){if(/^mailto:/.test(a)){return false}return a.indexOf("@")!==-1}function sh_setHref(b,c,d){var a=d.substring(b[c-2].pos,b[c-1].pos);if(a.length>=2&&a.charAt(0)==="<"&&a.charAt(a.length-1)===">"){a=a.substr(1,a.length-2)}if(sh_isEmailAddress(a)){a="mailto:"+a}b[c-2].node.href=a}function sh_konquerorExec(b){var a=[""];a.index=b.length;a.input=b;return a}function sh_highlightString(B,o){if(/Konqueror/.test(navigator.userAgent)){if(!o.konquered){for(var F=0;FI){x(g.substring(I,E.index),null)}var e=O[u];var J=e[1];var b;if(J instanceof Array){for(var L=0;L0){var e=b.split(" ");for(var c=0;c0){a.push(e[c])}}}return a}function sh_addClass(c,a){var d=sh_getClasses(c);for(var b=0;b element with class="'+h+'", but no such language exists'}}break}}}};unity-webapps-qml-0.1+16.04.20160114/docs/getting-started/js/sh_js.js0000644000015600001650000001300612645740734025440 0ustar pbuserpbgroup00000000000000if (! this.sh_languages) { this.sh_languages = {}; } sh_languages['javascript'] = [ [ [ /\/\/\//g, 'sh_comment', 1 ], [ /\/\//g, 'sh_comment', 7 ], [ /\/\*\*/g, 'sh_comment', 8 ], [ /\/\*/g, 'sh_comment', 9 ], [ /\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with|Unity)\b/g, 'sh_keyword', -1 ], [ /(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g, ['sh_symbol', 'sh_normal', 'sh_symbol'], -1 ], [ /(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g, ['sh_number', 'sh_normal', 'sh_symbol'], -1 ], [ /([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g, ['sh_normal', 'sh_symbol'], -1 ], [ /\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g, 'sh_regexp', -1 ], [ /\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g, 'sh_number', -1 ], [ /"/g, 'sh_string', 10 ], [ /'/g, 'sh_string', 11 ], [ /~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g, 'sh_symbol', -1 ], [ /\{|\}/g, 'sh_cbracket', -1 ], [ /\b(?:Math|Infinity|NaN|undefined|arguments|Seed|signal|argv|argc|Gtk|GObject|GLib|WebKit)\b/g, 'sh_predef_var', -1 ], [ /\b(?:printf|sprintf|connect|Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g, 'sh_predef_func', -1 ], [ /(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g, 'sh_function', -1 ] ], [ [ /$/g, null, -2 ], [ /(?:?)|(?:?)/g, 'sh_url', -1 ], [ /<\?xml/g, 'sh_preproc', 2, 1 ], [ //g, 'sh_keyword', -1 ], [ /<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g, 'sh_keyword', 6, 1 ], [ /&(?:[A-Za-z0-9]+);/g, 'sh_preproc', -1 ], [ /<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g, 'sh_keyword', -1 ], [ /<(?:\/)?[A-Za-z][A-Za-z0-9]*/g, 'sh_keyword', 6, 1 ], [ /@[A-Za-z]+/g, 'sh_type', -1 ], [ /(?:TODO|FIXME|BUG)(?:[:]?)/g, 'sh_todo', -1 ] ], [ [ /\?>/g, 'sh_preproc', -2 ], [ /([^=" \t>]+)([ \t]*)(=?)/g, ['sh_type', 'sh_normal', 'sh_symbol'], -1 ], [ /"/g, 'sh_string', 3 ] ], [ [ /\\(?:\\|")/g, null, -1 ], [ /"/g, 'sh_string', -2 ] ], [ [ />/g, 'sh_preproc', -2 ], [ /([^=" \t>]+)([ \t]*)(=?)/g, ['sh_type', 'sh_normal', 'sh_symbol'], -1 ], [ /"/g, 'sh_string', 3 ] ], [ [ /-->/g, 'sh_comment', -2 ], [ //g, 'sh_comment', -2 ], [ /
unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_launcher.html0000644000015600001650000000263512645740734030726 0ustar pbuserpbgroup00000000000000 Unity Webapps QML test: Launcher HELLO WORLD

THE CONTENT IS VISIBLE

unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_api_injected.html0000644000015600001650000000126512645740734031541 0ustar pbuserpbgroup00000000000000 Unity Webapps QML test HELLO WORLD
unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_messagingmenu.html0000644000015600001650000000201612645740734031760 0ustar pbuserpbgroup00000000000000 Unity Webapps QML test: MessagingMenu HELLO WORLD

THE CONTENT IS VISIBLE

unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_callback_dispatch_api.js.in0000644000015600001650000000351212645740734033441 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ (function () { // Acknowledge that the API has been fully injected var sendApiCreatedAcknowledgeEvent = function () { var e = document.createEvent ("Events"); e.initEvent ("ubuntu-webapps-api-ready", false, false); document.dispatchEvent (e); }; //@include ../../src/Ubuntu/UnityWebApps/UnityWebAppsUtils.js //@include ../../src/Ubuntu/UnityWebApps/common/js/unity-backend-messaging-proxy.js //@include ../../src/Ubuntu/UnityWebApps/common/js/unity-binding-proxy.js //@include ../../src/Ubuntu/UnityWebApps/common/js/unity-binding-bridge.js var apiBuilder = function(backend) { return { withCallback: function(callback) { backend.call('withCallback', [callback]); } }; }; var apiBridge = new UnityBindingBridge( makeCallbackManager(), createMessagingProxyForCurrentWebRuntime()); var api = apiBuilder (apiBridge); apiBridge.setBindingApi(api); if (!window.external) window.external = {}; window.external.getUnityObject = function (version) { return api; }; sendApiCreatedAcknowledgeEvent(); }) (); unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_callback_dispatch.html0000644000015600001650000000201512645740734032530 0ustar pbuserpbgroup00000000000000 Unity Webapps QML test: callback HELLO WORLD
unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/html/test_webapps_mediaplayer.html0000644000015600001650000000333712645740734031421 0ustar pbuserpbgroup00000000000000 Unity Webapps QML test: MediaPlayer HELLO WORLD

THE CONTENT IS VISIBLE

unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/autopilot.pro0000644000015600001650000000231112645740734025244 0ustar pbuserpbgroup00000000000000TEMPLATE=aux UNITY_API_JS_FILE = $$system($$PWD/../../tools/inject-js-utils.py ./html/test_webapps_callback_dispatch_api.js.in ./html/test_webapps_callback_dispatch_api.js) inject_dependancies.target = ./html/test_webapps_callback_dispatch_api.js inject_dependancies.depends = ./html/test_webapps_callback_dispatch_api.js.in inject_dependancies.commands = $$PWD/../../tools/inject-js-utils.py $< $@ QMAKE_EXTRA_TARGETS += inject_dependancies PRE_TARGETDEPS += \ ./html/test_webapps_callback_dispatch_api.js OTHER_FILES += \ $$system(ls ./qml/*) \ $$system(ls ./html/*) \ $$system(ls ./unity_webapps_qml/emulators/*.py) \ $$system(ls ./unity_webapps_qml/tests/*.py) \ $$system(ls ./unity_webapps_qml/*.py) \ $$system(ls ./data/*/*) \ unity_webapps_qml/tests/test_installedWebapp.py \ unity_webapps_qml/tests/fake_servers.py \ qml/WebviewBackendOxide.qml \ qml/message-server.js \ $$system(ls ./data/installed-webapps/*) \ unity_webapps_qml/tests/test_callbackDispatch.py \ html/test_webapps_callback_dispatch.html \ html/test_webapps_callback_dispatch_api.js \ html/test_webapps_callback_dispatch_api.js.in \ qml/test_webapps_callback_dispatch_api.qml unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/0000755000015600001650000000000012645741276023300 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/message-server.js0000644000015600001650000000212412645740734026563 0ustar pbuserpbgroup00000000000000// Copyright (C) 2014 Canonical Ltd. // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA oxide.addMessageHandler("EVALUATE-CODE", function(msg) { var code = msg.args.code; if (msg.args.wrap) { code = "(function() {" + code + "})()"; } try { var result = eval(code); msg.reply({result: result}); } catch(e) { msg.error("Code threw exception: \"" + e + "\""); } }); unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/test_webapps_callback_dispatch_api.qml0000644000015600001650000000047212645740734033040 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 Item { function buildapi() { return { withCallback: function(clientCallback) { function callbackLoop(callback) { callback(callbackLoop); } clientCallback(callbackLoop); } }; } } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/injected-script.js0000644000015600001650000000214612645740734026726 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * webbrowser-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ (function () { var UBUNTU_WEBAPPS_API_READY_KEY = 'ubuntu-webapps-api-ready-key'; window.onload = function () { document.addEventListener('ubuntu-webapps-api-ready', function () { if ( ! window.localStorage[UBUNTU_WEBAPPS_API_READY_KEY]) { window.localStorage[UBUNTU_WEBAPPS_API_READY_KEY] = 0; } window.localStorage[UBUNTU_WEBAPPS_API_READY_KEY] ++; }); }; }) (); unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/FullWebViewApp.qml0000644000015600001650000000570112645740734026650 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * webbrowser-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Window 2.0 import Ubuntu.Unity.Action 1.0 as UnityActions import Ubuntu.UnityWebApps 0.1 import "." import "dom-introspection-utils.js" as DomIntrospectionUtils Window { id: root objectName: "webviewContainer" width: 640 height: 640 signal resultUpdated(string message) function evalInPageUnsafe(expr) { var val = webView.evaluateCode(expr, true); resultUpdated(DomIntrospectionUtils.createResult(val)) } property string url: "" property string apiBackendQmlFileUrl: "" property string clientApiFileUrl: "" property string webappName: "" property string webappSearchPath: "" property string webappHomepage: "" UnityActions.ActionManager { localContexts: [webappsActionsContext] } UnityActions.ActionContext { id: webappsActionsContext active: true } WebviewBackendOxide { id: webView url: root.url localUserAgentOverride: webappName && webappModel.exists(webappName) ? webappModel.userAgentOverrideFor(webappName) : "" } // Offers a way to override/mock the API backends Loader { id: apiBackendQmlFileLoader source: apiBackendQmlFileUrl.length !== 0 ? apiBackendQmlFileUrl : "" } Loader { id: unityWebappsComponentLoader anchors.fill: parent sourceComponent: (apiBackendQmlFileUrl.length !== 0 && !apiBackendQmlFileLoader.item) ? undefined : unityWebappsComponent } UnityWebappsAppModel { id: webappModel searchPath: root.webappSearchPath } Component { id: unityWebappsComponent UnityWebApps { id: webapps objectName: "webappsContainer" actionsContext: webappsActionsContext name: root.webappName injectExtraUbuntuApis: true customBackendProxies: apiBackendQmlFileLoader.item ? apiBackendQmlFileLoader.item.buildapi() : undefined customClientApiFileUrl: root.clientApiFileUrl bindee: webView _opt_homepage: root.webappHomepage model: webappModel } } } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/dom-introspection-utils.js0000644000015600001650000000251212645740734030447 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * webbrowser-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ function gentid() { return Math.random() + ''; } function wrapJsCommands(commands) { return '(function() { ' + commands + ' })();' } function createResult(result, tid) { return JSON.stringify({result: result, tid: tid}); } function dumpValue(v) { if (typeof(v) === "string") { return "'" + v + "'"; } return v; } function setupClosedVariables(variables) { var variableDeclStatements = ''; for (var variable in variables) { if (variables.hasOwnProperty(variable)) { variableDeclStatements += 'var ' + variable + ' = ' + dumpValue(variables[variable]) + ';'; } } return variableDeclStatements; } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/qml/WebviewBackendOxide.qml0000644000015600001650000000531112645740734027662 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import QtTest 1.0 import com.canonical.Oxide 1.0 as Oxide import Ubuntu.Web 0.2 import Ubuntu.UnityWebApps 0.1 WebView { id: webView objectName: "webview" property string localUserAgentOverride: "" preferences.localStorageEnabled: true preferences.appCacheEnabled: true function _waitForResult(req, timeout) { var result; var error; req.onreply = function(response) { result = response; error = 0; }; req.onerror = function(error_code, msg) { result = msg; error = error_code; }; webView._waitFor(function() { return error !== undefined; }, timeout); if (error > 0) { console.error('Error:' + error + ', result:' + result) } else if (error === 0) { return result; } else { throw new Error("Message call timed out"); } } function _waitFor(predicate, timeout) { timeout = timeout || 5000000; var end = Date.now() + timeout; var i = Date.now(); while (i < end && !predicate()) { qtest_testResult.wait(50); i = Date.now(); } return predicate(); } function evaluateCode(code, wrap) { var value = webView._waitForResult( webView.rootFrame.sendMessage( "oxide://main-world", "EVALUATE-CODE", { code: code, wrap: wrap === undefined ? false : wrap })); return value ? value.result : undefined; } context: WebContext { userAgent: webView.localUserAgentOverride.length === 0 ? "" : webView.localUserAgentOverride userScripts: [ Oxide.UserScript { context: "oxide://main-world" emulateGreasemonkey: true url: Qt.resolvedUrl("message-server.js") matchAllFrames: true } ] } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webView); } onJavaScriptConsoleMessage: { var msg = "[JS] (%1:%2) %3".arg(sourceId).arg(lineNumber).arg(message) if (level === Oxide.WebView.LogSeverityVerbose) { console.log(msg) } else if (level === Oxide.WebView.LogSeverityInfo) { console.info(msg) } else if (level === Oxide.WebView.LogSeverityWarning) { console.warn(msg) } else if ((level === Oxide.WebView.LogSeverityError) || (level === Oxide.WebView.LogSeverityErrorReport) || (level === Oxide.WebView.LogSeverityFatal)) { console.error(msg) } } TestResult { id: qtest_testResult } } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/0000755000015600001650000000000012645741276023420 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/all-in-same-folder/0000755000015600001650000000000012645741276026770 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/all-in-same-folder/webapp-properties.json0000644000015600001650000000033312645740734033330 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.test.com/*"], "name": "ExtendedWebappProperties", "scripts": ["script.user.js"], "domain":"", "homepage":"http://www.test.com/", "user-agent-override": "My Override" } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/all-in-same-folder/script.user.js0000644000015600001650000000015112645740734031602 0ustar pbuserpbgroup00000000000000window.onload = function() { document.getElementById('content').innerHTML="WebApp Script Injected" } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-with-altered-ua-string/0000755000015600001650000000000012645741276032525 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-with-altered-ua-string/script.user.jsunity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-with-altered-ua-string/scrip0000644000015600001650000000015112645740734033563 0ustar pbuserpbgroup00000000000000window.onload = function() { document.getElementById('content').innerHTML="WebApp Script Injected" } ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-with-altered-ua-string/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-with-altered-ua-string/manif0000644000015600001650000000033212645740734033536 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.test.com/*"], "name": "AlteredUAWebapp", "scripts": ["script.user.js"], "domain":"test.com", "homepage":"http://www.test.com/", "user-agent-override": "My Override" } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-normal/0000755000015600001650000000000012645741276027515 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-normal/script.user.js0000644000015600001650000000015112645740734032327 0ustar pbuserpbgroup00000000000000window.onload = function() { document.getElementById('content').innerHTML="WebApp Script Injected" } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/data/unity-webapps-normal/manifest.json0000644000015600001650000000027112645740734032214 0ustar pbuserpbgroup00000000000000{ "name": "Normal", "domain": "test.com", "homepage": "http://www.test.com/", "includes": [ "http://www.test.com/*" ], "scripts": [ "script.user.js" ] } unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/setup.py0000644000015600001650000000112612645740734024217 0ustar pbuserpbgroup00000000000000#!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. from distutils.core import setup from setuptools import find_packages setup( name='unity-webapps-qml', version='0.1', description='Unity WebApps QML component autopilot tests.', url='https://launchpad.net/unity-webapps-qml', license='GPLv3', packages=find_packages(), ) unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/0000755000015600001650000000000012645741276026251 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/__init__.py0000644000015600001650000000055512645740734030365 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. """unity-webapps-qml autopilot tests and emulators - top level package.""" unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/0000755000015600001650000000000012645741276027413 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_launcher.py0000644000015600001650000000753712645740734032637 0ustar pbuserpbgroup00000000000000#!/usr/bin/env python # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. import os from testtools.matchers import Equals, NotEquals from testtools import skipUnless from autopilot import platform from autopilot.matchers import Eventually from unity_webapps_qml.tests import UnityWebappsTestCaseBase LOCAL_HTML_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../html/test_webapps_launcher.html') INSTALLED_HTML_TEST_FILE = \ '/usr/share/unity-webapps-qml/' \ 'autopilot-tests/html/test_webapps_launcher.html' class UnityWebappsLauncherTestCase(UnityWebappsTestCaseBase): def get_html_test_file(self): if os.path.exists(LOCAL_HTML_TEST_FILE): return os.path.abspath(LOCAL_HTML_TEST_FILE) return INSTALLED_HTML_TEST_FILE def setUp(self): super(UnityWebappsLauncherTestCase, self).setUp() self.launch_with_html_filepath(self.get_html_test_file()) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkCounts(self): from gi.repository import Unity self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('launcher-updated'))) launcher_icon = Unity.LauncherEntry.get_for_desktop_id( 'unitywebappsqmllauncher.desktop') self.assertThat(launcher_icon, NotEquals(None)) expr = """ document.addEventListener('unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'Launcher.__get', 'with_callback': true, 'args': ['count']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('42'))) # self.assertThat( # lambda: launcher_icon.get_property("count"), # Eventually(Equals(42))) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkProgress(self): from gi.repository import Unity self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('launcher-updated'))) launcher_icon = Unity.LauncherEntry.get_for_desktop_id( 'unitywebappsqmllauncher.desktop') self.assertThat(launcher_icon, NotEquals(None)) expr = """ document.addEventListener( 'unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'Launcher.__get', 'with_callback': true, 'args': ['progress']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('0.09375'))) unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/__init__.py0000644000015600001650000001402212645740734031521 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. """unity-webapps-qml autopilot tests.""" import os import json import os.path from testtools.matchers import Equals, GreaterThan from autopilot.matchers import Eventually from unity_webapps_qml.tests import fake_servers from autopilot.testcase import AutopilotTestCase LOCAL_QML_LAUNCHER_APP_PATH = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../../../tools/qml-launcher/unity-webapps-qml-launcher') INSTALLED_QML_LAUNCHER_APP_PATH = 'unity-webapps-qml-launcher' # TODO create __init__.py.in LOCAL_BROWSER_CONTAINER_PATH = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../qml/FullWebViewApp.qml') INSTALLED_BROWSER_CONTAINER_PATH = \ '/usr/share/unity-webapps-qml/autopilot-tests/qml/FullWebViewApp.qml' BASE_URL = '' class UnityWebappsTestCaseBase(AutopilotTestCase): def setUp(self): super(UnityWebappsTestCaseBase, self).setUp() self.use_oxide = False def tearDown(self): super(UnityWebappsTestCaseBase, self).tearDown() def create_file_url(self, path): return 'file://' + path def get_qml_browser_container_path(self): if os.path.exists(LOCAL_BROWSER_CONTAINER_PATH): return LOCAL_BROWSER_CONTAINER_PATH return INSTALLED_BROWSER_CONTAINER_PATH def get_qml_launcher_path(self): if os.path.exists(LOCAL_QML_LAUNCHER_APP_PATH): return LOCAL_QML_LAUNCHER_APP_PATH return INSTALLED_QML_LAUNCHER_APP_PATH def get_launch_params( self, url, webapp_name='unitywebappsqmllauncher', webapp_search_path="", webapp_homepage="", use_oxide=False, extra_params=[]): base_params = ['--qml=' + self.get_qml_browser_container_path(), '--app-id=' + webapp_name, '--webappName=' + webapp_name, '--webappSearchPath=' + webapp_search_path] if len(webapp_homepage) != 0: base_params.append('--webappHomepage=' + webapp_homepage) if len(url) != 0: base_params.append('--url=' + url) if use_oxide: base_params.append('--useOxide') if os.path.exists(LOCAL_QML_LAUNCHER_APP_PATH): # we are local base_params.append( '--import={}'.format( os.path.join( os.path.dirname(os.path.realpath(__file__)), '../../../../src'))) base_params += extra_params return base_params def launch_with_html_filepath(self, html_filepath, extra_params=[]): self.assertThat(os.path.exists(html_filepath), Equals(True)) url = self.create_file_url(html_filepath) self.launch_application( self.get_launch_params( url, 'unitywebappsqmllauncher', '', '', False, extra_params)) self.assert_url_eventually_loaded(url) def launch_application(self, args, envvars={}): if envvars: for envvar_key in envvars: self.patch_environment(envvar_key, envvars[envvar_key]) self.app = self.launch_test_application( self.get_qml_launcher_path(), *args, app_type='qt') self.webviewContainer = self.get_webviewContainer() self.watcher = self.webviewContainer.watch_signal( 'resultUpdated(QString)') def pick_app_launcher(self, app_path): # force Qt app introspection: from autopilot.introspection.qt import QtApplicationLauncher return QtApplicationLauncher() def get_webviewContainer(self): return self.app.select_single(objectName="webviewContainer") def get_webview(self): return self.app.select_single(objectName="webview") def get_title(self): return self.get_webview().title def assert_url_eventually_loaded(self, url): webview = self.get_webview() self.assertThat(webview.loadProgress, Eventually(Equals(100))) self.assertThat(webview.loading, Eventually(Equals(False))) self.assertThat(webview.url, Eventually(Equals(url))) def eval_expression_in_page_unsafe(self, expr): webview = self.get_webviewContainer() p = self.watcher.num_emissions webview.slots.evalInPageUnsafe(expr) self.assertThat( lambda: self.watcher.num_emissions, Eventually(GreaterThan(p))) results = json.loads( webview.get_signal_emissions( 'resultUpdated(QString)')[-1][0]) return 'result' in results and results['result'] or None class WebappsTestCaseBaseWithLocalHttpContentBase(UnityWebappsTestCaseBase): BASE_URL_SCHEME = 'http://' def setUp(self): super(WebappsTestCaseBaseWithLocalHttpContentBase, self).setUp() self.http_server = fake_servers.WebappsQmlContentHttpServer() self.addCleanup(self.http_server.shutdown) self.base_url = "{}localhost:{}".format( self.BASE_URL_SCHEME, self.http_server.port) def get_base_url_hostname(self): return self.base_url[len(self.BASE_URL_SCHEME):] def launch_with_webapp( self, name, webapp_search_path, envvars={}, use_oxide=False, expected_homepage=''): self.use_oxide = use_oxide self.launch_application( self.get_launch_params( "", name, webapp_search_path, self.base_url, use_oxide), envvars) url = self.base_url if expected_homepage: url = expected_homepage self.assert_url_eventually_loaded(url) ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_callbackDispatch.pyunity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_callbackDispatch.p0000644000015600001650000000523212645740734034047 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import os from testtools.matchers import Equals from autopilot.matchers import Eventually from unity_webapps_qml.tests import UnityWebappsTestCaseBase LOCAL_HTML_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../html/test_webapps_callback_dispatch.html') INSTALLED_HTML_TEST_FILE = \ '/usr/share/unity-webapps-qml/autopilot-tests/' \ 'html/test_webapps_callback_dispatch.html' LOCAL_JS_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../html/test_webapps_callback_dispatch_api.js') INSTALLED_JS_TEST_FILE = \ '/usr/share/unity-webapps-qml/autopilot-tests/' \ 'html/test_webapps_callback_dispatch_api.js' LOCAL_QML_BACKEND_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../qml/test_webapps_callback_dispatch_api.qml') INSTALLED_QML_BACKEND_TEST_FILE = \ '/usr/share/unity-webapps-qml/autopilot-tests/' \ 'qml/test_webapps_callback_dispatch_api.qml' class WebappsCallbackDispatchTestCaseBase(UnityWebappsTestCaseBase): def setUp(self): super(WebappsCallbackDispatchTestCaseBase, self).setUp() self.launch_with_html_filepath( self.get_html_test_file(), ['--clientApiFileUrl=file://' + self.get_js_test_file(), '--apiBackendQmlFileUrl=file://' + self.get_qml_test_file()]) def get_html_test_file(self): if os.path.exists(LOCAL_HTML_TEST_FILE): return os.path.abspath(LOCAL_HTML_TEST_FILE) return INSTALLED_HTML_TEST_FILE def get_js_test_file(self): if os.path.exists(LOCAL_JS_TEST_FILE): return os.path.abspath(LOCAL_JS_TEST_FILE) return INSTALLED_JS_TEST_FILE def get_qml_test_file(self): if os.path.exists(LOCAL_QML_BACKEND_TEST_FILE): return os.path.abspath(LOCAL_QML_BACKEND_TEST_FILE) return INSTALLED_QML_BACKEND_TEST_FILE def test_bidirectionalCallback(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('content').innerHTML;"), Eventually(Equals('callback-loop-count-reached'))) unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/fake_servers.py0000644000015600001650000000405712645740734032450 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Autopilot tests for the unity_webapps_qml package """ import http.server as http import logging import threading class RequestHandler(http.BaseHTTPRequestHandler): def serve_content(self, content, mime_type='text/html'): self.send_header('Content-type', mime_type) self.end_headers() self.wfile.write(content.encode()) def basic_html_content(self): return """ Some content
This is some content
""" def do_GET(self): if self.path == '/': self.send_response(200) self.serve_content(self.basic_html_content()) else: self.send_error(404) class WebappsQmlContentHttpServer(object): def __init__(self): super(WebappsQmlContentHttpServer, self).__init__() self.server = http.HTTPServer(("", 0), RequestHandler) self.server.allow_reuse_address = True self.server_thread = threading.Thread(target=self.server.serve_forever) self.server_thread.start() logging.info("now serving on port {}".format(self.server.server_port)) @property def port(self): return self.server.server_port def run(self): self.server.serve_forever() def shutdown(self): self.server.shutdown() self.server.server_close() self.server_thread.join() ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_injectedOnWebapp.pyunity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_injectedOnWebapp.p0000644000015600001650000000754312645740734034063 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import os from testtools.matchers import Equals from autopilot.matchers import Eventually from unity_webapps_qml.tests import UnityWebappsTestCaseBase LOCAL_HTML_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../html/test_webapps_api_injected.html') INSTALLED_HTML_TEST_FILE = \ '/usr/share/unity-webapps-qml/' \ 'autopilot-tests/html/test_webapps_api_injected.html' class UnityWebappsApiInjectedTestCaseBase(UnityWebappsTestCaseBase): def get_html_test_file(self): if os.path.exists(LOCAL_HTML_TEST_FILE): return os.path.abspath(LOCAL_HTML_TEST_FILE) return INSTALLED_HTML_TEST_FILE def setUp(self): super(UnityWebappsApiInjectedTestCaseBase, self).setUp() self.launch_with_html_filepath(self.get_html_test_file()) def test_getUnityObjectFound(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null'), Eventually(Equals(True))) def test_actionsApiFound(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var unity = window.external.getUnityObject("1.0"); return unity.addAction != null && unity.clearActions != null && unity.clearAction != null; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals(True))) def test_notificationApiFound(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var unity = window.external.getUnityObject("1.0"); return unity.Notification != null && unity.Notification.showNotification != null; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals(True))) def test_messagingIndicatorApiFound(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var unity = window.external.getUnityObject("1.0"); return unity.MessagingIndicator != null && unity.MessagingIndicator.addAction != null && unity.MessagingIndicator.clearIndicator != null && unity.MessagingIndicator.clearIndicators != null && unity.MessagingIndicator.showIndicator != null; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals(True))) def test_ubuntuReadyEventSent(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var api_ready_count = window.localStorage['ubuntu-webapps-api-ready-key']; return api_ready_count != null && api_ready_count > 0; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals(True))) unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_mediaplayer.py0000644000015600001650000001314212645740734033317 0ustar pbuserpbgroup00000000000000#!/usr/bin/env python # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. import os from testtools.matchers import Equals from testtools import skipUnless from autopilot import platform from autopilot.matchers import Eventually from unity_webapps_qml.tests import UnityWebappsTestCaseBase LOCAL_HTML_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../html/test_webapps_mediaplayer.html') INSTALLED_HTML_TEST_FILE = \ '/usr/share/unity-webapps-qml/' \ 'autopilot-tests/html/test_webapps_mediaplayer.html' class UnityWebappsMediaplayerTestCase(UnityWebappsTestCaseBase): def get_html_test_file(self): if os.path.exists(LOCAL_HTML_TEST_FILE): return os.path.abspath(LOCAL_HTML_TEST_FILE) return INSTALLED_HTML_TEST_FILE def setUp(self): super(UnityWebappsMediaplayerTestCase, self).setUp() self.launch_with_html_filepath(self.get_html_test_file()) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkInitialSetTrack(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('mediaplayer-updated'))) expr = """ document.addEventListener( 'unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'MediaPlayer.__get', 'with_callback': true, 'args': ['track']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('TXlBcnRpc3Q=;TXlUaXRsZQ==;TXlBbGJ1bQ=='))) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkInitialSetCanGoNext(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('mediaplayer-updated'))) expr = """ document.addEventListener( 'unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'MediaPlayer.__get', 'with_callback': true, 'args': ['can-go-next']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('true'))) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkInitialSetCanGoPrevious(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('mediaplayer-updated'))) expr = """ document.addEventListener('unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'MediaPlayer.__get', 'with_callback': true, 'args': ['can-go-previous']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('true'))) @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop") def test_checkInitialSetCanPlay(self): self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('mediaplayer-updated'))) expr = """ document.addEventListener('unity-webapps-do-call-response', function(e) { var response = e.detail; document.getElementById('status').innerHTML = '' + e.detail; }); var e = new CustomEvent ( "unity-webapps-do-call", {"detail": JSON.stringify( {"name": 'MediaPlayer.__get', 'with_callback': true, 'args': ['can-play']})}); document.dispatchEvent (e); return true; """ self.eval_expression_in_page_unsafe(expr) self.assertThat( lambda: self.eval_expression_in_page_unsafe( "return document.getElementById('status').innerHTML;"), Eventually(Equals('true'))) unity-webapps-qml-0.1+16.04.20160114/tests/autopilot/unity_webapps_qml/tests/test_installedWebapp.py0000644000015600001650000001040412645740734034137 0ustar pbuserpbgroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import os from testtools.matchers import Equals from autopilot.matchers import Eventually from unity_webapps_qml.tests import WebappsTestCaseBaseWithLocalHttpContentBase LOCAL_HTML_TEST_FILE = "{}/{}".format( os.path.dirname(os.path.realpath(__file__)), '../../data') INSTALLED_HTML_TEST_FILE = \ '/usr/share/unity-webapps-qml/autopilot-tests/data' class InstalledWebappsTestCaseBase( WebappsTestCaseBaseWithLocalHttpContentBase): def setUp(self): super(InstalledWebappsTestCaseBase, self).setUp() def get_webapp_install_folder(self): if os.path.exists(LOCAL_HTML_TEST_FILE): return os.path.abspath(LOCAL_HTML_TEST_FILE) return INSTALLED_HTML_TEST_FILE def test_normalWebappFound(self): rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() self.launch_with_webapp( 'Normal', self.get_webapp_install_folder(), {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule}, False, 'http://www.test.com/') self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var contentElement = document.getElementById('content'); return contentElement.innerHTML; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals("WebApp Script Injected"))) def test_webappWithUAOverrideFound(self): rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() self.launch_with_webapp( 'AlteredUAWebapp', self.get_webapp_install_folder(), {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule}, True, 'http://www.test.com/') self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return navigator.userAgent;'), Eventually(Equals("My Override"))) def test_webappFoundWithSpecialWebappPropertiesFile(self): rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() self.launch_with_webapp( 'ExtendedWebappProperties', self.get_webapp_install_folder() + '/all-in-same-folder', {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule}, False, 'http://www.test.com/') self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) expression = """ var contentElement = document.getElementById('content'); return contentElement.innerHTML; """ self.assertThat( lambda: self.eval_expression_in_page_unsafe(expression), Eventually(Equals("WebApp Script Injected"))) def test_webappPropertiesFileWithUA(self): rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() self.launch_with_webapp( 'ExtendedWebappProperties', self.get_webapp_install_folder() + '/all-in-same-folder', {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule}, True, 'http://www.test.com/') self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return navigator.userAgent;'), Eventually(Equals("My Override"))) def test_webappPropertiesNameUpdated(self): rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() self.launch_with_webapp( '', self.get_webapp_install_folder() + '/all-in-same-folder', {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule}, False, 'http://www.test.com/') self.assertThat( lambda: self.eval_expression_in_page_unsafe( 'return window.external.getUnityObject("1.0") != null;'), Eventually(Equals(True))) unity-webapps-qml-0.1+16.04.20160114/tests/unit/0000755000015600001650000000000012645741276021446 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/unit.pro0000644000015600001650000000010612645740734023142 0ustar pbuserpbgroup00000000000000TEMPLATE=subdirs SUBDIRS = test_plugin \ test_qml \ test_js unity-webapps-qml-0.1+16.04.20160114/tests/unit/main.cpp0000644000015600001650000000000112645740734023063 0ustar pbuserpbgroup00000000000000 unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/0000755000015600001650000000000012645741276024003 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_plugin.cpp0000644000015600001650000001152712645740734026703 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "tst_plugin.h" #include #include #include #include #include #include #include #include #include #include "plugin/unity-webapps-api.h" #include "plugin/abstract-item-model-adaptor.h" const QString webappName = "MyWebapp"; const QString url = "http://MyWebapp.com"; QVariantMap getParams() { QVariantMap params; params["domain"] = QVariant("MyWebapp.com"); params["name"] = QVariant("MyWebapp"); params["iconUrl"] = QVariant("icon://MyWebappcom"); return params; } PluginTest::PluginTest() :QObject(0) { } void PluginTest::initTestCase() {} void PluginTest::testLoadPlugin() { #if 0 QQmlEngine engine; QQmlComponent component(&engine); component.setData("import QtQuick 2.0\nimport Ubuntu.UnityWebApps 0.1\n" "Item { }", QUrl()); QObject *object = component.create(); QVERIFY(object != 0); delete object; #endif } void PluginTest::testInit() { #if 0 UnityWebapps * p = new UnityWebapps(); p->setHandleDesktopFileUpdates(false); p->init(webappName, url, getParams()); QVERIFY( ! p->getDesktopFileContent().isEmpty()); #endif } #include class TestAbstractListModel: public QAbstractListModel { Q_OBJECT Q_ENUMS(Roles) public: TestAbstractListModel(QObject * parent , const QStringList & data) : QAbstractListModel(parent) , _data(data) {} enum Roles { FirstRole = Qt::DisplayRole + 1, SecondRole, ThirdRole, FourthRole, }; QHash roleNames() const Q_DECL_OVERRIDE { QHash roles; roles[FirstRole] = QString("FirstRole").toLocal8Bit(); roles[SecondRole] = QString("SecondRole").toLocal8Bit(); roles[ThirdRole] = QString("ThirdRole").toLocal8Bit(); roles[FourthRole] = QString("FourthRole").toLocal8Bit(); return roles; } int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE { Q_UNUSED(parent); return _data.count(); } QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE { int idx = index.row(); if (idx >= rowCount()) return QVariant(); QHash namePerRow = roleNames(); return QVariant(QString("%1-%2") .arg(QString(namePerRow[role])) .arg(_data.at(idx))); } private: QStringList _data; }; void PluginTest::testAbstractItemModelAdaptor() { QStringList data; data.append(QLatin1String("First")); data.append(QLatin1String("Second")); data.append(QLatin1String("Third")); data.append(QLatin1String("Fourth")); TestAbstractListModel * model = new TestAbstractListModel(0, data); AbstractItemModelAdaptor * adaptor = new AbstractItemModelAdaptor(); adaptor->setItemModel(model); QStringList roles = adaptor->roles(); QVERIFY(roles.count() == 4); for (int i = 0; i < model->rowCount(); ++i) { for (int roleIdx = 0; roleIdx < roles.count(); ++roleIdx) { QString role = roles.at(roleIdx); QVariant item = adaptor->itemAt(i, role); QString expected = QString("%1-%2") .arg(role, data.at(i)); QVERIFY(item.isValid()); QVERIFY(item.canConvert(QMetaType::QString)); QVERIFY(0 == item.toString().compare(expected)); } } delete adaptor; delete model; } void PluginTest::testApplicationSignalHandler() { QProcess testApp; QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("APP_ID", "application-api"); testApp.setProcessEnvironment(env); testApp.start("qmlscene -I ../../../src ../../../examples/api-bindings/application-api/main.qml"); testApp.waitForStarted(); testApp.terminate(); testApp.waitForFinished(); QVERIFY(true); } #include "tst_plugin.moc" unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/main.cpp0000644000015600001650000000232412645740734025432 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "tst_manifestParser.h" #include "tst_plugin.h" #include "tst_webappsAppModel.h" int runTests(int argc, char ** argv) { static QList tests; tests.append(new WebappsAppModelTest()); tests.append(new ManifestParserTest()); tests.append(new PluginTest()); Q_FOREACH(QObject *test, tests) { QTest::qExec(test, argc, argv); } return EXIT_SUCCESS; } int main (int argc, char ** argv) { return runTests(argc, argv); } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/runtests.sh0000755000015600001650000000203112645740734026223 0ustar pbuserpbgroup00000000000000#!/bin/bash # # Copyright © 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ################################################################################ set +e _CMD="" _TEST_FILE=$1 function create_test_cmd { _CMD="./$_TEST_FILE" } function execute_test_cmd { echo "Executing $_CMD" _FAILURES=$($_CMD | grep 'FAIL!' 2>&1) echo $_FAILURES if [ -z "$_FAILURES" ] then echo "OK." else echo "*** Failed tests." set -e exit -2 fi } create_test_cmd execute_test_cmd unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_webappsAppModel.cpp0000644000015600001650000001465612645740734030476 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "tst_webappsAppModel.h" #include #include #include #include #include #include #include #include #include "plugin/unity-webapps-app-model.h" namespace { QString VALID_INSTALLED_WEBAPPS_SEARCH_PATH = "./data/installed-webapps"; } WebappsAppModelTest::WebappsAppModelTest() :QObject(0) {} void WebappsAppModelTest::initTestCase() { } void WebappsAppModelTest::testEmptyWebappsModel() { UnityWebappsAppModel model; model.setSearchPath("./data/no-installed-webapps"); QVERIFY(model.rowCount() == 0); } void WebappsAppModelTest::testWebappsModel() { const int VALID_INSTALLED_WEBAPPS_COUNT = QDir(VALID_INSTALLED_WEBAPPS_SEARCH_PATH) .entryInfoList (QStringList("*-valid"), QDir::Dirs) .count(); UnityWebappsAppModel model; model.setSearchPath(VALID_INSTALLED_WEBAPPS_SEARCH_PATH); const int FOUND_COUNT = model.rowCount(); QCOMPARE(FOUND_COUNT, VALID_INSTALLED_WEBAPPS_COUNT); for (int i = 0; i < FOUND_COUNT; ++i) { QVariant d = model.data(model.index(i), UnityWebappsAppModel::Name); QVERIFY(d.canConvert(QVariant::String)); QVERIFY(d.toString().endsWith("-valid")); QVariant content = model.data(model.index(i), UnityWebappsAppModel::ScriptsContent); QVERIFY(content.canConvert(QVariant::String)); QVERIFY(!content.toString().isEmpty()); QVERIFY(!model.getDomainFor(d.toString()).isEmpty()); } } void WebappsAppModelTest::testWebappsContentWithRequiresModel() { const int VALID_INSTALLED_WEBAPPS_COUNT = QDir(VALID_INSTALLED_WEBAPPS_SEARCH_PATH) .entryInfoList (QStringList("*-valid"), QDir::Dirs) .count(); UnityWebappsAppModel model; model.setSearchPath(VALID_INSTALLED_WEBAPPS_SEARCH_PATH); const int FOUND_COUNT = model.rowCount(); QCOMPARE(FOUND_COUNT, VALID_INSTALLED_WEBAPPS_COUNT); bool requiresFound = false; for (int i = 0; i < FOUND_COUNT; ++i) { QVariant d = model.data(model.index(i), UnityWebappsAppModel::Name); QVERIFY(d.canConvert(QVariant::String)); QVERIFY(d.toString().endsWith("-valid")); if (d.toString() == "with-requires-valid") { QVariant content = model.data(model.index(i), UnityWebappsAppModel::ScriptsContent); QVERIFY(content.canConvert(QVariant::String)); QVERIFY(!content.toString().isEmpty()); QVERIFY(content.toString().contains("var trim = function (s) { return s; };")); requiresFound = true; break; } } QVERIFY(requiresFound); } void WebappsAppModelTest::testWebappsModelUrlMatch() { const int VALID_INSTALLED_WEBAPPS_COUNT = QDir(VALID_INSTALLED_WEBAPPS_SEARCH_PATH) .entryInfoList (QStringList("*-valid"), QDir::Dirs) .count(); UnityWebappsAppModel model; model.setSearchPath(VALID_INSTALLED_WEBAPPS_SEARCH_PATH); const int FOUND_COUNT = model.rowCount(); QCOMPARE(FOUND_COUNT, VALID_INSTALLED_WEBAPPS_COUNT); int i = 0; for (; i < FOUND_COUNT; ++i) { QString name = model.data(model.index(i), UnityWebappsAppModel::Name).toString(); if (name.compare("BBCNews-valid") != 0) continue; QVERIFY(model.doesUrlMatchesWebapp(name, "http://www.bbc.co.uk/news")); QVERIFY(model.doesUrlMatchesWebapp(name, "http://www.bbc.co.uk/news/extra/e")); QVERIFY(model.doesUrlMatchesWebapp(name, "http://www.bbc.com/news/extra/e")); QVERIFY( ! model.doesUrlMatchesWebapp(name, "http://www.bbc.com/sports/extra/e")); break; } QVERIFY(i != FOUND_COUNT); } void WebappsAppModelTest::testSimplifiedManifestInstall() { { UnityWebappsAppModel model; model.setSearchPath(QString("./data/simple-install")); QCOMPARE(model.rowCount(), 1); QString name = model.data(model.index(0), UnityWebappsAppModel::Name).toString(); QVERIFY(name == "MyWebApp"); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::Homepage).toString() == "http://www.bbc.co.uk/news/"); QCOMPARE(model.data(model.index(0), UnityWebappsAppModel::Urls).toStringList().count(), 0); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::UserAgentOverride).toString() == ""); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::Domain).toString() == "bbc.co.uk"); QCOMPARE(model.data(model.index(0), UnityWebappsAppModel::Scripts).toStringList().count(), 0); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::ScriptsContent).toString() == ""); } { UnityWebappsAppModel model; model.setSearchPath(QString("./data/simple-install-webapp-properties-file")); QCOMPARE(model.rowCount(), 1); QString name = model.data(model.index(0), UnityWebappsAppModel::Name).toString(); QVERIFY(name == "MyWebApp"); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::Homepage).toString() == "http://www.bbc.co.uk/news/"); QCOMPARE(model.data(model.index(0), UnityWebappsAppModel::Urls).toStringList().count(), 0); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::UserAgentOverride).toString() == ""); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::Domain).toString() == "bbc.co.uk"); QCOMPARE(model.data(model.index(0), UnityWebappsAppModel::Scripts).toStringList().count(), 0); QVERIFY(model.data(model.index(0), UnityWebappsAppModel::ScriptsContent).toString() == ""); QVERIFY(model.providesSingleInlineWebapp()); QVERIFY(model.getSingleInlineWebappName() == "MyWebApp"); } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/0000755000015600001650000000000012645741276024714 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install/0000755000015600001650000000000012645741276027651 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install/manifest.json0000644000015600001650000000017012645740734032346 0ustar pbuserpbgroup00000000000000{ "name": "MyWebApp", "homepage": "http://www.bbc.co.uk/news/", "domain": "bbc.co.uk", "includes": [] } ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-file/unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-fi0000755000015600001650000000000012645741276033634 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017600000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-file/webapp-properties.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-fi0000644000015600001650000000017012645740734033632 0ustar pbuserpbgroup00000000000000{ "name": "MyWebApp", "homepage": "http://www.bbc.co.uk/news/", "domain": "bbc.co.uk", "includes": [] } ././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-file/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/simple-install-webapp-properties-fi0000644000015600001650000000067112645740734033640 0ustar pbuserpbgroup00000000000000{ "description": "Gmail (webapp version)", "framework": "ubuntu-sdk-14.04-dev1", "architecture": "all", "hooks": { "webapp-gmail": { "apparmor": "webapp-gmail.json", "desktop": "webapp-gmail.desktop" } }, "maintainer": "Webapps Team ", "name": "com.ubuntu.developer.webapps.webapp-gmail", "title": "webapp-gmail", "version": "1.0.10" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/0000755000015600001650000000000012645741276030332 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-with-requires-valid/unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-wit0000755000015600001650000000000012645741276033663 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-with-requires-valid/valid.user.jsunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-wit0000644000015600001650000000006312645740734033662 0ustar pbuserpbgroup00000000000000var Unity = window.external.getUnityObject('1.0'); ././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-with-requires-valid/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-wit0000644000015600001650000000074212645740734033666 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "with-requires-valid", "scripts": ["valid.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/invalid/0000755000015600001650000000000012645741276031760 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/invalid/valid.user.jsunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/invalid/valid.use0000644000015600001650000000006312645740734033572 0ustar pbuserpbgroup00000000000000var Unity = window.external.getUnityObject('1.0'); ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/invalid/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/invalid/manifest.0000644000015600001650000000073412645740734033571 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews-valid", "scripts": ["valid.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/common/0000755000015600001650000000000012645741276031622 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/common/utils.js0000644000015600001650000000004712645740734033317 0ustar pbuserpbgroup00000000000000var trim = function (s) { return s; }; ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-valid/unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-val0000755000015600001650000000000012645741276033642 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-valid/valid.user.jsunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-val0000644000015600001650000000006312645740734033641 0ustar pbuserpbgroup00000000000000var Unity = window.external.getUnityObject('1.0'); ././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-valid/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/installed-webapps/unity-webapps-val0000644000015600001650000000073212645740734033644 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news", "http://www.bbc.*/news/*"], "requires": ["utils.js"], "name": "BBCNews-valid", "scripts": ["valid.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/0000755000015600001650000000000012645741276026705 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016200000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-chrome-backfw-and-no-chrome.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-chrome-backfw-and-n0000644000015600001650000000101012645740734033416 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3", "chrome": "back-forward-buttons;no-chrome" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-manifest.json0000644000015600001650000000073012645740734032501 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3" } ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-no-default-chrome.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-no-default-chrome.j0000644000015600001650000000073012645740734033464 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3" } ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-with-ua-override.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-with-ua-override.js0000644000015600001650000000100212645740734033522 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3", "user-agent-override": "My Override" } ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-chrome-backfw-and-reload.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-chrome-backfw-and-r0000644000015600001650000000101412645740734033426 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3", "chrome": "back-forward-buttons;reload-button" } ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-simplified-manifest.jsonunity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-simplified-manifest0000644000015600001650000000017012645740734033652 0ustar pbuserpbgroup00000000000000{ "name": "MyWebApp", "homepage": "http://www.bbc.co.uk/news/", "domain": "bbc.co.uk", "includes": [] } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/manifests/valid-chrome-backfw.json0000644000015600001650000000077612645740734033415 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/", "http://www.bbc.com/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": {"128":"128/unity-webapps-bbc.png"}, "domain":"bbc.co.uk", "homepage":"http://www.bbc.co.uk/news/", "license":"GPL-3", "chrome": "back-forward-buttons" } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/data/no-installed-webapps/0000755000015600001650000000000012645741276030744 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_plugin.h0000644000015600001650000000201012645740734026333 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef TST_PLUGIN_H #define TST_PLUGIN_H #include class PluginTest: public QObject { Q_OBJECT public: PluginTest(); private Q_SLOTS: void initTestCase(); // tests void testLoadPlugin(); void testInit(); void testAbstractItemModelAdaptor(); void testApplicationSignalHandler(); }; #endif // TST_PLUGIN_H unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_manifestParser.h0000644000015600001650000000233012645740734030025 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __TST_MANIFEST_PARSER_H__ #define __TST_MANIFEST_PARSER_H__ #include #include #include class ManifestParserTest: public QObject { Q_OBJECT public: ManifestParserTest(); private Q_SLOTS: void initTestCase(); // tests void testParseManifest(); void testParseChromeOptions(); void testParseUserOverride(); private: static QFileInfoList listManifests(const QDir& parent); static bool shouldManifestSucceed(const QString& filename); }; #endif // __TST_MANIFEST_PARSER_H__ unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_manifestParser.cpp0000644000015600001650000000700212645740734030361 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "tst_manifestParser.h" #include #include #include #include #include #include #include #include "plugin/unity-webapps-app-manifest-parser.h" namespace { const QString manifestsDataPath = "./data/manifests"; void verifyChrome(const QString & filename, const ManifestFileInfoOption & option) { if (! filename.contains("chrome")) { // regular validation, should default to no-chrome QVERIFY(option.value().chromeOptions.contains("no-chrome") && option.value().chromeOptions.count() == 1); return; } bool noChromePresent = filename.contains("no-chrome"); if (noChromePresent) { // no-chrome should override any other value QVERIFY(option.value().chromeOptions.contains("no-chrome") && option.value().chromeOptions.count() == 1); return; } if (filename.contains("backfw")) { QVERIFY(option.value().chromeOptions.contains("back-forward-buttons") && ! option.value().chromeOptions.contains("no-chrome")); } if (filename.contains("reload")) { QVERIFY(option.value().chromeOptions.contains("reload-button") && ! option.value().chromeOptions.contains("no-chrome")); } } } // namespace { ManifestParserTest::ManifestParserTest() :QObject(0) {} QFileInfoList ManifestParserTest::listManifests(const QDir& parent) { return parent.entryInfoList(QStringList("*.json"), QDir::Files); } bool ManifestParserTest::shouldManifestSucceed(const QString& filename) { return filename.startsWith("valid-"); } void ManifestParserTest::initTestCase() { } void ManifestParserTest::testParseManifest() { UnityWebappsAppManifestParser parser; QFileInfoList manifests = listManifests(manifestsDataPath); Q_FOREACH(QFileInfo manifest, manifests) { QVERIFY(manifest.isFile()); ManifestFileInfoOption result = parser.parse(manifest); QString filename = manifest.fileName(); QVERIFY(result.isvalid() == shouldManifestSucceed(filename)); } } void ManifestParserTest::testParseChromeOptions() { UnityWebappsAppManifestParser parser; QFileInfoList manifests = listManifests(manifestsDataPath); Q_FOREACH(QFileInfo manifest, manifests) { QVERIFY(manifest.isFile()); ManifestFileInfoOption result = parser.parse(manifest); QString filename = manifest.fileName(); QVERIFY(result.isvalid() == shouldManifestSucceed(filename)); verifyChrome(filename, result); } } void ManifestParserTest::testParseUserOverride() { UnityWebappsAppManifestParser parser; ManifestFileInfoOption result = parser.parse(manifestsDataPath + "/valid-with-ua-override.json"); QVERIFY(result.value().userAgentOverride == "My Override"); } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/test_plugin.pro0000644000015600001650000000253612645740734027066 0ustar pbuserpbgroup00000000000000include(../../../common-project-config.pri) TARGET = tst_plugin CONFIG += \ debug \ link_pkgconfig PKGCONFIG += glib-2.0 \ gio-2.0 QT += \ core \ qml \ testlib PLUGIN_SRC_DIR = \ $$TOP_SRC_DIR/src/Ubuntu/UnityWebApps/plugin SOURCES += \ tst_plugin.cpp \ tst_manifestParser.cpp \ tst_webappsAppModel.cpp \ $${PLUGIN_SRC_DIR}/unity-webapps-app-model.cpp \ $${PLUGIN_SRC_DIR}/unity-webapps-app-manifest-parser.cpp \ $${PLUGIN_SRC_DIR}/unity-webapps-desktop-infos.cpp \ $${PLUGIN_SRC_DIR}/abstract-item-model-adaptor.cpp \ main.cpp HEADERS += \ tst_plugin.h \ tst_manifestParser.h \ tst_webappsAppModel.h \ $${PLUGIN_SRC_DIR}/unity-webapps-app-model.h \ $${PLUGIN_SRC_DIR}/unity-webapps-desktop-infos.h \ $${PLUGIN_SRC_DIR}/abstract-item-model-adaptor.h \ $${PLUGIN_SRC_DIR}/unity-webapps-app-manifest-parser.h INCLUDEPATH += \ $$TOP_SRC_DIR/src/Ubuntu/UnityWebApps OTHER_FILES += \ $$system(ls ./data/*/*) \ $$system(ls ./data/*/*/*) \ $$system(ls *.sh) \ data/manifests/valid-with-ua-override.json \ data/manifests/valid-simplified-manifest.json \ data/manifests/valid-embedded-in-click-manifest.json # manually add the 'check' target check.depends = $${TARGET} check.commands = "set -e; ./runtests.sh $${TARGET}" QMAKE_EXTRA_TARGETS += check unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_plugin/tst_webappsAppModel.h0000644000015600001650000000227312645740734030133 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __TST_WEBAPPS_APP_MODEL_H__ #define __TST_WEBAPPS_APP_MODEL_H__ #include #include #include class WebappsAppModelTest: public QObject { Q_OBJECT public: WebappsAppModelTest(); private Q_SLOTS: void initTestCase(); // tests void testEmptyWebappsModel(); void testWebappsModel(); void testWebappsContentWithRequiresModel(); void testWebappsModelUrlMatch(); void testSimplifiedManifestInstall(); private: }; #endif // __TST_WEBAPPS_APP_MODEL_H__ unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/0000755000015600001650000000000012645741276023276 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_contenthub.html0000644000015600001650000000215712645740734030063 0ustar pbuserpbgroup00000000000000 unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_contenthub.qml0000644000015600001650000001376212645740734027714 0ustar pbuserpbgroup00000000000000/* * Copyright 2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.Web 0.2 import com.canonical.Oxide 1.0 as Oxide import Ubuntu.UnityWebApps 0.1 TestCase { id: testcase name: "ContentHubApiTest" signal messageReceived() SignalSpy { id: spyMessageReceived target: testcase signalName: "messageReceived" } function setup() { callbacks = [] objects = {} lastReceivedMethod = "" webview.url = "empty.html" spyMessageReceived.clear() } property var callbacks: [] property var objects: null property var backends: getContentHubBackend() property string lastReceivedMethod function serializeContentTransferObject(id, content, selection, handlerFuncs) { if (!objects) { objects = {} } objects[id] = { content: content, selection: selection, items: {text: "blabla"}, handlerFuncs: handlerFuncs }; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentTransfer', objectid: id, content: { store: "store", state: "state", selectionType: selection, contentType: content, direction: "direction" } } } function getContentHubBackend() { return { ContentHub: { onShareRequested: function(callback) { callbacks.push(callback) lastReceivedMethod = 'onShareRequested' testcase.messageReceived() }, dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; verify(objects != null && objects[infos.objectid] != null) verify(objects[infos.objectid].handlerFuncs[method_name] != null) testcase.messageReceived() var r try { r = objects[infos.objectid].handlerFuncs[method_name].apply(objects[infos.objectid], args) } catch(e) { verify(0 && "Exception " + e.toString()) } if (callback) { verify (typeof(callback) === 'function') callback(r) } } } } } function test_call_shareRequested() { setup(); webview.url = "tst_api_contenthub.html" spyMessageReceived.wait() compare(spyMessageReceived.count, 1, "Should have had 1 apiCallDispatched signal"); compare(lastReceivedMethod, 'onShareRequested', "Should have had 2 apiCallDispatched signal"); compare(callbacks.length, 1, "Should have had 1 callback object"); } function test_invoke_shareRequestedCallback() { setup(); var transferObject = { contentType: function() { return "Pictures"; }, items: function() { return [{ text: "blabla" }] } } webview.url = "tst_api_contenthub.html" spyMessageReceived.wait() compare(spyMessageReceived.count, 1, "Should have had 2 apiCallDispatched signal"); compare(lastReceivedMethod, 'onShareRequested', "Should have had 2 apiCallDispatched signal"); compare(callbacks.length, 1, "Should have had 1 callback object"); evaluateCode("document.addEventListener('onsharerequest', function(e) { \ oxide.sendMessage('share-request-received', { type: e.detail.type }); \ })") evaluateCode("document.addEventListener('received-object-value', function(e) { \ oxide.sendMessage('share-request-received', { type: e.detail.type }); \ })") callbacks[0]( serializeContentTransferObject( "1", "", "", transferObject)) spyMessageReceived.wait() compare(spyMessageReceived.count, 3, "Should have had 1 messageReceived signal"); } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true injectExtraContentShareCapabilities: true customBackendProxies: backends } function evaluateCode(code, wrap) { webview.rootFrame.sendMessageNoReply( "oxide://test-msg-handler/", "evalcode", { code: code, wrap: wrap === undefined ? false : wrap }); } WebView { id: webview anchors.fill: parent messageHandlers: [ Oxide.ScriptMessageHandler { msgId: "share-request-received" contexts: [ "oxide://test-msg-handler/" ] callback: function(msg) { testcase.lastReceivedMethod = msg.args; testcase.messageReceived() } } ] context: WebContext { userScripts: [ Oxide.UserScript { context: "oxide://test-msg-handler/" url: Qt.resolvedUrl("tst_api_contenthub.js") incognitoEnabled: true matchAllFrames: true } ] } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/test_qml.pro0000644000015600001650000000130112645740734025641 0ustar pbuserpbgroup00000000000000include(../../../common-project-config.pri) TESTS += $$system(ls tst_*.qml) TEMPLATE = app QT += qml \ quick \ qmltest CONFIG += no_keywords # build main test TARGET = test_qml SOURCES += \ test_qml.cpp OTHER_FILES += \ $$system(ls *.qml) \ $$system(ls *.sh) \ tst_api_contenthub.qml \ tst_api_contenthub.html \ tst_api_contenthub.js \ tst_api_launchEmbeddedUI.qml \ tst_api_launchEmbeddedUI.html \ embeddedUI.qml \ tst_api_launchEmbeddedUI.js \ empty.html # make check target check.target = check check.commands = "set -e;" for(TEST, TESTS) { check.commands += ./runtest.sh $${TARGET} $${TEST} ../../../src; } QMAKE_EXTRA_TARGETS += check unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_launchEmbeddedUI.qml0000644000015600001650000000441012645740734030653 0ustar pbuserpbgroup00000000000000/* * Copyright 2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.Web 0.2 import com.canonical.Oxide 1.0 as Oxide import Ubuntu.UnityWebApps 0.1 TestCase { id: testcase name: "LaunchEmbeddedUIApiTest" SignalSpy { id: spy target: webview signalName: "visibleChanged" } function setup() { spy.clear() } function test_invoke_shareRequestedCallback() { setup(); webview.url = "tst_api_launchEmbeddedUI.html" evaluateCode("var e = new CustomEvent('launchEmbeddedUI', { bubbles: true }); document.dispatchEvent(e);") // spy.wait() // compare(spy.count, 1, "Should have had 1 messageReceived signal"); } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true injectExtraContentShareCapabilities: true } function evaluateCode(code, wrap) { webview.rootFrame.sendMessageNoReply( "oxide://test-ui/", "evalcode", { code: code, wrap: wrap === undefined ? false : wrap }); } visible: true WebView { id: webview width: 200 height: 200 visible: true context: WebContext { userScripts: [ Oxide.UserScript { context: "oxide://test-ui/" url: Qt.resolvedUrl("tst_api_launchEmbeddedUI.js") incognitoEnabled: true matchAllFrames: true } ] } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_init.qml0000644000015600001650000000665312645740734025656 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.UnityWebApps 0.1 TestCase { name: "WebAppsComponentInitTests" function setup() { webapps.__unbind(); mockedWebView.disconnectAll(); } function test_nullInit() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "injected"; webapps.name = "test_nullInit"; compare(spy.count, 0, "Invalid (null) init call"); } function test_initAndInjected() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "injected"; webapps.name = "test_initAndInjected"; webapps.bindee = mockedWebView; mockedWebView.loadingStarted(); compare(spy.count, 1, "Script has been injected"); } function test_initWithNoName() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "messageReceivedConnected"; webapps.name = "test_initWithNoName"; webapps.bindee = mockedWebView; compare(spy.count, 1, "WebApp message received connected"); } SignalSpy { id: spy } UnityWebApps { id: webapps name: "" bindee: null } // 'mocks' the 'bindee' Item { id: mockedWebView property var connectedSlots: [] function disconnectAll () { connectedSlots.forEach(function (slot) { slot.target.disconnect(slot.slot); }); connectedSlots = []; } function getUnityWebappsProxies() { return { injectUserScripts: function(userScriptUrls) { injected(userScriptUrls); }, sendToPage: function (message) { }, navigateTo: function (url) { }, loadingStartedConnect: function (onLoadingStarted) { mockedWebView.loadingStarted.connect(onLoadingStarted); loadingStartedConnected(); connectedSlots.push({'target': mockedWebView.loadingStarted, 'slot': onLoadingStarted}); }, messageReceivedConnect: function (onMessageReceived) { mockedWebView.messageReceived.connect(onMessageReceived); messageReceivedConnected(); connectedSlots.push({'target': mockedWebView.messageReceived, 'slot': onMessageReceived}); }, }; } // back to webapps element signal loadingStarted() signal messageReceived() // called signal injected(string src) signal loadingStartedConnected() signal messageReceivedConnected() } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/empty.html0000644000015600001650000000005512645740734025320 0ustar pbuserpbgroup00000000000000 unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/test_qml.cpp0000644000015600001650000000007512645740734025632 0ustar pbuserpbgroup00000000000000#include QUICK_TEST_MAIN(QmlTests) unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_launchEmbeddedUI.js0000644000015600001650000000203212645740734030474 0ustar pbuserpbgroup00000000000000// vim:expandtab:shiftwidth=2:tabstop=2: // Copyright (C) 2015 Canonical Ltd. // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // ==UserScript== // @run-at document-start // ==/UserScript== oxide.addMessageHandler("evalcode", function(msg) { var code = msg.args.code; if (msg.args.wrap) { code = "(function() {" + code + "})()"; } eval(code); }); unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/runtest.sh0000755000015600001650000000262412645740734025343 0ustar pbuserpbgroup00000000000000#!/bin/bash # # Copyright © 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Author: Juhapekka Piiroinen ################################################################################ _CMD="" _TARGET=$1 _TESTFILE=$2 _MAIN_MODULE_PATH=$3 _ARGS="-platform minimal" set +e function create_test_cmd { _CMD="./$_TARGET -input $_TESTFILE -import \"$_MAIN_MODULE_PATH\" -maxwarnings 20" } function execute_test_cmd { echo "Executing $_CMD $_ARGS" # segfault if [ $? -eq 139 ]; then return 2 fi # abort if [ $? -eq 134 ]; then return 2 fi return 0 } create_test_cmd execute_test_cmd if [ $? -eq 2 ]; then echo "FAILURE: Failed to execute test with -platform minimal, lets try without" _ARGS="" execute_test_cmd if [ $? -eq 2 ]; then echo "FAILURE: Failed to execute test." set -e exit -2 fi fi set -e unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_launchEmbeddedUI.html0000644000015600001650000000052612645740734031032 0ustar pbuserpbgroup00000000000000 unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/embeddedUI.qml0000644000015600001650000000145312645740734026001 0ustar pbuserpbgroup00000000000000/* * Copyright 2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 Rectangle { property string fileToShare property string p property string q color: Qt.red } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_cleanup.qml0000644000015600001650000001151712645740734026335 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.UnityWebApps 0.1 TestCase { name: "WebAppsDispatchCleanupTest" function setup() { } function createWebViewMock() { var messageReceivedCallbacks = []; var loadingChangedCallbacks = []; return { url: '', loadingChanged: { connect: function (callback) { loadingChangedCallbacks.push(callback); }, disconnect: function(callback) { loadingChangedCallbacks = loadingChangedCallbacks.filter(function (e) { return e !== callback; }); } }, experimental: { messageReceived: { connect: function (callback) { messageReceivedCallbacks.push(callback); }, disconnect: function(callback) { messageReceivedCallbacks = messageReceivedCallbacks.filter(function (e) { return e !== callback; }); } }, userScripts: [], postMessage: function(msg) {} }, callMessageReceivedCallbacks: function(msg) { var wrapped = {data: JSON.stringify(msg)}; messageReceivedCallbacks.forEach(function(f) { f(wrapped); }); } }; } function createWebAppsDispatcherWithSimpleBackend(mockedwebview) { var simple_backend = {This: { Is: { A: {Backend: function (args) { mockedWebView.called(args) } } } } }; var bindeeProxies = UnityWebAppsUtils.makeProxiesForWebViewBindee(mockedwebview); var bridge = new UnityWebAppsJs.UnityWebApps(null, bindeeProxies); bridge.setBackends(simple_backend); return bridge; } function test_cleanupOnce() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var mwv = createWebViewMock(); var dispatcher = createWebAppsDispatcherWithSimpleBackend(mwv); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 1, "This.Is.A.Backend backend called"); dispatcher.cleanup(); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 1, "This.Is.A.Backend backend called"); } function test_multipleCleanup() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var mwv = createWebViewMock(); var dispatcher = createWebAppsDispatcherWithSimpleBackend(mwv); var dispatcher1 = createWebAppsDispatcherWithSimpleBackend(mwv); var dispatcher2 = createWebAppsDispatcherWithSimpleBackend(mwv); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 3, "This.Is.A.Backend backend called"); dispatcher.cleanup(); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 5, "This.Is.A.Backend backend called"); dispatcher1.cleanup(); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 6, "This.Is.A.Backend backend called"); dispatcher2.cleanup(); mwv.callMessageReceivedCallbacks (UnityWebAppsUtils.formatUnityWebappsCall ('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 6, "This.Is.A.Backend backend called"); } SignalSpy { id: spy } // 'mocks' the 'bindee' Item { id: mockedWebView // back to webapps element signal loadingStarted() signal messageReceived(var message) // called signal called() signal injected(string src) signal loadingStartedConnected() signal messageReceivedConnected() } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_api_contenthub.js0000644000015600001650000000203212645740734027523 0ustar pbuserpbgroup00000000000000// vim:expandtab:shiftwidth=2:tabstop=2: // Copyright (C) 2015 Canonical Ltd. // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // ==UserScript== // @run-at document-start // ==/UserScript== oxide.addMessageHandler("evalcode", function(msg) { var code = msg.args.code; if (msg.args.wrap) { code = "(function() {" + code + "})()"; } eval(code); }); unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_qml/tst_dispatch.qml0000644000015600001650000001406012645740734026501 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.UnityWebApps 0.1 TestCase { name: "WebAppsDispatchTest" function setup() { webapps.__unbind(); mockedWebView.disconnectAll(); } function test_properBackendDispatched() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var simple_backend = {This: { Is: { A: {Backend: function (args) { mockedWebView.called(args) } } } } }; webapps.customBackendProxies = simple_backend; webapps.name = "test_properBackendDispatched"; webapps.bindee = mockedWebView; mockedWebView.messageReceived(UnityWebAppsUtils.formatUnityWebappsCall('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 1, "This.Is.A.Backend backend called"); } function test_backendDispatchedWithProperArguments() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var params = [1, 2, 'AAU']; var action = function() { var args = arguments; mockedWebView.called(args); verify(null != args && args.length !== 0, "Non null args"); verify(typeof(args) == 'object', "Proper args type: " + typeof(args)); params.forEach(function (elt, idx) { compare(elt, args[idx], "Validate args index :" + idx); }); }; var simple_backend = {This: { Is: { A: {Backend: action } } } }; webapps.customBackendProxies = simple_backend; webapps.name = "test_backendDispatchedWithProperArguments"; webapps.bindee = mockedWebView; mockedWebView.messageReceived(UnityWebAppsUtils.formatUnityWebappsCall('This.Is.A.Backend', JSON.stringify(params))); compare(spy.count, 1, "This.Is.A.Backend backend called"); } function test_invalidBackendNotDispatched() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var invalid_backend = {This: { Is: { Not: { A: {Backend: function (args) { mockedWebView.called(args) } } } } } }; webapps.customBackendProxies = invalid_backend; webapps.name = "test_invalidBackendNotDispatched"; webapps.bindee = mockedWebView; mockedWebView.messageReceived(UnityWebAppsUtils.formatUnityWebappsCall('This.Is.A.Backend', JSON.stringify([1, 2, "AAU"]))); compare(spy.count, 0, "This.Is.Not.A.Backend backend not called"); } function test_callbacksAreWrapped() { setup(); spy.clear(); spy.target = mockedWebView; spy.signalName = "called"; var action = function() { var args = Array.prototype.slice.call(arguments); mockedWebView.called(args); // make sure that we have a function that wraps the callbackid verify(null != args, "Non null args"); verify(typeof(args) == 'object', "Proper args type"); expectFail(args.some(function (arg) { return typeof(arg) == 'object' && 'callbackid' in arg; }), ""); verify(args.some(function (arg) { return typeof(arg) == 'function'; }), "We have at least a wrapping function"); }; var backend = {This: { Is: { A: {Backend: action } } } }; webapps.customBackendProxies = backend; webapps.name = "test_callbacksAreWrapped"; webapps.bindee = mockedWebView; //We assume a bit about the implementation there ('callbackid') mockedWebView.messageReceived(UnityWebAppsUtils.formatUnityWebappsCall('This.Is.A.Backend', JSON.stringify([1, {'callbackid': 1}, "AAU"]))); compare(spy.count, 1, "This.Is.A.Backend backend called"); } SignalSpy { id: spy } UnityWebApps { id: webapps name: "" bindee: null injectExtraUbuntuApis: true } // 'mocks' the 'bindee' Item { id: mockedWebView property var connectedSlots: [] function disconnectAll () { connectedSlots.forEach(function (slot) { slot.target.disconnect(slot.slot); }); connectedSlots = []; } function getUnityWebappsProxies() { return { injectUserScripts: function(userScriptUrls) { injected(userScriptUrls); }, sendToPage: function (message) { }, navigateTo: function (url) { }, loadingStartedConnect: function (onLoadingStarted) { mockedWebView.loadingStarted.connect(onLoadingStarted); loadingStartedConnected(); connectedSlots.push({'target': mockedWebView.loadingStarted, 'slot': onLoadingStarted}); }, messageReceivedConnect: function (onMessageReceived) { mockedWebView.messageReceived.connect(onMessageReceived); messageReceivedConnected(); connectedSlots.push({'target': mockedWebView.messageReceived, 'slot': onMessageReceived}); }, }; } // back to webapps element signal loadingStarted() signal messageReceived(var message) // called signal called() signal injected(string src) signal loadingStartedConnected() signal messageReceivedConnected() } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_js/0000755000015600001650000000000012645741276023121 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_js/tst_sanitizer.qml0000644000015600001650000000553512645740734026544 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import QtTest 1.0 import "../../../src/Ubuntu/UnityWebApps/common/js/api-sanitizer.js" as SanitizerJs TestCase { name: "JavascriptApiCallSanitizerTests" function setup() { } function test_checkString() { setup(); var threw = false; threw = false; try { SanitizerJs.checkString(); } catch(e) { threw = true; }; compare(threw, true, "Null string type"); threw = false; try { SanitizerJs.checkString(1); } catch(e) { threw = true; }; compare(threw, true, "Invalid string type"); threw = false; try { SanitizerJs.checkString("blabla"); } catch(e) { threw = true; }; compare(threw, false, "Valid string"); threw = false; try { SanitizerJs.checkString(null, true); } catch(e) { threw = true; }; compare(threw, false, "Valid null string"); } function test_findName() { setup(); } function test_stringify() { setup(); compare(SanitizerJs.stringify(null), null, "Stringify null"); compare(SanitizerJs.stringify(undefined), undefined, "Stringify undefined"); compare(SanitizerJs.stringify("blabla"), "blabla", "Stringify string"); compare(SanitizerJs.stringify(1), 1, "Stringify number"); } function test_sanitizer() { setup(); var called = false; var actualArgs = null; var actualFuncName = null; var backend = { call: function(func_name, args) { called = true; actualArgs = args; actualFuncName = func_name; }, }; var sanitizer = null; called = false; sanitizer = SanitizerJs.createArgumentsSanitizer (backend, [], 'myfunc'); sanitizer(); compare(called, true, "Simple sanitizer func call") called = false; var args = [1, 2, "blabla"]; actualArgs = null; sanitizer = SanitizerJs.createArgumentsSanitizer (backend, [{ number: true }, { number: true }, { str: true }], 'myfunc'); sanitizer.apply(null, args); compare(called, true, "With args sanitizer func call"); expectFail(actualArgs == null, "Non null args"); compare(actualArgs.length, 3, "Invalid number of args received"); for (var i = 0; i < actualArgs.length; ++i) { compare(actualArgs[i], args[i], "Invalid arg value"); } compare(actualFuncName, "myfunc", "Invalid function name"); var threw = false; try { sanitizer.apply(null, []); } catch(e) { threw = true; } verify(threw, "Invalid call args count threw"); threw = false; try { sanitizer.apply(null, [1, 2, 3]); } catch(e) { threw = true; } verify(threw, "Invalid call args type threw"); } } unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_js/test_js.cpp0000644000015600001650000000007512645740734025300 0ustar pbuserpbgroup00000000000000#include QUICK_TEST_MAIN(QmlTests) unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_js/test_js.pro0000644000015600001650000000077312645740734025323 0ustar pbuserpbgroup00000000000000include(../../../common-project-config.pri) TESTS += $$system(ls tst_*.qml) TEMPLATE = app TARGET = test_js QT += qml \ testlib \ qmltest CONFIG += no_keywords \ debug \ link_pkgconfig SOURCES += \ test_js.cpp OTHER_FILES += $$system(ls *.qml) \ $$system(ls *.js) \ $$system(ls *.sh) # make check target check.target = check check.commands = "set -e;" for(TEST, TESTS) { check.commands += ./runtest.sh $${TARGET} $${TEST} ../../../src; } QMAKE_EXTRA_TARGETS += check unity-webapps-qml-0.1+16.04.20160114/tests/unit/test_js/runtest.sh0000755000015600001650000000262412645740734025166 0ustar pbuserpbgroup00000000000000#!/bin/bash # # Copyright © 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Author: Juhapekka Piiroinen ################################################################################ _CMD="" _TARGET=$1 _TESTFILE=$2 _MAIN_MODULE_PATH=$3 _ARGS="-platform minimal" set +e function create_test_cmd { _CMD="./$_TARGET -input $_TESTFILE -import \"$_MAIN_MODULE_PATH\" -maxwarnings 20" } function execute_test_cmd { echo "Executing $_CMD $_ARGS" # segfault if [ $? -eq 139 ]; then return 2 fi # abort if [ $? -eq 134 ]; then return 2 fi return 0 } create_test_cmd execute_test_cmd if [ $? -eq 2 ]; then echo "FAILURE: Failed to execute test with -platform minimal, lets try without" _ARGS="" execute_test_cmd if [ $? -eq 2 ]; then echo "FAILURE: Failed to execute test." set -e exit -2 fi fi set -e unity-webapps-qml-0.1+16.04.20160114/common-vars.pri0000644000015600001650000000145612645740734022306 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common variables for all projects. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Project name (used e.g. in include file and doc install path). # remember to update debian/* files if you changes this #----------------------------------------------------------------------------- PROJECT_NAME = webapps-qml-module #----------------------------------------------------------------------------- # Project version # remember to update debian/* files if you changes this #----------------------------------------------------------------------------- PROJECT_VERSION = 0.1 API_URI = "Ubuntu.UnityWebApps" # End of File unity-webapps-qml-0.1+16.04.20160114/src/0000755000015600001650000000000012645741276020114 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/0000755000015600001650000000000012645741276021376 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/Ubuntu.pro0000644000015600001650000000005212645740734023375 0ustar pbuserpbgroup00000000000000TEMPLATE = subdirs SUBDIRS = UnityWebApps unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/0000755000015600001650000000000012645741276023770 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/UnityWebAppsUtils.js0000644000015600001650000003402512645740741027741 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ .pragma library var UBUNTU_WEBAPPS_BINDING_API_CALL_MESSAGE = "ubuntu-webapps-binding-call"; var UBUNTU_WEBAPPS_BINDING_API_CALLBACK_MESSAGE = "ubuntu-webapps-binding-callback-call"; var UBUNTU_WEBAPPS_BINDING_OBJECT_METHOD_CALL_MESSAGE = "ubuntu-webapps-binding-call-object-method"; function QtWebviewAdapter(webview, disposer, makeSignalDisconnecter) { this.webview = webview; this.disposer = disposer; this.makeSignalDisconnecter = makeSignalDisconnecter; } QtWebviewAdapter.prototype = { injectUserScripts: function(userScriptUrls) { var scripts = this.webview.experimental.userScripts; for (var i = 0; i < userScriptUrls.length; ++i) { scripts.push(userScriptUrls[i]); } this.webview.experimental.userScripts = scripts; }, sendToPage: function (message) { this.webview.experimental.postMessage(message); }, loadingStartedConnect: function (onLoadingStarted) { function handler(loadRequest) { var LoadStartedStatus = 0; if (loadRequest.status === LoadStartedStatus) { onLoadingStarted(); } }; this.webview.loadingChanged.connect(handler); this.disposer.addDisposer(this.makeSignalDisconnecter(this.webview.loadingChanged, handler)); }, messageReceivedConnect: function (onMessageReceived) { function handler(raw) { onMessageReceived(JSON.parse(raw.data)); }; this.webview.experimental.messageReceived.connect(handler); this.disposer.addDisposer(this.makeSignalDisconnecter(this.webview.experimental.messageReceived, handler)); } } function OxideWebviewAdapter(webview, disposer, makeSignalDisconnecter) { this.webview = webview; this.disposer = disposer; this.makeSignalDisconnecter = makeSignalDisconnecter; this._WEBAPPS_USER_SCRIPT_CONTEXT = "oxide://main-world"; this._injectedUserScripts = []; this._scriptMessageReceivedHandler = null; } OxideWebviewAdapter.prototype = { injectUserScripts: function(userScriptUrls) { var context = this.webview.context; if (!context) { console.error('No context found for the current Oxide webview. Cannot inject user scripts.'); return; } for (var i = 0; i < userScriptUrls.length; ++i) { var script = userScriptUrls[i]; if (this._injectedUserScripts.some( function(e) { return e === script; })) { continue; } var scriptStart = "import com.canonical.Oxide 1.0 as Oxide; \ Oxide.UserScript { "; var scriptEnd = " }"; var statement = scriptStart + 'context: "' + this._WEBAPPS_USER_SCRIPT_CONTEXT + '";' + 'matchAllFrames: false;' + 'emulateGreasemonkey: true;' + 'url: "' + script + '";' + scriptEnd; context.addUserScript( Qt.createQmlObject(statement, this.webview)); } this._injectedUserScripts.push(script); }, sendToPage: function (message) { this.webview.rootFrame.sendMessageNoReply( this._WEBAPPS_USER_SCRIPT_CONTEXT, "UnityWebappApi-Host-Message", JSON.parse(message)); }, loadingStartedConnect: function (onLoadingStarted) { function handler(loadEvent) { var typeStarted = 0; //LoadEvent.TypeStarted if (loadEvent.type === typeStarted) { onLoadingStarted(); } } this.webview.loadingChanged.connect(handler); this.disposer.addDisposer(this.makeSignalDisconnecter(this.webview.loadingChanged, handler)); }, messageReceivedConnect: function (onMessageReceived) { function _handler(msg, frame) { onMessageReceived(msg.args); } if ( ! this._scriptMessageReceivedHandler) { var script = 'import com.canonical.Oxide 1.0 as Oxide; ' + ' Oxide.ScriptMessageHandler { ' + 'msgId: "UnityWebappApi-Message"; ' + 'contexts: ["' + this._WEBAPPS_USER_SCRIPT_CONTEXT + '"]; ' + '}'; this._scriptMessageReceivedHandler = Qt.createQmlObject(script, this.webview); } this._scriptMessageReceivedHandler.callback = _handler; }, cleanupAdapterInternals: function() { this._scriptMessageReceivedHandler.callback = function() {}; } } function WebviewAdapterFactory(disposer, makeSignalDisconnecter) { this.disposer = disposer; this.makeSignalDisconnecter = makeSignalDisconnecter; }; WebviewAdapterFactory.prototype = { create: function(webview) { if (! webview) return null if (webview.experimental) { // assume qtwebkit return new QtWebviewAdapter(webview, this.disposer, this.makeSignalDisconnecter); } // assume oxide return new OxideWebviewAdapter(webview, this.disposer, this.makeSignalDisconnecter); } }; /** * Creates a simple proxy object that bridges * a UnityWebapps component with a given webview. * * The UnityWebApps component does not reach out directly to * a webview but expects something that provides a simple * interface of needed methods/functions. For the regular * case though (binding to an existing webview) writing the * interface manually is tedious, so this tool does it and creates * the bridging object to a webview. * * @param webViewId * @param handlers (optional) map of handlers for UnityWebApps * events to the external world, supported events: * { * onAppRaised: function () {} * } */ function makeProxiesForQtWebViewBindee(webViewId, eventHandlers) { var handlers = eventHandlers && typeof(eventHandlers) === 'object' ? eventHandlers : {}; function SignalConnectionDisposer() { this._signalConnectionDisposers = []; } SignalConnectionDisposer.prototype.disposeAndCleanupAll = function() { for(var i = 0; i < this._signalConnectionDisposers.length; ++i) { if (typeof(this._signalConnectionDisposers[i]) === 'function') { this._signalConnectionDisposers[i](); } } this._signalConnectionDisposers = []; }; SignalConnectionDisposer.prototype.addDisposer = function(d) { if ( ! this._signalConnectionDisposers.some(function(elt) { return elt === d; })) this._signalConnectionDisposers.push(d); }; return (function (disposer) { var makeSignalDisconnecter = function(sig, callback) { return function () { sig.disconnect(callback); }; }; var waf = new WebviewAdapterFactory(disposer, makeSignalDisconnecter); var proxy = waf.create(webViewId); // inject common function proxy.navigateTo = function(url) { if (url.length !== 0) { webViewId.url = url; } }; // called from the UnityWebApps side proxy.onAppRaised = function () { if (handlers && handlers.onAppRaised) handlers.onAppRaised(); }; // called from the UnityWebApps side proxy.cleanup = function() { disposer.disposeAndCleanupAll(); if (this.cleanupAdapterInternals && typeof(this.cleanupAdapterInternals) === "function") { this.cleanupAdapterInternals(); } }; return proxy; })(new SignalConnectionDisposer()); } // Just to allow a smooth transition w/o breaking all the projects // remove qtwebkit name reference var makeProxiesForWebViewBindee = makeProxiesForQtWebViewBindee; /** * For a given list of objects returns a function that validates the presence and validity of the * specified properties. * * \param props list of object properties to validate. Each * property is an object w/ a 'name' and 'type' (as in typeof()). */ function isIterableObject(obj) { if (obj === undefined || obj === null) { return false; } var t = typeof(obj); var types = {'string': 0, 'function': 0, 'number': 0, 'undefined': 0, 'boolean': 0}; return types[t] === undefined; }; /** * Format a specific * * \param props list of object properties to validate. Each * property is an object w/ a 'name' and 'type' (as in typeof()). */ function formatUnityWebappsCall(type, serialized_args) { return {target: "ubuntu-webapps-binding-call", name: type, args: serialized_args}; } // // \brief For a given list of objects returns a function that validates the presence and validity of the // specified properties. // // \param props list of object properties to validate. Each property is an object w/ a 'name' and 'type' (as in typeof()). // function formatUnityWebappsCallbackCall(callbackid, args) { return {target: 'ubuntu-webapps-binding-callback-call', id: callbackid, args: args}; }; // // \brief For a given list of objects returns a function that validates the presence and validity of the // specified properties. // // \param props list of object properties to validate. Each property is an object w/ a 'name' and 'type' (as in typeof()). // function isUbuntuBindingCallbackCall(params) { function _has(o,k) { return (k in o) && o[k] != null; } return params != null && (typeof(params) === 'object') && _has(params,"target") && _has(params,"args") && _has(params,"id") && params.target === 'ubuntu-webapps-binding-callback-call'; }; /** * * */ function isUbuntuBindingObjectProxy(params) { function _has(o,k) { return (k in o) && o[k] != null; } return params != null && (typeof(params) === 'object') && _has(params,"type") && params.type === 'object-proxy' && _has(params,"apiid") && _has(params,"objecttype") && _has(params,"objectid"); }; // \brief For a given list of objects returns a function that validates the presence and validity of the // specified properties. // // \param props list of object properties to validate. Each property is an object w/ a 'name' and 'type' (as in typeof()). // function makePropertyValidator(props) { return function (object) { var _hasProperty = function(o, prop, type) { return o != null && (prop in o) && typeof (o[prop]) === type; }; return !props.some(function (prop) { return !_hasProperty(object, prop.name, prop.type); }); }; } // // \brief For a given list of objects returns a function that validates the presence and validity of the // specified properties. // var makeCallbackManager = function () { // TODO: remove magic name var prepend = 'ubuntu-webapps-api'; var callbacks = {}; return { store: function (callback) { if (!callback || !(callback instanceof Function)) throw "Invalid callback"; var __gensym = function() { return prepend + Math.random(); }; var id = __gensym(); while (undefined !== callbacks[id]) { id = __gensym(); } callbacks[id] = callback; return id; } , get: function (id) { return callbacks[id]; } }; }; // // // var toISODate = function(d) { function pad(n) { return n < 10 ? '0' + n : n; } return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + 'Z'; }; function transformFunctionToCallbackIdIfNecessary(obj, callbackManager) { var ret = obj; if (obj instanceof Function && callbackManager && callbackManager.store) { var id = callbackManager.store(obj); ret = {callbackid: id}; } return ret; } function transformCallbacksToIds(obj, callbackManager) { if ( ! isIterableObject(obj)) { return transformFunctionToCallbackIdIfNecessary(obj, callbackManager); } var ret = (obj instanceof Array) ? [] : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { if (obj[key] instanceof Function) { ret[key] = transformFunctionToCallbackIdIfNecessary(obj[key], callbackManager); } else if (isIterableObject (obj[key])) { ret[key] = transformCallbacksToIds(obj[key]); } else { ret[key] = obj[key]; } } } return ret; } /** * Wraps callback ids in proper callback that dispatch to the * webpage thru a proper event * */ function wrapCallbackIds(obj) { if ( ! obj) return obj; if (!UnityWebAppsUtils.isIterableObject(obj)) { return obj; } if (obj && obj.hasOwnProperty('callbackid') && obj.callbackid !== null) { return this._makeWebpageCallback (obj.callbackid); } var ret = (obj instanceof Array) ? [] : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { if (UnityWebAppsUtils.isIterableObject (obj[key])) { if (obj[key].callbackid !== null) { ret[key] = this._makeWebpageCallback (obj[key].callbackid); } else { ret[key] = this._wrapCallbackIds (obj[key]); } } else { ret[key] = obj[key]; } } } return ret; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/0000755000015600001650000000000012645741276025565 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/DOCS-README0000644000015600001650000000075012645740734027173 0ustar pbuserpbgroup00000000000000To build docs for the known apis: Install yuidocs as described here: https://bugs.launchpad.net/ubuntu-html5-theme/+bug/1241029/comments/16 Run yuidoc-build.sh Docs are generated in each API/client/docsbuild, for example in: * alarm-api/client/docsbuild To add new api directories for autobuilding: * Add the dir to the for loop in yuidocs-build.sh * Add the following to the NEWAPI/client/ dir - yudioc.json filei, edited accordingly - index.handlebars file,, edited accordinly unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/0000755000015600001650000000000012645741276030666 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/0000755000015600001650000000000012645741276032144 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/yuidoc.jsonunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/yuidoc.0000644000015600001650000000035712645740734033444 0ustar pbuserpbgroup00000000000000{ "name": "Online Accounts JS API", "description": "Ubuntu App Platform Online Accounts JavaScript API docs", "version": "0.1", "options": { "outdir": "./docsbuild", "themedir": "../../yuidoc-theme" } } ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-accounts.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/online-0000644000015600001650000002542412645740734033435 0ustar pbuserpbgroup00000000000000 /** * OnlineAccounts is the entry point to online accounts service access. * @module OnlineAccounts */ function createOnlineAccountsApi(backendBridge) { var PLUGIN_URI = 'OnlineAccounts'; /** * AccountService represents an instance of a service in an Online Accounts. * * The AcountService object is not directly constructible but returned as a result of * OnlineAccounts api calls. * * @class AccountService */ function AccountService(id, content) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'AccountService', id); this._accountId = content && content.accountId ? content.accountId : null; this._enabled = content && content.enabled ? content.enabled : null; this._serviceEnabled = content && content.serviceEnabled ? content.serviceEnabled : null; this._displayName = content && content.displayName ? content.displayName : null; this._provider = content && content.provider ? content.provider : null; this._service = content && content.service ? content.service : null; }; AccountService.prototype = { // properties /** * Returns the account's numeric ID; note that all * AccountService objects which work on the same online account will have the same ID. * * @method accountId * @return {String} Value for the accountId */ accountId: function() { return this._accountId; }, /** * This read-only property returns whether the AccountService is enabled. * An application shouldn't use an AccountService which is disabled * * @method enabled * @return {Boolean} Value for the enabled flag */ enabled: function() { return this._enabled; }, /** * Returns The account's display name (usually the user's login or ID). * Note that all AccountService objects which work on the same online account * will share the same display name. * * @method displayName * @return {String} Value of the displayName */ displayName: function() { return this._displayName; }, /** * Returns an object representing the provider which provides the account. * * The returned object will have at least these properties: * - 'id' is the unique identifier for this provider * - 'displayName' * - 'iconName' * * @method provider * @return {Object} Value object for the provider */ provider: function() { return this._provider; }, /** * Returns an object representing the service which this AccountService instantiates * * The returned object will have at least these properties: * - 'id' is the unique identifier for this service * - 'displayName' * - 'iconName' * - 'serviceTypeId' identifies the provided service type * * @method service * @return {Object} Value object for the service */ service: function() { return this._service; }, // methods /** * Perform the authentication on this account. * * The callback will be called with the authentication result object which will have * these properties: * - 'error': error message if the authentication was a failure * - 'authenticated': boolean value that identifies if the operation was a success * - 'data': Object with the data returned by the authentication process. An 'AccessToken' property can be usually found (when it applies) with the OAuth access token. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method authenticate * @param callback {Function(Object)} */ authenticate: function(callback) { this._proxy.call('authenticate', [callback]); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; function _constructorFromName(className) { var constructorPerName = { "AccountService": AccountService, }; return className in constructorPerName ? constructorPerName[className] : null; }; /** * The OnlineAccounts object is the entry point to online accounts service access. * @class OnlineAccounts * * @example var api = external.getUnityObject(1.0); var oa = api.OnlineAccounts; oa.api.getAccounts({'provider': 'facebook'}, function(result) { [...] }); */ return { api: { /** * Gets the configured accounts satisfying the given filters. * * @method api.getAccounts * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications) * - provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers) * - service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services) * * @param callback {Function(List of AccountService objects)} Callback that receives the result or null * * @example var api = external.getUnityObject(1.0); var oa = api.OnlineAccounts; oa.api.getAccounts({'provider': 'facebook'}, function(result) { for (var i = 0; i < result.length; ++i) { console.log("name: " + result[i].displayName() + ', id: ' + result[i].accountId() + ', providerName: ' + result[i].provider().displayName + ', enabled: ' + (result[i].enabled() ? "true" : "false") ); } }); */ getAccounts: function(filters, callback) { backendBridge.call('OnlineAccounts.getAccounts' , [filters] , callback); }, /** * Gets list of available providers. * * @method api.getProviders * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications) * @param callback {Function(List of AccountService objects)} Callback that receives the result or null. * The result is a dictionary with the following keys: * - displayName: the display name for the corresponding provider * - providerId: the provider id * * @example var api = external.getUnityObject(1.0); var oa = api.OnlineAccounts; oa.api.getProviders({}, function(result) { for (var i = 0; i < result.length; ++i) { console.log("displayName: " + result[i].displayName + ', providerId: ' + result[i].providerId); } }); */ getProviders: function(filters, callback) { backendBridge.call('OnlineAccounts.getProviders' , [filters] , callback); }, /** * Requests access to an account. * * Applications must invoke this method in order to obtain access * to an account. The user will be prompted to grant access to * either an existing account, to create a new one or to decline * the request. * * @method api.requestAccount * @param applicationId {String} The ID of the application * requesting the account (see /usr/share/accounts/applications/ or * ~/.local/share/accounts/applications/ for a list of the * available applications) * @param providerId {String} The ID of the provider of the desired * account (see /usr/share/accounts/providers/ or * ~/.local/share/accounts/providers/ for a list of the available * providers) * @param callback {Function()} Callback which will be invoked * after the access request has been decided (either with the * access to an account being granted, or with a refusal). * * @example var api = external.getUnityObject(1.0); var oa = api.OnlineAccounts; var appId = 'com.ubuntu.developer.me.MyPackage_MyApp'; oa.api.requestAccount(appId, 'facebook', function() { oa.api.getAccounts({ 'application': appId }, function(result) { for (var i = 0; i < result.length; ++i) { console.log("name: " + result[i].displayName() + ', id: ' + result[i].accountId() + ', providerName: ' + result[i].provider().displayName + ', enabled: ' + (result[i].enabled() ? "true" : "false") ); } }); }); */ requestAccount: function(applicationId, providerId, callback) { backendBridge.call('OnlineAccounts.Client.requestAccount', [ applicationId, providerId], callback); }, }, // Internal /** * @private * */ createObjectWrapper: function(objectType, objectId, content) { var Constructor = _constructorFromName(objectType); return new Constructor(objectId, content); }, }; }; ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/data.jsonunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000003151012645740734033515 0ustar pbuserpbgroup00000000000000{ "project": { "name": "Online Accounts JS API", "description": "Ubuntu App Platform Online Accounts JavaScript API docs", "version": "0.1" }, "files": { "online-accounts.js": { "name": "online-accounts.js", "modules": { "OnlineAccounts": 1 }, "classes": { "AccountService": 1, "OnlineAccounts": 1 }, "fors": {}, "namespaces": {} } }, "modules": { "OnlineAccounts": { "name": "OnlineAccounts", "submodules": {}, "classes": { "AccountService": 1, "OnlineAccounts": 1 }, "fors": {}, "namespaces": {}, "tag": "module", "file": "online-accounts.js", "line": 144, "description": "OnlineAccounts is the entry point to online accounts service access." } }, "classes": { "AccountService": { "name": "AccountService", "shortname": "AccountService", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "OnlineAccounts", "namespace": "", "file": "online-accounts.js", "line": 10, "description": "AccountService represents an instance of a service in an Online Accounts.\n\nThe AcountService object is not directly constructible but returned as a result of\nOnlineAccounts api calls." }, "OnlineAccounts": { "name": "OnlineAccounts", "shortname": "OnlineAccounts", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "OnlineAccounts", "namespace": "", "file": "online-accounts.js", "line": 144, "description": "The OnlineAccounts object is the entry point to online accounts service access.", "example": [ "\n\n var api = external.getUnityObject(1.0);\n var oa = api.OnlineAccounts;\n\n oa.api.getAccounts({'provider': 'facebook'}, function(result) { [...] });" ] } }, "classitems": [ { "file": "online-accounts.js", "line": 38, "description": "Returns the account's numeric ID; note that all\nAccountService objects which work on the same online account will have the same ID.", "itemtype": "method", "name": "accountId", "return": { "description": "Value for the accountId", "type": "String" }, "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 49, "description": "This read-only property returns whether the AccountService is enabled.\nAn application shouldn't use an AccountService which is disabled", "itemtype": "method", "name": "enabled", "return": { "description": "Value for the enabled flag", "type": "Boolean" }, "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 60, "description": "Returns The account's display name (usually the user's login or ID).\nNote that all AccountService objects which work on the same online account\nwill share the same display name.", "itemtype": "method", "name": "displayName", "return": { "description": "Value of the displayName", "type": "String" }, "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 72, "description": "Returns an object representing the provider which provides the account.\n\nThe returned object will have at least these properties:\n - 'id' is the unique identifier for this provider\n - 'displayName'\n - 'iconName'", "itemtype": "method", "name": "provider", "return": { "description": "Value object for the provider", "type": "Object" }, "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 87, "description": "Returns an object representing the service which this AccountService instantiates\n\nThe returned object will have at least these properties:\n - 'id' is the unique identifier for this service\n - 'displayName'\n - 'iconName'\n - 'serviceTypeId' identifies the provided service type", "itemtype": "method", "name": "service", "return": { "description": "Value object for the service", "type": "Object" }, "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 105, "description": "Perform the authentication on this account.\n\nThe callback will be called with the authentication result object which will have\nthese properties:\n - 'error': error message if the authentication was a failure\n - 'authenticated': boolean value that identifies if the operation was a success\n - 'data': Object with the data returned by the authentication process. An 'AccessToken' property can be usually found (when it applies) with the OAuth access token.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "authenticate", "params": [ { "name": "callback", "description": "", "type": "Function(Object)" } ], "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 125, "description": "Destroys the remote object. This proxy object is not valid anymore.", "itemtype": "method", "name": "destroy", "class": "AccountService", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 159, "description": "Gets the configured accounts satisfying the given filters.", "itemtype": "method", "name": "api.getAccounts", "params": [ { "name": "filters", "description": "A dictionary of parameters to filter the result. The filtering keys are:\n- applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)\n- provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers)\n- service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services)", "type": "Object" }, { "name": "callback", "description": "Callback that receives the result or null", "type": "Function(List of AccountService objects)" } ], "example": [ "\n var api = external.getUnityObject(1.0);\n var oa = api.OnlineAccounts;\n \n oa.api.getAccounts({'provider': 'facebook'}, function(result) {\n for (var i = 0; i < result.length; ++i) {\n console.log(\"name: \" + result[i].displayName()\n + ', id: ' + result[i].accountId()\n + ', providerName: ' + result[i].provider().displayName\n + ', enabled: ' + (result[i].enabled() ? \"true\" : \"false\")\n );\n } \n });\n" ], "class": "OnlineAccounts", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 190, "description": "Gets list of available providers.", "itemtype": "method", "name": "api.getProviders", "params": [ { "name": "filters", "description": "A dictionary of parameters to filter the result. The filtering keys are:\n- applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)", "type": "Object" }, { "name": "callback", "description": "Callback that receives the result or null.\n The result is a dictionary with the following keys:\n - displayName: the display name for the corresponding provider\n - providerId: the provider id", "type": "Function(List of AccountService objects)" } ], "example": [ "\n var api = external.getUnityObject(1.0);\n var oa = api.OnlineAccounts;\n\n oa.api.getProviders({}, function(result) {\n for (var i = 0; i < result.length; ++i) {\n console.log(\"displayName: \" + result[i].displayName\n + ', providerId: ' + result[i].providerId);\n }\n });\n" ], "class": "OnlineAccounts", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 218, "description": "Requests access to an account.\n\nApplications must invoke this method in order to obtain access\nto an account. The user will be prompted to grant access to\neither an existing account, to create a new one or to decline\nthe request.", "itemtype": "method", "name": "api.requestAccount", "params": [ { "name": "applicationId", "description": "The ID of the application\nrequesting the account (see /usr/share/accounts/applications/ or\n~/.local/share/accounts/applications/ for a list of the\navailable applications)", "type": "String" }, { "name": "providerId", "description": "The ID of the provider of the desired\naccount (see /usr/share/accounts/providers/ or\n~/.local/share/accounts/providers/ for a list of the available\nproviders)", "type": "String" }, { "name": "callback", "description": "Callback which will be invoked\nafter the access request has been decided (either with the\naccess to an account being granted, or with a refusal).", "type": "Function()" } ], "example": [ "\n var api = external.getUnityObject(1.0);\n var oa = api.OnlineAccounts;\n\n var appId = 'com.ubuntu.developer.me.MyPackage_MyApp';\n oa.api.requestAccount(appId,\n 'facebook',\n function() {\n oa.api.getAccounts({ 'application': appId }, function(result) {\n for (var i = 0; i < result.length; ++i) {\n console.log(\"name: \" + result[i].displayName()\n + ', id: ' + result[i].accountId()\n + ', providerName: ' + result[i].provider().displayName\n + ', enabled: ' + (result[i].enabled() ? \"true\" : \"false\")\n );\n }\n });\n });" ], "class": "OnlineAccounts", "module": "OnlineAccounts" }, { "file": "online-accounts.js", "line": 268, "access": "private", "tagname": "", "class": "OnlineAccounts", "module": "OnlineAccounts" } ], "warnings": [ { "message": "Missing item type", "line": " online-accounts.js:268" } ] }././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/modules/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/modules/OnlineAccounts.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000611512645740734033520 0ustar pbuserpbgroup00000000000000 OnlineAccounts - Online Accounts JS API

OnlineAccounts

OnlineAccounts is the entry point to online accounts service access.

This module has the following classes:



Module description found: online-accounts.js:144
././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/files/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020500000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/files/online-accounts.js.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000003344412645740734033525 0ustar pbuserpbgroup00000000000000 online-accounts.js - Online Accounts JS API

online-accounts.js

    /**
 * OnlineAccounts is the entry point to online accounts service access.

 * @module OnlineAccounts
 */

function createOnlineAccountsApi(backendBridge) {
    var PLUGIN_URI = 'OnlineAccounts';

/**
 * AccountService represents an instance of a service in an Online Accounts.
 * 
 * The AcountService object is not directly constructible but returned as a result of
 * OnlineAccounts api calls.
 *
 * @class AccountService
 */
    function AccountService(id, content) {
        this._proxy = backendBridge.createRemoteObject(
            PLUGIN_URI, 'AccountService', id);

        this._accountId = content && content.accountId
             ? content.accountId : null;
        this._enabled = content && content.enabled
             ? content.enabled : null;
        this._serviceEnabled = content && content.serviceEnabled
             ? content.serviceEnabled : null;
        this._displayName = content && content.displayName
             ? content.displayName : null;
        this._provider = content && content.provider
             ? content.provider : null;
        this._service = content && content.service
             ? content.service : null;
    };
    AccountService.prototype = {
        // properties

        /**
         * Returns the account's numeric ID; note that all
         * AccountService objects which work on the same online account will have the same ID.
         *
         * @method accountId
         * @return {String} Value for the accountId
         */
        accountId: function() {
            return this._accountId;
        },

        /**
         * This read-only property returns whether the AccountService is enabled.
         * An application shouldn't use an AccountService which is disabled
         *
         * @method enabled
         * @return {Boolean} Value for the enabled flag
         */
        enabled: function() {
            return this._enabled;
        },

        /**
         * Returns The account's display name (usually the user's login or ID).
         * Note that all AccountService objects which work on the same online account
         * will share the same display name.
         *
         * @method displayName
         * @return {String} Value of the displayName
         */
        displayName: function() {
            return this._displayName;
        },

        /**
         * Returns an object representing the provider which provides the account.
         * 
         * The returned object will have at least these properties:
         *   - 'id' is the unique identifier for this provider
         *   - 'displayName'
         *   - 'iconName'
         * 
         * @method provider
         * @return {Object} Value object for the provider
         */
        provider: function() {
            return this._provider;
        },

        /**
         * Returns an object representing the service which this AccountService instantiates
         * 
         * The returned object will have at least these properties:
         *   - 'id' is the unique identifier for this service
         *   - 'displayName'
         *   - 'iconName'
         *   - 'serviceTypeId' identifies the provided service type
         * 
         * @method service
         * @return {Object} Value object for the service
         */
        service: function() {
            return this._service;
        },

        // methods

        /**
         * Perform the authentication on this account.
         * 
         * The callback will be called with the authentication result object which will have
         * these properties:
         *   - 'error': error message if the authentication was a failure
         *   - 'authenticated': boolean value that identifies if the operation was a success
         *   - 'data': Object with the data returned by the authentication process. An 'AccessToken' property can be usually found (when it applies) with the OAuth access token.
         * 
         * If the callback parameter is not set, the current "local" value is retrieved.
         *
         * @method authenticate
         * @param callback {Function(Object)}
         */
        authenticate: function(callback) {
            this._proxy.call('authenticate', [callback]);
        },

        // extras

        /**
         * Destroys the remote object. This proxy object is not valid anymore.
         *
         * @method destroy
         */
        destroy: function() {
            this._proxy.call('destroy', []);
        },
    };

    function _constructorFromName(className) {
        var constructorPerName = {
            "AccountService": AccountService,
        };
        return className in constructorPerName
                ? constructorPerName[className]
                : null;
    };
 
/**
 * The OnlineAccounts object is the entry point to online accounts service access.

 * @class OnlineAccounts
 * 
 * @example

        var api = external.getUnityObject(1.0);
        var oa = api.OnlineAccounts;

        oa.api.getAccounts({'provider': 'facebook'}, function(result) { [...] });
 */
   return {

        api: {
            /**
             * Gets the configured accounts satisfying the given filters.
             *
             * @method api.getAccounts
             * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are:
             * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)
             * - provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers)
             * - service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services)
             *
             * @param callback {Function(List of AccountService objects)} Callback that receives the result or null
             *
             * @example
               var api = external.getUnityObject(1.0);
               var oa = api.OnlineAccounts;
             
               oa.api.getAccounts({'provider': 'facebook'}, function(result) {
                 for (var i = 0; i < result.length; ++i) {
                   console.log("name: " + result[i].displayName()
                               + ', id: ' + result[i].accountId()
                               + ', providerName: ' + result[i].provider().displayName
                               + ', enabled: ' + (result[i].enabled() ? "true" : "false")
                               );
                 }               
               });

             */
            getAccounts: function(filters, callback) {
                backendBridge.call('OnlineAccounts.getAccounts'
                                   , [filters]
                                   , callback);
            },
            /**
             * Gets list of available providers.
             *
             * @method api.getProviders
             * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are:
             * - applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)
             * @param callback {Function(List of AccountService objects)} Callback that receives the result or null.
             *                                                            The result is a dictionary with the following keys:
             *          - displayName: the display name for the corresponding provider
             *          - providerId: the provider id
             *
             * @example
               var api = external.getUnityObject(1.0);
               var oa = api.OnlineAccounts;

               oa.api.getProviders({}, function(result) {
                 for (var i = 0; i < result.length; ++i) {
                   console.log("displayName: " + result[i].displayName
                               + ', providerId: ' + result[i].providerId);
                 }
               });

             */
            getProviders: function(filters, callback) {
                backendBridge.call('OnlineAccounts.getProviders'
                                   , [filters]
                                   , callback);
            },
            /**
             * Requests access to an account.
             *
             * Applications must invoke this method in order to obtain access
             * to an account.  The user will be prompted to grant access to
             * either an existing account, to create a new one or to decline
             * the request.
             *
             * @method api.requestAccount
             * @param applicationId {String} The ID of the application
             * requesting the account (see /usr/share/accounts/applications/ or
             * ~/.local/share/accounts/applications/ for a list of the
             * available applications)
             * @param providerId {String} The ID of the provider of the desired
             * account (see /usr/share/accounts/providers/ or
             * ~/.local/share/accounts/providers/ for a list of the available
             * providers)
             * @param callback {Function()} Callback which will be invoked
             * after the access request has been decided (either with the
             * access to an account being granted, or with a refusal).
             *
             * @example
               var api = external.getUnityObject(1.0);
               var oa = api.OnlineAccounts;

               var appId = 'com.ubuntu.developer.me.MyPackage_MyApp';
               oa.api.requestAccount(appId,
                                     'facebook',
                                     function() {
                 oa.api.getAccounts({ 'application': appId }, function(result) {
                   for (var i = 0; i < result.length; ++i) {
                     console.log("name: " + result[i].displayName()
                                 + ', id: ' + result[i].accountId()
                                 + ', providerName: ' + result[i].provider().displayName
                                 + ', enabled: ' + (result[i].enabled() ? "true" : "false")
                                 );
                   }
                 });
               });
             */
            requestAccount: function(applicationId, providerId, callback) {
                backendBridge.call('OnlineAccounts.Client.requestAccount',
                                   [ applicationId, providerId],
                                   callback);
            },
        },


        // Internal

        /**
         * @private
         *
         */
        createObjectWrapper: function(objectType, objectId, content) {
            var Constructor = _constructorFromName(objectType);
            return new Constructor(objectId, content);
        },
    };
};



././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017200000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/favicon.icounity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000001246612645740734033526 0ustar pbuserpbgroup00000000000000 h&  (  !Юmrf<0SKVhQK6>,1"}2'ɤ`FaKQ=A1y)ԻO1vjv;-dKjR[FK8/|mVK7D6Q>mSdNTA?.QD|gĠ\BVCG8aJlS_IN;7'B˜>,]AbITBN=iOhQXD=*vڷoU=S@M9aCbISBUAkRcMO;I9-jѪ]EZFS=aDaISAXDjR]H?+šÊu_D_IWB_DaHSAYEgOR=SCҦeJ_G[F\D_GSBVD`JD/ÜEnɭ`FZCYCZESAP?S?Q>ź\ˆsícLR;N9I7F6>+u.ڸp‘raΜ\KK<@1ϳ^#+$?( @ ־E*ҵZyUJ}2'i~xĽNsP>9'2!}. y+qZRݽa|hͤXAP:N;I7B1:+3%v(8-fLcJeO]HUAM:F5>/7)|/"s#=ŋvdJiRcLZER>K8C2<-5&r zνIjYѳhMjRgP_IWCO.3$8,I8~@/{A3q8-XCmRjQiQaKYDQ=I7B1;+x(ѶT(q[ӖQ;UCO>H9y?2D5jOjQjRfP^HVBN;F5?/|,xo(bE^E\HVDO>H9x>2WClRiQiRcMZFS?K8D38(D7ټd]>`H\HVCO>G8D5eMkQjRgP_JWCPE7O=kQjQjReN\GT@M:E44#qf}q3"B0cDdH`H\HVCO>E7ZElQjRhRbLYDQ>J8@/>/|D/K8B2K6gFdG`H\HVCN=H9bKkQiRgP^IVBN;G63"yҫzSgGcG`H\HUCL,eYٵlbFgNhQcL\GVBOJ8:)C޿]gLfKjRfO`JYEQ?W?eFdG_H[GUCK,oc@rXbGjQhQcL\GUAV@bEdG_H[GUCL;VCjReN[FT@K8>,<q`DhOjRfO`JXDU@^CdG`H[GUCK;TAhQbLXDQ>@-naԫ}fKcHjQhQcM\GUBYBaFaH[HUCK;P?cM_IUAN:=*J7maDfLjRfO`JXDVA\C`H\HUCKO.|7)s0">01 $49:9???././@LongLink0000000000000000000000000000016200000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/api-list.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000001465012645740734033523 0ustar pbuserpbgroup00000000000000YUI.add('api-list', function (Y) { var Lang = Y.Lang, YArray = Y.Array, APIList = Y.namespace('APIList'), classesNode = Y.one('#api-classes'), inputNode = Y.one('#api-filter'), modulesNode = Y.one('#api-modules'), tabviewNode = Y.one('#api-tabview'), tabs = APIList.tabs = {}, filter = APIList.filter = new Y.APIFilter({ inputNode : inputNode, maxResults: 1000, on: { results: onFilterResults } }), search = APIList.search = new Y.APISearch({ inputNode : inputNode, maxResults: 100, on: { clear : onSearchClear, results: onSearchResults } }), tabview = APIList.tabview = new Y.TabView({ srcNode : tabviewNode, panelNode: '#api-tabview-panel', render : true, on: { selectionChange: onTabSelectionChange } }), focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, { circular : true, descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a', keys : {next: 'down:40', previous: 'down:38'} }).focusManager, LIST_ITEM_TEMPLATE = '
  • ' + '{displayName}' + '
  • '; // -- Init --------------------------------------------------------------------- // Duckpunch FocusManager's key event handling to prevent it from handling key // events when a modifier is pressed. Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusPrevious', focusManager); Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusNext', focusManager); // Create a mapping of tabs in the tabview so we can refer to them easily later. tabview.each(function (tab, index) { var name = tab.get('label').toLowerCase(); tabs[name] = { index: index, name : name, tab : tab }; }); // Switch tabs on Ctrl/Cmd-Left/Right arrows. tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); // Focus the filter input when the `/` key is pressed. Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); // Keep the Focus Manager up to date. inputNode.on('focus', function () { focusManager.set('activeDescendant', inputNode); }); // Update all tabview links to resolved URLs. tabview.get('panelNode').all('a').each(function (link) { link.setAttribute('href', link.get('href')); }); // -- Private Functions -------------------------------------------------------- function getFilterResultNode() { return filter.get('queryType') === 'classes' ? classesNode : modulesNode; } // -- Event Handlers ----------------------------------------------------------- function onFilterResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()), resultNode = getFilterResultNode(), typePlural = filter.get('queryType'), typeSingular = typePlural === 'classes' ? 'class' : 'module'; if (e.results.length) { YArray.each(e.results, function (result) { frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { rootPath : APIList.rootPath, displayName : filter.getDisplayName(result.highlighted), name : result.text, typePlural : typePlural, typeSingular: typeSingular })); }); } else { frag.append( '
  • ' + 'No ' + typePlural + ' found.' + '
  • ' ); } resultNode.empty(true); resultNode.append(frag); focusManager.refresh(); } function onSearchClear(e) { focusManager.refresh(); } function onSearchKey(e) { var target = e.target; if (target.test('input,select,textarea') || target.get('isContentEditable')) { return; } e.preventDefault(); inputNode.focus(); focusManager.refresh(); } function onSearchResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()); if (e.results.length) { YArray.each(e.results, function (result) { frag.append(result.display); }); } else { frag.append( '
  • ' + 'No results found. Maybe you\'ll have better luck with a ' + 'different query?' + '
  • ' ); } focusManager.refresh(); } function onTabSelectionChange(e) { var tab = e.newVal, name = tab.get('label').toLowerCase(); tabs.selected = { index: tab.get('index'), name : name, tab : tab }; switch (name) { case 'classes': // fallthru case 'modules': filter.setAttrs({ minQueryLength: 0, queryType : name }); search.set('minQueryLength', -1); // Only send a request if this isn't the initially-selected tab. if (e.prevVal) { filter.sendRequest(filter.get('value')); } break; case 'everything': filter.set('minQueryLength', -1); search.set('minQueryLength', 1); if (search.get('value')) { search.sendRequest(search.get('value')); } else { inputNode.focus(); } break; default: // WTF? We shouldn't be here! filter.set('minQueryLength', -1); search.set('minQueryLength', -1); } if (focusManager) { setTimeout(function () { focusManager.refresh(); }, 1); } } function onTabSwitchKey(e) { var currentTabIndex = tabs.selected.index; if (!(e.ctrlKey || e.metaKey)) { return; } e.preventDefault(); switch (e.keyCode) { case 37: // left arrow if (currentTabIndex > 0) { tabview.selectChild(currentTabIndex - 1); inputNode.focus(); } break; case 39: // right arrow if (currentTabIndex < (Y.Object.size(tabs) - 2)) { tabview.selectChild(currentTabIndex + 1); inputNode.focus(); } break; } } }, '3.4.0', {requires: [ 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' ]}); ././@LongLink0000000000000000000000000000017400000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/apidocs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000002407112645740734033521 0ustar pbuserpbgroup00000000000000YUI().use( 'yuidoc-meta', 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', function (Y) { var win = Y.config.win, localStorage = win.localStorage, bdNode = Y.one('#bd'), pjax, defaultRoute, classTabView, selectedTab; // Kill pjax functionality unless serving over HTTP. if (!Y.getLocation().protocol.match(/^https?\:/)) { Y.Router.html5 = false; } // Create the default route with middleware which enables syntax highlighting // on the loaded content. defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { prettyPrint(); bdNode.removeClass('loading'); next(); }); pjax = new Y.Pjax({ container : '#docs-main', contentSelector: '#docs-main > .content', linkSelector : '#bd a', titleSelector : '#xhr-title', navigateOnHash: true, root : '/', routes : [ // -- / ---------------------------------------------------------------- { path : '/(index.html)?', callbacks: defaultRoute }, // -- /classes/* ------------------------------------------------------- { path : '/classes/:class.html*', callbacks: [defaultRoute, 'handleClasses'] }, // -- /files/* --------------------------------------------------------- { path : '/files/*file', callbacks: [defaultRoute, 'handleFiles'] }, // -- /modules/* ------------------------------------------------------- { path : '/modules/:module.html*', callbacks: defaultRoute } ] }); // -- Utility Functions -------------------------------------------------------- pjax.checkVisibility = function (tab) { tab || (tab = selectedTab); if (!tab) { return; } var panelNode = tab.get('panelNode'), visibleItems; // If no items are visible in the tab panel due to the current visibility // settings, display a message to that effect. visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { if (itemNode.getComputedStyle('display') !== 'none') { return true; } }); panelNode.all('.no-visible-items').remove(); if (!visibleItems) { if (Y.one('#index .index-item')) { panelNode.append( '
    ' + '

    ' + 'Some items are not shown due to the current visibility ' + 'settings. Use the checkboxes at the upper right of this ' + 'page to change the visibility settings.' + '

    ' + '
    ' ); } else { panelNode.append( '
    ' + '

    ' + 'This class doesn\'t provide any methods, properties, ' + 'attributes, or events.' + '

    ' + '
    ' ); } } // Hide index sections without any visible items. Y.all('.index-section').each(function (section) { var items = 0, visibleItems = 0; section.all('.index-item').each(function (itemNode) { items += 1; if (itemNode.getComputedStyle('display') !== 'none') { visibleItems += 1; } }); section.toggleClass('hidden', !visibleItems); section.toggleClass('no-columns', visibleItems < 4); }); }; pjax.initClassTabView = function () { if (!Y.all('#classdocs .api-class-tab').size()) { return; } if (classTabView) { classTabView.destroy(); selectedTab = null; } classTabView = new Y.TabView({ srcNode: '#classdocs', on: { selectionChange: pjax.onTabSelectionChange } }); pjax.updateTabState(); classTabView.render(); }; pjax.initLineNumbers = function () { var hash = win.location.hash.substring(1), container = pjax.get('container'), hasLines, node; // Add ids for each line number in the file source view. container.all('.linenums>li').each(function (lineNode, index) { lineNode.set('id', 'l' + (index + 1)); lineNode.addClass('file-line'); hasLines = true; }); // Scroll to the desired line. if (hasLines && /^l\d+$/.test(hash)) { if ((node = container.getById(hash))) { win.scroll(0, node.getY()); } } }; pjax.initRoot = function () { var terminators = /^(?:classes|files|modules)$/, parts = pjax._getPathRoot().split('/'), root = [], i, len, part; for (i = 0, len = parts.length; i < len; i += 1) { part = parts[i]; if (part.match(terminators)) { // Makes sure the path will end with a "/". root.push(''); break; } root.push(part); } pjax.set('root', root.join('/')); }; pjax.updateTabState = function (src) { var hash = win.location.hash.substring(1), defaultTab, node, tab, tabPanel; function scrollToNode() { if (node.hasClass('protected')) { Y.one('#api-show-protected').set('checked', true); pjax.updateVisibility(); } if (node.hasClass('private')) { Y.one('#api-show-private').set('checked', true); pjax.updateVisibility(); } setTimeout(function () { // For some reason, unless we re-get the node instance here, // getY() always returns 0. var node = Y.one('#classdocs').getById(hash); win.scrollTo(0, node.getY() - 70); }, 1); } if (!classTabView) { return; } if (src === 'hashchange' && !hash) { defaultTab = 'index'; } else { if (localStorage) { defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || 'index'; } else { defaultTab = 'index'; } } if (hash && (node = Y.one('#classdocs').getById(hash))) { if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } } // Scroll to the desired element if this is a hash URL. if (node) { if (classTabView.get('rendered')) { scrollToNode(); } else { classTabView.once('renderedChange', scrollToNode); } } } else { tab = Y.one('#classdocs .api-class-tab.' + defaultTab); // When the `defaultTab` node isn't found, `localStorage` is stale. if (!tab && defaultTab !== 'index') { tab = Y.one('#classdocs .api-class-tab.index'); } if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } }; pjax.updateVisibility = function () { var container = pjax.get('container'); container.toggleClass('hide-inherited', !Y.one('#api-show-inherited').get('checked')); container.toggleClass('show-deprecated', Y.one('#api-show-deprecated').get('checked')); container.toggleClass('show-protected', Y.one('#api-show-protected').get('checked')); container.toggleClass('show-private', Y.one('#api-show-private').get('checked')); pjax.checkVisibility(); }; // -- Route Handlers ----------------------------------------------------------- pjax.handleClasses = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initClassTabView(); } next(); }; pjax.handleFiles = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initLineNumbers(); } next(); }; // -- Event Handlers ----------------------------------------------------------- pjax.onNavigate = function (e) { var hash = e.hash, originTarget = e.originEvent && e.originEvent.target, tab; if (hash) { tab = originTarget && originTarget.ancestor('.yui3-tab', true); if (hash === win.location.hash) { pjax.updateTabState('hashchange'); } else if (!tab) { win.location.hash = hash; } e.preventDefault(); return; } // Only scroll to the top of the page when the URL doesn't have a hash. this.set('scrollToTop', !e.url.match(/#.+$/)); bdNode.addClass('loading'); }; pjax.onOptionClick = function (e) { pjax.updateVisibility(); }; pjax.onTabSelectionChange = function (e) { var tab = e.newVal, tabId = tab.get('contentBox').getAttribute('href').substring(1); selectedTab = tab; // If switching from a previous tab (i.e., this is not the default tab), // replace the history entry with a hash URL that will cause this tab to // be selected if the user navigates away and then returns using the back // or forward buttons. if (e.prevVal && localStorage) { localStorage.setItem('tab_' + pjax.getPath(), tabId); } pjax.checkVisibility(tab); }; // -- Init --------------------------------------------------------------------- pjax.on('navigate', pjax.onNavigate); pjax.initRoot(); pjax.upgrade(); pjax.initClassTabView(); pjax.initLineNumbers(); pjax.updateVisibility(); Y.APIList.rootPath = pjax.get('root'); Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); Y.on('hashchange', function (e) { pjax.updateTabState('hashchange'); }, win); }); ././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/tabs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000537412645740734033526 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ././@LongLink0000000000000000000000000000020100000000000011206 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/yui-prettify.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000377512645740734033531 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); ././@LongLink0000000000000000000000000000017700000000000011222 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/api-search.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000555412645740734033526 0ustar pbuserpbgroup00000000000000YUI.add('api-search', function (Y) { var Lang = Y.Lang, Node = Y.Node, YArray = Y.Array; Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { // -- Public Properties ---------------------------------------------------- RESULT_TEMPLATE: '
  • ' + '' + '

    {name}

    ' + '{resultType}' + '
    {description}
    ' + '{class}' + '
    ' + '
  • ', // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, // -- Protected Methods ---------------------------------------------------- _apiResultFilter: function (query, results) { // Filter components out of the results. return YArray.filter(results, function (result) { return result.raw.resultType === 'component' ? false : result; }); }, _apiResultFormatter: function (query, results) { return YArray.map(results, function (result) { var raw = Y.merge(result.raw), // create a copy desc = raw.description || ''; // Convert description to text and truncate it if necessary. desc = Node.create('
    ' + desc + '
    ').get('text'); if (desc.length > 65) { desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; } else { desc = Y.Escape.html(desc); } raw['class'] || (raw['class'] = ''); raw.description = desc; // Use the highlighted result name. raw.name = result.highlighted; return Lang.sub(this.RESULT_TEMPLATE, raw); }, this); }, _apiTextLocator: function (result) { return result.displayName || result.name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultFormatter: { valueFn: function () { return this._apiResultFormatter; } }, resultFilters: { valueFn: function () { return this._apiResultFilter; } }, resultHighlighter: { value: 'phraseMatch' }, resultListLocator: { value: 'data.results' }, resultTextLocator: { valueFn: function () { return this._apiTextLocator; } }, source: { value: '/api/v1/search?q={query}&count={maxResults}' } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 'escape' ]}); ././@LongLink0000000000000000000000000000017700000000000011222 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/js/api-filter.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000264512645740734033524 0ustar pbuserpbgroup00000000000000YUI.add('api-filter', function (Y) { Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, getDisplayName: function(name) { Y.each(Y.YUIDoc.meta.allModules, function(i) { if (i.name === name && i.displayName) { name = i.displayName; } }); return name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultHighlighter: { value: 'phraseMatch' }, // May be set to "classes" or "modules". queryType: { value: 'classes' }, source: { valueFn: function() { var self = this; return function(q) { var data = Y.YUIDoc.meta[self.get('queryType')], out = []; Y.each(data, function(v) { if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { out.push(v); } }); return out; }; } } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' ]}); ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/css/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/css/main.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000002421212645740734033516 0ustar pbuserpbgroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
       blocks. */
    pre code, pre kbd, pre samp { font-size: 100%; }
    
    /* Used to denote text that shouldn't be selectable, such as line numbers or
       shell prompts. Guess which browser this doesn't work in. */
    .noselect {
        -moz-user-select: -moz-none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    
    /* -- Lists ----------------------------------------------------------------- */
    dd { margin: 0.2em 0 0.7em 1em; }
    dl { margin: 1em 0; }
    dt { font-weight: bold; }
    
    /* -- Tables ---------------------------------------------------------------- */
    caption, th { text-align: left; }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    td, th {
        border: 1px solid #fff;
        padding: 5px 12px;
        vertical-align: top;
    }
    
    td { background: #E6E9F5; }
    td dl { margin: 0; }
    td dl dl { margin: 1em 0; }
    td pre:first-child { margin-top: 0; }
    
    th {
        background: #D2D7E6;/*#97A0BF*/
        border-bottom: none;
        border-top: none;
        color: #000;/*#FFF1D5*/
        font-family: 'Trebuchet MS', sans-serif;
        font-weight: bold;
        line-height: 1.3;
        white-space: nowrap;
    }
    
    
    /* -- Layout and Content ---------------------------------------------------- */
    #doc {
        margin: auto;
        min-width: 1024px;
    }
    
    #main { width: 754px; }
    #sidebar { width: 270px; margin: 0 15px; }
    
    .content { padding: 0 20px 0 25px; }
    
    /* -- Sidebar --------------------------------------------------------------- */
    .sidebox {
        background: #F9F9FC;/*E6E9F5*/
        border: 1px solid #D4D8EB;
    
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
        margin: 0 0 15px 0;
        padding-bottom: 1px;
    }
    
    .sidebox h2 {
        background: #E5E6F1;
        -moz-border-radius: 4px 4px 0 0;
        -webkit-border-radius: 4px 4px 0 0;
        border-radius: 4px 4px 0 0;
        color: #5E6BA4;
        font-weight: bold;
        font-size: 107.692%;
        margin: 0;
        padding: 4px 7px 5px;
    }
    
    .sidebox .bd {
        font-size: 84.615%;
        padding: 0 5px 0 8px;
    }
    
    .sidebox li { list-style-type: disc; color:#D4D5E3; }
    
    .sidebox ol, .sidebox ul {
        margin-left: 0;
        padding-left: 16px;
    }
    
    .sidebox ol ol, .sidebox ol ul,
    .sidebox ul ol, .sidebox ul ul {
        margin: 0;
        padding-left: 16px;
    }
    
    /* -- Table of Contents ----------------------------------------------------- */
    
    /* The #toc id refers to the single global table of contents, while the .toc
       class refers to generic TOC lists that could be used throughout the page. */
    
    .toc code, .toc kbd, .toc samp { font-size: 100%; }
    .toc li { font-weight: bold; }
    .toc li li { font-weight: normal; }
    
    /* -- Intro and Example Boxes ----------------------------------------------- */
    .intro, .example { margin-bottom: 2em; }
    
    .example {
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 5px #bfbfbf;
        -webkit-box-shadow: 0 0 5px #bfbfbf;
        box-shadow: 0 0 5px #bfbfbf;
        padding: 1em;
    }
    
    .intro {
        background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    }
    
    /* -- Other Styles ---------------------------------------------------------- */
    
    /* These are probably YUI-specific, and should be moved out of Selleck's default
       theme. */
    
    .button {
        border: 1px solid #dadada;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        color: #444;
        display: inline-block;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 92.308%;
        font-weight: bold;
        padding: 4px 13px 3px;
        -moz-text-shadow: 1px 1px 0 #fff;
        -webkit-text-shadow: 1px 1px 0 #fff;
        text-shadow: 1px 1px 0 #fff;
        white-space: nowrap;
    
        background: #EFEFEF; /* old browsers */
        background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    }
    
    .button:hover {
        border-color: #466899;
        color: #fff;
        text-decoration: none;
        -moz-text-shadow: 1px 1px 0 #222;
        -webkit-text-shadow: 1px 1px 0 #222;
        text-shadow: 1px 1px 0 #222;
    
        background: #6396D8; /* old browsers */
        background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    }
    
    .newwindow { text-align: center; }
    
    .header .version em {
        display: block;
        text-align: right;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        background-color: transparent;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        border: none;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DEDCD9;
        border-right: 1px solid #CDCBC8;
        border-left: 1px solid #CDCBC8;
        border-top: 1px solid #DADADA;
        color: #333333;
        text-decoration: none;
    }
    .yui3-skin-sam .yui3-tabview .yui3-tab-label,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
        border: none;
        background: none;
        font-size: 100%;
        color: #000;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: none;
        background-color: #fff;
        border-bottom-color: #FFFFFF;
        border-top: 2px solid #8193C9;
        font-weight: bold;
        color: #000;
    
    }
    
    .yui3-skin-sam .yui3-tabview-list {
        border-color: #DFDFDF;
        border-width: 0 0 1px; 
    }
    
    
    a.external {
        background-image: url(external-small.png);
        background-repeat: no-repeat;
        background-position: 0 0;
        padding-left: 16px;
    }
    
    #classdocs .item {
        border-bottom: 1px solid #466899;
        margin: 1em 0;
        padding: 1.5em;
    }
    
    #classdocs .item .params p,
        #classdocs .item .returns p,{
        display: inline;
    }
    
    #classdocs .item em code, #classdocs .item em.comment {
        color: green;
    }
    
    #classdocs .item em.comment a {
        color: green;
        text-decoration: underline;
    }
    
    #classdocs .foundat {
        font-size: 11px;
        font-style: normal;
    }
    
    .attrs .emits {
        margin-left: 2em;
        padding: .5em;
        border-left: 1px dashed #ccc;
    }
    
    abbr {
        border-bottom: 1px dashed #ccc;
        font-size: 80%;
        cursor: help;
    }
    
    .prettyprint li.L0, 
    .prettyprint li.L1, 
    .prettyprint li.L2, 
    .prettyprint li.L3, 
    .prettyprint li.L5, 
    .prettyprint li.L6, 
    .prettyprint li.L7, 
    .prettyprint li.L8 {
        list-style: decimal;
    }
    
    ul li p {
        margin-top: 0;
    }
    
    .method .name {
        font-size: 110%;
    }
    
    #hd {
        background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DFDFDF;
        padding: 0 15px 1px 20px;
        margin-bottom: 15px;
    }
    
    #hd img {
        margin-right: 10px;
        vertical-align: middle;
    }
    
    ././@LongLink0000000000000000000000000000017300000000000011216 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/css/logo.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000135512645740734033521 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDR=29PLTEvO_1S#ƶl{]j@H9	pHYstIME
    &	fEGIDAThv eQ;,.i]	9=Ï	QxBHB$$!	IȿTobH
    L,LAJ!z2@{}q%>D*()29zfv0v'xY|~2ܾHIȔdY.Ҭ$FH[62MT%a>$XmSUhiKY.kUdYps6#È+ټV`HU2z/[Y
    ̷]PT&[o^|ߗuǞl 5e]6UǶEu<*5d+BoIHB$$!	JnɒőIENDB`././@LongLink0000000000000000000000000000020500000000000011212 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/css/external-small.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000075312645740734033522 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb?%B@,0]VVV0affȊ=8JOy %pJջ+30¿}sʋ`n|dx
    mXa |ȹWpA+ca|u=zϰp-l\w01nCy?*Yr%cfxÿ8
    `g2ȉ0!GA[EV66>Ӏ'E]AOCAY^#.S>>#񶉝
    "ÏOv%w@FX^`ddR|8 wX
    	 OƓIENDB`././@LongLink0000000000000000000000000000017100000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/index.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000033012645740734033511 0ustar  pbuserpbgroup00000000000000
    
        
            Redirector
            
        
        
            Click here to redirect
        
    
    ././@LongLink0000000000000000000000000000016600000000000011220 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017700000000000011222 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020600000000000011213 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/COPYINGunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000002613612645740734033525 0ustar  pbuserpbgroup00000000000000
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    ././@LongLink0000000000000000000000000000021600000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/prettify-min.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000004564712645740734033535 0ustar  pbuserpbgroup00000000000000/*
     * Copyright 2011 Yahoo! Inc.
     * All rights reserved.
     *-
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *     * Redistributions of source code must retain the above copyright
     *       notice, this list of conditions and the following disclaimer.
     *     * Redistributions in binary form must reproduce the above copyright
     *       notice, this list of conditions and the following disclaimer in the
     *       documentation and/or other materials provided with the distribution.
     *     * Neither the name of the Yahoo! Inc. nor the
     *       names of its contributors may be used to endorse or promote products
     *       derived from this software without specific prior written permission.
     *-
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
     * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
    ././@LongLink0000000000000000000000000000021700000000000011215 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/prettify-min.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000124312645740734033515 0ustar  pbuserpbgroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}././@LongLink0000000000000000000000000000021300000000000011211 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/CHANGES.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000001370412645740734033522 0ustar  pbuserpbgroup00000000000000
      
        
        Change Log
      
      
        README
    
        

    Known Issues

    • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
    • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

    Change Log

    29 March 2007

    • Added tests for PHP support to address issue 3.
    • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
    • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
    • Fixed bug: was eating tabs (test)
    • Fixed entity handling so that the caveat

      Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

      is no longer applicable.
    • Added noisefree's C# patch
    • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

    4 Jul 2008

    • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
    • Fixed bug: python handling of '''string'''
    • Fixed bug: / in regex [charsets] should not end regex

    5 Jul 2008

    • Defined language extensions for Lisp and Lua

    14 Jul 2008

    • Language handlers for F#, OCAML, SQL
    • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

    6 Jan 2009

    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
    • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
    • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

    21 May 2009

    • Rewrote to improve performance on large files. See benchmarks.
    • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

    14 August 2009

    • Fixed prettifying of <code> blocks with embedded newlines.

    3 October 2009

    • Fixed prettifying of XML/HTML tags that contain uppercase letters.

    19 July 2010

    • Added support for line numbers. Bug 22
    • Added YAML support. Bug 123
    • Added VHDL support courtesy Le Poussin.
    • IE performance improvements. Bug 102 courtesy jacobly.
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • Fixed copy and paste in IE[678].
    • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
    ././@LongLink0000000000000000000000000000021200000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/vendor/prettify/README.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000001735012645740734033523 0ustar pbuserpbgroup00000000000000 Javascript code prettifier Languages : CH

    Javascript code prettifier

    Setup

    1. Download a distribution
    2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
      <link href="prettify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="prettify.js"></script>
    3. Add onload="prettyPrint()" to your document's body tag.
    4. Modify the stylesheet to get the coloring you prefer

    Usage

    Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
    The original Prettier
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }

    FAQ

    Which languages does it work for?

    The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

    LISPy languages are supported via an extension: lang-lisp.js.

    And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

    If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

    How do I specify which language my code is in?

    You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

    <pre class="prettyprint lang-html">
      The lang-* class specifies the language file extensions.
      File extensions supported by default include
        "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
        "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
        "xhtml", "xml", "xsl".
    </pre>

    It doesn't work on <obfuscated code sample>?

    Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

    Which browsers does it work with?

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

    What's changed?

    See the change log

    Why doesn't Prettyprinting of strings work on WordPress?

    Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

    This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

    How do I put line numbers in my code?

    You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

    For example

    <pre class="prettyprint linenums:4"
    >// This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    <pre>
    produces
    // This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    

    How do I prevent a portion of markup from being marked as code?

    You can use the nocode class to identify a span of markup that is not code.

    <pre class=prettyprint>
    int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
      Continuation of comment */
    int y = bar();
    </pre>
    produces
    int x = foo();  /* This is a comment  This is not code
      Continuation of comment */
    int y = bar();
    

    For a more complete example see the issue22 testcase.

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

    addEventListener('load', prettyPrint, false);
    wrap it in a closure like
    addEventListener('load', function (event) { prettyPrint() }, false);
    so that the browser does not pass an event object to prettyPrint which will confuse it.


    ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/img/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017600000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/assets/img/spinner.gifunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000000517512645740734033525 0ustar pbuserpbgroup00000000000000GIF89a333555666[[[^^^oooppprrr777KKKMMMbbbcccsssuuuzzzجmmm]]]\\\! NETSCAPE2.0! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB!-Made by Krasimira Nejcheva (www.loadinfo.net)! ,`'dif&EꊙG[u0(02n#S`lXtd ÈTC٤q{$9c+{"}  vxz{q";BY+-ist!! ,pH,2C:3`j>5+k: BRJ ˊkΖHrNFHnNdDȑ+rSݎKP/j~iD?.tq?//V:} '>GD2%&+D+CC4:" ^ $#Ϳ !<$ _lA! ,EE--D?EE2?9B?-E99EA66̻-66ǂ69ۚӻE A ƌ 2DF~ 2ACА iȐ$;! ,??D./H=-/D-.2D2/=/?+GD)/?GDD&" *?$ 6 )D#?++26 ؅ %F%T$bZ# 6Z(DBx封0 p$9rX(! , Online Accounts JS API
    API Docs for: 0.1

    Welcome to Ubuntu Online Accounts JavaScript API Docs

    ././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/classes/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000755000015600001650000000000012645741276033515 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/classes/OnlineAccounts.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000002717412645740734033530 0ustar pbuserpbgroup00000000000000 OnlineAccounts - Online Accounts JS API

    Class OnlineAccounts

    Class defined in: online-accounts.js:144

    The OnlineAccounts object is the entry point to online accounts service access.

    api.getAccounts( filters, callback )
    online-accounts.js:159

    Gets the configured accounts satisfying the given filters.

    Parameters:
    • filters <Object>

      A dictionary of parameters to filter the result. The filtering keys are:

      • applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)
      • provider: the ID of a provider (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers)
      • service: the ID of a service (see /usr/share/accounts/services/ or ~/.local/share/accounts/services/ for a list of the available services)
    • callback <Function(List of AccountService objects)>

      Callback that receives the result or null

    Example
              var api = external.getUnityObject(1.0);
                              var oa = api.OnlineAccounts;
                            
                              oa.api.getAccounts({'provider': 'facebook'}, function(result) {
                                for (var i = 0; i < result.length; ++i) {
                                  console.log("name: " + result[i].displayName()
                                              + ', id: ' + result[i].accountId()
                                              + ', providerName: ' + result[i].provider().displayName
                                              + ', enabled: ' + (result[i].enabled() ? "true" : "false")
                                              );
                                }               
                              });
                    
    api.getProviders( filters, callback )
    online-accounts.js:190

    Gets list of available providers.

    Parameters:
    • filters <Object>

      A dictionary of parameters to filter the result. The filtering keys are:

      • applicationId: the ID of a application (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)
    • callback <Function(List of AccountService objects)>

      Callback that receives the result or null. The result is a dictionary with the following keys: - displayName: the display name for the corresponding provider - providerId: the provider id

    Example
              var api = external.getUnityObject(1.0);
                              var oa = api.OnlineAccounts;
                    
                              oa.api.getProviders({}, function(result) {
                                for (var i = 0; i < result.length; ++i) {
                                  console.log("displayName: " + result[i].displayName
                                              + ', providerId: ' + result[i].providerId);
                                }
                              });
                    
    api.requestAccount( applicationId, providerId, callback )
    online-accounts.js:218

    Requests access to an account.

    Applications must invoke this method in order to obtain access to an account. The user will be prompted to grant access to either an existing account, to create a new one or to decline the request.

    Parameters:
    • applicationId <String>

      The ID of the application requesting the account (see /usr/share/accounts/applications/ or ~/.local/share/accounts/applications/ for a list of the available applications)

    • providerId <String>

      The ID of the provider of the desired account (see /usr/share/accounts/providers/ or ~/.local/share/accounts/providers/ for a list of the available providers)

    • callback <Function()>

      Callback which will be invoked after the access request has been decided (either with the access to an account being granted, or with a refusal).

    Example
              var api = external.getUnityObject(1.0);
                              var oa = api.OnlineAccounts;
                    
                              var appId = 'com.ubuntu.developer.me.MyPackage_MyApp';
                              oa.api.requestAccount(appId,
                                                    'facebook',
                                                    function() {
                                oa.api.getAccounts({ 'application': appId }, function(result) {
                                  for (var i = 0; i < result.length; ++i) {
                                    console.log("name: " + result[i].displayName()
                                                + ', id: ' + result[i].accountId()
                                                + ', providerName: ' + result[i].provider().displayName
                                                + ', enabled: ' + (result[i].enabled() ? "true" : "false")
                                                );
                                  }
                                });
                              });
    ././@LongLink0000000000000000000000000000020300000000000011210 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbuild/classes/AccountService.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/docsbui0000644000015600001650000002435012645740734033521 0ustar pbuserpbgroup00000000000000 AccountService - Online Accounts JS API

    Class AccountService

    Class defined in: online-accounts.js:10

    AccountService represents an instance of a service in an Online Accounts.

    The AcountService object is not directly constructible but returned as a result of OnlineAccounts api calls.

    String accountId( )
    online-accounts.js:38

    Returns the account's numeric ID; note that all AccountService objects which work on the same online account will have the same ID.


    Returns: <String>

    Value for the accountId

    authenticate( callback )
    online-accounts.js:105

    Perform the authentication on this account.

    The callback will be called with the authentication result object which will have these properties:

    • 'error': error message if the authentication was a failure
    • 'authenticated': boolean value that identifies if the operation was a success
    • 'data': Object with the data returned by the authentication process. An 'AccessToken' property can be usually found (when it applies) with the OAuth access token.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(Object)>
    destroy( )
    online-accounts.js:125

    Destroys the remote object. This proxy object is not valid anymore.

    String displayName( )
    online-accounts.js:60

    Returns The account's display name (usually the user's login or ID). Note that all AccountService objects which work on the same online account will share the same display name.


    Returns: <String>

    Value of the displayName

    Boolean enabled( )
    online-accounts.js:49

    This read-only property returns whether the AccountService is enabled. An application shouldn't use an AccountService which is disabled


    Returns: <Boolean>

    Value for the enabled flag

    Object provider( )
    online-accounts.js:72

    Returns an object representing the provider which provides the account.

    The returned object will have at least these properties:

    • 'id' is the unique identifier for this provider
    • 'displayName'
    • 'iconName'

    Returns: <Object>

    Value object for the provider

    Object service( )
    online-accounts.js:87

    Returns an object representing the service which this AccountService instantiates

    The returned object will have at least these properties:

    • 'id' is the unique identifier for this service
    • 'displayName'
    • 'iconName'
    • 'serviceTypeId' identifies the provided service type

    Returns: <Object>

    Value object for the service

    ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/index.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/client/index.h0000644000015600001650000000007712645740734033426 0ustar pbuserpbgroup00000000000000

    Welcome to Ubuntu Online Accounts JavaScript API Docs

    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/0000755000015600001650000000000012645741276032255 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online0000644000015600001650000005332312645740734033470 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * * Online Accounts API backend binding * */ function createOnlineAccountsApi(backendDelegate, accessPolicy) { var PLUGIN_URI = 'Ubuntu.OnlineAccounts'; var VERSION = 0.1; function Account(account, objectid) { var id = objectid; if ( ! id) { id = backendDelegate.storeQmlObject(transfer, PLUGIN_URI, VERSION, 'Account'); } this._id = id; this._object = account; }; Account.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'OnlineAccounts', objecttype: 'Account', objectid: self._id, // serialize immutable values content: { enabled: self._object.enabled, provider: self._object.provider, displayName: self._object.displayName, accountId: self._object.accountId, } } }, // properties // immutable enabled: function(callback) { this._validate(); callback(this._object.enabled); }, // immutable provider: function(callback) { this._validate(); callback(this._object.provider); }, // immutable displayName: function(callback) { this._validate(); callback(this._object.displayName); }, // immutable accountId: function(callback) { this._validate(); callback(this._object.accountId); }, // method updateDisplayName: function(displayName) { this._validate(); this._object.updateDisplayName(displayName); }, updateEnabled: function(enabled) { this._validate(); this._object.updateEnabled(enabled); }, remove: function(enabled) { this._validate(); this._object.remove(); }, }; function AccountService(service, objectid) { var id = objectid; if ( ! service) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'AccountService'); id = result.id; service = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(service, PLUGIN_URI, VERSION, 'AccountService'); } this._id = id; this._object = service; }; AccountService.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'OnlineAccounts', objecttype: 'AccountService', objectid: self._id, // serialize immutable values content: { accountId: self._object.accountId, enabled: self._object.enabled, serviceEnabled: self._object.serviceEnabled, displayName: self._object.displayName, provider: self.internal.getProvider(self), service: self.internal.getService(self), }, } }, // properties autoSync: function(callback) { this._validate(); callback(this._object.autoSync); }, setAutoSync: function(autoSync, callback) { this._validate(); this._object.autoSync = autoSync; if (callback) callback(); }, // immutable accountId: function(callback) { this._validate(); callback(this._object.accountId); }, // immutable enabled: function(callback) { this._validate(); callback(this._object.enabled); }, // immutable serviceEnabled: function(callback) { this._validate(); callback(this._object.serviceEnabled); }, // immutable displayName: function(callback) { this._validate(); callback(this._object.displayName); }, // immutable provider: function(callback) { this._validate(); callback(this.internal.getProvider(this)); }, // immutable service: function(callback) { this._validate(); callback(this.internal.getService(this)); }, objectHandle: function(callback) { this._validate(); callback(this._object.objectHandle); }, setObjectHandle: function(objectHandle) { this._validate(); this._object.objectHandle = objectHandle; }, // methods authenticate: function(callback) { this._validate(); var onAuthenticated; var onAuthenticationError; var self = this; onAuthenticated = function(reply) { callback({error: null, authenticated: true, data: reply}); self._object.onAuthenticated.disconnect(onAuthenticated); self._object.onAuthenticationError.disconnect(onAuthenticationError); }; onAuthenticationError = function(error){ callback({error: error.message, authenticated: false, data: null, accountId: null}); self._object.onAuthenticated.disconnect(onAuthenticated); self._object.onAuthenticationError.disconnect(onAuthenticationError); }; this._object.onAuthenticated.connect(onAuthenticated); this._object.onAuthenticationError.connect(onAuthenticationError); this._object.authenticate(null); }, // Internal internal: { getService: function(self) { return { id: self._object.service.id, displayName: self._object.service.displayName, iconName: self._object.service.iconName, }; }, getProvider: function(self) { return { id: self._object.provider.id, displayName: self._object.provider.displayName, iconName: self._object.provider.iconName, }; } } }; function Manager() { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'Manager'); this._id = result.id; this._object = result.object; }; Manager.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { return { type: 'object-proxy', apiid: 'OnlineAccounts', objecttype: 'Manager', objectid: this._id, } }, // methods createAccount: function(providerName, callback) { this._validate(); var account = new Account(this._object.createAccount(providerName)); callback(account.serialize()); }, loadAccount: function(id, callback) { this._validate(); var account = new Account(this._object.loadAccount(id)); callback(account.serialize()); }, internal: { loadAccount: function(self, id) { return new Account(self._object.loadAccount(id)); }, }, }; function ProviderModel(filterParams) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ProviderModel', filterParams); this._id = result.id; this._object = result.object; this._modelAdaptor = backendDelegate.createModelAdaptorFor(this._object); this._roles = this._modelAdaptor.roles(); }; ProviderModel.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); this._modelAdaptor.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { this._validate(); return { type: 'object-proxy', apiid: 'OnlineAccounts', objecttype: 'ProviderModel', objectid: this._id, } }, // properties applicationId: function(callback) { this._validate(); callback(this._object.applicationId); }, setApplicationId: function(applicationId, callback) { this._validate(); this._object.applicationId = applicationId; if (callback) callback(); }, // QAbtractListModel prototype count: function(callback) { this._validate(); if (this._modelAdaptor) { return -1; } callback(this._modelAdaptor.rowCount()); }, at: function(idx, callback) { this._validate(); if (idx >= this.proxy.count || ! this._modelAdaptor) { callback(null); return; } var result = {}; for (var role in this._roles) { result[role] = this._modelAdaptor.itemAt(idx, role); } callback(result); }, internal: { // special case for an object wrapper at: function(self, idx) { self._validate(); var displayName = self._modelAdaptor.itemAt(idx, "displayName"); var providerId = self._modelAdaptor.itemAt(idx, "providerId"); return {displayName: displayName, providerId: providerId}; }, count: function(self) { return self._modelAdaptor ? self._modelAdaptor.rowCount() : -1; }, } }; function AccountServiceModel(filterParams) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'AccountServiceModel', filterParams); this._id = result.id; this._object = result.object; this._modelAdaptor = backendDelegate.createModelAdaptorFor(this._object); this._roles = this._modelAdaptor.roles(); // quickly filter out roles that are "tricky" if (this._roles.indexOf('accountServiceHandle') !== -1) { this._roles.splice(this._roles.indexOf('accountServiceHandle'), 1); } if (this._roles.indexOf('accountHandle') !== -1) { this._roles.splice(this._roles.indexOf('accountHandle'), 1); } }; AccountServiceModel.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); this._modelAdaptor.destroy(); backendDelegate.deleteId(this._id); }, // properties count: function(callback) { this._validate(); callback(this._object.count); }, service: function(callback) { this._validate(); callback(this._object.service); }, setService: function(service, callback) { this._validate(); this._object.service = service; if (callback) callback(); }, provider: function(callback) { this._validate(); callback(this._object.provider); }, setProvider: function(provider, callback) { this._validate(); this._object.provider = provider; if (callback) callback(); }, serviceType: function(callback) { this._validate(); callback(this._object.serviceType); }, setServiceType: function(serviceType, callback) { this._validate(); this._object.serviceType = serviceType; if (callback) callback(); }, includeDisabled: function(callback) { this._validate(); callback(this._object.includeDisabled); }, setIncludeDisabled: function(includeDisabled, callback) { this._validate(); this._object.includeDisabled = includeDisabled; if (callback) callback(); }, accountId: function(callback) { this._validate(); callback(this._object.accountId); }, setAccountId: function(accountId, callback) { this._validate(); this._object.accountId = accountId; if (callback) callback(); }, // QAbtractListModel prototype count: function(callback) { if (this._modelAdaptor) { callback(-1); } callback(this._modelAdaptor.rowCount()); }, at: function(idx, callback) { var count = this._modelAdaptor.rowCount(); if (idx >= count || ! this._modelAdaptor) { callback(null); return; } var result = {}; for (var role in this._roles) { result[role] = this._modelAdaptor.itemAt(idx, role); } callback(result); }, // Internal bits, not part of the API (especially no async) internal: { // special case for an object wrapper accountServiceAtIndex: function(self, idx) { self._validate(); var accountServiceHandle = self._modelAdaptor.itemAt(idx, "accountServiceHandle"); if (accountServiceHandle != null) { var accountService = new AccountService(); accountService.setObjectHandle(accountServiceHandle); return accountService; } return null; }, itemAt: function(self, idx, role) { self._validate(); return self._modelAdaptor.itemAt(idx, role); }, count: function(self) { return self._modelAdaptor ? self._modelAdaptor.rowCount() : -1; }, includeDisabled: function(self) { return self._object.includeDisabled; }, } }; function _constructorFromName(className) { var constructorPerName = { "AccountServiceModel": AccountServiceModel, "Account": Account, "ProviderModel": ProviderModel, "Manager": Manager, "AccountService": AccountService }; return className in constructorPerName ? constructorPerName[className] : null; }; return { createAccountServiceModel: function(callback) { var service = new AccountServiceModel(); callback(service.serialize()); }, createManager: function(callback) { var manager = new Manager(); callback(manager.serialize()); }, createProviderModel: function(callback) { var provider = new ProviderModel(); callback(provider.serialize()); }, // api getAccountsInfoFor: function(service, provider, callback) { var serviceModel = new AccountServiceModel({'service': service, 'provider': provider}); var count = serviceModel.internal.count(serviceModel); var accountsInfo = [] for (var i = 0; i < count; ++i) { var displayName = serviceModel.internal.itemAt(serviceModel, i, "displayName"); var accountId = serviceModel.internal.itemAt(serviceModel, i, "accountId"); var providerName = serviceModel.internal.itemAt(serviceModel, i, "providerName"); var serviceName = serviceModel.internal.itemAt(serviceModel, i, "serviceName"); var enabled = serviceModel.internal.itemAt(serviceModel, i, "enabled"); accountsInfo.push({displayName: displayName , accountId: accountId , providerName: providerName , serviceName: serviceName , enabled: enabled }); } serviceModel.destroy(); callback(accountsInfo); }, getAccounts: function(filters, callback) { var serviceModel = new AccountServiceModel(filters); var count = serviceModel.internal.count(serviceModel); var accounts = [] for (var i = 0; i < count; ++i) { var service = serviceModel.internal.accountServiceAtIndex(serviceModel, i); if (service) { var s = service.serialize(); console.debug(JSON.stringify(s.content)) accounts.push(s); } } callback(accounts); }, getProviders: function(filters, callback) { var providerModel = new ProviderModel(filters); var count = providerModel.internal.count(providerModel); var providers = [] for (var i = 0; i < count; ++i) { providers.push(providerModel.internal.at(providerModel, i)); } callback(providers); }, getAccountById: function(accountId, callback) { var manager = new Manager(); var account = manager.internal.loadAccount(manager, accountId); manager.destroy(); callback(account.serialize()); }, getAccessTokenFor: function(serviceName, providerName, accountId, callback) { var serviceModel = new AccountServiceModel(); if (serviceName) serviceModel.setService(serviceName); if (providerName) serviceModel.setProvider(providerName); if (accountId) serviceModel.setAccountId(accountId); var count = serviceModel.internal.count(serviceModel); if (count > 0) { var accountIdx = 0; if (count > 1) { console.debug("More than one account with id: " + accountId); } var onAuthenticated = function(results) { serviceModel.destroy(); callback(results); }; serviceModel.internal .accountServiceAtIndex(serviceModel, accountIdx) .authenticate(onAuthenticated); } else { serviceModel.destroy(); callback({error: "No account found"}); } }, Client: OnlineAccountsClientApiBackend.createOnlineAccountsClientApi(backendDelegate), // Internal dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; var objectid = infos.objectid; var class_name = infos.class_name; if (callback) args.push(callback); var o = backendDelegate.objectFromId(objectid); if (o == null) { console.debug('Cannot dispatch to unknown object: ' + objectid); return; } var Constructor = _constructorFromName(class_name); var instance = new Constructor(o, objectid); instance[method_name].apply(instance, args); } }; } ././@LongLink0000000000000000000000000000017000000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online-accounts-client.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/online-accounts/backend/online0000644000015600001650000000470712645740734033472 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * * Online Accounts client API backend binding * */ function createOnlineAccountsClientApi(backendDelegate) { var PLUGIN_URI = 'Ubuntu.OnlineAccounts.Client'; var VERSION = 0.1; function Setup(params) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'Setup', params); this._id = result.id; this._object = result.object; }; Setup.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { this._validate(); return { type: 'object-proxy', apiid: 'OnlineAccounts.Client', objecttype: 'Setup', objectid: this._id, } }, // methods exec: function(callback) { this._validate(); var self = this; var onFinished = function() { self._object.onFinished.disconnect(onFinished); callback(); } this._object.onFinished.connect(onFinished); this._object.exec(); } }; return { requestAccount: function(applicationId, providerId, callback) { var setup = new Setup({ 'applicationId': applicationId, 'providerId': providerId, }); var onFinished = function() { setup.destroy(); callback(); }; setup.exec(onFinished); }, }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/0000755000015600001650000000000012645741276031004 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/client/0000755000015600001650000000000012645741276032262 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/client/download-api.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/client/downlo0000644000015600001650000004003012645740734033502 0ustar pbuserpbgroup00000000000000/** * DownloadApi gives access to Download management. * @module DownloadApi */ function createDownloadApi(backendBridge) { var PLUGIN_URI = 'DownloadApi'; /** * SingleDownload provides facilities for downloading a single * file, track the process, react to error conditions, etc. * * @class SingleDownload * @constructor * @example */ function SingleDownload(id) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'SingleDownload', id); }; SingleDownload.prototype = { /** * This property retrieves if the downloads should start automatically, or let the user * decide when to start them calling the "start()" method on each download. * * @method autoStart * @param callback {Function(Error)} */ autoStart: function(callback) { this._proxy.call('autoStart', [], callback); }, /** * This property sets if the downloads should start automatically, or let the user * decide when to start them calling the "start()" method on each download. * * @method setAutoStart * @param shouldAutoStart {Bool} * @param callback (optional) {Function()} To be called after the value is set. */ setAutoStart: function(shouldAutoStart, callback) { this._proxy.call('setAutoStart', [shouldAutoStart], callback); }, /** * Retrieves the current error message (if any) * * @method errorMessage * @param callback {Function(String)} Called with the current error message. */ errorMessage: function(callback) { this._proxy.call('errorMessage', [], callback); }, /** * Sets up a callback that is to be called when error message changes. * * @method errorChanged * @param callback {Function(String)} Called with the current error message. */ errorChanged: function(callback) { this._proxy.call('errorChanged', [callback]); }, /** * Retrieves the property that determines if the download handled by this object * will work under mobile data connection. * * @method allowMobileDownload * @param callback {Function(Bool)} Called with the current value. */ allowMobileDownload: function(callback) { this._proxy.call('allowMobileDownload', [], callback); }, /** * Sets the property that determines if the download handled by this object * will work under mobile data connection. * * @method setAllowMobileDownload * @param allow {Bool} * @param callback (optional) {Function()} Called after the value has been set. */ setAllowMobileDownload: function(allow, callback) { this._proxy.call('setAllowMobileDownload', [allow], callback); }, /** * Retrieves the current state of the download. True if the download already finished, False otherwise. * * @method isCompleted * @param callback {Function(Bool)} Called with the current value. */ isCompleted: function(callback) { this._proxy.call('isCompleted', [], callback); }, /** * Sets up a callback that is to be called when the download completion status changes. * * @method isCompletedChanged * @param callback {Function(Bool)} Function to be called when the download completion status changes. Called with a boolean corresponding to the current value. */ isCompletedChanged: function(callback) { this._proxy.call('isCompletedChanged', [callback]); }, /** * Retrieves the property that indicates if the download is active whatever its internal status is (paused etc.). * If a download is active, the value will be True. It will become False when the download * finished or get canceled. * * @method downloadInProgress * @param callback {Function(Bool)} Called with the current value. */ downloadInProgress: function(callback) { this._proxy.call('downloadInProgress', [], callback); }, /** * Sets up a callback that is to be called when the download progress status changes. * * @method downloadInProgressChanged * @param callback {Function(Bool)} Function to be called when the downloading progress status changes. Called with a boolean corresponding to the current value. */ downloadInProgressChanged: function(callback) { this._proxy.call('downloadInProgressChanged', [callback]); }, /** * Retrieves the property that reports the current progress in percentage of the download, from 0 to 100. * * @method progress * @param callback {Function(Int)} Called with the current value. */ progress: function(callback) { this._proxy.call('progress', [], callback); }, /** * Sets up a callback that is to be called when the progress value changes. * * @method progressChanged * @param callback {Function(Int)} Function to be called when the progress value changes. Called with the current value. */ progressChanged: function(callback) { this._proxy.call('progressChanged', [callback]); }, /** * Retrieves the property that represents the current state of the download. * False if paused or not downloading anything. * True if the file is currently being downloaded. * * @method downloading * @param callback {Function(Bool)} Called with the current value. */ downloading: function(callback) { this._proxy.call('downloading', [], callback); }, /** * Sets up a callback that is to be called when the downloading status changes. * * @method progressChanged * @param callback {Function(Bool)} Function to be called when the downloading status changes. Called with the current value. */ downloadingChanged: function(callback) { this._proxy.call('downloadingChanged', [callback]); }, /** * Sets up a callback that is to be called when the download is finished. * * @method finished * @param callback {Function(String)} Function to be called when the download is finished. Called with a the path of the downloaded file. */ finished: function(callback) { this._proxy.call('finished', [callback]); }, /** * Sets up a callback that is to be called when the download is canceled. * * @method canceled * @param callback {Function(Bool)} Function to be called when the download is canceled. Called with a boolean indicating if the operation was successful. */ canceled: function(callback) { this._proxy.call('canceled', [callback]); }, /** * Sets up a callback that is to be called when the download is paused. * * @method paused * @param callback {Function(Bool)} Function to be called when the download is paused. Called with a boolean indicating if the operation was successful. */ paused: function(callback) { this._proxy.call('paused', [callback]); }, /** * Starts a download. * * @method start */ start: function() { this._proxy.call('start', []); }, /** * Pauses a download. * * @method pause */ pause: function() { this._proxy.call('pause', []); }, /** * Resumes a download. * * @method resume */ resume: function() { this._proxy.call('resume', []); }, /** * Cancels a download. * * @method cancel */ cancel: function() { this._proxy.call('cancel', []); }, /** * Downloads a given item by url. * * @method download * @param url {String} Url of the file to download. */ download: function(url) { this._proxy.call('download', []); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; /** * DownloadManager provides facilities for downloading a several * files, list the current downloads in progress or finished, * and dynamically update the content of those to show the current * downloads. . * * @class DownloadManager * @constructor * @example * */ function DownloadManager(id) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'DownloadManager', id); }; DownloadManager.prototype = { /** * This property sets if the downloads should start automatically, or let the user * decide when to start them calling the "start()" method on each download object. * * @method autoStart * @param callback {Function(Error)} */ autoStart: function(callback) { this._proxy.call('autoStart', [], callback); }, /** * This property sets if the downloads should start automatically, or let the user * decide when to start them calling the "start()" method on each download object. * * @method setAutoStart * @param shouldAutoStart {Bool} * @param callback (optional) {Function()} To be called after the value is set. */ setAutoStart: function(shouldAutoStart, callback) { this._proxy.call('setAutoStart', [shouldAutoStart], callback); }, /** * Retrieves the clean download flag value. * * @method cleanDownloads * @param callback {Function(Bool)} Called with the current value of the clean download flag */ cleanDownloads: function(callback) { this._proxy.call('cleanDownloads', [], callback); }, /** * Sets the value of the clean download flag. This informs the download manager that * the list of SingleDownload listed by the 'downloads' property should only contain * the downloads in progress. Those that finishes are being removed from the list. * * @method setCleanDownloads * @param clean {Bool} * @param callback (optional) {Function()} To be called after the value is set. */ setCleanDownloads: function(clean, callback) { this._proxy.call('setCleanDownloads', [clean], callback); }, /** * Retrieves the current error message (if any) * * @method errorMessage * @param callback {Function(String)} Called with the current error message. */ errorMessage: function(callback) { this._proxy.call('errorMessage', [], callback); }, /** * Sets up a callback that is to be called when error message changes. * * @method errorChanged * @param callback {Function(String)} Called with the current error message. */ errorChanged: function(callback) { this._proxy.call('errorChanged', [callback]); }, /** * Retrieves the current set of download being proceeded. * * @method downloads * @param callback {Function(List of SingleDownload)} Called with the current set of download objects. */ downloads: function(callback) { this._proxy.call('downloads', [], callback); }, /** * Sets up a callback that is to be called when the set of urls being downloaded * changes (items being added or removed). * * @method downloadsChanged * @param callback {Function(List of SingleDownload)} Called with the current set of download objects. */ downloadsChanged: function(callback) { this._proxy.call('downloadsChanged', [callback]); }, /** * Starts a download operation for the given url. * * @method download * @param url {String} */ download: function(url) { this._proxy.call('download', [url]); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; function _constructorFromName(className) { var constructorPerName = { "SingleDownload": SingleDownload, "DownloadManager": DownloadManager, }; return className in constructorPerName ? constructorPerName[className] : null; }; /** * The DownloadApi object * @class DownloadApi * @constructor * @example */ return { /** * Creates a download manager object. * * @method createDownloadManager * @param options {Object} A dictionary of download options. The option keys are: * - autoStart: This property sets if the downloads should start automatically, or let the user * decide when to start them calling the "start()" method on each download. * - cleanDownloads: This informs the download manager that the list of SingleDownload listed by * the 'downloads' property should only contain the downloads in progress. Those that * finishes are being removed from the list * @param callback {Function(DownloadManager)} Function called with the DownloadManager object created. */ createDownloadManager: function(options, callback) { backendBridge.call('DownloadApi.createDownloadManager' , [options] , callback); }, /** * Download a file. * * @method downloadFile * @param url {String} Function called with the created Alarm. * @param options {Object} A dictionary of download options. The option keys are: * - allowMobileDownload: * - throttle: * @param onCompleted {Function(Object)} Function called when the download completes. The function is called with an dictionary with the following keys: * - status: status of the download ("Success" or "Cancelled") * - path: path of the downloaded resource * - download: SingleDownload object that performed the download (so that it can be inspected & destroyed) * @param onProgress {Function(Float)} (optional) Function called with current progress. * @param onError {Function(String)} (optional) Function called when an error occurs with the error message. * - error: * - downloads: */ downloadFile: function(url, options, onCompleted, onProgress, onError) { if ( ! onCompleted || typeof onCompleted !== 'function') throw Error("Invalid (null) onCompleted callback"); if ( ! url || typeof url !== 'string') throw Error("Invalid (null) url"); backendBridge.call('DownloadApi.downloadFile' , [url, options, onCompleted, onProgress, onError]); }, // Internal /** * @private * */ createObjectWrapper: function(objectType, objectId, content) { var Constructor = _constructorFromName(objectType); return new Constructor(objectId, content); }, }; }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/backend/0000755000015600001650000000000012645741276032373 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/backend/download-api.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/download-manager/backend/downl0000644000015600001650000003010612645740734033437 0ustar pbuserpbgroup00000000000000/** * * Download API backend binding * */ function createDownloadApi(backendDelegate) { var PLUGIN_URI = 'Ubuntu.DownloadManager'; var VERSION = 0.1; function SingleDownload(singledownload, objectid) { var id = objectid; if ( ! singledownload) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'SingleDownload'); id = result.id; singledownload = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(singledownload, PLUGIN_URI, VERSION, 'SingleDownload'); } this._id = id; this._object = singledownload; }; SingleDownload.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { return { type: 'object-proxy', apiid: 'DownloadApi', objecttype: 'SingleDownload', objectid: this._id, } }, // methods cancel: function() { this._validate(); this._object.cancel(); }, start: function() { this._validate(); this._object.start(); }, pause: function() { this._validate(); this._object.pause(); }, resume: function() { this._validate(); this._object.resume(); }, download: function(url) { this._validate(); this._object.download(url); }, // properties autoStart: function(callback) { this._validate(); callback(this._object.autoStart); }, setAutoStart: function(shouldAutoStart, callback) { this._validate(); this._object.autoStart = shouldAutoStart; if (callback && typeof(callback) === 'function') callback(); }, allowMobileDownload: function(callback) { this._validate(); callback(this._object.allowMobileDownload); }, setAllowMobileDownload: function(allow, callback) { this._validate(); this._object.allowMobileDownload = allow; if (callback && typeof(callback) === 'function') callback(); }, isCompleted: function(callback) { this._validate(); callback(this._object.isCompleted); }, isCompletedChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.isCompletedChanged.connect(function() { callback(self._object.isCompleted); }); } }, downloadInProgress: function(callback) { this._validate(); callback(this._object.downloadInProgress); }, downloadInProgressChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.downloadInProgressChanged.connect(function() { callback(self._object.downloadInProgress); }); } }, progress: function(callback) { this._validate(); callback(this._object.progress); }, progressChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.progressChanged.connect(function() { callback(self._object.progress); }); } }, downloading: function(callback) { this._validate(); callback(this._object.downloading); }, downloadingChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.downloadingChanged.connect(function() { callback(self._object.downloading); }); } }, errorMessage: function(callback) { this._validate(); callback(this._object.errorMessage); }, errorChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.errorChanged.connect(function() { callback(self._object.errorMessage); }); } }, finished: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { this._object.finished.connect(callback); } }, canceled: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { this._object.canceled.connect(callback); } }, paused: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { this._object.paused.connect(callback); } }, // internal internal: { error: function(self) { return self._object.error; } } }; function DownloadManager(downloadManager, objectid) { var id = objectid; if ( ! downloadManager) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'DownloadManager'); id = result.id; downloadManager = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(downloadManager, PLUGIN_URI, VERSION, 'DownloadManager'); } this._id = id; this._object = downloadManager; }; DownloadManager.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { return { type: 'object-proxy', apiid: 'DownloadApi', objecttype: 'DownloadManager', objectid: this._id, } }, // methods download: function(url) { this._validate(); this._object.download(url); }, // properties autoStart: function(callback) { this._validate(); callback(this._object.autoStart); }, setAutoStart: function(shouldAutoStart, callback) { this._validate(); this._object.autoStart = shouldAutoStart; if (callback && typeof(callback) === 'function') callback(); }, cleanDownloads: function(callback) { this._validate(); callback(this._object.cleanDownloads); }, setCleanDownloads: function(clean, callback) { this._validate(); this._object.cleanDownloads = clean; if (callback && typeof(callback) === 'function') callback(); }, errorMessage: function(callback) { this._validate(); callback(this._object.errorMessage); }, errorChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.errorChanged.connect(function() { callback(self._object.errorMessage); }); } }, downloads: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var downloadCount = this._object.downloads.length; var downloads = []; for (var i = 0; i < downloadCount; ++i) { var download = new SingleDownload(this._object.downloads[i]); downloads.push(download.serialize()); } callback(downloads); } }, downloadsChanged: function(callback) { this._validate(); if (callback && typeof(callback) === 'function') { var self = this; this._object.downloadsChanged.connect(function() { self.downloads(callback); }); } }, }; function _constructorFromName(className) { var constructorPerName = { "SingleDownload": SingleDownload, "DownloadManager": DownloadManager, }; return className in constructorPerName ? constructorPerName[className] : null; } return { createDownloadManager: function(options, callback) { if (! callback || typeof callback !== 'function') return; var autoStart = options && options.autoStart === undefined ? false : options.autoStart; var cleanDownloads = options && options.cleanDownloads === undefined ? false : options.cleanDownloads; var manager = new DownloadManager(); manager.setAutoStart(autoStart); manager.setCleanDownloads(cleanDownloads); callback(manager.serialize()); }, downloadFile: function(url, options, onCompleted, onProgress, onError) { var download = new SingleDownload(); var allowMobileDownload = options && options.allowMobileDownload === undefined ? false : options.allowMobileDownload; var throttle = options && options.throttle ? options.throttle : undefined; if (allowMobileDownload === true) download.setAllowMobileDownload(allowMobileDownload); if (throttle !== undefined) download.setThrottle(throttle); if (onProgress && typeof onProgress === 'function') { download.progressChanged(onProgress); } if (onError && typeof onError === 'function') { download.errorChanged(onError); } if (onCompleted && typeof onCompleted === 'function') { download.finished(function(path) { onCompleted({status: "Success", path: path, download: download.serialize()}) }); download.canceled(function(success) { onCompleted({status: "Cancelled", download: download.serialize()}) }); } download.setAutoStart(true); download.download(url); }, // Internal dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; var objectid = infos.objectid; var class_name = infos.class_name; if (callback) args.push(callback); var o = backendDelegate.objectFromId(objectid); if (o == null) { console.debug('Cannot dispatch to unknown object: ' + objectid); return; } var Constructor = _constructorFromName(class_name); var instance = new Constructor(o, objectid); instance[method_name].apply(instance, args); } }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/tools/0000755000015600001650000000000012645741276026725 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/tools/client/0000755000015600001650000000000012645741276030203 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/tools/client/tools.js0000644000015600001650000000570112645740734031702 0ustar pbuserpbgroup00000000000000/* * Copyright 2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Tools gives access to various helpers/tools. * @module Tools */ function createToolsApi(backendBridge) { var PLUGIN_URI = 'Tools'; /** * The Tools object * @class Tools * @constructor * @example var api = external.getUnityObject('1.0'); api.Tools.getHmacHash(hmac, algorithm, key, function(result) { console.log('Application name: ' + result); }); */ return { /** Enumeration of the available types of CryptographicAlgorithm. Values: MD5: MD5 hash function SHA1: SHA1 hash function SHA256: SHA-256 hash function SHA512: SHA-512 hash function @static @property CryptographicAlgorithm {Object} @example var api = external.getUnityObject('1.0'); var algorithm = api.Tools.CryptographicAlgorithm; // use algorithm.MD5, algorithm.SHA-1, ... */ CryptographicAlgorithm: { MD5: "MD5", SHA1: "SHA1", SHA256: "SHA256", SHA512: "SHA512" }, /** * Generates a . * * @method getHmacHash * @param hmac {Function (Application)} * @param algorithm {CryptographicAlgorithm} * @param key {Function (Application)} * @param callback {Function (Application)} */ getHmacHash: function(message, algorithm, key, callback) { if (! callback || typeof(callback) !== 'function') { return; } backendBridge.call('ToolsApi.getHmacHash' , [message, algorithm, key] , callback); }, /** * @internal */ __private__: { sendHttpRequest: function(url, request, payload, callback) { if (! callback || typeof(callback) !== 'function') { return; } var location = window && window.location ? window.location.href : "" backendBridge.call('ToolsApi.sendHttpRequest' , [url, location, request, payload] , callback); } } }; }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/tools/backend/0000755000015600001650000000000012645741276030314 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/tools/backend/tools.js0000644000015600001650000000610012645740734032005 0ustar pbuserpbgroup00000000000000/* * Copyright 20145 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ .import Ubuntu.UnityWebApps 0.2 as UnityWebAppsBridge /** * * Tools API backend binding * */ function createToolsApi(backendDelegate) { var PLUGIN_URI = 'Ubuntu.UnityWebApps'; var VERSION = 0.2; var toolsApiInstance = UnityWebAppsBridge.ToolsApi; function isValidAlgorithm(algorithm) { var algos = ["MD5", "SHA1", "SHA256", "SHA512"] return algos.some(function(e) { return e === algorithm; }) }; function stringToCryptoAlgorithm(algorithm) { var assoc = { "MD5": toolsApiInstance.MD5 , "SHA1": toolsApiInstance.SHA1 , "SHA256": toolsApiInstance.SHA256 , "SHA512": toolsApiInstance.SHA512 }; return assoc[algorithm] }; return { getHmacHash: function(message, algorithm, key, callback) { if ( ! isValidAlgorithm(algorithm)) { callback({errorMsg: "Invalid algorithm", result: null}); return; } callback({errorMsg: "", result: toolsApiInstance.getHmacHash( message, stringToCryptoAlgorithm(algorithm), key)}); }, sendHttpRequest: function(url, location, request, payload, callback) { if ( ! toolsApiInstance.areCompatibleCorsUrl(url, location)) { console.error('sendHttpRequest: incompatible CORS request urls') return; } var xmlrequest = new XMLHttpRequest(); var verb = payload && payload.length !== 0 ? "POST" : "GET" xmlrequest.open(verb, url, true); xmlrequest.onreadystatechange = function() { if (xmlrequest.readyState === XMLHttpRequest.DONE) { callback({ errorMsg: xmlrequest.statusText, success: xmlrequest.status == 200, response: xmlrequest.responseText }); } }; for (var header in request.headers) { if (request.headers.hasOwnProperty(header)) { xmlrequest.setRequestHeader(header, request.headers[header]) } } xmlrequest.setRequestHeader( "Content-Length", String(payload.length)); xmlrequest.send(payload); } }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/0000755000015600001650000000000012645741276030017 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/0000755000015600001650000000000012645741276031275 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/runtime-api.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/runtime-api0000644000015600001650000002131112645740734033446 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * RuntimeApi gives access to the application runtime information and management. * @module RuntimeApi */ function createRuntimeApi(backendBridge) { var PLUGIN_URI = 'RuntimeApi'; function Application(id, content) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'Application', id); this._name = content.name; this._platform = content.platform; this._writableLocation = content.writableLocation; this._screenOrientation = content.screenOrientation; this._inputMethodName = content.inputMethodName; this._setupPropertyListeners(); }; Application.prototype = { /** * Internal */ _setupPropertyListeners: function() { var self = this; this._proxy.call('onApplicationNameChanged' , [function(name) {self._name = name;}]); this._proxy.call('onScreenOrientationChanged' , [function(orientation) {self._screenOrientation = orientation;}]); }, /** * Retrieves the application name. * * @method getApplicationName * @return {String} application name */ getApplicationName: function() { return this._name; }, /** * Sets up a callback that is to be called when the application's name changed. * * @method onApplicationNameChanged * @param callback {Function(String)} Function to be called when the application's name has changed. */ onApplicationNameChanged: function(callback) { var self = this; this._proxy.call('onApplicationNameChanged' , [callback]); }, /** * Retrieves the fileystem location where the application is allowed to write its data in. * * @method getApplicationWritableLocation * @return {String} application writable location path */ getApplicationWritableLocation: function() { return this._writableLocation; }, /** * Retrieves current platform information. * * @method getPlatformInfos * @return {Object} platform information as a dictionary with the following keys: * - name: the platform name */ getPlatformInfo: function() { return this._platform; }, /** * Sets up a callback that is to be called when the application is about to quit. * * @method onAboutToQuit * @param callback {Function()} Function to be called when the application is about to quit. */ onAboutToQuit: function(callback) { this._proxy.call('onAboutToQuit' , [callback]); }, /** * Sets up a callback that is to be called when the application has been deactivated (background). * * @method onDeactivated * @param callback {Function()} Function to be called when the application has been deactivated. */ onDeactivated: function(callback) { this._proxy.call('onDeactivated' , [callback]); }, /** * Sets up a callback that is to be called when the application has been activated (from background). * * @method onActivated * @param callback {Function()} Function to be called when the application has been activated. */ onActivated: function(callback) { this._proxy.call('onActivated' , [callback]); }, /** * Retrieves the current screen orientation. * * @method getScreenOrientation * @return {ScreenOrientation} current screen orientation. */ getScreenOrientation: function() { return this._screenOrientation; }, /** * Sets up a callback that is to be called when the application's screen has changed its orientation. * * @method onScreenOrientationChanged * @param callback {Function(ScreenOrientation)} Function to be called when the application's screen orientation has changed. */ onScreenOrientationChanged: function(callback) { var self = this; this._proxy.call('onScreenOrientationChanged' , [callback]); }, /** * Sets up a URI handler. The application can be sent URIs to open. * * @method setupUriHandler * @param callback {Function([String])} Function to be called with the current list of uris to open */ setupUriHandler: function(callback) { this._proxy.call('setupUriHandler' , [callback]); }, /** * Retrieves the current input method's name. The name varies depending on the platform * e.g. maliit can be part of the name for a maliit based Virtual Keyboard (possibly mangled * with e.g. 'phablet'), when a keyboard is there the name can be empty, ... * * @method getInputMethodName * @return {String} current input method name */ getInputMethodName: function() { return this._inputMethodName; }, /** * Sets up a callback that is to be called when the On Screen Keyboard visibility has changed. * * @method onInputMethodVisibilityChanged * @param callback {Function(Bool)} Function to be called when the On Screen Keyboard visibility has changed (received the visibility as an arg). */ onInputMethodVisibilityChanged: function(callback) { this._proxy.call('onInputMethodVisibilityChanged' , [callback]); } }; function _constructorFromName(className) { var constructorPerName = { "Application": Application, }; return className in constructorPerName ? constructorPerName[className] : null; }; /** * The RuntimeApi object * @class RuntimeApi * @constructor * @example var api = external.getUnityObject('1.0'); api.RuntimeApi.getApplication(function(application) { console.log('Application name: ' + application.getApplicationName()); }); */ return { /** Enumeration of the available types of ScreenOrientation. Values: Landscape: The application screen is in landscape mode InvertedLandscape: The application screen is in inverted landscape mode Portrait: The application screen is in portrait mode InvertedPortrait: The application screen is in inverted portrait mode Unknown: The application screen is in an unknown mode @static @property ScreenOrientation {Object} @example var api = external.getUnityObject('1.0'); var orientation = api.RuntimeApi.ScreenOrientation; // use orientation.Landscape or orientation.Portrait */ ScreenOrientation: { Landscape: "Landscape", InvertedLandscape: "InvertedLandscape", Portrait: "Portrait", InvertedPortrait: "InvertedPortrait", Unknwon: "Unknown", }, /** * Creates an Application object. * * @method getApplication * @param callback {Function (Application)} */ getApplication: function(callback) { backendBridge.call('RuntimeApi.getApplication' , [] , callback); }, /** * @private * */ createObjectWrapper: function(objectType, objectId, content) { var Constructor = _constructorFromName(objectType); return new Constructor(objectId, content); }, }; }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/yuidoc.json0000644000015600001650000000033712645740734033465 0ustar pbuserpbgroup00000000000000{ "name": "Runtime JS API", "description": "Ubuntu App Platform Runtime JavaScript API docs", "version": "0.1", "options": { "outdir": "./docsbuild", "themedir": "../../yuidoc-theme" } } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/0000755000015600001650000000000012645741276033245 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/data.jsonunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/d0000644000015600001650000002454712645740734033425 0ustar pbuserpbgroup00000000000000{ "project": { "name": "Runtime JS API", "description": "Ubuntu App Platform Runtime JavaScript API docs", "version": "0.1" }, "files": { "runtime-api.js": { "name": "runtime-api.js", "modules": { "RuntimeApi": 1 }, "classes": { "RuntimeApi": 1 }, "fors": {}, "namespaces": {} } }, "modules": { "RuntimeApi": { "name": "RuntimeApi", "submodules": {}, "classes": { "RuntimeApi": 1 }, "fors": {}, "namespaces": {}, "tag": "module", "file": "runtime-api.js", "line": 196, "description": "RuntimeApi gives access to the application runtime information and management." } }, "classes": { "RuntimeApi": { "name": "RuntimeApi", "shortname": "RuntimeApi", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "RuntimeApi", "namespace": "", "file": "runtime-api.js", "line": 196, "description": "The RuntimeApi object", "is_constructor": 1, "example": [ "\n\n var api = external.getUnityObject('1.0');\n api.RuntimeApi.getApplication(function(application) {\n console.log('Application name: ' + application.getApplicationName());\n });" ] } }, "classitems": [ { "file": "runtime-api.js", "line": 42, "description": "Internal", "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 53, "description": "Retrieves the application name.", "itemtype": "method", "name": "getApplicationName", "return": { "description": "application name", "type": "String" }, "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 63, "description": "Sets up a callback that is to be called when the application's name changed.", "itemtype": "method", "name": "onApplicationNameChanged", "params": [ { "name": "callback", "description": "Function to be called when the application's name has changed.", "type": "Function(String)" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 75, "description": "Retrieves the fileystem location where the application is allowed to write its data in.", "itemtype": "method", "name": "getApplicationWritableLocation", "return": { "description": "application writable location path", "type": "String" }, "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 85, "description": "Retrieves current platform information.", "itemtype": "method", "name": "getPlatformInfos", "return": { "description": "platform information as a dictionary with the following keys:\n - name: the platform name", "type": "Object" }, "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 96, "description": "Sets up a callback that is to be called when the application is about to quit.", "itemtype": "method", "name": "onAboutToQuit", "params": [ { "name": "callback", "description": "Function to be called when the application is about to quit.", "type": "Function()" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 107, "description": "Sets up a callback that is to be called when the application has been deactivated (background).", "itemtype": "method", "name": "onDeactivated", "params": [ { "name": "callback", "description": "Function to be called when the application has been deactivated.", "type": "Function()" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 118, "description": "Sets up a callback that is to be called when the application has been activated (from background).", "itemtype": "method", "name": "onActivated", "params": [ { "name": "callback", "description": "Function to be called when the application has been activated.", "type": "Function()" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 129, "description": "Retrieves the current screen orientation.", "itemtype": "method", "name": "getScreenOrientation", "return": { "description": "current screen orientation.", "type": "ScreenOrientation" }, "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 139, "description": "Sets up a callback that is to be called when the application's screen has changed its orientation.", "itemtype": "method", "name": "onScreenOrientationChanged", "params": [ { "name": "callback", "description": "Function to be called when the application's screen orientation has changed.", "type": "Function(ScreenOrientation)" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 151, "description": "Sets up a URI handler. The application can be sent URIs to open.", "itemtype": "method", "name": "setupUriHandler", "params": [ { "name": "callback", "description": "Function to be called with the current list of uris to open", "type": "Function([String])" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 162, "description": "Retrieves the current input method's name. The name varies depending on the platform\ne.g. maliit can be part of the name for a maliit based Virtual Keyboard (possibly mangled\nwith e.g. 'phablet'), when a keyboard is there the name can be empty, ...", "itemtype": "method", "name": "getInputMethodName", "return": { "description": "current input method name", "type": "String" }, "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 174, "description": "Sets up a callback that is to be called when the On Screen Keyboard visibility has changed.", "itemtype": "method", "name": "onInputMethodVisibilityChanged", "params": [ { "name": "callback", "description": "Function to be called when the On Screen Keyboard visibility has changed (received the visibility as an arg).", "type": "Function(Bool)" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 209, "description": "Enumeration of the available types of ScreenOrientation.\n\n Values:\n\n Landscape: The application screen is in landscape mode\n\n InvertedLandscape: The application screen is in inverted landscape mode\n\n Portrait: The application screen is in portrait mode\n\n InvertedPortrait: The application screen is in inverted portrait mode\n\n Unknown: The application screen is in an unknown mode", "static": 1, "itemtype": "property", "name": "ScreenOrientation", "type": "Object", "example": [ "\n\n var api = external.getUnityObject('1.0');\n var orientation = api.RuntimeApi.ScreenOrientation;\n // use orientation.Landscape or orientation.Portrait" ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 245, "description": "Creates an Application object.", "itemtype": "method", "name": "getApplication", "params": [ { "name": "callback", "description": "", "type": "Function (Application)" } ], "class": "RuntimeApi", "module": "RuntimeApi" }, { "file": "runtime-api.js", "line": 257, "access": "private", "tagname": "", "class": "RuntimeApi", "module": "RuntimeApi" } ], "warnings": [ { "message": "Missing item type\nInternal", "line": " runtime-api.js:42" }, { "message": "Missing item type", "line": " runtime-api.js:257" } ] }././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/modules/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/m0000755000015600001650000000000012645741276033422 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/modules/RuntimeApi.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/m0000644000015600001650000000554512645740734033433 0ustar pbuserpbgroup00000000000000 RuntimeApi - Runtime JS API
    API Docs for: 0.1

    RuntimeApi

    RuntimeApi gives access to the application runtime information and management.

    This module has the following classes:



    Module description found: runtime-api.js:196
    ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/files/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/f0000755000015600001650000000000012645741276033413 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/files/runtime-api.js.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/f0000644000015600001650000002653412645740734033425 0ustar pbuserpbgroup00000000000000 runtime-api.js - Runtime JS API
    API Docs for: 0.1

    runtime-api.js

    /*
     * Copyright 2014 Canonical Ltd.
     *
     * This file is part of unity-webapps-qml.
     *
     * unity-webapps-qml is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; version 3.
     *
     * unity-webapps-qml is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    
    /**
     * RuntimeApi gives access to the application runtime information and management.
    
     * @module RuntimeApi
     */
    function createRuntimeApi(backendBridge) {
        var PLUGIN_URI = 'RuntimeApi';
    
        function Application(id, content) {
            this._proxy = backendBridge.createRemoteObject(
                PLUGIN_URI, 'Application', id);
    
            this._name = content.name;
            this._platform = content.platform;
            this._writableLocation = content.writableLocation;
            this._screenOrientation = content.screenOrientation;
            this._inputMethodName = content.inputMethodName;
    
            this._setupPropertyListeners();
        };
        Application.prototype = {
    
            /**
             * Internal
             */
            _setupPropertyListeners: function() {
                var self = this;
                this._proxy.call('onApplicationNameChanged'
                                   , [function(name) {self._name = name;}]);
                this._proxy.call('onScreenOrientationChanged'
                                   , [function(orientation) {self._screenOrientation = orientation;}]);
            },
    
            /**
             * Retrieves the application name.
             *
             * @method getApplicationName
             * @return {String} application name
             */
            getApplicationName: function() {
                return this._name;
            },
    
            /**
             * Sets up a callback that is to be called when the application's name changed.
             *
             * @method onApplicationNameChanged
             * @param callback {Function(String)} Function to be called when the application's name has changed.
             */
            onApplicationNameChanged: function(callback) {
                var self = this;
                this._proxy.call('onApplicationNameChanged'
                                   , [callback]);
            },
    
            /**
             * Retrieves the fileystem location where the application is allowed to write its data in.
             *
             * @method getApplicationWritableLocation
             * @return {String} application writable location path
             */
            getApplicationWritableLocation: function() {
                return this._writableLocation;
            },
    
            /**
             * Retrieves current platform information.
             *
             * @method getPlatformInfos
             * @return {Object} platform information as a dictionary with the following keys:
             *  - name: the platform name
             */
            getPlatformInfo: function() {
                return this._platform;
            },
    
            /**
             * Sets up a callback that is to be called when the application is about to quit.
             *
             * @method onAboutToQuit
             * @param callback {Function()} Function to be called when the application is about to quit.
             */
            onAboutToQuit: function(callback) {
                this._proxy.call('onAboutToQuit'
                                   , [callback]);
            },
    
            /**
             * Sets up a callback that is to be called when the application has been deactivated (background).
             *
             * @method onDeactivated
             * @param callback {Function()} Function to be called when the application has been deactivated.
             */
            onDeactivated: function(callback) {
                this._proxy.call('onDeactivated'
                                   , [callback]);
            },
    
            /**
             * Sets up a callback that is to be called when the application has been activated (from background).
             *
             * @method onActivated
             * @param callback {Function()} Function to be called when the application has been activated.
             */
            onActivated: function(callback) {
                this._proxy.call('onActivated'
                                   , [callback]);
            },
    
            /**
             * Retrieves the current screen orientation.
             *
             * @method getScreenOrientation
             * @return {ScreenOrientation} current screen orientation.
             */
            getScreenOrientation: function() {
                return this._screenOrientation;
            },
    
            /**
             * Sets up a callback that is to be called when the application's screen has changed its orientation.
             *
             * @method onScreenOrientationChanged
             * @param callback {Function(ScreenOrientation)} Function to be called when the application's screen orientation has changed.
             */
            onScreenOrientationChanged: function(callback) {
                var self = this;
                this._proxy.call('onScreenOrientationChanged'
                                   , [callback]);
            },
    
            /**
             * Sets up a URI handler. The application can be sent URIs to open.
             *
             * @method setupUriHandler
             * @param callback {Function([String])} Function to be called with the current list of uris to open
             */
            setupUriHandler: function(callback) {
                this._proxy.call('setupUriHandler'
                                   , [callback]);
            },
    
            /**
             * Retrieves the current input method's name. The name varies depending on the platform
             * e.g. maliit can be part of the name for a maliit based Virtual Keyboard (possibly mangled
             * with e.g. 'phablet'), when a keyboard is there the name can be empty, ...
             *
             * @method getInputMethodName
             * @return {String} current input method name
             */
            getInputMethodName: function() {
                return this._inputMethodName;
            },
    
            /**
             * Sets up a callback that is to be called when the On Screen Keyboard visibility has changed.
             *
             * @method onInputMethodVisibilityChanged
             * @param callback {Function(Bool)} Function to be called when the On Screen Keyboard visibility has changed (received the visibility as an arg).
             */
            onInputMethodVisibilityChanged: function(callback) {
                this._proxy.call('onInputMethodVisibilityChanged'
                                   , [callback]);
            }
        };
    
        function _constructorFromName(className) {
            var constructorPerName = {
                "Application": Application,
            };
            return className in constructorPerName
                    ? constructorPerName[className]
                    : null;
        };
    
    
    /**
     * The RuntimeApi object
    
     * @class RuntimeApi
     * @constructor
     * @example
    
           var api = external.getUnityObject('1.0');
           api.RuntimeApi.getApplication(function(application) {
             console.log('Application name: ' + application.getApplicationName());
           });
     */
        return {
            /**
               Enumeration of the available types of ScreenOrientation.
    
                 Values:
    
                   Landscape: The application screen is in landscape mode
    
                   InvertedLandscape: The application screen is in inverted landscape mode
    
                   Portrait: The application screen is in portrait mode
    
                   InvertedPortrait: The application screen is in inverted portrait mode
    
                   Unknown: The application screen is in an unknown mode
    
               @static
               @property ScreenOrientation {Object}
    
               @example
    
                   var api = external.getUnityObject('1.0');
                   var orientation = api.RuntimeApi.ScreenOrientation;
                   // use orientation.Landscape or orientation.Portrait
             */
            ScreenOrientation: {
                Landscape: "Landscape",
    
                InvertedLandscape: "InvertedLandscape",
    
                Portrait: "Portrait",
    
                InvertedPortrait: "InvertedPortrait",
    
                Unknwon: "Unknown",
            },
    
            /**
             * Creates an Application object.
             *
             * @method getApplication
             * @param callback {Function (Application)}
             */
            getApplication: function(callback) {
                backendBridge.call('RuntimeApi.getApplication'
                                   , []
                                   , callback);
            },
    
            /**
             * @private
             *
             */
            createObjectWrapper: function(objectType, objectId, content) {
                var Constructor = _constructorFromName(objectType);
                return new Constructor(objectId, content);
            },
        };
    };
    
    
    
    
    ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/favicon.icounity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000001246612645740734033417 0ustar pbuserpbgroup00000000000000 h&  (  !Юmrf<0SKVhQK6>,1"}2'ɤ`FaKQ=A1y)ԻO1vjv;-dKjR[FK8/|mVK7D6Q>mSdNTA?.QD|gĠ\BVCG8aJlS_IN;7'B˜>,]AbITBN=iOhQXD=*vڷoU=S@M9aCbISBUAkRcMO;I9-jѪ]EZFS=aDaISAXDjR]H?+šÊu_D_IWB_DaHSAYEgOR=SCҦeJ_G[F\D_GSBVD`JD/ÜEnɭ`FZCYCZESAP?S?Q>ź\ˆsícLR;N9I7F6>+u.ڸp‘raΜ\KK<@1ϳ^#+$?( @ ־E*ҵZyUJ}2'i~xĽNsP>9'2!}. y+qZRݽa|hͤXAP:N;I7B1:+3%v(8-fLcJeO]HUAM:F5>/7)|/"s#=ŋvdJiRcLZER>K8C2<-5&r zνIjYѳhMjRgP_IWCO.3$8,I8~@/{A3q8-XCmRjQiQaKYDQ=I7B1;+x(ѶT(q[ӖQ;UCO>H9y?2D5jOjQjRfP^HVBN;F5?/|,xo(bE^E\HVDO>H9x>2WClRiQiRcMZFS?K8D38(D7ټd]>`H\HVCO>G8D5eMkQjRgP_JWCPE7O=kQjQjReN\GT@M:E44#qf}q3"B0cDdH`H\HVCO>E7ZElQjRhRbLYDQ>J8@/>/|D/K8B2K6gFdG`H\HVCN=H9bKkQiRgP^IVBN;G63"yҫzSgGcG`H\HUCL,eYٵlbFgNhQcL\GVBOJ8:)C޿]gLfKjRfO`JYEQ?W?eFdG_H[GUCK,oc@rXbGjQhQcL\GUAV@bEdG_H[GUCL;VCjReN[FT@K8>,<q`DhOjRfO`JXDU@^CdG`H[GUCK;TAhQbLXDQ>@-naԫ}fKcHjQhQcM\GUBYBaFaH[HUCK;P?cM_IUAN:=*J7maDfLjRfO`JXDVA\C`H\HUCKO.|7)s0">01 $49:9???././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/api-list.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000001465012645740734033414 0ustar pbuserpbgroup00000000000000YUI.add('api-list', function (Y) { var Lang = Y.Lang, YArray = Y.Array, APIList = Y.namespace('APIList'), classesNode = Y.one('#api-classes'), inputNode = Y.one('#api-filter'), modulesNode = Y.one('#api-modules'), tabviewNode = Y.one('#api-tabview'), tabs = APIList.tabs = {}, filter = APIList.filter = new Y.APIFilter({ inputNode : inputNode, maxResults: 1000, on: { results: onFilterResults } }), search = APIList.search = new Y.APISearch({ inputNode : inputNode, maxResults: 100, on: { clear : onSearchClear, results: onSearchResults } }), tabview = APIList.tabview = new Y.TabView({ srcNode : tabviewNode, panelNode: '#api-tabview-panel', render : true, on: { selectionChange: onTabSelectionChange } }), focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, { circular : true, descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a', keys : {next: 'down:40', previous: 'down:38'} }).focusManager, LIST_ITEM_TEMPLATE = '
  • ' + '{displayName}' + '
  • '; // -- Init --------------------------------------------------------------------- // Duckpunch FocusManager's key event handling to prevent it from handling key // events when a modifier is pressed. Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusPrevious', focusManager); Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusNext', focusManager); // Create a mapping of tabs in the tabview so we can refer to them easily later. tabview.each(function (tab, index) { var name = tab.get('label').toLowerCase(); tabs[name] = { index: index, name : name, tab : tab }; }); // Switch tabs on Ctrl/Cmd-Left/Right arrows. tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); // Focus the filter input when the `/` key is pressed. Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); // Keep the Focus Manager up to date. inputNode.on('focus', function () { focusManager.set('activeDescendant', inputNode); }); // Update all tabview links to resolved URLs. tabview.get('panelNode').all('a').each(function (link) { link.setAttribute('href', link.get('href')); }); // -- Private Functions -------------------------------------------------------- function getFilterResultNode() { return filter.get('queryType') === 'classes' ? classesNode : modulesNode; } // -- Event Handlers ----------------------------------------------------------- function onFilterResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()), resultNode = getFilterResultNode(), typePlural = filter.get('queryType'), typeSingular = typePlural === 'classes' ? 'class' : 'module'; if (e.results.length) { YArray.each(e.results, function (result) { frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { rootPath : APIList.rootPath, displayName : filter.getDisplayName(result.highlighted), name : result.text, typePlural : typePlural, typeSingular: typeSingular })); }); } else { frag.append( '
  • ' + 'No ' + typePlural + ' found.' + '
  • ' ); } resultNode.empty(true); resultNode.append(frag); focusManager.refresh(); } function onSearchClear(e) { focusManager.refresh(); } function onSearchKey(e) { var target = e.target; if (target.test('input,select,textarea') || target.get('isContentEditable')) { return; } e.preventDefault(); inputNode.focus(); focusManager.refresh(); } function onSearchResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()); if (e.results.length) { YArray.each(e.results, function (result) { frag.append(result.display); }); } else { frag.append( '
  • ' + 'No results found. Maybe you\'ll have better luck with a ' + 'different query?' + '
  • ' ); } focusManager.refresh(); } function onTabSelectionChange(e) { var tab = e.newVal, name = tab.get('label').toLowerCase(); tabs.selected = { index: tab.get('index'), name : name, tab : tab }; switch (name) { case 'classes': // fallthru case 'modules': filter.setAttrs({ minQueryLength: 0, queryType : name }); search.set('minQueryLength', -1); // Only send a request if this isn't the initially-selected tab. if (e.prevVal) { filter.sendRequest(filter.get('value')); } break; case 'everything': filter.set('minQueryLength', -1); search.set('minQueryLength', 1); if (search.get('value')) { search.sendRequest(search.get('value')); } else { inputNode.focus(); } break; default: // WTF? We shouldn't be here! filter.set('minQueryLength', -1); search.set('minQueryLength', -1); } if (focusManager) { setTimeout(function () { focusManager.refresh(); }, 1); } } function onTabSwitchKey(e) { var currentTabIndex = tabs.selected.index; if (!(e.ctrlKey || e.metaKey)) { return; } e.preventDefault(); switch (e.keyCode) { case 37: // left arrow if (currentTabIndex > 0) { tabview.selectChild(currentTabIndex - 1); inputNode.focus(); } break; case 39: // right arrow if (currentTabIndex < (Y.Object.size(tabs) - 2)) { tabview.selectChild(currentTabIndex + 1); inputNode.focus(); } break; } } }, '3.4.0', {requires: [ 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' ]}); ././@LongLink0000000000000000000000000000017000000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/apidocs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000002407112645740734033412 0ustar pbuserpbgroup00000000000000YUI().use( 'yuidoc-meta', 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', function (Y) { var win = Y.config.win, localStorage = win.localStorage, bdNode = Y.one('#bd'), pjax, defaultRoute, classTabView, selectedTab; // Kill pjax functionality unless serving over HTTP. if (!Y.getLocation().protocol.match(/^https?\:/)) { Y.Router.html5 = false; } // Create the default route with middleware which enables syntax highlighting // on the loaded content. defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { prettyPrint(); bdNode.removeClass('loading'); next(); }); pjax = new Y.Pjax({ container : '#docs-main', contentSelector: '#docs-main > .content', linkSelector : '#bd a', titleSelector : '#xhr-title', navigateOnHash: true, root : '/', routes : [ // -- / ---------------------------------------------------------------- { path : '/(index.html)?', callbacks: defaultRoute }, // -- /classes/* ------------------------------------------------------- { path : '/classes/:class.html*', callbacks: [defaultRoute, 'handleClasses'] }, // -- /files/* --------------------------------------------------------- { path : '/files/*file', callbacks: [defaultRoute, 'handleFiles'] }, // -- /modules/* ------------------------------------------------------- { path : '/modules/:module.html*', callbacks: defaultRoute } ] }); // -- Utility Functions -------------------------------------------------------- pjax.checkVisibility = function (tab) { tab || (tab = selectedTab); if (!tab) { return; } var panelNode = tab.get('panelNode'), visibleItems; // If no items are visible in the tab panel due to the current visibility // settings, display a message to that effect. visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { if (itemNode.getComputedStyle('display') !== 'none') { return true; } }); panelNode.all('.no-visible-items').remove(); if (!visibleItems) { if (Y.one('#index .index-item')) { panelNode.append( '
    ' + '

    ' + 'Some items are not shown due to the current visibility ' + 'settings. Use the checkboxes at the upper right of this ' + 'page to change the visibility settings.' + '

    ' + '
    ' ); } else { panelNode.append( '
    ' + '

    ' + 'This class doesn\'t provide any methods, properties, ' + 'attributes, or events.' + '

    ' + '
    ' ); } } // Hide index sections without any visible items. Y.all('.index-section').each(function (section) { var items = 0, visibleItems = 0; section.all('.index-item').each(function (itemNode) { items += 1; if (itemNode.getComputedStyle('display') !== 'none') { visibleItems += 1; } }); section.toggleClass('hidden', !visibleItems); section.toggleClass('no-columns', visibleItems < 4); }); }; pjax.initClassTabView = function () { if (!Y.all('#classdocs .api-class-tab').size()) { return; } if (classTabView) { classTabView.destroy(); selectedTab = null; } classTabView = new Y.TabView({ srcNode: '#classdocs', on: { selectionChange: pjax.onTabSelectionChange } }); pjax.updateTabState(); classTabView.render(); }; pjax.initLineNumbers = function () { var hash = win.location.hash.substring(1), container = pjax.get('container'), hasLines, node; // Add ids for each line number in the file source view. container.all('.linenums>li').each(function (lineNode, index) { lineNode.set('id', 'l' + (index + 1)); lineNode.addClass('file-line'); hasLines = true; }); // Scroll to the desired line. if (hasLines && /^l\d+$/.test(hash)) { if ((node = container.getById(hash))) { win.scroll(0, node.getY()); } } }; pjax.initRoot = function () { var terminators = /^(?:classes|files|modules)$/, parts = pjax._getPathRoot().split('/'), root = [], i, len, part; for (i = 0, len = parts.length; i < len; i += 1) { part = parts[i]; if (part.match(terminators)) { // Makes sure the path will end with a "/". root.push(''); break; } root.push(part); } pjax.set('root', root.join('/')); }; pjax.updateTabState = function (src) { var hash = win.location.hash.substring(1), defaultTab, node, tab, tabPanel; function scrollToNode() { if (node.hasClass('protected')) { Y.one('#api-show-protected').set('checked', true); pjax.updateVisibility(); } if (node.hasClass('private')) { Y.one('#api-show-private').set('checked', true); pjax.updateVisibility(); } setTimeout(function () { // For some reason, unless we re-get the node instance here, // getY() always returns 0. var node = Y.one('#classdocs').getById(hash); win.scrollTo(0, node.getY() - 70); }, 1); } if (!classTabView) { return; } if (src === 'hashchange' && !hash) { defaultTab = 'index'; } else { if (localStorage) { defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || 'index'; } else { defaultTab = 'index'; } } if (hash && (node = Y.one('#classdocs').getById(hash))) { if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } } // Scroll to the desired element if this is a hash URL. if (node) { if (classTabView.get('rendered')) { scrollToNode(); } else { classTabView.once('renderedChange', scrollToNode); } } } else { tab = Y.one('#classdocs .api-class-tab.' + defaultTab); // When the `defaultTab` node isn't found, `localStorage` is stale. if (!tab && defaultTab !== 'index') { tab = Y.one('#classdocs .api-class-tab.index'); } if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } }; pjax.updateVisibility = function () { var container = pjax.get('container'); container.toggleClass('hide-inherited', !Y.one('#api-show-inherited').get('checked')); container.toggleClass('show-deprecated', Y.one('#api-show-deprecated').get('checked')); container.toggleClass('show-protected', Y.one('#api-show-protected').get('checked')); container.toggleClass('show-private', Y.one('#api-show-private').get('checked')); pjax.checkVisibility(); }; // -- Route Handlers ----------------------------------------------------------- pjax.handleClasses = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initClassTabView(); } next(); }; pjax.handleFiles = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initLineNumbers(); } next(); }; // -- Event Handlers ----------------------------------------------------------- pjax.onNavigate = function (e) { var hash = e.hash, originTarget = e.originEvent && e.originEvent.target, tab; if (hash) { tab = originTarget && originTarget.ancestor('.yui3-tab', true); if (hash === win.location.hash) { pjax.updateTabState('hashchange'); } else if (!tab) { win.location.hash = hash; } e.preventDefault(); return; } // Only scroll to the top of the page when the URL doesn't have a hash. this.set('scrollToTop', !e.url.match(/#.+$/)); bdNode.addClass('loading'); }; pjax.onOptionClick = function (e) { pjax.updateVisibility(); }; pjax.onTabSelectionChange = function (e) { var tab = e.newVal, tabId = tab.get('contentBox').getAttribute('href').substring(1); selectedTab = tab; // If switching from a previous tab (i.e., this is not the default tab), // replace the history entry with a hash URL that will cause this tab to // be selected if the user navigates away and then returns using the back // or forward buttons. if (e.prevVal && localStorage) { localStorage.setItem('tab_' + pjax.getPath(), tabId); } pjax.checkVisibility(tab); }; // -- Init --------------------------------------------------------------------- pjax.on('navigate', pjax.onNavigate); pjax.initRoot(); pjax.upgrade(); pjax.initClassTabView(); pjax.initLineNumbers(); pjax.updateVisibility(); Y.APIList.rootPath = pjax.get('root'); Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); Y.on('hashchange', function (e) { pjax.updateTabState('hashchange'); }, win); }); ././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/tabs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000537412645740734033417 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/yui-prettify.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000377512645740734033422 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/api-search.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000555412645740734033417 0ustar pbuserpbgroup00000000000000YUI.add('api-search', function (Y) { var Lang = Y.Lang, Node = Y.Node, YArray = Y.Array; Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { // -- Public Properties ---------------------------------------------------- RESULT_TEMPLATE: '
  • ' + '' + '

    {name}

    ' + '{resultType}' + '
    {description}
    ' + '{class}' + '
    ' + '
  • ', // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, // -- Protected Methods ---------------------------------------------------- _apiResultFilter: function (query, results) { // Filter components out of the results. return YArray.filter(results, function (result) { return result.raw.resultType === 'component' ? false : result; }); }, _apiResultFormatter: function (query, results) { return YArray.map(results, function (result) { var raw = Y.merge(result.raw), // create a copy desc = raw.description || ''; // Convert description to text and truncate it if necessary. desc = Node.create('
    ' + desc + '
    ').get('text'); if (desc.length > 65) { desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; } else { desc = Y.Escape.html(desc); } raw['class'] || (raw['class'] = ''); raw.description = desc; // Use the highlighted result name. raw.name = result.highlighted; return Lang.sub(this.RESULT_TEMPLATE, raw); }, this); }, _apiTextLocator: function (result) { return result.displayName || result.name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultFormatter: { valueFn: function () { return this._apiResultFormatter; } }, resultFilters: { valueFn: function () { return this._apiResultFilter; } }, resultHighlighter: { value: 'phraseMatch' }, resultListLocator: { value: 'data.results' }, resultTextLocator: { valueFn: function () { return this._apiTextLocator; } }, source: { value: '/api/v1/search?q={query}&count={maxResults}' } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 'escape' ]}); ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/js/api-filter.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000264512645740734033415 0ustar pbuserpbgroup00000000000000YUI.add('api-filter', function (Y) { Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, getDisplayName: function(name) { Y.each(Y.YUIDoc.meta.allModules, function(i) { if (i.name === name && i.displayName) { name = i.displayName; } }); return name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultHighlighter: { value: 'phraseMatch' }, // May be set to "classes" or "modules". queryType: { value: 'classes' }, source: { valueFn: function() { var self = this; return function(q) { var data = Y.YUIDoc.meta[self.get('queryType')], out = []; Y.each(data, function(v) { if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { out.push(v); } }); return out; }; } } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' ]}); ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/css/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016700000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/css/main.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000002421212645740734033407 0ustar pbuserpbgroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
       blocks. */
    pre code, pre kbd, pre samp { font-size: 100%; }
    
    /* Used to denote text that shouldn't be selectable, such as line numbers or
       shell prompts. Guess which browser this doesn't work in. */
    .noselect {
        -moz-user-select: -moz-none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    
    /* -- Lists ----------------------------------------------------------------- */
    dd { margin: 0.2em 0 0.7em 1em; }
    dl { margin: 1em 0; }
    dt { font-weight: bold; }
    
    /* -- Tables ---------------------------------------------------------------- */
    caption, th { text-align: left; }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    td, th {
        border: 1px solid #fff;
        padding: 5px 12px;
        vertical-align: top;
    }
    
    td { background: #E6E9F5; }
    td dl { margin: 0; }
    td dl dl { margin: 1em 0; }
    td pre:first-child { margin-top: 0; }
    
    th {
        background: #D2D7E6;/*#97A0BF*/
        border-bottom: none;
        border-top: none;
        color: #000;/*#FFF1D5*/
        font-family: 'Trebuchet MS', sans-serif;
        font-weight: bold;
        line-height: 1.3;
        white-space: nowrap;
    }
    
    
    /* -- Layout and Content ---------------------------------------------------- */
    #doc {
        margin: auto;
        min-width: 1024px;
    }
    
    #main { width: 754px; }
    #sidebar { width: 270px; margin: 0 15px; }
    
    .content { padding: 0 20px 0 25px; }
    
    /* -- Sidebar --------------------------------------------------------------- */
    .sidebox {
        background: #F9F9FC;/*E6E9F5*/
        border: 1px solid #D4D8EB;
    
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
        margin: 0 0 15px 0;
        padding-bottom: 1px;
    }
    
    .sidebox h2 {
        background: #E5E6F1;
        -moz-border-radius: 4px 4px 0 0;
        -webkit-border-radius: 4px 4px 0 0;
        border-radius: 4px 4px 0 0;
        color: #5E6BA4;
        font-weight: bold;
        font-size: 107.692%;
        margin: 0;
        padding: 4px 7px 5px;
    }
    
    .sidebox .bd {
        font-size: 84.615%;
        padding: 0 5px 0 8px;
    }
    
    .sidebox li { list-style-type: disc; color:#D4D5E3; }
    
    .sidebox ol, .sidebox ul {
        margin-left: 0;
        padding-left: 16px;
    }
    
    .sidebox ol ol, .sidebox ol ul,
    .sidebox ul ol, .sidebox ul ul {
        margin: 0;
        padding-left: 16px;
    }
    
    /* -- Table of Contents ----------------------------------------------------- */
    
    /* The #toc id refers to the single global table of contents, while the .toc
       class refers to generic TOC lists that could be used throughout the page. */
    
    .toc code, .toc kbd, .toc samp { font-size: 100%; }
    .toc li { font-weight: bold; }
    .toc li li { font-weight: normal; }
    
    /* -- Intro and Example Boxes ----------------------------------------------- */
    .intro, .example { margin-bottom: 2em; }
    
    .example {
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 5px #bfbfbf;
        -webkit-box-shadow: 0 0 5px #bfbfbf;
        box-shadow: 0 0 5px #bfbfbf;
        padding: 1em;
    }
    
    .intro {
        background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    }
    
    /* -- Other Styles ---------------------------------------------------------- */
    
    /* These are probably YUI-specific, and should be moved out of Selleck's default
       theme. */
    
    .button {
        border: 1px solid #dadada;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        color: #444;
        display: inline-block;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 92.308%;
        font-weight: bold;
        padding: 4px 13px 3px;
        -moz-text-shadow: 1px 1px 0 #fff;
        -webkit-text-shadow: 1px 1px 0 #fff;
        text-shadow: 1px 1px 0 #fff;
        white-space: nowrap;
    
        background: #EFEFEF; /* old browsers */
        background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    }
    
    .button:hover {
        border-color: #466899;
        color: #fff;
        text-decoration: none;
        -moz-text-shadow: 1px 1px 0 #222;
        -webkit-text-shadow: 1px 1px 0 #222;
        text-shadow: 1px 1px 0 #222;
    
        background: #6396D8; /* old browsers */
        background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    }
    
    .newwindow { text-align: center; }
    
    .header .version em {
        display: block;
        text-align: right;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        background-color: transparent;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        border: none;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DEDCD9;
        border-right: 1px solid #CDCBC8;
        border-left: 1px solid #CDCBC8;
        border-top: 1px solid #DADADA;
        color: #333333;
        text-decoration: none;
    }
    .yui3-skin-sam .yui3-tabview .yui3-tab-label,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
        border: none;
        background: none;
        font-size: 100%;
        color: #000;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: none;
        background-color: #fff;
        border-bottom-color: #FFFFFF;
        border-top: 2px solid #8193C9;
        font-weight: bold;
        color: #000;
    
    }
    
    .yui3-skin-sam .yui3-tabview-list {
        border-color: #DFDFDF;
        border-width: 0 0 1px; 
    }
    
    
    a.external {
        background-image: url(external-small.png);
        background-repeat: no-repeat;
        background-position: 0 0;
        padding-left: 16px;
    }
    
    #classdocs .item {
        border-bottom: 1px solid #466899;
        margin: 1em 0;
        padding: 1.5em;
    }
    
    #classdocs .item .params p,
        #classdocs .item .returns p,{
        display: inline;
    }
    
    #classdocs .item em code, #classdocs .item em.comment {
        color: green;
    }
    
    #classdocs .item em.comment a {
        color: green;
        text-decoration: underline;
    }
    
    #classdocs .foundat {
        font-size: 11px;
        font-style: normal;
    }
    
    .attrs .emits {
        margin-left: 2em;
        padding: .5em;
        border-left: 1px dashed #ccc;
    }
    
    abbr {
        border-bottom: 1px dashed #ccc;
        font-size: 80%;
        cursor: help;
    }
    
    .prettyprint li.L0, 
    .prettyprint li.L1, 
    .prettyprint li.L2, 
    .prettyprint li.L3, 
    .prettyprint li.L5, 
    .prettyprint li.L6, 
    .prettyprint li.L7, 
    .prettyprint li.L8 {
        list-style: decimal;
    }
    
    ul li p {
        margin-top: 0;
    }
    
    .method .name {
        font-size: 110%;
    }
    
    #hd {
        background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DFDFDF;
        padding: 0 15px 1px 20px;
        margin-bottom: 15px;
    }
    
    #hd img {
        margin-right: 10px;
        vertical-align: middle;
    }
    
    ././@LongLink0000000000000000000000000000016700000000000011221 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/css/logo.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000135512645740734033412 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDR=29PLTEvO_1S#ƶl{]j@H9	pHYstIME
    &	fEGIDAThv eQ;,.i]	9=Ï	QxBHB$$!	IȿTobH
    L,LAJ!z2@{}q%>D*()29zfv0v'xY|~2ܾHIȔdY.Ҭ$FH[62MT%a>$XmSUhiKY.kUdYps6#È+ټV`HU2z/[Y
    ̷]PT&[o^|ߗuǞl 5e]6UǶEu<*5d+BoIHB$$!	JnɒőIENDB`././@LongLink0000000000000000000000000000020100000000000011206 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/css/external-small.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000075312645740734033413 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb?%B@,0]VVV0affȊ=8JOy %pJջ+30¿}sʋ`n|dx
    mXa |ȹWpA+ca|u=zϰp-l\w01nCy?*Yr%cfxÿ8
    `g2ȉ0!GA[EV66>Ӏ'E]AOCAY^#.S>>#񶉝
    "ÏOv%w@FX^`ddR|8 wX
    	 OƓIENDB`././@LongLink0000000000000000000000000000016500000000000011217 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/index.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000033012645740734033402 0ustar  pbuserpbgroup00000000000000
    
        
            Redirector
            
        
        
            Click here to redirect
        
    
    ././@LongLink0000000000000000000000000000016200000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020200000000000011207 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/COPYINGunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000002613612645740734033416 0ustar  pbuserpbgroup00000000000000
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    ././@LongLink0000000000000000000000000000021200000000000011210 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/prettify-min.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000004564712645740734033426 0ustar  pbuserpbgroup00000000000000/*
     * Copyright 2011 Yahoo! Inc.
     * All rights reserved.
     *-
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *     * Redistributions of source code must retain the above copyright
     *       notice, this list of conditions and the following disclaimer.
     *     * Redistributions in binary form must reproduce the above copyright
     *       notice, this list of conditions and the following disclaimer in the
     *       documentation and/or other materials provided with the distribution.
     *     * Neither the name of the Yahoo! Inc. nor the
     *       names of its contributors may be used to endorse or promote products
     *       derived from this software without specific prior written permission.
     *-
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
     * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
    ././@LongLink0000000000000000000000000000021300000000000011211 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/prettify-min.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000124312645740734033406 0ustar  pbuserpbgroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}././@LongLink0000000000000000000000000000020700000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/CHANGES.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000001370412645740734033413 0ustar  pbuserpbgroup00000000000000
      
        
        Change Log
      
      
        README
    
        

    Known Issues

    • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
    • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

    Change Log

    29 March 2007

    • Added tests for PHP support to address issue 3.
    • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
    • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
    • Fixed bug: was eating tabs (test)
    • Fixed entity handling so that the caveat

      Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

      is no longer applicable.
    • Added noisefree's C# patch
    • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

    4 Jul 2008

    • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
    • Fixed bug: python handling of '''string'''
    • Fixed bug: / in regex [charsets] should not end regex

    5 Jul 2008

    • Defined language extensions for Lisp and Lua

    14 Jul 2008

    • Language handlers for F#, OCAML, SQL
    • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

    6 Jan 2009

    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
    • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
    • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

    21 May 2009

    • Rewrote to improve performance on large files. See benchmarks.
    • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

    14 August 2009

    • Fixed prettifying of <code> blocks with embedded newlines.

    3 October 2009

    • Fixed prettifying of XML/HTML tags that contain uppercase letters.

    19 July 2010

    • Added support for line numbers. Bug 22
    • Added YAML support. Bug 123
    • Added VHDL support courtesy Le Poussin.
    • IE performance improvements. Bug 102 courtesy jacobly.
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • Fixed copy and paste in IE[678].
    • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
    ././@LongLink0000000000000000000000000000020600000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/vendor/prettify/README.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000001735012645740734033414 0ustar pbuserpbgroup00000000000000 Javascript code prettifier Languages : CH

    Javascript code prettifier

    Setup

    1. Download a distribution
    2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
      <link href="prettify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="prettify.js"></script>
    3. Add onload="prettyPrint()" to your document's body tag.
    4. Modify the stylesheet to get the coloring you prefer

    Usage

    Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
    The original Prettier
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }

    FAQ

    Which languages does it work for?

    The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

    LISPy languages are supported via an extension: lang-lisp.js.

    And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

    If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

    How do I specify which language my code is in?

    You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

    <pre class="prettyprint lang-html">
      The lang-* class specifies the language file extensions.
      File extensions supported by default include
        "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
        "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
        "xhtml", "xml", "xsl".
    </pre>

    It doesn't work on <obfuscated code sample>?

    Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

    Which browsers does it work with?

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

    What's changed?

    See the change log

    Why doesn't Prettyprinting of strings work on WordPress?

    Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

    This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

    How do I put line numbers in my code?

    You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

    For example

    <pre class="prettyprint linenums:4"
    >// This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    <pre>
    produces
    // This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    

    How do I prevent a portion of markup from being marked as code?

    You can use the nocode class to identify a span of markup that is not code.

    <pre class=prettyprint>
    int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
      Continuation of comment */
    int y = bar();
    </pre>
    produces
    int x = foo();  /* This is a comment  This is not code
      Continuation of comment */
    int y = bar();
    

    For a more complete example see the issue22 testcase.

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

    addEventListener('load', prettyPrint, false);
    wrap it in a closure like
    addEventListener('load', function (event) { prettyPrint() }, false);
    so that the browser does not pass an event object to prettyPrint which will confuse it.


    ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/img/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000755000015600001650000000000012645741276033406 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017200000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/assets/img/spinner.gifunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/a0000644000015600001650000000517512645740734033416 0ustar pbuserpbgroup00000000000000GIF89a333555666[[[^^^oooppprrr777KKKMMMbbbcccsssuuuzzzجmmm]]]\\\! NETSCAPE2.0! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB!-Made by Krasimira Nejcheva (www.loadinfo.net)! ,`'dif&EꊙG[u0(02n#S`lXtd ÈTC٤q{$9c+{"}  vxz{q";BY+-ist!! ,pH,2C:3`j>5+k: BRJ ˊkΖHrNFHnNdDȑ+rSݎKP/j~iD?.tq?//V:} '>GD2%&+D+CC4:" ^ $#Ϳ !<$ _lA! ,EE--D?EE2?9B?-E99EA66̻-66ǂ69ۚӻE A ƌ 2DF~ 2ACА iȐ$;! ,??D./H=-/D-.2D2/=/?+GD)/?GDD&" *?$ 6 )D#?++26 ؅ %F%T$bZ# 6Z(DBx封0 p$9rX(! , Runtime JS API
    API Docs for: 0.1

    Welcome to Ubuntu Runtime Javascript API Docs

    ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/classes/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/c0000755000015600001650000000000012645741276033410 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/classes/RuntimeApi.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/docsbuild/c0000644000015600001650000004310112645740734033407 0ustar pbuserpbgroup00000000000000 RuntimeApi - Runtime JS API
    API Docs for: 0.1

    Class RuntimeApi

    Class defined in: runtime-api.js:196

    The RuntimeApi object

    RuntimeApi( )
    runtime-api.js:196
    Example
      var api = external.getUnityObject('1.0');
          api.RuntimeApi.getApplication(function(application) {
            console.log('Application name: ' + application.getApplicationName());
          });
    getApplication( callback )
    runtime-api.js:245

    Creates an Application object.

    Parameters:
    • callback <Function (Application)>
    String getApplicationName( )
    runtime-api.js:53

    Retrieves the application name.


    Returns: <String>

    application name

    String getApplicationWritableLocation( )
    runtime-api.js:75

    Retrieves the fileystem location where the application is allowed to write its data in.


    Returns: <String>

    application writable location path

    String getInputMethodName( )
    runtime-api.js:162

    Retrieves the current input method's name. The name varies depending on the platform e.g. maliit can be part of the name for a maliit based Virtual Keyboard (possibly mangled with e.g. 'phablet'), when a keyboard is there the name can be empty, ...


    Returns: <String>

    current input method name

    Object getPlatformInfos( )
    runtime-api.js:85

    Retrieves current platform information.


    Returns: <Object>

    platform information as a dictionary with the following keys:

    • name: the platform name
    ScreenOrientation getScreenOrientation( )
    runtime-api.js:129

    Retrieves the current screen orientation.


    Returns: <ScreenOrientation>

    current screen orientation.

    onAboutToQuit( callback )
    runtime-api.js:96

    Sets up a callback that is to be called when the application is about to quit.

    Parameters:
    • callback <Function()>

      Function to be called when the application is about to quit.

    onActivated( callback )
    runtime-api.js:118

    Sets up a callback that is to be called when the application has been activated (from background).

    Parameters:
    • callback <Function()>

      Function to be called when the application has been activated.

    onApplicationNameChanged( callback )
    runtime-api.js:63

    Sets up a callback that is to be called when the application's name changed.

    Parameters:
    • callback <Function(String)>

      Function to be called when the application's name has changed.

    onDeactivated( callback )
    runtime-api.js:107

    Sets up a callback that is to be called when the application has been deactivated (background).

    Parameters:
    • callback <Function()>

      Function to be called when the application has been deactivated.

    onInputMethodVisibilityChanged( callback )
    runtime-api.js:174

    Sets up a callback that is to be called when the On Screen Keyboard visibility has changed.

    Parameters:
    • callback <Function(Bool)>

      Function to be called when the On Screen Keyboard visibility has changed (received the visibility as an arg).

    onScreenOrientationChanged( callback )
    runtime-api.js:139

    Sets up a callback that is to be called when the application's screen has changed its orientation.

    Parameters:
    • callback <Function(ScreenOrientation)>

      Function to be called when the application's screen orientation has changed.

    setupUriHandler( callback )
    runtime-api.js:151

    Sets up a URI handler. The application can be sent URIs to open.

    Parameters:
    • callback <Function(String)>

      Function to be called with the current list of uris to open

    ScreenOrientation <Object> (static)
    runtime-api.js:209

    Enumeration of the available types of ScreenOrientation.

    Values:

    Landscape: The application screen is in landscape mode
                    
                    InvertedLandscape: The application screen is in inverted landscape mode
                    
                    Portrait: The application screen is in portrait mode
                    
                    InvertedPortrait: The application screen is in inverted portrait mode
                    
                    Unknown: The application screen is in an unknown mode
    Example
    var api = external.getUnityObject('1.0');
                    var orientation = api.RuntimeApi.ScreenOrientation;
                    // use orientation.Landscape or orientation.Portrait
    ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/index.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/client/index.handl0000644000015600001650000000006712645740734033415 0ustar pbuserpbgroup00000000000000

    Welcome to Ubuntu Runtime Javascript API Docs

    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/backend/0000755000015600001650000000000012645741276031406 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/backend/runtime-api.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/runtime-api/backend/runtime-ap0000644000015600001650000001374112645740734033416 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ .import Ubuntu.UnityWebApps 0.1 as UnityWebAppsBridge .import Ubuntu.Components 0.1 as ComponentsBridge /** * * Runtime API backend binding * */ function createRuntimeApi(backendDelegate) { var PLUGIN_URI = 'Ubuntu.UnityWebApps'; var VERSION = 0.1; var applicationApiInstance = UnityWebAppsBridge.ApplicationApi; function Application() { // no need to have a specific id since this class is mostly a passtrough one this._id = 0; }; Application.prototype = { // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'RuntimeApi', objecttype: 'Application', objectid: this._id, content: { name: applicationApiInstance.applicationName, platform: applicationApiInstance.applicationPlatform, writableLocation: applicationApiInstance.applicationDataPath, screenOrientation: applicationApiInstance.screenOrientation, inputMethodName: applicationApiInstance.getInputMethodName(), } } }, getApplicationName: function(callback) { if (callback && typeof(callback) === 'function') callback(applicationApiInstance.applicationName); }, onApplicationNameChanged: function(callback) { if (callback && typeof(callback) === 'function') applicationApiInstance.applicationNameChanged.connect(function() { callback(applicationApiInstance.applicationName); }); }, getApplicationWritableLocation: function(callback) { if (callback && typeof(callback) === 'function') callback(applicationApiInstance.applicationDataPath); }, getPlatformInfo: function(callback) { if (callback && typeof(callback) === 'function') { var info = {}; info.name = applicationApiInstance.applicationPlatform; callback(info); } }, setInputMethodVisible: function(visible, callback) { applicationApiInstance.setInputMethodVisible(visible); if (callback && typeof(callback) === 'function') callback(); }, getInputMethodName: function(callback) { if (callback && typeof(callback) === 'function') callback(applicationApiInstance.getInputMethodName()); }, onInputMethodVisibilityChanged: function(callback) { if (callback && typeof(callback) === 'function') Qt.inputMethod.onVisibleChanged.connect(function() { callback(Qt.inputMethod.visible) }); }, onAboutToQuit: function(callback) { if (callback && typeof(callback) === 'function') applicationApiInstance.applicationAboutToQuit.connect(function(killed) { callback(killed); }); }, setupUriHandler: function(callback) { if (callback && typeof(callback) === 'function') var urihandler = ComponentsBridge.UriHandler; urihandler.opened.connect(function(uris, data) { var translatedUris = [] for (var idx in uris) { translatedUris.push(uris[idx]) } callback(translatedUris); }); }, onDeactivated: function(callback) { if (callback && typeof(callback) === 'function') applicationApiInstance.applicationDeactivated.connect(callback); }, onActivated: function(callback) { if (callback && typeof(callback) === 'function') applicationApiInstance.applicationActivated.connect(callback); }, getScreenOrientation: function(callback) { if (callback && typeof(callback) === 'function') callback(applicationApiInstance.screenOrientation); }, onScreenOrientationChanged: function(callback) { if (callback && typeof(callback) === 'function') applicationApiInstance.applicationScreenOrientationChanged.connect(callback); }, }; function _constructorFromName(className) { var constructorPerName = { "Application": Application, }; return className in constructorPerName ? constructorPerName[className] : null; } return { getApplication: function(callback) { var application = new Application(); callback(application.serialize()); }, // Internal dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; var objectid = infos.objectid; var class_name = infos.class_name; if (callback) args.push(callback); var Constructor = _constructorFromName(class_name); var instance = new Constructor(objectid); instance[method_name].apply(instance, args); } }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-build.sh0000755000015600001650000000061312645740734030513 0ustar pbuserpbgroup00000000000000#/bin/bash set -e for api in alarm-api content-hub online-accounts runtime-api ; do echo $api cd $api/client mv ../../yuidoc-theme/partials/index.handlebars index.handlebars.orig cp index.handlebars ../../yuidoc-theme/partials/ rm -rf ./docsbuild yuidoc -c yuidoc.json . mv index.handlebars.orig ../../yuidoc-theme/partials/index.handlebars cd ../.. done; exit 0 unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/0000755000015600001650000000000012645741276030161 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/0000755000015600001650000000000012645741276032000 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/events.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/events.h0000644000015600001650000000234412645740734033456 0ustar pbuserpbgroup00000000000000
    `{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}}
    `{{file}}:{{line}}` {{{eventDescription}}} {{#if params}} Extra event object properties:
      {{#params}}
    • {{#if optional}} `[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]` <{{#crossLink type}}{{/crossLink}}> {{else}} `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{/if}} {{#if multiple}} (*..n) {{/if}} {{{description}}} {{#if props}}
        {{#props}}
      • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}} {{/props}}
      {{/if}}
    • {{/params}}
    {{/if}}
    ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/sidebar.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/sidebar.0000644000015600001650000000474212645740734033417 0ustar pbuserpbgroup00000000000000 {{#if methods}} {{/if}} {{#if events}} {{/if}} {{#if props}} {{/if}} {{#if attributes}} {{/if}} {{#if fileTree}} {{/if}} ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/props.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/props.ha0000644000015600001650000000062712645740734033460 0ustar pbuserpbgroup00000000000000
    `{{name}}` <{{#crossLink type}}{{/crossLink}}>{{#if final}} (final){{/if}}{{#if static}} (static){{/if}}
    `{{file}}:{{line}}` {{{propertyDescription}}} {{#if example}}
    Example
    {{{example}}} {{/if}}
    ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/module.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/module.h0000644000015600001650000000155012645740734033435 0ustar pbuserpbgroup00000000000000

    {{moduleName}}

    {{{moduleDescription}}}
    {{#if moduleClasses}}

    This module has the following classes:

    {{/if}}
    {{#if subModules}}

    This module has the following submodules:

    {{/if}}


    Module description found: `{{file}}:{{line}}` ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/attrs.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/attrs.ha0000644000015600001650000000257512645740734033456 0ustar pbuserpbgroup00000000000000
    `{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}}
    `{{file}}:{{line}}` {{{attrDescription}}} {{#if emit}}
    Fires: `{{name}}Change(e)`

    Fires when the value for the configuration attribute `{{name}}` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

    Parameters:
    `e` <EventFacade> An Event Facade object with the following attribute specific properties added:
    • `prevVal` The value of the attribute, prior to it being set
    • `newVal` The value the attribute is to be set to
    • `attrName` The name of the attribute being set
    • `subAttrName` If setting a property within the attribute's value, the name of the sub-attribute property being set
    {{/if}}
    ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/files.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/files.ha0000644000015600001650000000012412645740734033407 0ustar pbuserpbgroup00000000000000

    {{fileName}}

    {{fileData}}
    
    ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/index.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/index.ha0000644000015600001650000000002112645740734033410 0ustar pbuserpbgroup00000000000000

    Welcome

    ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/classes.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/classes.0000644000015600001650000000324112645740734033434 0ustar pbuserpbgroup00000000000000

    Class {{moduleName}}

    {{#if uses}} Uses: {{#each uses}} {{this}} {{/each}}
    {{/if}} {{#if extension_for}} Extension For: {{#each extension_for}} {{this}} {{/each}}
    {{/if}} {{#if extends}} Extends: {{#crossLink extends}}{{/crossLink}}
    {{/if}} Class defined in: `{{file}}:{{line}}`
    {{{classDescription}}}
    {{#if is_constructor}} {{#is_constructor}} {{>method}} {{/is_constructor}} {{/if}}
    {{#if methods}}
    {{#methods}} {{>method}} {{/methods}}
    {{/if}} {{#if properties}}
    {{#properties}} {{>props}} {{/properties}}
    {{/if}} {{#if attrs}}
    {{#attrs}} {{>attrs}} {{/attrs}}
    {{/if}} {{#if events}}
    {{#events}} {{>events}} {{/events}}
    {{/if}}
    ././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/method.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/partials/method.h0000644000015600001650000000423412645740734033432 0ustar pbuserpbgroup00000000000000
    {{#if final}}final {{/if}}{{#if returnType}}{{#crossLink returnType}}{{/crossLink}} {{/if}}`{{name}}`( `{{paramsList}} ` ) {{#if access}}`/* {{access}} method */`{{/if}}
    {{#if overwritten_from}} Defined in {{overwritten_from/class}} but overwritten locally: {{else}} {{#if extended_from}} Defined in {{extended_from}}: {{/if}} {{/if}} `{{file}}:{{line}}`
    {{{methodDescription}}} {{#if params}} Parameters:
      {{#params}}
    • {{#if optional}} `[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]` <{{#crossLink type}}{{/crossLink}}> {{else}} `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{/if}} {{#if multiple}} (*..n) {{/if}} {{{description}}} {{#if props}}
        {{#props}}
      • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}} {{#if props}}
          {{#props}}
        • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}}
        • {{/props}}
        {{/if}}
      • {{/props}}
      {{/if}}
    • {{/params}}
    {{/if}} {{#if return}} {{#return}}
    Returns: {{#if type}}<{{#crossLink type}}{{/crossLink}}> {{/if}}{{{description}}}
    {{/return}} {{/if}} {{#if example}}
    Example
    {{{example}}} {{/if}}
    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/.zip0000644000015600001650000000046212645740734030764 0ustar pbuserpbgroup00000000000000PKiGDy_ yuidoc.jsonUT JRJRux RT%+ФҼR_SO%|JjqrQfAIf~6eV ^e`% iEP2ǂbAeEPC a```iIJfH~RifN T5X$#57*]Y R+PKiGDy_ yuidoc.jsonUTJRux PKQunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/layouts/0000755000015600001650000000000012645741276031661 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/layouts/main.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/layouts/main.hand0000644000015600001650000000227612645740734033446 0ustar pbuserpbgroup00000000000000 {{htmlTitle}}
    API Docs for: {{projectVersion}}
    {{>layout_content}}
    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/theme.json0000644000015600001650000000025512645740734032156 0ustar pbuserpbgroup00000000000000{ "yuiGridsUrl": "http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css", "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js" } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/0000755000015600001650000000000012645741276031463 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/js/0000755000015600001650000000000012645741276032077 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/js/tabs.js0000644000015600001650000000537412645740734033375 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/js/yui-prettify.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/js/yui-pre0000644000015600001650000000377512645740734033426 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/0000755000015600001650000000000012645741276032253 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/main.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/main.c0000644000015600001650000002421212645740734033342 0ustar pbuserpbgroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
       blocks. */
    pre code, pre kbd, pre samp { font-size: 100%; }
    
    /* Used to denote text that shouldn't be selectable, such as line numbers or
       shell prompts. Guess which browser this doesn't work in. */
    .noselect {
        -moz-user-select: -moz-none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    
    /* -- Lists ----------------------------------------------------------------- */
    dd { margin: 0.2em 0 0.7em 1em; }
    dl { margin: 1em 0; }
    dt { font-weight: bold; }
    
    /* -- Tables ---------------------------------------------------------------- */
    caption, th { text-align: left; }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    td, th {
        border: 1px solid #fff;
        padding: 5px 12px;
        vertical-align: top;
    }
    
    td { background: #E6E9F5; }
    td dl { margin: 0; }
    td dl dl { margin: 1em 0; }
    td pre:first-child { margin-top: 0; }
    
    th {
        background: #D2D7E6;/*#97A0BF*/
        border-bottom: none;
        border-top: none;
        color: #000;/*#FFF1D5*/
        font-family: 'Trebuchet MS', sans-serif;
        font-weight: bold;
        line-height: 1.3;
        white-space: nowrap;
    }
    
    
    /* -- Layout and Content ---------------------------------------------------- */
    #doc {
        margin: auto;
        min-width: 1024px;
    }
    
    #main { width: 754px; }
    #sidebar { width: 270px; margin: 0 15px; }
    
    .content { padding: 0 20px 0 25px; }
    
    /* -- Sidebar --------------------------------------------------------------- */
    .sidebox {
        background: #F9F9FC;/*E6E9F5*/
        border: 1px solid #D4D8EB;
    
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
        margin: 0 0 15px 0;
        padding-bottom: 1px;
    }
    
    .sidebox h2 {
        background: #E5E6F1;
        -moz-border-radius: 4px 4px 0 0;
        -webkit-border-radius: 4px 4px 0 0;
        border-radius: 4px 4px 0 0;
        color: #5E6BA4;
        font-weight: bold;
        font-size: 107.692%;
        margin: 0;
        padding: 4px 7px 5px;
    }
    
    .sidebox .bd {
        font-size: 84.615%;
        padding: 0 5px 0 8px;
    }
    
    .sidebox li { list-style-type: disc; color:#D4D5E3; }
    
    .sidebox ol, .sidebox ul {
        margin-left: 0;
        padding-left: 16px;
    }
    
    .sidebox ol ol, .sidebox ol ul,
    .sidebox ul ol, .sidebox ul ul {
        margin: 0;
        padding-left: 16px;
    }
    
    /* -- Table of Contents ----------------------------------------------------- */
    
    /* The #toc id refers to the single global table of contents, while the .toc
       class refers to generic TOC lists that could be used throughout the page. */
    
    .toc code, .toc kbd, .toc samp { font-size: 100%; }
    .toc li { font-weight: bold; }
    .toc li li { font-weight: normal; }
    
    /* -- Intro and Example Boxes ----------------------------------------------- */
    .intro, .example { margin-bottom: 2em; }
    
    .example {
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 5px #bfbfbf;
        -webkit-box-shadow: 0 0 5px #bfbfbf;
        box-shadow: 0 0 5px #bfbfbf;
        padding: 1em;
    }
    
    .intro {
        background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    }
    
    /* -- Other Styles ---------------------------------------------------------- */
    
    /* These are probably YUI-specific, and should be moved out of Selleck's default
       theme. */
    
    .button {
        border: 1px solid #dadada;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        color: #444;
        display: inline-block;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 92.308%;
        font-weight: bold;
        padding: 4px 13px 3px;
        -moz-text-shadow: 1px 1px 0 #fff;
        -webkit-text-shadow: 1px 1px 0 #fff;
        text-shadow: 1px 1px 0 #fff;
        white-space: nowrap;
    
        background: #EFEFEF; /* old browsers */
        background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    }
    
    .button:hover {
        border-color: #466899;
        color: #fff;
        text-decoration: none;
        -moz-text-shadow: 1px 1px 0 #222;
        -webkit-text-shadow: 1px 1px 0 #222;
        text-shadow: 1px 1px 0 #222;
    
        background: #6396D8; /* old browsers */
        background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    }
    
    .newwindow { text-align: center; }
    
    .header .version em {
        display: block;
        text-align: right;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        background-color: transparent;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        border: none;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DEDCD9;
        border-right: 1px solid #CDCBC8;
        border-left: 1px solid #CDCBC8;
        border-top: 1px solid #DADADA;
        color: #333333;
        text-decoration: none;
    }
    .yui3-skin-sam .yui3-tabview .yui3-tab-label,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
        border: none;
        background: none;
        font-size: 100%;
        color: #000;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: none;
        background-color: #fff;
        border-bottom-color: #FFFFFF;
        border-top: 2px solid #8193C9;
        font-weight: bold;
        color: #000;
    
    }
    
    .yui3-skin-sam .yui3-tabview-list {
        border-color: #DFDFDF;
        border-width: 0 0 1px; 
    }
    
    
    a.external {
        background-image: url(external-small.png);
        background-repeat: no-repeat;
        background-position: 0 0;
        padding-left: 16px;
    }
    
    #classdocs .item {
        border-bottom: 1px solid #466899;
        margin: 1em 0;
        padding: 1.5em;
    }
    
    #classdocs .item .params p,
        #classdocs .item .returns p,{
        display: inline;
    }
    
    #classdocs .item em code, #classdocs .item em.comment {
        color: green;
    }
    
    #classdocs .item em.comment a {
        color: green;
        text-decoration: underline;
    }
    
    #classdocs .foundat {
        font-size: 11px;
        font-style: normal;
    }
    
    .attrs .emits {
        margin-left: 2em;
        padding: .5em;
        border-left: 1px dashed #ccc;
    }
    
    abbr {
        border-bottom: 1px dashed #ccc;
        font-size: 80%;
        cursor: help;
    }
    
    .prettyprint li.L0, 
    .prettyprint li.L1, 
    .prettyprint li.L2, 
    .prettyprint li.L3, 
    .prettyprint li.L5, 
    .prettyprint li.L6, 
    .prettyprint li.L7, 
    .prettyprint li.L8 {
        list-style: decimal;
    }
    
    ul li p {
        margin-top: 0;
    }
    
    .method .name {
        font-size: 110%;
    }
    
    #hd {
        background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DFDFDF;
        padding: 0 15px 1px 20px;
        margin-bottom: 15px;
    }
    
    #hd img {
        margin-right: 10px;
        vertical-align: middle;
    }
    
    ././@LongLink0000000000000000000000000000014700000000000011217 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/logo.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/logo.p0000644000015600001650000000135512645740734033376 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDR=29PLTEvO_1S#ƶl{]j@H9	pHYstIME
    &	fEGIDAThv eQ;,.i]	9=Ï	QxBHB$$!	IȿTobH
    L,LAJ!z2@{}q%>D*()29zfv0v'xY|~2ܾHIȔdY.Ҭ$FH[62MT%a>$XmSUhiKY.kUdYps6#È+ټV`HU2z/[Y
    ̷]PT&[o^|ߗuǞl 5e]6UǶEu<*5d+BoIHB$$!	JnɒőIENDB`././@LongLink0000000000000000000000000000016100000000000011213 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/external-small.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/css/extern0000644000015600001650000000075312645740734033506 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb?%B@,0]VVV0affȊ=8JOy %pJջ+30¿}sʋ`n|dx
    mXa |ȹWpA+ca|u=zϰp-l\w01nCy?*Yr%cfxÿ8
    `g2ȉ0!GA[EV66>Ӏ'E]AOCAY^#.S>>#񶉝
    "ÏOv%w@FX^`ddR|8 wX
    	 OƓIENDB`unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/0000755000015600001650000000000012645741276032760 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015300000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000755000015600001650000000000012645741276033467 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016200000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/COPYINGunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000644000015600001650000002613612645740734033477 0ustar  pbuserpbgroup00000000000000
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    ././@LongLink0000000000000000000000000000017200000000000011215 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/prettify-min.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000644000015600001650000004564712645740734033507 0ustar  pbuserpbgroup00000000000000/*
     * Copyright 2011 Yahoo! Inc.
     * All rights reserved.
     *-
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *     * Redistributions of source code must retain the above copyright
     *       notice, this list of conditions and the following disclaimer.
     *     * Redistributions in binary form must reproduce the above copyright
     *       notice, this list of conditions and the following disclaimer in the
     *       documentation and/or other materials provided with the distribution.
     *     * Neither the name of the Yahoo! Inc. nor the
     *       names of its contributors may be used to endorse or promote products
     *       derived from this software without specific prior written permission.
     *-
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
     * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
    ././@LongLink0000000000000000000000000000017300000000000011216 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/prettify-min.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000644000015600001650000000124312645740734033467 0ustar  pbuserpbgroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}././@LongLink0000000000000000000000000000016700000000000011221 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/CHANGES.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000644000015600001650000001370412645740734033474 0ustar  pbuserpbgroup00000000000000
      
        
        Change Log
      
      
        README
    
        

    Known Issues

    • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
    • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

    Change Log

    29 March 2007

    • Added tests for PHP support to address issue 3.
    • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
    • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
    • Fixed bug: was eating tabs (test)
    • Fixed entity handling so that the caveat

      Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

      is no longer applicable.
    • Added noisefree's C# patch
    • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

    4 Jul 2008

    • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
    • Fixed bug: python handling of '''string'''
    • Fixed bug: / in regex [charsets] should not end regex

    5 Jul 2008

    • Defined language extensions for Lisp and Lua

    14 Jul 2008

    • Language handlers for F#, OCAML, SQL
    • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

    6 Jan 2009

    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
    • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
    • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

    21 May 2009

    • Rewrote to improve performance on large files. See benchmarks.
    • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

    14 August 2009

    • Fixed prettifying of <code> blocks with embedded newlines.

    3 October 2009

    • Fixed prettifying of XML/HTML tags that contain uppercase letters.

    19 July 2010

    • Added support for line numbers. Bug 22
    • Added YAML support. Bug 123
    • Added VHDL support courtesy Le Poussin.
    • IE performance improvements. Bug 102 courtesy jacobly.
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • Fixed copy and paste in IE[678].
    • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
    ././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/prettify/README.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/yuidoc-theme/assets/vendor/pre0000644000015600001650000001735012645740734033475 0ustar pbuserpbgroup00000000000000 Javascript code prettifier Languages : CH

    Javascript code prettifier

    Setup

    1. Download a distribution
    2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
      <link href="prettify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="prettify.js"></script>
    3. Add onload="prettyPrint()" to your document's body tag.
    4. Modify the stylesheet to get the coloring you prefer

    Usage

    Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
    The original Prettier
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }

    FAQ

    Which languages does it work for?

    The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

    LISPy languages are supported via an extension: lang-lisp.js.

    And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

    If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

    How do I specify which language my code is in?

    You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

    <pre class="prettyprint lang-html">
      The lang-* class specifies the language file extensions.
      File extensions supported by default include
        "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
        "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
        "xhtml", "xml", "xsl".
    </pre>

    It doesn't work on <obfuscated code sample>?

    Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

    Which browsers does it work with?

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

    What's changed?

    See the change log

    Why doesn't Prettyprinting of strings work on WordPress?

    Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

    This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

    How do I put line numbers in my code?

    You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

    For example

    <pre class="prettyprint linenums:4"
    >// This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    <pre>
    produces
    // This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    

    How do I prevent a portion of markup from being marked as code?

    You can use the nocode class to identify a span of markup that is not code.

    <pre class=prettyprint>
    int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
      Continuation of comment */
    int y = bar();
    </pre>
    produces
    int x = foo();  /* This is a comment  This is not code
      Continuation of comment */
    int y = bar();
    

    For a more complete example see the issue22 testcase.

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

    addEventListener('load', prettyPrint, false);
    wrap it in a closure like
    addEventListener('load', function (event) { prettyPrint() }, false);
    so that the browser does not pass an event object to prettyPrint which will confuse it.


    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/0000755000015600001650000000000012645741276030013 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/0000755000015600001650000000000012645741276031271 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/yuidoc.json0000644000015600001650000000034712645740734033462 0ustar pbuserpbgroup00000000000000{ "name": "Content Hub JS API", "description": "Ubuntu App Platform Content Hub JavaScript API docs", "version": "0.1", "options": { "outdir": "./docsbuild", "themedir": "../../yuidoc-theme" } } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/0000755000015600001650000000000012645741276033241 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/data.jsonunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/d0000644000015600001650000010671012645740734033412 0ustar pbuserpbgroup00000000000000{ "project": { "name": "Content Hub JS API", "description": "Ubuntu App Platform Content Hub JavaScript API docs", "version": "0.1" }, "files": { "content-hub.js": { "name": "content-hub.js", "modules": { "ContentHub": 1 }, "classes": { "ContentTransfer": 1, "ContentPeer": 1, "ContentStore": 1, "ContentHub": 1 }, "fors": {}, "namespaces": {} } }, "modules": { "ContentHub": { "name": "ContentHub", "submodules": {}, "classes": { "ContentTransfer": 1, "ContentPeer": 1, "ContentStore": 1, "ContentHub": 1 }, "fors": {}, "namespaces": {}, "tag": "module", "file": "content-hub.js", "line": 568, "description": "ContentHub is the entry point to resource io transfer\n from/to remote applications (peers)." } }, "classes": { "ContentTransfer": { "name": "ContentTransfer", "shortname": "ContentTransfer", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "ContentHub", "namespace": "", "file": "content-hub.js", "line": 11, "description": "ContentTransfer is an object created by the ContentHub to\n and allows one to properly setup and manage a data\n transfer between two peers.", "is_constructor": 1, "example": [ "\n\n var api = external.getUnityObject('1.0');\n var hub = api.ContentHub;\n\n var pictureContentType = hub.ContentType.Pictures;\n\n hub.defaultSourceForType(\n pictureContentType\n , function(peer) {\n hub.importContentForPeer(\n pictureContentType,\n peer,\n function(transfer) {\n [setup the transfer options and store]\n transfer.start(function(state) { [...] });\n });\n });" ] }, "ContentPeer": { "name": "ContentPeer", "shortname": "ContentPeer", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "ContentHub", "namespace": "", "file": "content-hub.js", "line": 230, "description": "ContentPeer is an object returned by the ContentHub.\n It represents a remote peer that can be used in a request\n to import, export or share content.", "is_constructor": 1, "example": [ "\n\n var api = external.getUnityObject('1.0');\n var hub = api.ContentHub;\n\n var pictureContentType = hub.ContentType.Pictures;\n\n hub.defaultSourceForType(\n pictureContentType\n , function(peer) {\n [do something with the peer]\n });" ] }, "ContentStore": { "name": "ContentStore", "shortname": "ContentStore", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "ContentHub", "namespace": "", "file": "content-hub.js", "line": 456, "description": "ContentStore is an object returned by the ContentHub.\n\n It represents a location where the resources imported or\n exported from a peer during a transfer operation are to be\n either saved or found.", "is_constructor": 1, "example": [ "\n\n var api = external.getUnityObject('1.0');\n var hub = api.ContentHub;\n\n var pictureContentType = hub.ContentType.Pictures;\n\n hub.defaultStoreForType(pictureContentType, function(store) {\n [do something with the store]\n });" ] }, "ContentHub": { "name": "ContentHub", "shortname": "ContentHub", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "ContentHub", "namespace": "", "file": "content-hub.js", "line": 568, "description": "The ContentHub object.", "static": 1, "is_constructor": 1 } }, "classitems": [ { "file": "content-hub.js", "line": 64, "description": "Retrieves the current store.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "store", "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 79, "description": "Sets the current store for the ContentTransfer.", "itemtype": "method", "name": "setStore", "params": [ { "name": "store", "description": "", "type": "ContentStore" }, { "name": "callback", "description": "(optional) called when the store has been updated", "type": "Function()" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 90, "description": "Retrieves the current state.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "state", "params": [ { "name": "callback", "description": "(optional)", "type": "Function(ContentTransfer.State)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 105, "description": "Sets the state of the transfer.", "itemtype": "method", "name": "setState", "params": [ { "name": "state", "description": "", "type": "ContentTransfer.State" }, { "name": "callback", "description": "called when the state has been updated", "type": "Function()" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 115, "description": "Notifies the listener when the state of the transfer changes.", "itemtype": "method", "name": "onStateChanged", "params": [ { "name": "callback", "description": "", "type": "Function(ContentTransfer.State)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 125, "description": "Retrieves the current selection type.", "itemtype": "method", "name": "selectionType", "params": [ { "name": "callback", "description": "", "type": "Function(ContentTransfer.SelectionType)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 138, "description": "Sets the selection type (single or multiple).", "itemtype": "method", "name": "setSelectionType", "params": [ { "name": "selectionType", "description": "", "type": "ContentTransfer.SelectionType" }, { "name": "callback", "description": "called when the state has been updated", "type": "Function()" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 150, "description": "Retrieves the current transfer direction.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "direction", "params": [ { "name": "callback", "description": "(optional)", "type": "Function(ContentTransfer.Direction)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 165, "description": "Sets the transfer direction (import or export).", "itemtype": "method", "name": "setDirection", "params": [ { "name": "direction", "description": "", "type": "ContentTransfer.Direction" }, { "name": "callback", "description": "called when the state has been updated", "type": "Function()" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 177, "description": "Retrieves the list of items associated with the ContentTransfer.", "itemtype": "method", "name": "items", "params": [ { "name": "callback", "description": "} )}", "type": "Function( Objectname: , url:" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 186, "description": "Sets the list of items for the associated ContentTransfer (used when exporting).", "itemtype": "method", "name": "setItems", "params": [ { "name": "items", "description": "}", "type": "Array of Objectname: String, url: String" }, { "name": "callback", "description": "called when the state has been updated", "type": "Function()" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 199, "description": "Starts a transfer", "itemtype": "method", "name": "start", "params": [ { "name": "callback", "description": "", "type": "Function(ContentTransfer.State)" } ], "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 209, "description": "Sets State to ContentTransfer.Finalized and cleans up temporary files.", "itemtype": "method", "name": "finalize", "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 220, "description": "Destroys the remote object. This proxy object is not valid anymore.", "itemtype": "method", "name": "destroy", "class": "ContentTransfer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 281, "description": "Retrieves the app Id of the associated peer.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "appId", "return": { "description": "Application Id for this peer", "type": "String" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 297, "description": "Sets the app Id of the associated peer.", "itemtype": "method", "name": "setAppId", "params": [ { "name": "appId", "description": "", "type": "String" }, { "name": "callback", "description": "called when the appId has been updated", "type": "Function()" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 308, "description": "Retrieves the specific ContentHandler for this peer.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "handler", "return": { "description": "ContentHandler for this peer", "type": "String" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 324, "description": "Sets specific ContentHandler for this peer.", "itemtype": "method", "name": "setHandler", "params": [ { "name": "handler", "description": "", "type": "ContentHandler" }, { "name": "callback", "description": "called when the appId has been updated", "type": "Function()" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 335, "description": "Retrieves the specific ContentType for this peer.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "contentType", "return": { "description": "ContentType for this peer", "type": "String" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 351, "description": "Sets specific ContentType for this peer.", "itemtype": "method", "name": "setContentType", "params": [ { "name": "contentType", "description": "", "type": "ContentType" }, { "name": "callback", "description": "called when the content type has been updated", "type": "Function()" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 362, "description": "Retrieves the specific SelectionType for this peer.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "selectionType", "return": { "description": "ContentTransfer.SelectionType for this peer", "type": "String" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 378, "description": "Sets specific SelectionType for this peer.", "itemtype": "method", "name": "setSelectionType", "params": [ { "name": "selectionType", "description": "", "type": "ContentTransfer.SelectionType" }, { "name": "callback", "description": "called when the content type has been updated", "type": "Function()" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 389, "description": "Retrieves the name of the associated peer.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "name", "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 405, "description": "Returns true if the peer is a default one, false otherwise.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "isDefaultPeer", "params": [ { "name": "callback", "description": "(optional)", "type": "Function(Bool)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 423, "description": "Request to exchange content with this ContentPeer.", "itemtype": "method", "name": "request", "params": [ { "name": "callback", "description": "Called with the resulting content transfer", "type": "Function(ContentTransfer)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 433, "description": "Request to import content from this ContentPeer and use a ContentStore for permanent storage.", "itemtype": "method", "name": "requestForStore", "params": [ { "name": "store", "description": "Store used as a permanent storage", "type": "ContentStore" }, { "name": "callback", "description": "Called with the resulting content transfer", "type": "Function(ContentTransfer)" } ], "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 446, "description": "Destroys the remote object. This proxy object is not valid anymore.", "itemtype": "method", "name": "destroy", "class": "ContentPeer", "module": "ContentHub" }, { "file": "content-hub.js", "line": 501, "description": "Retrieves the uri of the associated store.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "uri", "return": { "description": "current uri", "type": "String" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(String)" } ], "class": "ContentStore", "module": "ContentHub" }, { "file": "content-hub.js", "line": 518, "description": "Retrieves the current scope.\n\nIf the callback parameter is not set, the current \"local\" value is retrieved.", "itemtype": "method", "name": "scope", "return": { "description": "current scope", "type": "ContentScope" }, "params": [ { "name": "callback", "description": "(optional)", "type": "Function(ContentScope)" } ], "class": "ContentStore", "module": "ContentHub" }, { "file": "content-hub.js", "line": 534, "description": "Sets the current scope.", "itemtype": "method", "name": "setScope", "params": [ { "name": "scope", "description": "", "type": "ContentScope" }, { "name": "callback", "description": "called when the scope has been updated", "type": "Function()" } ], "class": "ContentStore", "module": "ContentHub" }, { "file": "content-hub.js", "line": 547, "description": "Destroys the remote object. This proxy object is not valid anymore.", "itemtype": "method", "name": "destroy", "class": "ContentStore", "module": "ContentHub" }, { "file": "content-hub.js", "line": 576, "description": "ContentType is an enumeration of well known content types.\n\n Values:\n\n Pictures\n\n Documents\n \n Music\n\n Contacts\n\n Videos\n\n Links", "static": 1, "itemtype": "property", "name": "ContentType", "type": "String", "example": [ "\n\n var api = external.getUnityObject('1.0');\n var hub = api.ContentHub;\n\n var pictureContentType = hub.ContentType.Pictures;" ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 614, "description": "ContentHandler is an enumeration of well known content handlers.\n\n Values:\n\n Source\n\n Destination\n\n Share", "static": 1, "itemtype": "property", "name": "ContentHandler", "type": "String", "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 634, "description": "ContentScope is an enumeration of well known scope types.\n\n Values:\n\n System\n\n User\n\n App", "static": 1, "itemtype": "property", "name": "ContentScope", "type": "String", "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 656, "description": "ContentTransfer.State is an enumeration of the state of a given ongoing ContentTransfer.\n\n Values:\n\n Created: Transfer created, waiting to be initiated.\n\n Initiated: Transfer has been initiated.\n\n InProgress: Transfer is in progress.\n\n Charged: Transfer is charged with items and ready to be collected.\n\n Collected: Items in the transfer have been collected.\n\n Aborted: Transfer has been aborted.\n\n Finalized: Transfer has been finished and cleaned up.\n\n Downloaded: Download specified by downloadId has completed.\n\n Downloading: Transfer is downloading item specified by downloadId.", "static": 1, "itemtype": "property", "name": "ContentTransfer.State", "type": "String", "example": [ "\n\n var api = external.getUnityObject('1.0');\n var hub = api.ContentHub;\n\n var transferState = hub.ContentTransfer.State;\n var pictureContentType = hub.ContentType.Pictures;\n\n hub.importContentForPeer(\n pictureContentType,\n peer,\n function(transfer) {\n hub.defaultStoreForType(pictureContentType, function(store) {\n transfer.setStore(store, function() {\n transfer.start(function(state) {\n if (transferState.Aborted === state) {\n [...]\n }\n [...]\n });\n });\n });\n });\n" ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 736, "description": "ContentTransfer.Direction is an enumeration of the directions of a given ContentTransfer.\n\n Values:\n\n Import\n\n Export\n\n Share", "static": 1, "itemtype": "property", "name": "ContentTransfer.Direction", "type": "String", "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 761, "description": "ContentTransfer.SelectionType is an enumeration of the directions of a given ContentTransfer.\n\n Values:\n\n Single: Transfer should contain a single item\n\n Multiple: Transfer can contain multiple items", "static": 1, "itemtype": "property", "name": "ContentTransfer.SelectionType", "type": "String", "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 782, "description": "Creates a ContentPeer object for the given source type.", "itemtype": "method", "name": "getPeers", "params": [ { "name": "filters", "description": "A dictionary of parameters to filter the result. The filtering keys are:\n- contentType: desired ContentType\n- handler: desired ContentHandler", "type": "Object" }, { "name": "callback", "description": "Callback that receives the result or null", "type": "Function(List of ContentPeer objects)" } ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 798, "description": "Creates a ContentStore object for the given scope type.", "itemtype": "method", "name": "getStore", "params": [ { "name": "scope", "description": "The content scope for the store", "type": "ContentScope" }, { "name": "callback", "description": "Callback that receives the result or null", "type": "Function(ContentStore)" } ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 811, "description": "Launches the content peer picker ui that allows the user to select a peer.", "itemtype": "method", "name": "launchContentPeerPicker", "params": [ { "name": "filters", "description": "A dictionary of parameters to filter the result. The filtering keys are:\n- contentType: desired ContentType\n- handler: desired ContentHandler\n- showTitle: boolean value indicating if the title should be visible", "type": "Object" }, { "name": "onPeerSelected", "description": "Called when the user has selected a peer", "type": "Function(ContentPeer)" }, { "name": "onCancelPressed", "description": "Called when the user has pressed cancel", "type": "Function()" } ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 827, "description": "Sets a handler that is to be called when the current application is the\ntarget of an export request.", "itemtype": "method", "name": "onExportRequested", "params": [ { "name": "callback", "description": "Function when one requests a resource to be exported.\n The corresponding ContentTransfer is provided as a parameter.", "type": "Function(ContentTransfer)" } ], "example": [ "\n \n var api = external.getUnityObject(1.0);\n var hub = api.ContentHub;\n \n var transferState = hub.ContentTransfer.State;\n \n function _exportRequested(transfer) {\n var url = window.location.href;\n url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png';\n \n transfer.setItems([{name: 'Ubuntu One', url: url}],\n function() {\n transfer.setState(hub.ContentTransfer.State.Charged);\n });\n };\n \n hub.onExportRequested(_exportRequested);\n " ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 860, "description": "Sets a handler that is to be called when the current application is the\ntarget of an share request.", "itemtype": "method", "name": "onShareRequested", "params": [ { "name": "callback", "description": "Function when one requests a resource to be shared.\n The corresponding ContentTransfer is provided as a parameter.", "type": "Function(ContentTransfer)" } ], "example": [ "\n\n var api = external.getUnityObject(1.0);\n var hub = api.ContentHub;\n\n var transferState = hub.ContentTransfer.State;\n\n function _shareRequested(transfer) {\n };\n\n hub.onShareRequested(_shareRequested);\n" ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 886, "description": "Sets a handler that is to be called when the current application is the\ntarget of an import request.", "itemtype": "method", "name": "onImportRequested", "params": [ { "name": "callback", "description": "Function when one requests a resource to be imported.\n The corresponding ContentTransfer is provided as a parameter.", "type": "Function(ContentTransfer)" } ], "example": [ "\n\n var api = external.getUnityObject(1.0);\n var hub = api.ContentHub;\n\n var transferState = hub.ContentTransfer.State;\n\n function _importRequested(transfer) {\n };\n\n hub.onImportRequested(_importRequested);\n" ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 914, "description": "Creates a ContentStore object for the given ContentPeer.", "itemtype": "method", "name": "api.importContent", "params": [ { "name": "type", "description": "type of the content to import", "type": "ContentType" }, { "name": "peer", "description": "peer who's content should be imported", "type": "ContentPeer" }, { "name": "transferOptions", "description": "a dictionary of transfer options. The options are the following:\n- multipleFiles {Bool}: specified if a transfer should involve multiple files or not\n- scope {ContentScope}: specifies the location where the transferred files should be copied to", "type": "Object" }, { "name": "onError", "description": "called when the transfer has failed", "type": "Function(reason:)" }, { "name": "onSuccess", "description": ")} called when the transfer has been a success and items are available", "type": "Function(Array of ContentItem" } ], "class": "ContentHub", "module": "ContentHub" }, { "file": "content-hub.js", "line": 934, "access": "private", "tagname": "", "class": "ContentHub", "module": "ContentHub" } ], "warnings": [ { "message": "Missing item type", "line": " content-hub.js:934" } ] }././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/modules/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/m0000755000015600001650000000000012645741276033416 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/modules/ContentHub.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/m0000644000015600001650000000657712645740734033435 0ustar pbuserpbgroup00000000000000 ContentHub - Content Hub JS API
    API Docs for: 0.1

    ContentHub

    ContentHub is the entry point to resource io transfer from/to remote applications (peers).

    This module has the following classes:



    Module description found: content-hub.js:568
    ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/files/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/f0000755000015600001650000000000012645741276033407 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/files/content-hub.js.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/f0000644000015600001650000010246012645740734033412 0ustar pbuserpbgroup00000000000000 content-hub.js - Content Hub JS API

    content-hub.js

    /**
     * ContentHub is the entry point to resource io transfer
       from/to remote applications (peers).
    
     * @module ContentHub
     */
    
    function createContentHubApi(backendBridge) {
        var PLUGIN_URI = 'ContentHub';
    
    /**
     * ContentTransfer is an object created by the ContentHub to
       and allows one to properly setup and manage a data
       transfer between two peers.
    
     * @class ContentTransfer
     * @constructor
     * @example
    
           var api = external.getUnityObject('1.0');
           var hub = api.ContentHub;
    
           var pictureContentType = hub.ContentType.Pictures;
    
           hub.defaultSourceForType(
              pictureContentType
              , function(peer) {
                hub.importContentForPeer(
                  pictureContentType,
                  peer,
                  function(transfer) {
                    [setup the transfer options and store]
                    transfer.start(function(state) { [...] });
                  });
               });
     */
        function ContentTransfer(objectid, content) {
            this._proxy = backendBridge.createRemoteObject(
                PLUGIN_URI, 'ContentTransfer', objectid);
    
            this._store = content && content.store
                 ? content.store : null;
            this._state = content && content.state
                 ? content.state : null;
            this._selectionType = content && content.selectionType
                 ? content.selectionType : null;
            this._direction = content && content.direction
                 ? content.direction : null;
        };
        ContentTransfer.prototype = {
            // object methods
            serialize: function() {
                var self = this;
                return {
                    type: 'object-proxy',
                    apiid: 'ContentHub',
                    objecttype: 'ContentTransfer',
                    objectid: self._proxy.id(),
                }
            },
    
            // properties
    
            /**
             * Retrieves the current store.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method store
             * @param callback (optional) {Function(String)}
             */
            store: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('store', [], callback);
                    return;
                }
                return this._store;
            },
            /**
             * Sets the current store for the ContentTransfer.
             *
             * @method setStore
             * @param store {ContentStore}
             * @param callback (optional) {Function()} called when the store has been updated
             */
            setStore: function(store, callback) {
                this._proxy.call('setStore', [store.serialize(), callback]);
            },
    
            /**
             * Retrieves the current state.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method state
             * @param callback (optional) {Function(ContentTransfer.State)}
             */
            state: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('state', [], callback);
                    return;
                }
                return this._state;
            },
            /**
             * Sets the state of the transfer.
             *
             * @method setState
             * @param state {ContentTransfer.State}
             * @param callback {Function()} called when the state has been updated
             */
            setState: function(state, callback) {
                this._proxy.call('setState', [state, callback]);
            },
            /**
             * Notifies the listener when the state of the transfer changes.
             *
             * @method onStateChanged
             * @param callback {Function(ContentTransfer.State)}
             */
            onStateChanged: function(callback) {
                this._proxy.call('onStateChanged', [callback]);
            },
    
            /**
             * Retrieves the current selection type.
             *
             * @method selectionType
             * @param callback {Function(ContentTransfer.SelectionType)}
             */
            selectionType: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('selectionType', [], callback);
                    return;
                }
                return this._selectionType;
            },
            /**
             * Sets the selection type (single or multiple).
             *
             * @method setSelectionType
             * @param selectionType {ContentTransfer.SelectionType}
             * @param callback {Function()} called when the state has been updated
             */
            setSelectionType: function(selectionType, callback) {
                this._selectionType = selectionType;
                this._proxy.call('setSelectionType', [selectionType, callback]);
            },
    
            /**
             * Retrieves the current transfer direction.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method direction
             * @param callback (optional) {Function(ContentTransfer.Direction)}
             */
            direction: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('direction', [], callback);
                    return;
                }
                return this._direction;
            },
            /**
             * Sets the transfer direction (import or export).
             *
             * @method setDirection
             * @param direction {ContentTransfer.Direction}
             * @param callback {Function()} called when the state has been updated
             */
            setDirection: function(direction, callback) {
                this._direction = direction;
                this._proxy.call('setDirection', [direction, callback]);
            },
    
            /**
             * Retrieves the list of items associated with the ContentTransfer.
             *
             * @method items
             * @param callback {Function( {Object{name: , url: }} )}
             */
            items: function(callback) {
                this._proxy.call('items', [], callback);
            },
            /**
             * Sets the list of items for the associated ContentTransfer (used when exporting).
             *
             * @method setItems
             * @param items {Array of Object{name: String, url: String}}
             * @param callback {Function()} called when the state has been updated
             */
            setItems: function(items, callback) {
                this._proxy.call('setItems', [items, callback]);
            },
    
            // methods
    
            /**
             * Starts a transfer
             * 
             * @method start
             * @param callback {Function(ContentTransfer.State)} 
             */
            start: function(callback) {
                this._proxy.call('start', [callback]);
            },
    
            /**
             * Sets State to ContentTransfer.Finalized and cleans up temporary files.
             *
             * @method finalize
             */
            finalize: function() {
                this._proxy.call('finalize', []);
            },
    
            // extras
    
            /**
             * Destroys the remote object. This proxy object is not valid anymore.
             *
             * @method destroy
             */
            destroy: function() {
                this._proxy.call('destroy', []);
            },
        };
    
    /**
     * ContentPeer is an object returned by the ContentHub.
       It represents a remote peer that can be used in a request
       to import, export or share content.
    
     * @class ContentPeer
     * @module ContentHub
     * @constructor
     * @example
    
           var api = external.getUnityObject('1.0');
           var hub = api.ContentHub;
    
           var pictureContentType = hub.ContentType.Pictures;
    
           hub.defaultSourceForType(
              pictureContentType
              , function(peer) {
                 [do something with the peer]
               });
     */
        function ContentPeer(objectid, content) {
            this._proxy = backendBridge.createRemoteObject(
                PLUGIN_URI, 'ContentPeer', objectid);
    
            this._appId = content && content.appId
                 ? content.appId : null;
            this._name = content && content.name
                 ? content.name : null;
            this._handler = content && content.handler
                 ? content.handler : null;
            this._contentType = content && content.contentType
                 ? content.contentType : null;
            this._selectionType = content && content.selectionType
                 ? content.selectionType : null;
            this._isDefaultPeer = content && content.isDefaultPeer;
        };
        ContentPeer.prototype = {
            // object methods
            serialize: function() {
                var self = this;
                return {
                    type: 'object-proxy',
                    apiid: 'ContentHub',
                    objecttype: 'ContentPeer',
                    objectid: self._proxy.id(),
                }
            },
    
            // properties
    
            /**
             * Retrieves the app Id of the associated peer.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method appId
             * @return {String} Application Id for this peer
             * @param callback (optional) {Function(String)}
             */
            appId: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('appId', [], callback);
                    return;
                }
                return this._appId;
            },
            /**
             * Sets the app Id of the associated peer.
             *
             * @method setAppId
             * @param appId {String}
             * @param callback {Function()} called when the appId has been updated
             */
            setAppId: function(appId, callback) {
                this._proxy.call('setAppId', [appId, callback]);
            },
    
            /**
             * Retrieves the specific ContentHandler for this peer.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method handler
             * @return {String} ContentHandler for this peer
             * @param callback (optional) {Function(String)}
             */
            handler: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('handler', [], callback);
                    return;
                }
                return this._handler;
            },
            /**
             * Sets specific ContentHandler for this peer.
             *
             * @method setHandler
             * @param handler {ContentHandler}
             * @param callback {Function()} called when the appId has been updated
             */
            setHandler: function(handler, callback) {
                this._proxy.call('setHandler', [handler, callback]);
            },
    
            /**
             * Retrieves the specific ContentType for this peer.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method contentType
             * @return {String} ContentType for this peer
             * @param callback (optional) {Function(String)}
             */
            contentType: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('contentType', [], callback);
                    return;
                }
                return this._contentType;
            },
            /**
             * Sets specific ContentType for this peer.
             *
             * @method setContentType
             * @param contentType {ContentType}
             * @param callback {Function()} called when the content type has been updated
             */
            setContentType: function(contentType, callback) {
                this._proxy.call('setContentType', [contentType, callback]);
            },
    
            /**
             * Retrieves the specific SelectionType for this peer.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method selectionType
             * @return {String} ContentTransfer.SelectionType for this peer
             * @param callback (optional) {Function(String)}
             */
            selectionType: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('selectionType', [], callback);
                    return;
                }
                return this._selectionType;
            },
            /**
             * Sets specific SelectionType for this peer.
             *
             * @method setSelectionType
             * @param selectionType {ContentTransfer.SelectionType}
             * @param callback {Function()} called when the content type has been updated
             */
            setSelectionType: function(selectionType, callback) {
                this._proxy.call('setSelectionType', [selectionType, callback]);
            },
    
            /**
             * Retrieves the name of the associated peer.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method name
             * @param callback (optional) {Function(String)}
             */
            name: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('name', [], callback);
                    return;
                }
                return this._name;
            },
    
            /**
             * Returns true if the peer is a default one, false otherwise.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method isDefaultPeer
             * @param callback (optional) {Function(Bool)}
             */
            isDefaultPeer: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('isDefaultPeer', [], callback);
                    return;
                }
                return this._isDefaultPeer;
            },
    
            // methods
    
            /**
             * Request to exchange content with this ContentPeer.
             *
             * @method request
             * @param callback {Function(ContentTransfer)} Called with the resulting content transfer
             */
            request: function(callback) {
                this._proxy.call('request', [], callback);
            },
    
            /**
             * Request to import content from this ContentPeer and use a ContentStore for permanent storage.
             *
             * @method requestForStore
             * @param store {ContentStore} Store used as a permanent storage
             * @param callback {Function(ContentTransfer)} Called with the resulting content transfer
             */
            requestForStore: function(store, callback) {
                this._proxy.call('requestForStore', [store.serialize()], callback);
            },
    
            // extras
    
            /**
             * Destroys the remote object. This proxy object is not valid anymore.
             *
             * @method destroy
             */
            destroy: function() {
                this._proxy.call('destroy', []);
            },
        };
    
    /**
     * ContentStore is an object returned by the ContentHub.
    
       It represents a location where the resources imported or
       exported from a peer during a transfer operation are to be
       either saved or found.
    
     * @class ContentStore
     * @module ContentHub
     * @constructor
     * @example
    
           var api = external.getUnityObject('1.0');
           var hub = api.ContentHub;
    
           var pictureContentType = hub.ContentType.Pictures;
    
           hub.defaultStoreForType(pictureContentType, function(store) {
             [do something with the store]
             });
     */
        function ContentStore(objectid, content) {
            this._proxy = backendBridge.createRemoteObject(
                PLUGIN_URI, 'ContentStore', objectid);
    
            this._uri = content && content.uri
                 ? content.uri : null;
            this._scope = content && content.scope
                 ? content.scope : null;
        };
        ContentStore.prototype = {
            // object methods
            serialize: function() {
                return {
                    type: 'object-proxy',
                    apiid: 'ContentHub',
                    objecttype: 'ContentStore',
                    objectid: this._proxy.id(),
                }
            },
    
            // properties
    
            //immutable
    
            /**
             * Retrieves the uri of the associated store.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method uri
             * @return {String} current uri
             * @param callback (optional) {Function(String)}
             */
            uri: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('uri', [], callback);
                    return;
                }
                return this._uri;
            },
    
            /**
             * Retrieves the current scope.
             *
             * If the callback parameter is not set, the current "local" value is retrieved.
             *
             * @method scope
             * @return {ContentScope} current scope
             * @param callback (optional) {Function(ContentScope)}
             */
            scope: function(callback) {
                if (callback && typeof(callback) === 'function') {
                    this._proxy.call('scope', [], callback);
                    return;
                }
                return this._scope;
            },
            /**
             * Sets the current scope.
             *
             * @method setScope
             * @param scope {ContentScope}
             * @param callback {Function()} called when the scope has been updated
             */
            setScope: function(scope, callback) {
                this._proxy.call('setScope', [scope, callback]);
            },
    
            // extras
    
            /**
             * Destroys the remote object. This proxy object is not valid anymore.
             *
             * @method destroy
             */
            destroy: function() {
                this._proxy.call('destroy', []);
            },
        };
    
        function _constructorFromName(className) {
            var constructorPerName = {
                "ContentPeer": ContentPeer,
                "ContentStore": ContentStore,
                "ContentTransfer": ContentTransfer,
            };
            return className in constructorPerName
                    ? constructorPerName[className]
                    : null;
        };
    
    /**
     * The ContentHub object.
    
     * @class ContentHub
     * @static
     * @constructor
     */
        return {
            /**
             ContentType is an enumeration of well known content types.
             
               Values:
    
                 Pictures
    
                 Documents
                 
                 Music
    
                 Contacts
    
                 Videos
    
                 Links
    
             @static
             @property ContentType {String}
             
             @example
    
              var api = external.getUnityObject('1.0');
              var hub = api.ContentHub;
             
              var pictureContentType = hub.ContentType.Pictures;
             */
            ContentType: {
                All: "All",
                Unknown: "Unknown",
                Pictures: "Pictures",
                Documents: "Documents",
                Music: "Music",
                Contacts: "Contacts",
                Videos: "Videos",
                Links: "Links",
            },
    
            /**
              ContentHandler is an enumeration of well known content handlers.
    
               Values:
    
                 Source
    
                 Destination
    
                 Share
    
               @static
               @property ContentHandler {String}
             */
            ContentHandler: {
                Source: "Source",
                Destination: "Destination",
                Share: "Share",
            },
    
            /**
              ContentScope is an enumeration of well known scope types.
    
               Values:
    
                 System
    
                 User
    
                 App
    
               @static
               @property ContentScope {String}
             */
            ContentScope: {
                System: "System",
                User: "User",
                App: "App",
            },
    
            ContentTransfer: {
    
            /**
             ContentTransfer.State is an enumeration of the state of a given ongoing ContentTransfer.
             
               Values:
    
                Created: Transfer created, waiting to be initiated.
    
                Initiated: Transfer has been initiated.
    
                InProgress: Transfer is in progress.
    
                Charged: Transfer is charged with items and ready to be collected.
    
                Collected: Items in the transfer have been collected.
    
                Aborted: Transfer has been aborted.
    
                Finalized: Transfer has been finished and cleaned up.
    
                Downloaded: Download specified by downloadId has completed.
    
                Downloading: Transfer is downloading item specified by downloadId.
              
             @static
             @property ContentTransfer.State {String}
             
             @example
    
              var api = external.getUnityObject('1.0');
              var hub = api.ContentHub;
             
              var transferState = hub.ContentTransfer.State;
              var pictureContentType = hub.ContentType.Pictures;
    
              hub.importContentForPeer(
                pictureContentType,
                peer,
                function(transfer) {
                    hub.defaultStoreForType(pictureContentType, function(store) {
                        transfer.setStore(store, function() {
                            transfer.start(function(state) {
                                if (transferState.Aborted === state) {
                                  [...]
                                }
                                [...]
                            });
                        });
                    });
              });
    
             */
                State: {
                    // Transfer created, waiting to be initiated.
                    Created: "Created",
    
                    // Transfer has been initiated.
                    Initiated: "Initiated",
    
                    // Transfer is in progress.
                    InProgress: "InProgress",
    
                    // Transfer is charged with items and ready to be collected.
                    Charged: "Charged",
    
                    // Items in the transfer have been collected.
                    Collected: "Collected",
    
                    // Transfer has been aborted.
                    Aborted: "Aborted",
    
                    // Transfer has been finished and cleaned up.
                    Finalized: "Finalized",
    
                    // Transfer has finished downloading.
                    Downloaded: "Downloaded",
    
                    // Transfer is downloading.
                    Downloading: "Downloading",
                },
    
            /**
             ContentTransfer.Direction is an enumeration of the directions of a given ContentTransfer.
             
               Values:
    
                Import
    
                Export
    
                Share
    
             @static
             @property ContentTransfer.Direction {String}
             */
                Direction: {
                    // Transfer is a request to import content
                    Import: "Import",
    
                    // Transfer is a request to export content
                    Export: "Export",
    
                    // Transfer is a request to share content
                    Share: "Share",
                },
    
            /**
             ContentTransfer.SelectionType is an enumeration of the directions of a given ContentTransfer.
             
               Values:
    
                Single: Transfer should contain a single item
    
                Multiple: Transfer can contain multiple items
    
             @static
             @property ContentTransfer.SelectionType {String}
             */
                SelectionType: {
                    // Transfer should contain a single item
                    Single: "Single",
    
                    // Transfer can contain multiple items
                    Multiple: "Multiple",
                },
            },
    
            /**
             * Creates a ContentPeer object for the given source type.
             *
             * @method getPeers
             * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are:
             * - contentType: desired ContentType
             * - handler: desired ContentHandler
             *
             * @param callback {Function(List of ContentPeer objects)} Callback that receives the result or null
             */
            getPeers: function(filter, callback) {
                backendBridge.call('ContentHub.getPeers',
                                   [filter],
                                   callback);
            },
    
            /**
             * Creates a ContentStore object for the given scope type.
             *
             * @method getStore
             * @param scope {ContentScope} The content scope for the store
             * @param callback {Function(ContentStore)} Callback that receives the result or null
             */
            getStore: function(scope, callback) {
                backendBridge.call('ContentHub.getStore',
                                   [scope],
                                   callback);
            },
    
            /**
             * Launches the content peer picker ui that allows the user to select a peer.
             *
             * @method launchContentPeerPicker
             * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are:
             * - contentType: desired ContentType
             * - handler: desired ContentHandler
             * - showTitle: boolean value indicating if the title should be visible
             * @param onPeerSelected {Function(ContentPeer)} Called when the user has selected a peer
             * @param onCancelPressed {Function()} Called when the user has pressed cancel
             */
            launchContentPeerPicker: function(filters, onPeerSelected, onCancelPressed) {
                backendBridge.call('ContentHub.launchContentPeerPicker',
                                   [filters, onPeerSelected, onCancelPressed]);
            },
    
            /**
             * Sets a handler that is to be called when the current application is the
             * target of an export request.
             *
             * @method onExportRequested
             * @param callback {Function(ContentTransfer)} Function when one requests a resource to be exported.
             *                                                          The corresponding ContentTransfer is provided as a parameter.
             * 
             * @example
             
                var api = external.getUnityObject(1.0);
                var hub = api.ContentHub;
             
                var transferState = hub.ContentTransfer.State;
                
                function _exportRequested(transfer) {
                  var url = window.location.href;
                  url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png';
                
                  transfer.setItems([{name: 'Ubuntu One', url: url}],
                    function() {
                      transfer.setState(hub.ContentTransfer.State.Charged);
                    });
                  };
                
                hub.onExportRequested(_exportRequested);
             
             */
            onExportRequested: function(callback) {
                backendBridge.call('ContentHub.onExportRequested',
                                   [callback]);
            },
    
            /**
             * Sets a handler that is to be called when the current application is the
             * target of an share request.
             *
             * @method onShareRequested
             * @param callback {Function(ContentTransfer)} Function when one requests a resource to be shared.
             *                                                          The corresponding ContentTransfer is provided as a parameter.
             *
             * @example
    
                var api = external.getUnityObject(1.0);
                var hub = api.ContentHub;
    
                var transferState = hub.ContentTransfer.State;
    
                function _shareRequested(transfer) {
                };
    
                hub.onShareRequested(_shareRequested);
    
             */
            onShareRequested: function(callback) {
                backendBridge.call('ContentHub.onShareRequested',
                                   [callback]);
            },
    
            /**
             * Sets a handler that is to be called when the current application is the
             * target of an import request.
             *
             * @method onImportRequested
             * @param callback {Function(ContentTransfer)} Function when one requests a resource to be imported.
             *                                                          The corresponding ContentTransfer is provided as a parameter.
             *
             * @example
    
                var api = external.getUnityObject(1.0);
                var hub = api.ContentHub;
    
                var transferState = hub.ContentTransfer.State;
    
                function _importRequested(transfer) {
                };
    
                hub.onImportRequested(_importRequested);
    
             */
            onImportRequested: function(callback) {
                backendBridge.call('ContentHub.onImportRequested',
                                   [callback]);
            },
    
            api: {
    
                /**
                 * Creates a ContentStore object for the given ContentPeer.
                 *
                 * @method api.importContent
                 * @param type {ContentType} type of the content to import
                 * @param peer {ContentPeer} peer who's content should be imported
                 * @param transferOptions {Object} a dictionary of transfer options. The options are the following:
                 * - multipleFiles {Bool}: specified if a transfer should involve multiple files or not
                 * - scope {ContentScope}: specifies the location where the transferred files should be copied to
                 * @param onError {Function(reason:)} called when the transfer has failed
                 * @param onSuccess {Function(Array of {ContentItem})} called when the transfer has been a success and items are available
                 */
                importContent: function(type, peer, transferOptions, onSuccess, onError) {
                    backendBridge.call('ContentHub.apiImportContent',
                                      [type, peer.serialize(), transferOptions, onSuccess, onError]);
                }
            },
    
            // Internal
    
            /**
             * @private
             *
             */
            createObjectWrapper: function(objectType, objectId, content) {
                var Constructor = _constructorFromName(objectType);
                return new Constructor(objectId, content);
            },
        };
    };
    
    
    ././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/favicon.icounity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000001246612645740734033413 0ustar pbuserpbgroup00000000000000 h&  (  !Юmrf<0SKVhQK6>,1"}2'ɤ`FaKQ=A1y)ԻO1vjv;-dKjR[FK8/|mVK7D6Q>mSdNTA?.QD|gĠ\BVCG8aJlS_IN;7'B˜>,]AbITBN=iOhQXD=*vڷoU=S@M9aCbISBUAkRcMO;I9-jѪ]EZFS=aDaISAXDjR]H?+šÊu_D_IWB_DaHSAYEgOR=SCҦeJ_G[F\D_GSBVD`JD/ÜEnɭ`FZCYCZESAP?S?Q>ź\ˆsícLR;N9I7F6>+u.ڸp‘raΜ\KK<@1ϳ^#+$?( @ ־E*ҵZyUJ}2'i~xĽNsP>9'2!}. y+qZRݽa|hͤXAP:N;I7B1:+3%v(8-fLcJeO]HUAM:F5>/7)|/"s#=ŋvdJiRcLZER>K8C2<-5&r zνIjYѳhMjRgP_IWCO.3$8,I8~@/{A3q8-XCmRjQiQaKYDQ=I7B1;+x(ѶT(q[ӖQ;UCO>H9y?2D5jOjQjRfP^HVBN;F5?/|,xo(bE^E\HVDO>H9x>2WClRiQiRcMZFS?K8D38(D7ټd]>`H\HVCO>G8D5eMkQjRgP_JWCPE7O=kQjQjReN\GT@M:E44#qf}q3"B0cDdH`H\HVCO>E7ZElQjRhRbLYDQ>J8@/>/|D/K8B2K6gFdG`H\HVCN=H9bKkQiRgP^IVBN;G63"yҫzSgGcG`H\HUCL,eYٵlbFgNhQcL\GVBOJ8:)C޿]gLfKjRfO`JYEQ?W?eFdG_H[GUCK,oc@rXbGjQhQcL\GUAV@bEdG_H[GUCL;VCjReN[FT@K8>,<q`DhOjRfO`JXDU@^CdG`H[GUCK;TAhQbLXDQ>@-naԫ}fKcHjQhQcM\GUBYBaFaH[HUCK;P?cM_IUAN:=*J7maDfLjRfO`JXDVA\C`H\HUCKO.|7)s0">01 $49:9???././@LongLink0000000000000000000000000000015600000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/api-list.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000001465012645740734033410 0ustar pbuserpbgroup00000000000000YUI.add('api-list', function (Y) { var Lang = Y.Lang, YArray = Y.Array, APIList = Y.namespace('APIList'), classesNode = Y.one('#api-classes'), inputNode = Y.one('#api-filter'), modulesNode = Y.one('#api-modules'), tabviewNode = Y.one('#api-tabview'), tabs = APIList.tabs = {}, filter = APIList.filter = new Y.APIFilter({ inputNode : inputNode, maxResults: 1000, on: { results: onFilterResults } }), search = APIList.search = new Y.APISearch({ inputNode : inputNode, maxResults: 100, on: { clear : onSearchClear, results: onSearchResults } }), tabview = APIList.tabview = new Y.TabView({ srcNode : tabviewNode, panelNode: '#api-tabview-panel', render : true, on: { selectionChange: onTabSelectionChange } }), focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, { circular : true, descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a', keys : {next: 'down:40', previous: 'down:38'} }).focusManager, LIST_ITEM_TEMPLATE = '
  • ' + '{displayName}' + '
  • '; // -- Init --------------------------------------------------------------------- // Duckpunch FocusManager's key event handling to prevent it from handling key // events when a modifier is pressed. Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusPrevious', focusManager); Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusNext', focusManager); // Create a mapping of tabs in the tabview so we can refer to them easily later. tabview.each(function (tab, index) { var name = tab.get('label').toLowerCase(); tabs[name] = { index: index, name : name, tab : tab }; }); // Switch tabs on Ctrl/Cmd-Left/Right arrows. tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); // Focus the filter input when the `/` key is pressed. Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); // Keep the Focus Manager up to date. inputNode.on('focus', function () { focusManager.set('activeDescendant', inputNode); }); // Update all tabview links to resolved URLs. tabview.get('panelNode').all('a').each(function (link) { link.setAttribute('href', link.get('href')); }); // -- Private Functions -------------------------------------------------------- function getFilterResultNode() { return filter.get('queryType') === 'classes' ? classesNode : modulesNode; } // -- Event Handlers ----------------------------------------------------------- function onFilterResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()), resultNode = getFilterResultNode(), typePlural = filter.get('queryType'), typeSingular = typePlural === 'classes' ? 'class' : 'module'; if (e.results.length) { YArray.each(e.results, function (result) { frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { rootPath : APIList.rootPath, displayName : filter.getDisplayName(result.highlighted), name : result.text, typePlural : typePlural, typeSingular: typeSingular })); }); } else { frag.append( '
  • ' + 'No ' + typePlural + ' found.' + '
  • ' ); } resultNode.empty(true); resultNode.append(frag); focusManager.refresh(); } function onSearchClear(e) { focusManager.refresh(); } function onSearchKey(e) { var target = e.target; if (target.test('input,select,textarea') || target.get('isContentEditable')) { return; } e.preventDefault(); inputNode.focus(); focusManager.refresh(); } function onSearchResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()); if (e.results.length) { YArray.each(e.results, function (result) { frag.append(result.display); }); } else { frag.append( '
  • ' + 'No results found. Maybe you\'ll have better luck with a ' + 'different query?' + '
  • ' ); } focusManager.refresh(); } function onTabSelectionChange(e) { var tab = e.newVal, name = tab.get('label').toLowerCase(); tabs.selected = { index: tab.get('index'), name : name, tab : tab }; switch (name) { case 'classes': // fallthru case 'modules': filter.setAttrs({ minQueryLength: 0, queryType : name }); search.set('minQueryLength', -1); // Only send a request if this isn't the initially-selected tab. if (e.prevVal) { filter.sendRequest(filter.get('value')); } break; case 'everything': filter.set('minQueryLength', -1); search.set('minQueryLength', 1); if (search.get('value')) { search.sendRequest(search.get('value')); } else { inputNode.focus(); } break; default: // WTF? We shouldn't be here! filter.set('minQueryLength', -1); search.set('minQueryLength', -1); } if (focusManager) { setTimeout(function () { focusManager.refresh(); }, 1); } } function onTabSwitchKey(e) { var currentTabIndex = tabs.selected.index; if (!(e.ctrlKey || e.metaKey)) { return; } e.preventDefault(); switch (e.keyCode) { case 37: // left arrow if (currentTabIndex > 0) { tabview.selectChild(currentTabIndex - 1); inputNode.focus(); } break; case 39: // right arrow if (currentTabIndex < (Y.Object.size(tabs) - 2)) { tabview.selectChild(currentTabIndex + 1); inputNode.focus(); } break; } } }, '3.4.0', {requires: [ 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' ]}); ././@LongLink0000000000000000000000000000017000000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/apidocs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000002407112645740734033406 0ustar pbuserpbgroup00000000000000YUI().use( 'yuidoc-meta', 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', function (Y) { var win = Y.config.win, localStorage = win.localStorage, bdNode = Y.one('#bd'), pjax, defaultRoute, classTabView, selectedTab; // Kill pjax functionality unless serving over HTTP. if (!Y.getLocation().protocol.match(/^https?\:/)) { Y.Router.html5 = false; } // Create the default route with middleware which enables syntax highlighting // on the loaded content. defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { prettyPrint(); bdNode.removeClass('loading'); next(); }); pjax = new Y.Pjax({ container : '#docs-main', contentSelector: '#docs-main > .content', linkSelector : '#bd a', titleSelector : '#xhr-title', navigateOnHash: true, root : '/', routes : [ // -- / ---------------------------------------------------------------- { path : '/(index.html)?', callbacks: defaultRoute }, // -- /classes/* ------------------------------------------------------- { path : '/classes/:class.html*', callbacks: [defaultRoute, 'handleClasses'] }, // -- /files/* --------------------------------------------------------- { path : '/files/*file', callbacks: [defaultRoute, 'handleFiles'] }, // -- /modules/* ------------------------------------------------------- { path : '/modules/:module.html*', callbacks: defaultRoute } ] }); // -- Utility Functions -------------------------------------------------------- pjax.checkVisibility = function (tab) { tab || (tab = selectedTab); if (!tab) { return; } var panelNode = tab.get('panelNode'), visibleItems; // If no items are visible in the tab panel due to the current visibility // settings, display a message to that effect. visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { if (itemNode.getComputedStyle('display') !== 'none') { return true; } }); panelNode.all('.no-visible-items').remove(); if (!visibleItems) { if (Y.one('#index .index-item')) { panelNode.append( '
    ' + '

    ' + 'Some items are not shown due to the current visibility ' + 'settings. Use the checkboxes at the upper right of this ' + 'page to change the visibility settings.' + '

    ' + '
    ' ); } else { panelNode.append( '
    ' + '

    ' + 'This class doesn\'t provide any methods, properties, ' + 'attributes, or events.' + '

    ' + '
    ' ); } } // Hide index sections without any visible items. Y.all('.index-section').each(function (section) { var items = 0, visibleItems = 0; section.all('.index-item').each(function (itemNode) { items += 1; if (itemNode.getComputedStyle('display') !== 'none') { visibleItems += 1; } }); section.toggleClass('hidden', !visibleItems); section.toggleClass('no-columns', visibleItems < 4); }); }; pjax.initClassTabView = function () { if (!Y.all('#classdocs .api-class-tab').size()) { return; } if (classTabView) { classTabView.destroy(); selectedTab = null; } classTabView = new Y.TabView({ srcNode: '#classdocs', on: { selectionChange: pjax.onTabSelectionChange } }); pjax.updateTabState(); classTabView.render(); }; pjax.initLineNumbers = function () { var hash = win.location.hash.substring(1), container = pjax.get('container'), hasLines, node; // Add ids for each line number in the file source view. container.all('.linenums>li').each(function (lineNode, index) { lineNode.set('id', 'l' + (index + 1)); lineNode.addClass('file-line'); hasLines = true; }); // Scroll to the desired line. if (hasLines && /^l\d+$/.test(hash)) { if ((node = container.getById(hash))) { win.scroll(0, node.getY()); } } }; pjax.initRoot = function () { var terminators = /^(?:classes|files|modules)$/, parts = pjax._getPathRoot().split('/'), root = [], i, len, part; for (i = 0, len = parts.length; i < len; i += 1) { part = parts[i]; if (part.match(terminators)) { // Makes sure the path will end with a "/". root.push(''); break; } root.push(part); } pjax.set('root', root.join('/')); }; pjax.updateTabState = function (src) { var hash = win.location.hash.substring(1), defaultTab, node, tab, tabPanel; function scrollToNode() { if (node.hasClass('protected')) { Y.one('#api-show-protected').set('checked', true); pjax.updateVisibility(); } if (node.hasClass('private')) { Y.one('#api-show-private').set('checked', true); pjax.updateVisibility(); } setTimeout(function () { // For some reason, unless we re-get the node instance here, // getY() always returns 0. var node = Y.one('#classdocs').getById(hash); win.scrollTo(0, node.getY() - 70); }, 1); } if (!classTabView) { return; } if (src === 'hashchange' && !hash) { defaultTab = 'index'; } else { if (localStorage) { defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || 'index'; } else { defaultTab = 'index'; } } if (hash && (node = Y.one('#classdocs').getById(hash))) { if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } } // Scroll to the desired element if this is a hash URL. if (node) { if (classTabView.get('rendered')) { scrollToNode(); } else { classTabView.once('renderedChange', scrollToNode); } } } else { tab = Y.one('#classdocs .api-class-tab.' + defaultTab); // When the `defaultTab` node isn't found, `localStorage` is stale. if (!tab && defaultTab !== 'index') { tab = Y.one('#classdocs .api-class-tab.index'); } if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } }; pjax.updateVisibility = function () { var container = pjax.get('container'); container.toggleClass('hide-inherited', !Y.one('#api-show-inherited').get('checked')); container.toggleClass('show-deprecated', Y.one('#api-show-deprecated').get('checked')); container.toggleClass('show-protected', Y.one('#api-show-protected').get('checked')); container.toggleClass('show-private', Y.one('#api-show-private').get('checked')); pjax.checkVisibility(); }; // -- Route Handlers ----------------------------------------------------------- pjax.handleClasses = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initClassTabView(); } next(); }; pjax.handleFiles = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initLineNumbers(); } next(); }; // -- Event Handlers ----------------------------------------------------------- pjax.onNavigate = function (e) { var hash = e.hash, originTarget = e.originEvent && e.originEvent.target, tab; if (hash) { tab = originTarget && originTarget.ancestor('.yui3-tab', true); if (hash === win.location.hash) { pjax.updateTabState('hashchange'); } else if (!tab) { win.location.hash = hash; } e.preventDefault(); return; } // Only scroll to the top of the page when the URL doesn't have a hash. this.set('scrollToTop', !e.url.match(/#.+$/)); bdNode.addClass('loading'); }; pjax.onOptionClick = function (e) { pjax.updateVisibility(); }; pjax.onTabSelectionChange = function (e) { var tab = e.newVal, tabId = tab.get('contentBox').getAttribute('href').substring(1); selectedTab = tab; // If switching from a previous tab (i.e., this is not the default tab), // replace the history entry with a hash URL that will cause this tab to // be selected if the user navigates away and then returns using the back // or forward buttons. if (e.prevVal && localStorage) { localStorage.setItem('tab_' + pjax.getPath(), tabId); } pjax.checkVisibility(tab); }; // -- Init --------------------------------------------------------------------- pjax.on('navigate', pjax.onNavigate); pjax.initRoot(); pjax.upgrade(); pjax.initClassTabView(); pjax.initLineNumbers(); pjax.updateVisibility(); Y.APIList.rootPath = pjax.get('root'); Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); Y.on('hashchange', function (e) { pjax.updateTabState('hashchange'); }, win); }); ././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/tabs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000537412645740734033413 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/yui-prettify.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000377512645740734033416 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/api-search.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000555412645740734033413 0ustar pbuserpbgroup00000000000000YUI.add('api-search', function (Y) { var Lang = Y.Lang, Node = Y.Node, YArray = Y.Array; Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { // -- Public Properties ---------------------------------------------------- RESULT_TEMPLATE: '
  • ' + '' + '

    {name}

    ' + '{resultType}' + '
    {description}
    ' + '{class}' + '
    ' + '
  • ', // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, // -- Protected Methods ---------------------------------------------------- _apiResultFilter: function (query, results) { // Filter components out of the results. return YArray.filter(results, function (result) { return result.raw.resultType === 'component' ? false : result; }); }, _apiResultFormatter: function (query, results) { return YArray.map(results, function (result) { var raw = Y.merge(result.raw), // create a copy desc = raw.description || ''; // Convert description to text and truncate it if necessary. desc = Node.create('
    ' + desc + '
    ').get('text'); if (desc.length > 65) { desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; } else { desc = Y.Escape.html(desc); } raw['class'] || (raw['class'] = ''); raw.description = desc; // Use the highlighted result name. raw.name = result.highlighted; return Lang.sub(this.RESULT_TEMPLATE, raw); }, this); }, _apiTextLocator: function (result) { return result.displayName || result.name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultFormatter: { valueFn: function () { return this._apiResultFormatter; } }, resultFilters: { valueFn: function () { return this._apiResultFilter; } }, resultHighlighter: { value: 'phraseMatch' }, resultListLocator: { value: 'data.results' }, resultTextLocator: { valueFn: function () { return this._apiTextLocator; } }, source: { value: '/api/v1/search?q={query}&count={maxResults}' } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 'escape' ]}); ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/js/api-filter.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000264512645740734033411 0ustar pbuserpbgroup00000000000000YUI.add('api-filter', function (Y) { Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, getDisplayName: function(name) { Y.each(Y.YUIDoc.meta.allModules, function(i) { if (i.name === name && i.displayName) { name = i.displayName; } }); return name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultHighlighter: { value: 'phraseMatch' }, // May be set to "classes" or "modules". queryType: { value: 'classes' }, source: { valueFn: function() { var self = this; return function(q) { var data = Y.YUIDoc.meta[self.get('queryType')], out = []; Y.each(data, function(v) { if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { out.push(v); } }); return out; }; } } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' ]}); ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/css/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016700000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/css/main.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000002421212645740734033403 0ustar pbuserpbgroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
       blocks. */
    pre code, pre kbd, pre samp { font-size: 100%; }
    
    /* Used to denote text that shouldn't be selectable, such as line numbers or
       shell prompts. Guess which browser this doesn't work in. */
    .noselect {
        -moz-user-select: -moz-none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    
    /* -- Lists ----------------------------------------------------------------- */
    dd { margin: 0.2em 0 0.7em 1em; }
    dl { margin: 1em 0; }
    dt { font-weight: bold; }
    
    /* -- Tables ---------------------------------------------------------------- */
    caption, th { text-align: left; }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    td, th {
        border: 1px solid #fff;
        padding: 5px 12px;
        vertical-align: top;
    }
    
    td { background: #E6E9F5; }
    td dl { margin: 0; }
    td dl dl { margin: 1em 0; }
    td pre:first-child { margin-top: 0; }
    
    th {
        background: #D2D7E6;/*#97A0BF*/
        border-bottom: none;
        border-top: none;
        color: #000;/*#FFF1D5*/
        font-family: 'Trebuchet MS', sans-serif;
        font-weight: bold;
        line-height: 1.3;
        white-space: nowrap;
    }
    
    
    /* -- Layout and Content ---------------------------------------------------- */
    #doc {
        margin: auto;
        min-width: 1024px;
    }
    
    #main { width: 754px; }
    #sidebar { width: 270px; margin: 0 15px; }
    
    .content { padding: 0 20px 0 25px; }
    
    /* -- Sidebar --------------------------------------------------------------- */
    .sidebox {
        background: #F9F9FC;/*E6E9F5*/
        border: 1px solid #D4D8EB;
    
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
        margin: 0 0 15px 0;
        padding-bottom: 1px;
    }
    
    .sidebox h2 {
        background: #E5E6F1;
        -moz-border-radius: 4px 4px 0 0;
        -webkit-border-radius: 4px 4px 0 0;
        border-radius: 4px 4px 0 0;
        color: #5E6BA4;
        font-weight: bold;
        font-size: 107.692%;
        margin: 0;
        padding: 4px 7px 5px;
    }
    
    .sidebox .bd {
        font-size: 84.615%;
        padding: 0 5px 0 8px;
    }
    
    .sidebox li { list-style-type: disc; color:#D4D5E3; }
    
    .sidebox ol, .sidebox ul {
        margin-left: 0;
        padding-left: 16px;
    }
    
    .sidebox ol ol, .sidebox ol ul,
    .sidebox ul ol, .sidebox ul ul {
        margin: 0;
        padding-left: 16px;
    }
    
    /* -- Table of Contents ----------------------------------------------------- */
    
    /* The #toc id refers to the single global table of contents, while the .toc
       class refers to generic TOC lists that could be used throughout the page. */
    
    .toc code, .toc kbd, .toc samp { font-size: 100%; }
    .toc li { font-weight: bold; }
    .toc li li { font-weight: normal; }
    
    /* -- Intro and Example Boxes ----------------------------------------------- */
    .intro, .example { margin-bottom: 2em; }
    
    .example {
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 5px #bfbfbf;
        -webkit-box-shadow: 0 0 5px #bfbfbf;
        box-shadow: 0 0 5px #bfbfbf;
        padding: 1em;
    }
    
    .intro {
        background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    }
    
    /* -- Other Styles ---------------------------------------------------------- */
    
    /* These are probably YUI-specific, and should be moved out of Selleck's default
       theme. */
    
    .button {
        border: 1px solid #dadada;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        color: #444;
        display: inline-block;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 92.308%;
        font-weight: bold;
        padding: 4px 13px 3px;
        -moz-text-shadow: 1px 1px 0 #fff;
        -webkit-text-shadow: 1px 1px 0 #fff;
        text-shadow: 1px 1px 0 #fff;
        white-space: nowrap;
    
        background: #EFEFEF; /* old browsers */
        background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    }
    
    .button:hover {
        border-color: #466899;
        color: #fff;
        text-decoration: none;
        -moz-text-shadow: 1px 1px 0 #222;
        -webkit-text-shadow: 1px 1px 0 #222;
        text-shadow: 1px 1px 0 #222;
    
        background: #6396D8; /* old browsers */
        background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    }
    
    .newwindow { text-align: center; }
    
    .header .version em {
        display: block;
        text-align: right;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        background-color: transparent;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        border: none;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DEDCD9;
        border-right: 1px solid #CDCBC8;
        border-left: 1px solid #CDCBC8;
        border-top: 1px solid #DADADA;
        color: #333333;
        text-decoration: none;
    }
    .yui3-skin-sam .yui3-tabview .yui3-tab-label,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
        border: none;
        background: none;
        font-size: 100%;
        color: #000;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: none;
        background-color: #fff;
        border-bottom-color: #FFFFFF;
        border-top: 2px solid #8193C9;
        font-weight: bold;
        color: #000;
    
    }
    
    .yui3-skin-sam .yui3-tabview-list {
        border-color: #DFDFDF;
        border-width: 0 0 1px; 
    }
    
    
    a.external {
        background-image: url(external-small.png);
        background-repeat: no-repeat;
        background-position: 0 0;
        padding-left: 16px;
    }
    
    #classdocs .item {
        border-bottom: 1px solid #466899;
        margin: 1em 0;
        padding: 1.5em;
    }
    
    #classdocs .item .params p,
        #classdocs .item .returns p,{
        display: inline;
    }
    
    #classdocs .item em code, #classdocs .item em.comment {
        color: green;
    }
    
    #classdocs .item em.comment a {
        color: green;
        text-decoration: underline;
    }
    
    #classdocs .foundat {
        font-size: 11px;
        font-style: normal;
    }
    
    .attrs .emits {
        margin-left: 2em;
        padding: .5em;
        border-left: 1px dashed #ccc;
    }
    
    abbr {
        border-bottom: 1px dashed #ccc;
        font-size: 80%;
        cursor: help;
    }
    
    .prettyprint li.L0, 
    .prettyprint li.L1, 
    .prettyprint li.L2, 
    .prettyprint li.L3, 
    .prettyprint li.L5, 
    .prettyprint li.L6, 
    .prettyprint li.L7, 
    .prettyprint li.L8 {
        list-style: decimal;
    }
    
    ul li p {
        margin-top: 0;
    }
    
    .method .name {
        font-size: 110%;
    }
    
    #hd {
        background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DFDFDF;
        padding: 0 15px 1px 20px;
        margin-bottom: 15px;
    }
    
    #hd img {
        margin-right: 10px;
        vertical-align: middle;
    }
    
    ././@LongLink0000000000000000000000000000016700000000000011221 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/css/logo.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000135512645740734033406 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDR=29PLTEvO_1S#ƶl{]j@H9	pHYstIME
    &	fEGIDAThv eQ;,.i]	9=Ï	QxBHB$$!	IȿTobH
    L,LAJ!z2@{}q%>D*()29zfv0v'xY|~2ܾHIȔdY.Ҭ$FH[62MT%a>$XmSUhiKY.kUdYps6#È+ټV`HU2z/[Y
    ̷]PT&[o^|ߗuǞl 5e]6UǶEu<*5d+BoIHB$$!	JnɒőIENDB`././@LongLink0000000000000000000000000000020100000000000011206 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/css/external-small.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000075312645740734033407 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb?%B@,0]VVV0affȊ=8JOy %pJջ+30¿}sʋ`n|dx
    mXa |ȹWpA+ca|u=zϰp-l\w01nCy?*Yr%cfxÿ8
    `g2ȉ0!GA[EV66>Ӏ'E]AOCAY^#.S>>#񶉝
    "ÏOv%w@FX^`ddR|8 wX
    	 OƓIENDB`././@LongLink0000000000000000000000000000016500000000000011217 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/index.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000033012645740734033376 0ustar  pbuserpbgroup00000000000000
    
        
            Redirector
            
        
        
            Click here to redirect
        
    
    ././@LongLink0000000000000000000000000000016200000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017300000000000011216 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020200000000000011207 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/COPYINGunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000002613612645740734033412 0ustar  pbuserpbgroup00000000000000
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    ././@LongLink0000000000000000000000000000021200000000000011210 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/prettify-min.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000004564712645740734033422 0ustar  pbuserpbgroup00000000000000/*
     * Copyright 2011 Yahoo! Inc.
     * All rights reserved.
     *-
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *     * Redistributions of source code must retain the above copyright
     *       notice, this list of conditions and the following disclaimer.
     *     * Redistributions in binary form must reproduce the above copyright
     *       notice, this list of conditions and the following disclaimer in the
     *       documentation and/or other materials provided with the distribution.
     *     * Neither the name of the Yahoo! Inc. nor the
     *       names of its contributors may be used to endorse or promote products
     *       derived from this software without specific prior written permission.
     *-
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
     * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
    ././@LongLink0000000000000000000000000000021300000000000011211 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/prettify-min.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000124312645740734033402 0ustar  pbuserpbgroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}././@LongLink0000000000000000000000000000020700000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/CHANGES.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000001370412645740734033407 0ustar  pbuserpbgroup00000000000000
      
        
        Change Log
      
      
        README
    
        

    Known Issues

    • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
    • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

    Change Log

    29 March 2007

    • Added tests for PHP support to address issue 3.
    • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
    • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
    • Fixed bug: was eating tabs (test)
    • Fixed entity handling so that the caveat

      Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

      is no longer applicable.
    • Added noisefree's C# patch
    • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

    4 Jul 2008

    • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
    • Fixed bug: python handling of '''string'''
    • Fixed bug: / in regex [charsets] should not end regex

    5 Jul 2008

    • Defined language extensions for Lisp and Lua

    14 Jul 2008

    • Language handlers for F#, OCAML, SQL
    • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

    6 Jan 2009

    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
    • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
    • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

    21 May 2009

    • Rewrote to improve performance on large files. See benchmarks.
    • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

    14 August 2009

    • Fixed prettifying of <code> blocks with embedded newlines.

    3 October 2009

    • Fixed prettifying of XML/HTML tags that contain uppercase letters.

    19 July 2010

    • Added support for line numbers. Bug 22
    • Added YAML support. Bug 123
    • Added VHDL support courtesy Le Poussin.
    • IE performance improvements. Bug 102 courtesy jacobly.
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • Fixed copy and paste in IE[678].
    • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
    ././@LongLink0000000000000000000000000000020600000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/vendor/prettify/README.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000001735012645740734033410 0ustar pbuserpbgroup00000000000000 Javascript code prettifier Languages : CH

    Javascript code prettifier

    Setup

    1. Download a distribution
    2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
      <link href="prettify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="prettify.js"></script>
    3. Add onload="prettyPrint()" to your document's body tag.
    4. Modify the stylesheet to get the coloring you prefer

    Usage

    Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
    The original Prettier
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }

    FAQ

    Which languages does it work for?

    The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

    LISPy languages are supported via an extension: lang-lisp.js.

    And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

    If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

    How do I specify which language my code is in?

    You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

    <pre class="prettyprint lang-html">
      The lang-* class specifies the language file extensions.
      File extensions supported by default include
        "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
        "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
        "xhtml", "xml", "xsl".
    </pre>

    It doesn't work on <obfuscated code sample>?

    Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

    Which browsers does it work with?

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

    What's changed?

    See the change log

    Why doesn't Prettyprinting of strings work on WordPress?

    Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

    This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

    How do I put line numbers in my code?

    You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

    For example

    <pre class="prettyprint linenums:4"
    >// This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    <pre>
    produces
    // This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    

    How do I prevent a portion of markup from being marked as code?

    You can use the nocode class to identify a span of markup that is not code.

    <pre class=prettyprint>
    int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
      Continuation of comment */
    int y = bar();
    </pre>
    produces
    int x = foo();  /* This is a comment  This is not code
      Continuation of comment */
    int y = bar();
    

    For a more complete example see the issue22 testcase.

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

    addEventListener('load', prettyPrint, false);
    wrap it in a closure like
    addEventListener('load', function (event) { prettyPrint() }, false);
    so that the browser does not pass an event object to prettyPrint which will confuse it.


    ././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/img/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000755000015600001650000000000012645741276033402 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017200000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/assets/img/spinner.gifunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/a0000644000015600001650000000517512645740734033412 0ustar pbuserpbgroup00000000000000GIF89a333555666[[[^^^oooppprrr777KKKMMMbbbcccsssuuuzzzجmmm]]]\\\! NETSCAPE2.0! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB!-Made by Krasimira Nejcheva (www.loadinfo.net)! ,`'dif&EꊙG[u0(02n#S`lXtd ÈTC٤q{$9c+{"}  vxz{q";BY+-ist!! ,pH,2C:3`j>5+k: BRJ ˊkΖHrNFHnNdDȑ+rSݎKP/j~iD?.tq?//V:} '>GD2%&+D+CC4:" ^ $#Ϳ !<$ _lA! ,EE--D?EE2?9B?-E99EA66̻-66ǂ69ۚӻE A ƌ 2DF~ 2ACА iȐ$;! ,??D./H=-/D-.2D2/=/?+GD)/?GDD&" *?$ 6 )D#?++26 ؅ %F%T$bZ# 6Z(DBx封0 p$9rX(! , Content Hub JS API
    API Docs for: 0.1

    Welcome to Ubuntu Content Hub JavaScript API Docs

    ././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/classes/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/c0000755000015600001650000000000012645741276033404 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017500000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/classes/ContentStore.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/c0000644000015600001650000002016512645740734033410 0ustar pbuserpbgroup00000000000000 ContentStore - Content Hub JS API

    Class ContentStore

    Class defined in: content-hub.js:456

    ContentStore is an object returned by the ContentHub.

    It represents a location where the resources imported or exported from a peer during a transfer operation are to be either saved or found.

    ContentStore( )
    content-hub.js:456
    Example
      var api = external.getUnityObject('1.0');
          var hub = api.ContentHub;
        
          var pictureContentType = hub.ContentType.Pictures;
        
          hub.defaultStoreForType(pictureContentType, function(store) {
            [do something with the store]
            });
    destroy( )
    content-hub.js:547

    Destroys the remote object. This proxy object is not valid anymore.

    ContentScope scope( callback )
    content-hub.js:518

    Retrieves the current scope.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(ContentScope)>

      (optional)


    Returns: <ContentScope>

    current scope

    setScope( scope, callback )
    content-hub.js:534

    Sets the current scope.

    Parameters:
    • scope <ContentScope>
    • callback <Function()>

      called when the scope has been updated

    String uri( callback )
    content-hub.js:501

    Retrieves the uri of the associated store.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)


    Returns: <String>

    current uri

    ././@LongLink0000000000000000000000000000020000000000000011205 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/classes/ContentTransfer.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/c0000644000015600001650000004404512645740734033413 0ustar pbuserpbgroup00000000000000 ContentTransfer - Content Hub JS API

    Class ContentTransfer

    Class defined in: content-hub.js:11

    ContentTransfer is an object created by the ContentHub to and allows one to properly setup and manage a data transfer between two peers.

    ContentTransfer( )
    content-hub.js:11
    Example
      var api = external.getUnityObject('1.0');
          var hub = api.ContentHub;
        
          var pictureContentType = hub.ContentType.Pictures;
        
          hub.defaultSourceForType(
             pictureContentType
             , function(peer) {
               hub.importContentForPeer(
                 pictureContentType,
                 peer,
                 function(transfer) {
                   [setup the transfer options and store]
                   transfer.start(function(state) { [...] });
                 });
              });
    destroy( )
    content-hub.js:220

    Destroys the remote object. This proxy object is not valid anymore.

    direction( callback )
    content-hub.js:150

    Retrieves the current transfer direction.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(ContentTransfer.Direction)>

      (optional)

    finalize( )
    content-hub.js:209

    Sets State to ContentTransfer.Finalized and cleans up temporary files.

    items( callback )
    content-hub.js:177

    Retrieves the list of items associated with the ContentTransfer.

    Parameters:
    • callback <Function( Objectname: , url:>

      } )}

    onStateChanged( callback )
    content-hub.js:115

    Notifies the listener when the state of the transfer changes.

    Parameters:
    • callback <Function(ContentTransfer.State)>
    selectionType( callback )
    content-hub.js:125

    Retrieves the current selection type.

    Parameters:
    • callback <Function(ContentTransfer.SelectionType)>
    setDirection( direction, callback )
    content-hub.js:165

    Sets the transfer direction (import or export).

    Parameters:
    • direction <ContentTransfer.Direction>
    • callback <Function()>

      called when the state has been updated

    setItems( items, callback )
    content-hub.js:186

    Sets the list of items for the associated ContentTransfer (used when exporting).

    Parameters:
    • items <Array of Objectname: String, url: String>

      }

    • callback <Function()>

      called when the state has been updated

    setSelectionType( selectionType, callback )
    content-hub.js:138

    Sets the selection type (single or multiple).

    Parameters:
    • selectionType <ContentTransfer.SelectionType>
    • callback <Function()>

      called when the state has been updated

    setState( state, callback )
    content-hub.js:105

    Sets the state of the transfer.

    Parameters:
    • state <ContentTransfer.State>
    • callback <Function()>

      called when the state has been updated

    setStore( store, callback )
    content-hub.js:79

    Sets the current store for the ContentTransfer.

    Parameters:
    • store <ContentStore>
    • callback <Function()>

      (optional) called when the store has been updated

    start( callback )
    content-hub.js:199

    Starts a transfer

    Parameters:
    • callback <Function(ContentTransfer.State)>
    state( callback )
    content-hub.js:90

    Retrieves the current state.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(ContentTransfer.State)>

      (optional)

    store( callback )
    content-hub.js:64

    Retrieves the current store.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)

    ././@LongLink0000000000000000000000000000017400000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/classes/ContentPeer.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/c0000644000015600001650000004451512645740734033415 0ustar pbuserpbgroup00000000000000 ContentPeer - Content Hub JS API

    Class ContentPeer

    Class defined in: content-hub.js:230

    ContentPeer is an object returned by the ContentHub. It represents a remote peer that can be used in a request to import, export or share content.

    ContentPeer( )
    content-hub.js:230
    Example
      var api = external.getUnityObject('1.0');
          var hub = api.ContentHub;
        
          var pictureContentType = hub.ContentType.Pictures;
        
          hub.defaultSourceForType(
             pictureContentType
             , function(peer) {
                [do something with the peer]
              });
    String appId( callback )
    content-hub.js:281

    Retrieves the app Id of the associated peer.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)


    Returns: <String>

    Application Id for this peer

    String contentType( callback )
    content-hub.js:335

    Retrieves the specific ContentType for this peer.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)


    Returns: <String>

    ContentType for this peer

    destroy( )
    content-hub.js:446

    Destroys the remote object. This proxy object is not valid anymore.

    String handler( callback )
    content-hub.js:308

    Retrieves the specific ContentHandler for this peer.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)


    Returns: <String>

    ContentHandler for this peer

    isDefaultPeer( callback )
    content-hub.js:405

    Returns true if the peer is a default one, false otherwise.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(Bool)>

      (optional)

    name( callback )
    content-hub.js:389

    Retrieves the name of the associated peer.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)

    request( callback )
    content-hub.js:423

    Request to exchange content with this ContentPeer.

    Parameters:
    • callback <Function(ContentTransfer)>

      Called with the resulting content transfer

    requestForStore( store, callback )
    content-hub.js:433

    Request to import content from this ContentPeer and use a ContentStore for permanent storage.

    Parameters:
    • store <ContentStore>

      Store used as a permanent storage

    • callback <Function(ContentTransfer)>

      Called with the resulting content transfer

    String selectionType( callback )
    content-hub.js:362

    Retrieves the specific SelectionType for this peer.

    If the callback parameter is not set, the current "local" value is retrieved.

    Parameters:
    • callback <Function(String)>

      (optional)


    Returns: <String>

    ContentTransfer.SelectionType for this peer

    setAppId( appId, callback )
    content-hub.js:297

    Sets the app Id of the associated peer.

    Parameters:
    • appId <String>
    • callback <Function()>

      called when the appId has been updated

    setContentType( contentType, callback )
    content-hub.js:351

    Sets specific ContentType for this peer.

    Parameters:
    • contentType <ContentType>
    • callback <Function()>

      called when the content type has been updated

    setHandler( handler, callback )
    content-hub.js:324

    Sets specific ContentHandler for this peer.

    Parameters:
    • handler <ContentHandler>
    • callback <Function()>

      called when the appId has been updated

    setSelectionType( selectionType, callback )
    content-hub.js:378

    Sets specific SelectionType for this peer.

    Parameters:
    • selectionType <ContentTransfer.SelectionType>
    • callback <Function()>

      called when the content type has been updated

    ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/classes/ContentHub.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/docsbuild/c0000644000015600001650000005221612645740734033412 0ustar pbuserpbgroup00000000000000 ContentHub - Content Hub JS API
    API Docs for: 0.1

    Class ContentHub

    Class defined in: content-hub.js:568

    The ContentHub object.

    ContentHub( )
    content-hub.js:568
    api.importContent( type, peer, transferOptions, onError, onSuccess )
    content-hub.js:914

    Creates a ContentStore object for the given ContentPeer.

    Parameters:
    • type <ContentType>

      type of the content to import

    • peer <ContentPeer>

      peer who's content should be imported

    • transferOptions <Object>

      a dictionary of transfer options. The options are the following:

      • multipleFiles {Bool}: specified if a transfer should involve multiple files or not
      • scope {ContentScope}: specifies the location where the transferred files should be copied to
    • onError <Function(reason:)>

      called when the transfer has failed

    • onSuccess <Function(Array of ContentItem>

      )} called when the transfer has been a success and items are available

    getPeers( filters, callback )
    content-hub.js:782

    Creates a ContentPeer object for the given source type.

    Parameters:
    • filters <Object>

      A dictionary of parameters to filter the result. The filtering keys are:

      • contentType: desired ContentType
      • handler: desired ContentHandler
    • callback <Function(List of ContentPeer objects)>

      Callback that receives the result or null

    getStore( scope, callback )
    content-hub.js:798

    Creates a ContentStore object for the given scope type.

    Parameters:
    • scope <ContentScope>

      The content scope for the store

    • callback <Function(ContentStore)>

      Callback that receives the result or null

    launchContentPeerPicker( filters, onPeerSelected, onCancelPressed )
    content-hub.js:811

    Launches the content peer picker ui that allows the user to select a peer.

    Parameters:
    • filters <Object>

      A dictionary of parameters to filter the result. The filtering keys are:

      • contentType: desired ContentType
      • handler: desired ContentHandler
      • showTitle: boolean value indicating if the title should be visible
    • onPeerSelected <Function(ContentPeer)>

      Called when the user has selected a peer

    • onCancelPressed <Function()>

      Called when the user has pressed cancel

    onExportRequested( callback )
    content-hub.js:827

    Sets a handler that is to be called when the current application is the target of an export request.

    Parameters:
    • callback <Function(ContentTransfer)>

      Function when one requests a resource to be exported. The corresponding ContentTransfer is provided as a parameter.

    Example
           var api = external.getUnityObject(1.0);
                           var hub = api.ContentHub;
                        
                           var transferState = hub.ContentTransfer.State;
                           
                           function _exportRequested(transfer) {
                             var url = window.location.href;
                             url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png';
                           
                             transfer.setItems([{name: 'Ubuntu One', url: url}],
                               function() {
                                 transfer.setState(hub.ContentTransfer.State.Charged);
                               });
                             };
                           
                           hub.onExportRequested(_exportRequested);
                    
    onImportRequested( callback )
    content-hub.js:886

    Sets a handler that is to be called when the current application is the target of an import request.

    Parameters:
    • callback <Function(ContentTransfer)>

      Function when one requests a resource to be imported. The corresponding ContentTransfer is provided as a parameter.

    Example
           var api = external.getUnityObject(1.0);
                           var hub = api.ContentHub;
                    
                           var transferState = hub.ContentTransfer.State;
                    
                           function _importRequested(transfer) {
                           };
                    
                           hub.onImportRequested(_importRequested);
                    
    onShareRequested( callback )
    content-hub.js:860

    Sets a handler that is to be called when the current application is the target of an share request.

    Parameters:
    • callback <Function(ContentTransfer)>

      Function when one requests a resource to be shared. The corresponding ContentTransfer is provided as a parameter.

    Example
           var api = external.getUnityObject(1.0);
                           var hub = api.ContentHub;
                    
                           var transferState = hub.ContentTransfer.State;
                    
                           function _shareRequested(transfer) {
                           };
                    
                           hub.onShareRequested(_shareRequested);
                    
    ContentHandler <String> (static)
    content-hub.js:614

    ContentHandler is an enumeration of well known content handlers.

    Values:

    Source

    Destination

    Share

    ContentScope <String> (static)
    content-hub.js:634

    ContentScope is an enumeration of well known scope types.

    Values:

    System

    User

    App

    ContentTransfer.Direction <String> (static)
    content-hub.js:736

    ContentTransfer.Direction is an enumeration of the directions of a given ContentTransfer.

    Values:

    Import

    Export

    Share

    ContentTransfer.SelectionType <String> (static)
    content-hub.js:761

    ContentTransfer.SelectionType is an enumeration of the directions of a given ContentTransfer.

    Values:

    Single: Transfer should contain a single item

    Multiple: Transfer can contain multiple items

    ContentTransfer.State <String> (static)
    content-hub.js:656

    ContentTransfer.State is an enumeration of the state of a given ongoing ContentTransfer.

    Values:

    Created: Transfer created, waiting to be initiated.

    Initiated: Transfer has been initiated.

    InProgress: Transfer is in progress.

    Charged: Transfer is charged with items and ready to be collected.

    Collected: Items in the transfer have been collected.

    Aborted: Transfer has been aborted.

    Finalized: Transfer has been finished and cleaned up.

    Downloaded: Download specified by downloadId has completed.

    Downloading: Transfer is downloading item specified by downloadId.

    Example

    var api = external.getUnityObject('1.0'); var hub = api.ContentHub;

    var transferState = hub.ContentTransfer.State; var pictureContentType = hub.ContentType.Pictures;

    hub.importContentForPeer( pictureContentType, peer, function(transfer) { hub.defaultStoreForType(pictureContentType, function(store) { transfer.setStore(store, function() { transfer.start(function(state) { if (transferState.Aborted === state) { [...] } [...] }); }); }); });

    ContentType <String> (static)
    content-hub.js:576

    ContentType is an enumeration of well known content types.

    Values:

    Pictures
                    
                    Documents
                    
                    Music
                    
                    Contacts
                    
                    Videos
                    
                    Links
    Example

    var api = external.getUnityObject('1.0'); var hub = api.ContentHub;

    var pictureContentType = hub.ContentType.Pictures;

    ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/index.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/index.handl0000644000015600001650000000007312645740734033406 0ustar pbuserpbgroup00000000000000

    Welcome to Ubuntu Content Hub JavaScript API Docs

    ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub0000644000015600001650000007455512645740734033460 0ustar pbuserpbgroup00000000000000/** * ContentHub is the entry point to resource io transfer from/to remote applications (peers). * @module ContentHub */ function createContentHubApi(backendBridge) { var PLUGIN_URI = 'ContentHub'; /** * ContentTransfer is an object created by the ContentHub to and allows one to properly setup and manage a data transfer between two peers. * @class ContentTransfer * @constructor * @example var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var pictureContentType = hub.ContentType.Pictures; hub.defaultSourceForType( pictureContentType , function(peer) { hub.importContentForPeer( pictureContentType, peer, function(transfer) { [setup the transfer options and store] transfer.start(function(state) { [...] }); }); }); */ function ContentTransfer(objectid, content) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'ContentTransfer', objectid); this._store = content && content.store ? content.store : null; this._state = content && content.state ? content.state : null; this._selectionType = content && content.selectionType ? content.selectionType : null; this._contentType = content && content.contentType ? content.contentType : null; this._direction = content && content.direction ? content.direction : null; }; ContentTransfer.prototype = { // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentTransfer', objectid: self._proxy.id(), } }, // properties /** * Retrieves the current store. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method store * @param callback (optional) {Function(String)} */ store: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('store', [], callback); return; } return this._store; }, /** * Sets the current store for the ContentTransfer. * * @method setStore * @param store {ContentStore} * @param callback (optional) {Function()} called when the store has been updated */ setStore: function(store, callback) { this._proxy.call('setStore', [store.serialize(), callback]); }, /** * Retrieves the current state. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method state * @param callback (optional) {Function(ContentTransfer.State)} */ state: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('state', [], callback); return; } return this._state; }, /** * Sets the state of the transfer. * * @method setState * @param state {ContentTransfer.State} * @param callback {Function()} called when the state has been updated */ setState: function(state, callback) { this._proxy.call('setState', [state, callback]); }, /** * Notifies the listener when the state of the transfer changes. * * @method onStateChanged * @param callback {Function(ContentTransfer.State)} */ onStateChanged: function(callback) { this._proxy.call('onStateChanged', [callback]); }, /** * Retrieves the current selection type. * * @method selectionType * @param callback {Function(ContentTransfer.SelectionType)} */ selectionType: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('selectionType', [], callback); return; } return this._selectionType; }, /** * Sets the selection type (single or multiple). * * @method setSelectionType * @param selectionType {ContentTransfer.SelectionType} * @param callback {Function()} called when the state has been updated */ setSelectionType: function(selectionType, callback) { this._selectionType = selectionType; this._proxy.call('setSelectionType', [selectionType, callback]); }, /** * Retrieves the current content type. * * @method contentType * @param callback {Function(ContentTransfer.ContentType)} */ contentType: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('contentType', [], callback); return; } return this._contentType; }, /** * Sets the content type. * * @method setContentType * @param contentType {ContentTransfer.ContentType} * @param callback {Function()} called when the state has been updated */ setContentType: function(contentType, callback) { this._contentType = contentType; this._proxy.call('setContentType', [contentType, callback]); }, /** * Retrieves the current transfer direction. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method direction * @param callback (optional) {Function(ContentTransfer.Direction)} */ direction: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('direction', [], callback); return; } return this._direction; }, /** * Sets the transfer direction (import or export). * * @method setDirection * @param direction {ContentTransfer.Direction} * @param callback {Function()} called when the state has been updated */ setDirection: function(direction, callback) { this._direction = direction; this._proxy.call('setDirection', [direction, callback]); }, /** * Retrieves the list of items associated with the ContentTransfer. * * @method items * @param callback {Function( {Object{name: , url: }} )} */ items: function(callback) { this._proxy.call('items', [], callback); }, /** * Sets the list of items for the associated ContentTransfer (used when exporting). * * @method setItems * @param items {Array of Object{name: String, url: String}} * @param callback {Function()} called when the state has been updated */ setItems: function(items, callback) { this._proxy.call('setItems', [items, callback]); }, // methods /** * Starts a transfer * * @method start * @param callback {Function(ContentTransfer.State)} */ start: function(callback) { this._proxy.call('start', [callback]); }, /** * Sets State to ContentTransfer.Finalized and cleans up temporary files. * * @method finalize */ finalize: function() { this._proxy.call('finalize', []); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; /** * ContentPeer is an object returned by the ContentHub. It represents a remote peer that can be used in a request to import, export or share content. * @class ContentPeer * @module ContentHub * @constructor * @example var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var pictureContentType = hub.ContentType.Pictures; hub.defaultSourceForType( pictureContentType , function(peer) { [do something with the peer] }); */ function ContentPeer(objectid, content) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'ContentPeer', objectid); this._appId = content && content.appId ? content.appId : null; this._name = content && content.name ? content.name : null; this._handler = content && content.handler ? content.handler : null; this._contentType = content && content.contentType ? content.contentType : null; this._selectionType = content && content.selectionType ? content.selectionType : null; this._isDefaultPeer = content && content.isDefaultPeer; }; ContentPeer.prototype = { // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentPeer', objectid: self._proxy.id(), } }, // properties /** * Retrieves the app Id of the associated peer. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method appId * @return {String} Application Id for this peer * @param callback (optional) {Function(String)} */ appId: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('appId', [], callback); return; } return this._appId; }, /** * Sets the app Id of the associated peer. * * @method setAppId * @param appId {String} * @param callback {Function()} called when the appId has been updated */ setAppId: function(appId, callback) { this._proxy.call('setAppId', [appId, callback]); }, /** * Retrieves the specific ContentHandler for this peer. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method handler * @return {String} ContentHandler for this peer * @param callback (optional) {Function(String)} */ handler: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('handler', [], callback); return; } return this._handler; }, /** * Sets specific ContentHandler for this peer. * * @method setHandler * @param handler {ContentHandler} * @param callback {Function()} called when the appId has been updated */ setHandler: function(handler, callback) { this._proxy.call('setHandler', [handler, callback]); }, /** * Retrieves the specific ContentType for this peer. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method contentType * @return {String} ContentType for this peer * @param callback (optional) {Function(String)} */ contentType: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('contentType', [], callback); return; } return this._contentType; }, /** * Sets specific ContentType for this peer. * * @method setContentType * @param contentType {ContentType} * @param callback {Function()} called when the content type has been updated */ setContentType: function(contentType, callback) { this._proxy.call('setContentType', [contentType, callback]); }, /** * Retrieves the specific SelectionType for this peer. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method selectionType * @return {String} ContentTransfer.SelectionType for this peer * @param callback (optional) {Function(String)} */ selectionType: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('selectionType', [], callback); return; } return this._selectionType; }, /** * Sets specific SelectionType for this peer. * * @method setSelectionType * @param selectionType {ContentTransfer.SelectionType} * @param callback {Function()} called when the content type has been updated */ setSelectionType: function(selectionType, callback) { this._proxy.call('setSelectionType', [selectionType, callback]); }, /** * Retrieves the name of the associated peer. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method name * @param callback (optional) {Function(String)} */ name: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('name', [], callback); return; } return this._name; }, /** * Returns true if the peer is a default one, false otherwise. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method isDefaultPeer * @param callback (optional) {Function(Bool)} */ isDefaultPeer: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('isDefaultPeer', [], callback); return; } return this._isDefaultPeer; }, // methods /** * Request to exchange content with this ContentPeer. * * @method request * @param callback {Function(ContentTransfer)} Called with the resulting content transfer */ request: function(callback) { this._proxy.call('request', [], callback); }, /** * Request to import content from this ContentPeer and use a ContentStore for permanent storage. * * @method requestForStore * @param store {ContentStore} Store used as a permanent storage * @param callback {Function(ContentTransfer)} Called with the resulting content transfer */ requestForStore: function(store, callback) { this._proxy.call('requestForStore', [store.serialize()], callback); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; /** * ContentStore is an object returned by the ContentHub. It represents a location where the resources imported or exported from a peer during a transfer operation are to be either saved or found. * @class ContentStore * @module ContentHub * @constructor * @example var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var pictureContentType = hub.ContentType.Pictures; hub.defaultStoreForType(pictureContentType, function(store) { [do something with the store] }); */ function ContentStore(objectid, content) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'ContentStore', objectid); this._uri = content && content.uri ? content.uri : null; this._scope = content && content.scope ? content.scope : null; }; ContentStore.prototype = { // object methods serialize: function() { return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentStore', objectid: this._proxy.id(), } }, // properties //immutable /** * Retrieves the uri of the associated store. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method uri * @return {String} current uri * @param callback (optional) {Function(String)} */ uri: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('uri', [], callback); return; } return this._uri; }, /** * Retrieves the current scope. * * If the callback parameter is not set, the current "local" value is retrieved. * * @method scope * @return {ContentScope} current scope * @param callback (optional) {Function(ContentScope)} */ scope: function(callback) { if (callback && typeof(callback) === 'function') { this._proxy.call('scope', [], callback); return; } return this._scope; }, /** * Sets the current scope. * * @method setScope * @param scope {ContentScope} * @param callback {Function()} called when the scope has been updated */ setScope: function(scope, callback) { this._proxy.call('setScope', [scope, callback]); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; function _constructorFromName(className) { var constructorPerName = { "ContentPeer": ContentPeer, "ContentStore": ContentStore, "ContentTransfer": ContentTransfer, }; return className in constructorPerName ? constructorPerName[className] : null; }; /** * The ContentHub object. * @class ContentHub * @static * @constructor */ return { /** ContentType is an enumeration of well known content types. Values: Pictures Documents Music Contacts Videos Links EBooks Text @static @property ContentType {String} @example var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var pictureContentType = hub.ContentType.Pictures; */ ContentType: { All: "All", Unknown: "Unknown", Pictures: "Pictures", Documents: "Documents", Music: "Music", Contacts: "Contacts", Videos: "Videos", Links: "Links", Text: "Text", EBooks: "EBooks", }, /** ContentHandler is an enumeration of well known content handlers. Values: Source Destination Share @static @property ContentHandler {String} */ ContentHandler: { Source: "Source", Destination: "Destination", Share: "Share", }, /** ContentScope is an enumeration of well known scope types. Values: System User App @static @property ContentScope {String} */ ContentScope: { System: "System", User: "User", App: "App", }, ContentTransfer: { /** ContentTransfer.State is an enumeration of the state of a given ongoing ContentTransfer. Values: Created: Transfer created, waiting to be initiated. Initiated: Transfer has been initiated. InProgress: Transfer is in progress. Charged: Transfer is charged with items and ready to be collected. Collected: Items in the transfer have been collected. Aborted: Transfer has been aborted. Finalized: Transfer has been finished and cleaned up. Downloaded: Download specified by downloadId has completed. Downloading: Transfer is downloading item specified by downloadId. @static @property ContentTransfer.State {String} @example var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; var pictureContentType = hub.ContentType.Pictures; hub.importContentForPeer( pictureContentType, peer, function(transfer) { hub.defaultStoreForType(pictureContentType, function(store) { transfer.setStore(store, function() { transfer.start(function(state) { if (transferState.Aborted === state) { [...] } [...] }); }); }); }); */ State: { // Transfer created, waiting to be initiated. Created: "Created", // Transfer has been initiated. Initiated: "Initiated", // Transfer is in progress. InProgress: "InProgress", // Transfer is charged with items and ready to be collected. Charged: "Charged", // Items in the transfer have been collected. Collected: "Collected", // Transfer has been aborted. Aborted: "Aborted", // Transfer has been finished and cleaned up. Finalized: "Finalized", // Transfer has finished downloading. Downloaded: "Downloaded", // Transfer is downloading. Downloading: "Downloading", }, /** ContentTransfer.Direction is an enumeration of the directions of a given ContentTransfer. Values: Import Export Share @static @property ContentTransfer.Direction {String} */ Direction: { // Transfer is a request to import content Import: "Import", // Transfer is a request to export content Export: "Export", // Transfer is a request to share content Share: "Share", }, /** ContentTransfer.SelectionType is an enumeration of the directions of a given ContentTransfer. Values: Single: Transfer should contain a single item Multiple: Transfer can contain multiple items @static @property ContentTransfer.SelectionType {String} */ SelectionType: { // Transfer should contain a single item Single: "Single", // Transfer can contain multiple items Multiple: "Multiple", }, }, /** * Creates a ContentPeer object for the given source type. * * @method getPeers * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: * - contentType: desired ContentType * - handler: desired ContentHandler * * @param callback {Function(List of ContentPeer objects)} Callback that receives the result or null */ getPeers: function(filter, callback) { backendBridge.call('ContentHub.getPeers', [filter], callback); }, /** * Creates a ContentStore object for the given scope type. * * @method getStore * @param scope {ContentScope} The content scope for the store * @param callback {Function(ContentStore)} Callback that receives the result or null */ getStore: function(scope, callback) { backendBridge.call('ContentHub.getStore', [scope], callback); }, /** * Launches the content peer picker ui that allows the user to select a peer. * * @method launchContentPeerPicker * @param filters {Object} A dictionary of parameters to filter the result. The filtering keys are: * - contentType: desired ContentType * - handler: desired ContentHandler * - showTitle: boolean value indicating if the title should be visible * @param onPeerSelected {Function(ContentPeer)} Called when the user has selected a peer * @param onCancelPressed {Function()} Called when the user has pressed cancel */ launchContentPeerPicker: function(filters, onPeerSelected, onCancelPressed) { backendBridge.call('ContentHub.launchContentPeerPicker', [filters, onPeerSelected, onCancelPressed]); }, /** * Sets a handler that is to be called when the current application is the * target of an export request. * * @method onExportRequested * @param callback {Function(ContentTransfer)} Function when one requests a resource to be exported. * The corresponding ContentTransfer is provided as a parameter. * * @example var api = external.getUnityObject(1.0); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; function _exportRequested(transfer) { var url = window.location.href; url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png'; transfer.setItems([{name: 'Ubuntu One', url: url}], function() { transfer.setState(hub.ContentTransfer.State.Charged); }); }; hub.onExportRequested(_exportRequested); */ onExportRequested: function(callback) { backendBridge.call('ContentHub.onExportRequested', [callback]); }, /** * Sets a handler that is to be called when the current application is the * target of an share request. * * @method onShareRequested * @param callback {Function(ContentTransfer)} Function when one requests a resource to be shared. * The corresponding ContentTransfer is provided as a parameter. * * @example var api = external.getUnityObject(1.0); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; function _shareRequested(transfer) { }; hub.onShareRequested(_shareRequested); */ onShareRequested: function(callback) { backendBridge.call('ContentHub.onShareRequested', [callback]); }, /** * Sets a handler that is to be called when the current application is the * target of an import request. * * @method onImportRequested * @param callback {Function(ContentTransfer)} Function when one requests a resource to be imported. * The corresponding ContentTransfer is provided as a parameter. * * @example var api = external.getUnityObject(1.0); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; function _importRequested(transfer) { }; hub.onImportRequested(_importRequested); */ onImportRequested: function(callback) { backendBridge.call('ContentHub.onImportRequested', [callback]); }, api: { /** * Creates a ContentStore object for the given ContentPeer. * * @method api.importContent * @param type {ContentType} type of the content to import * @param peer {ContentPeer} peer who's content should be imported * @param transferOptions {Object} a dictionary of transfer options. The options are the following: * - multipleFiles {Bool}: specified if a transfer should involve multiple files or not * - scope {ContentScope}: specifies the location where the transferred files should be copied to * @param onError {Function(reason:)} called when the transfer has failed * @param onSuccess {Function(Array of {ContentItem})} called when the transfer has been a success and items are available */ importContent: function(type, peer, transferOptions, onSuccess, onError) { backendBridge.call('ContentHub.apiImportContent', [type, peer.serialize(), transferOptions, onSuccess, onError]); } }, // Internal /** * @private * */ createObjectWrapper: function(objectType, objectId, content) { var Constructor = _constructorFromName(objectType); return new Constructor(objectId, content); }, }; }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/backend/0000755000015600001650000000000012645741276031402 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hu0000644000015600001650000007175312645740734033424 0ustar pbuserpbgroup00000000000000/* * Copyright 2014-2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * * ContentHub API backend binding * */ function createContentHubApi(backendDelegate, parent) { var bridge = null try { bridge = Qt.createQmlObject( 'import QtQuick 2.0; import Ubuntu.Content 0.1 as ContentHubBridge; \ QtObject { property var hub: ContentHubBridge }', parent) } catch(e) { } if (!bridge) { console.log('Could not create ContentHub backend (does not appear to be installed)') return {}; } var ContentHubBridge = bridge.hub; var PLUGIN_URI = 'Ubuntu.Content'; var VERSION = 0.1; var _contenthub = ContentHubBridge.ContentHub; // TODO find a better way function _nameToContentType(name) { var contentTypePerName = { "All": ContentHubBridge.ContentType.All, "Unknown": ContentHubBridge.ContentType.Unknown, "Pictures": ContentHubBridge.ContentType.Pictures, "Documents": ContentHubBridge.ContentType.Documents, "Music": ContentHubBridge.ContentType.Music, "Contacts": ContentHubBridge.ContentType.Contacts, "Videos": ContentHubBridge.ContentType.Videos, "Links": ContentHubBridge.ContentType.Links, "Text": ContentHubBridge.ContentType.Text, "EBooks": ContentHubBridge.ContentType.EBooks, }; return name in contentTypePerName ? contentTypePerName[name] : ContentHubBridge.ContentType.Unknown; }; function _contentTypeToName(state) { if (state === ContentHubBridge.ContentType.All) return "All"; else if (state === ContentHubBridge.ContentType.Unknown) return "Unknown"; else if (state === ContentHubBridge.ContentType.Pictures) return "Pictures"; else if (state === ContentHubBridge.ContentType.Documents) return "Documents"; else if (state === ContentHubBridge.ContentType.Music) return "Music"; else if (state === ContentHubBridge.ContentType.Contacts) return "Contacts"; else if (state === ContentHubBridge.ContentType.Videos) return "Videos"; else if (state === ContentHubBridge.ContentType.Links) return "Links"; else if (state === ContentHubBridge.ContentType.Text) return "Text"; else if (state === ContentHubBridge.ContentType.EBooks) return "EBooks"; return "Unknown"; }; function _nameToContentTransferSelection(name) { var contentTypePerName = { "Single": ContentHubBridge.ContentTransfer.Single, "Multiple": ContentHubBridge.ContentTransfer.Multiple, }; return name in contentTypePerName ? contentTypePerName[name] : ContentHubBridge.ContentTransfer.Single; }; function _contentTransferSelectionToName(state) { if (state === ContentHubBridge.ContentTransfer.Single) return "Single"; else if (state === ContentHubBridge.ContentTransfer.Multiple) return "Multiple"; return "Single"; }; function _nameToContentHandler(name) { var contentHandlerPerName = { "Source": ContentHubBridge.ContentHandler.Source, "Destination": ContentHubBridge.ContentHandler.Destination, "Share": ContentHubBridge.ContentHandler.Share, }; return name in contentHandlerPerName ? contentHandlerPerName[name] : ContentHubBridge.ContentHandler.Source; }; function _contentHandlerToName(state) { if (state === ContentHubBridge.ContentHandler.Source) return "Source"; else if (state === ContentHubBridge.ContentHandler.Destination) return "Destination"; else if (state === ContentHubBridge.ContentHandler.Share) return "Share"; return "Source"; }; function _nameToContentTransferDirection(name) { var contentTypePerName = { "Import": ContentHubBridge.ContentTransfer.Import, "Export": ContentHubBridge.ContentTransfer.Export, "Share": ContentHubBridge.ContentTransfer.Share, }; return name in contentTypePerName ? contentTypePerName[name] : ContentHubBridge.ContentTransfer.Import; }; function _contentTransferDirectionToName(state) { if (state === ContentHubBridge.ContentTransfer.Import) return "Import"; else if (state === ContentHubBridge.ContentTransfer.Export) return "Export"; else if (state === ContentHubBridge.ContentTransfer.Share) return "Share"; return "Import"; }; function _nameToContentScope(name) { var contentScopePerName = { "System": ContentHubBridge.ContentScope.System, "User": ContentHubBridge.ContentScope.User, "App": ContentHubBridge.ContentScope.App, }; return name in contentScopePerName ? contentScopePerName[name] : ContentHubBridge.ContentScope.App; }; function _contentScopeToName(state) { if (state === ContentHubBridge.ContentScope.System) return "System"; else if (state === ContentHubBridge.ContentScope.User) return "User"; else if (state === ContentHubBridge.ContentScope.App) return "App"; return "App"; }; function _nameToContentTransferState(name) { var contentTransferStatePerName = { "Created": ContentHubBridge.ContentTransfer.Created, "Initiated": ContentHubBridge.ContentTransfer.Initiated, "InProgress": ContentHubBridge.ContentTransfer.InProgress, "Charged": ContentHubBridge.ContentTransfer.Charged, "Collected": ContentHubBridge.ContentTransfer.Collected, "Aborted": ContentHubBridge.ContentTransfer.Aborted, "Finalized": ContentHubBridge.ContentTransfer.Finalized, "Downloading": ContentHubBridge.ContentTransfer.Downloading, "Downloaded": ContentHubBridge.ContentTransfer.Downloaded, }; return name in contentTransferStatePerName ? contentTransferStatePerName[name] : ContentHubBridge.ContentTransfer.Created; }; function _contentTransferStateToName(state) { if (state === ContentHubBridge.ContentTransfer.Created) return "Created"; else if (state === ContentHubBridge.ContentTransfer.Initiated) return "Initiated"; else if (state === ContentHubBridge.ContentTransfer.InProgress) return "InProgress"; else if (state === ContentHubBridge.ContentTransfer.Charged) return "Charged"; else if (state === ContentHubBridge.ContentTransfer.Collected) return "Collected"; else if (state === ContentHubBridge.ContentTransfer.Aborted) return "Aborted"; else if (state === ContentHubBridge.ContentTransfer.Finalized) return "Finalized"; else if (state === ContentHubBridge.ContentTransfer.Downloading) return "Downloading"; else if (state === ContentHubBridge.ContentTransfer.Downloaded) return "Downloaded"; return ""; }; function ContentTransfer(transfer, objectid) { var id = objectid; if ( ! transfer) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ContentTransfer'); id = result.id; transfer = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(transfer, PLUGIN_URI, VERSION, 'ContentTransfer'); } this._id = id; this._object = transfer; this._callback = null; }; ContentTransfer.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentTransfer', objectid: self._id, // serialize immutable values content: { store: self._object.store, state: self._object.state, selectionType: self._object.selectionType, contentType: self._object.contentType, direction: self._object.direction } } }, // properties store: function(callback) { this._validate(); callback(this._object.store); }, setStore: function(storeProxy, callback) { this._validate(); if (backendDelegate.isObjectProxyInfo(storeProxy)) { var store = backendDelegate.objectFromId(storeProxy.objectid); if (store) this._object.setStore(store); } else { console.debug('setStore: invalid store object proxy'); } if (callback) callback(); }, state: function(callback) { this._validate(); callback(_contentTransferStateToName(this._object.state)); }, setState: function(state, callback) { this._validate(); this._object.state = _nameToContentTransferState(state); if (callback && typeof(callback) === 'function') callback(); }, onStateChanged: function(callback) { if (!callback || typeof(callback) !== 'function') return; this._validate(); var self = this; this._object.onStateChanged.connect(function() { callback(_contentTransferStateToName(self._object.state)); }); }, contentType: function(callback) { this._validate(); callback(_contentTypeToName(this._object.contentType)); }, setContentType: function(contentType, callback) { this._validate(); this._object.contentType = _nameToContentType(contentType); if (callback && typeof(callback) === 'function') callback(); }, selectionType: function(callback) { this._validate(); callback(_contentTransferSelectionToName(this._object.selectionType)); }, setSelectionType: function(selectionType, callback) { this._validate(); this._object.selectionType = _nameToContentTransferSelection(selectionType); if (callback && typeof(callback) === 'function') callback(); }, direction: function(callback) { this._validate(); callback(_contentTransferDirectionToName(this._object.direction)); }, setDirection: function(direction, callback) { this._validate(); this._object.direction = _nameToContentTransferDirection(direction); if (callback && typeof(callback) === 'function') callback(); }, items: function(callback) { this._validate(); // return in serialized form callback(this.internal.serializeItems(this._object)); }, setItems: function(items, callback) { this._validate(); var contentItems = []; for (var i = 0; i < items.length; ++i) { var item = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ContentItem'); if ( ! item.object) { console.debug('Could not create ContentItem object'); continue; } item.object.name = items[i].name; item.object.url = items[i].url; if (items[i].text) { item.object.text = items[i].text; } contentItems.push(item.object); } this._object.items = contentItems; if (callback && typeof(callback) === 'function') callback(); }, // methods start: function(callback) { this._validate(); var self = this; this._callback = function () { callback(_contentTransferStateToName(self._object.state)); }; this._object.stateChanged.connect(this._callback); this._object.start(); }, finalize: function() { this._validate(); if (this._callback) this._object.stateChanged.disconnect(this._callback); this._callback = null; this._object.finalize(); }, // internal internal: { serializeItems: function(self) { var items = []; for (var i = 0; i < self.items.length; ++i) { items.push({ name: self.items[i].name.toString(), url: self.items[i].url.toString(), text: self.items[i].text.toString() }); } return items; } } }; function ContentStore(store, objectid) { var id = objectid; if ( ! store) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ContentStore'); id = result.id; store = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(store, PLUGIN_URI, VERSION, 'ContentStore'); } this._id = id; this._object = store; }; ContentStore.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentStore', objectid: this._id, // serialize immutable values content: { uri: self._object.uri, scope: _contentScopeToName(self._object.scope), } } }, // properties scope: function(callback) { this._validate(); callback(_contentScopeToName(this._object.scope)); }, setScope: function(scope, callback) { this._validate(); this._object.scope = _nameToContentScope(scope); if (callback && typeof(callback) === 'function') callback(); }, //immutable uri: function(callback) { this._validate(); callback(this._object.uri); }, }; function ContentPeer(peer, objectid) { var id = objectid; if ( ! peer) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ContentPeer'); id = result.id; peer = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(peer, PLUGIN_URI, VERSION, 'ContentPeer'); } this._id = id; this._object = peer; }; ContentPeer.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { var self = this; return { type: 'object-proxy', apiid: 'ContentHub', objecttype: 'ContentPeer', objectid: self._id, // serialize immutable values content: { appId: self._object.appId, name: self._object.name, handler: self._object.handler, contentType: self._object.contentType, selectionType: self._object.selectionType, isDefaultPeer: self._object.isDefaultPeer, }, } }, // properties appId: function(callback) { this._validate(); callback(this._object.appId); }, setAppId: function(appId, callback) { this._validate(); this._object.appId = appId; if (callback && typeof(callback) === 'function') callback(); }, handler: function(callback) { this._validate(); callback(_contentHandlerToName(this._object.handler)); }, setHandler: function(handler, callback) { this._validate(); this._object.handler = _nameToContentHandler(handler); if (callback && typeof(callback) === 'function') callback(); }, contentType: function(callback) { this._validate(); callback(_contentTypeToName(this._object.contentType)); }, setContentType: function(contentType, callback) { this._validate(); this._object.contentType = _nameToContentType(contentType); if (callback && typeof(callback) === 'function') callback(); }, selectionType: function(callback) { this._validate(); callback(_contentTransferSelectionToName(this._object.selectionType)); }, setSelectionType: function(selectionType, callback) { this._validate(); this._object.selectionType = _nameToContentTransferSelection(selectionType); if (callback && typeof(callback) === 'function') callback(); }, // immutable name: function(callback) { this._validate(); callback(this._object.name); }, isDefaultPeer: function(callback) { this._validate(); callback(this._object.isDefaultPeer); }, // methods request: function(callback) { this._validate(); var transfer = new ContentTransfer(this._object.request()); if (callback && typeof(callback) === 'function') callback(transfer.serialize()); }, requestForStore: function(store, callback) { if ( ! store) { callback(null); return; } if (! backendDelegate.isObjectProxyInfo(store)) { console.debug('requestForStore: invalid store object proxy') callback("Invalid store"); return; } var _store = backendDelegate.objectFromId(store.objectid); if ( ! _store) { callback("Invalid store object (NULL)"); return; } this._validate(); var transfer = new ContentTransfer(this._object.request(_store)); if (callback && typeof(callback) === 'function') callback(transfer.serialize()); }, // internal internal: { request: function(self) { return self._object.request(); } } }; function ContentPeerModel(filterParams) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'ContentPeerModel', filterParams); this._id = result.id; this._object = result.object; this._modelAdaptor = backendDelegate.createModelAdaptorFor(this._object); this._roles = this._modelAdaptor.roles(); }; ContentPeerModel.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); this._modelAdaptor.destroy(); backendDelegate.deleteId(this._id); }, // properties setContentType: function(contentType, callback) { this._validate(); this._object.contentType = contentType; if (callback) callback(); }, setHandler: function(handler, callback) { this._validate(); this._object.handler = handler; if (callback) callback(); }, peers: function() { this._validate(); return this._object.peers; }, // QAbtractListModel prototype count: function(callback) { if (!this._modelAdaptor) { callback(-1); return; } callback(this._modelAdaptor.rowCount()); }, }; function _constructorFromName(className) { var constructorPerName = { "ContentPeer": ContentPeer, "ContentStore": ContentStore, "ContentTransfer": ContentTransfer, }; return className in constructorPerName ? constructorPerName[className] : null; } return { getPeers: function(filters, callback) { if ( ! filters){ callback(null); return; } var statement = "import QtQuick 2.0; import Ubuntu.Content 0.1; ContentPeerModel { "; if (filters.contentType) { statement += " contentType: ContentType." + filters.contentType + ";"; } if (filters.handler) { statement += " handler: ContentHandler." + filters.handler + ";"; } statement += " }"; var peerModel = Qt.createQmlObject(statement, backendDelegate.parent()); var peers = peerModel.peers; var wrappedPeers = []; for (var i = 0; i < peers.length; ++i) { var wrappedPeer = new ContentPeer(peers[i]); wrappedPeers.push(wrappedPeer.serialize()); } callback(wrappedPeers); }, getStore: function(scope, callback) { if ( ! scope){ callback(null); return; } var store = new ContentStore(); store.setScope(scope); callback(store.serialize()); }, launchContentPeerPicker: function(filters, onPeerSelected, onCancelPressed) { if ( ! filters){ callback(null); return; } var parentItem = backendDelegate.parentView(); if ( ! parentItem || ! parentItem.visible || ! parentItem.height || ! parentItem.width) { console.debug("Cannot launch the content peer picker UI, invalid parent item: " + parentItem); onCancelPressed(); return; } var statement = "import QtQuick 2.0; import Ubuntu.Content 0.1; ContentPeerPicker {"; if (filters.contentType) { statement += " contentType: ContentType." + filters.contentType + ""; } if (filters.handler) { statement += "; handler: ContentHandler." + filters.handler + ""; } if (filters.showTitle) { statement += "; showTitle: " + filters.showTitle === false ? "false" : "true"; } statement += "; visible: true; }"; if (parentItem.parent) parentItem.visible = false; var contentPeerPicker = Qt.createQmlObject(statement, parentItem.parent ? parentItem.parent : parentItem); function _onPeerSelected() { var peer = new ContentPeer(contentPeerPicker.peer); contentPeerPicker.visible = false; parentItem.visible = true; onPeerSelected(peer.serialize()); contentPeerPicker.onPeerSelected.disconnect(_onPeerSelected); contentPeerPicker.destroy(); } function _onCancelPressed() { contentPeerPicker.visible = false; parentItem.visible = true; onCancelPressed(); contentPeerPicker.onPeerSelected.disconnect(_onCancelPressed); contentPeerPicker.destroy(); } contentPeerPicker.onPeerSelected.connect(_onPeerSelected); contentPeerPicker.onCancelPressed.connect(_onCancelPressed); }, apiImportContent: function(type, peer, transferOptions, onSuccess, onFailure) { if (! backendDelegate.isObjectProxyInfo(peer)) { console.debug('apiImportContent: invalid peer object proxy') onError("Invalid peer"); return; } var _type = _nameToContentType(type); var _peer = backendDelegate.objectFromId(peer.objectid); if ( ! _peer) { onError("Invalid peer object (NULL)"); return; } var _transfer = null; if (transferOptions.scope) { var store = new ContentStore(); store.setScope(transferOptions.scope); _transfer = _peer.request(store._object); } else { _transfer = _peer.request(); } if (transferOptions.multipleFiles) { _transfer.selectionType = ContentHubBridge.ContentTransfer.Multiple; } else { _transfer.selectionType = ContentHubBridge.ContentTransfer.Single; } var transfer = new ContentTransfer(_transfer) _transfer.stateChanged.connect(function() { if (_transfer.state === ContentHubBridge.ContentTransfer.Aborted) { onFailure("Aborted"); return; } else if (_transfer.state === ContentHubBridge.ContentTransfer.Charged) { var d = transfer.internal.serializeItems(_transfer); onSuccess(d); _transfer.finalize(); return; } }); _transfer.start(); }, onExportRequested: function(callback) { _contenthub.exportRequested.connect(function(exportTransfer) { var wrapped = new ContentTransfer(exportTransfer); callback(wrapped.serialize()); }); }, onImportRequested: function(callback) { _contenthub.onImportRequested.connect(function(importTransfer) { var wrapped = new ContentTransfer(importTransfer); callback(wrapped.serialize()); }); }, onShareRequested: function(callback) { _contenthub.shareRequested.connect(function(shareTransfer) { var wrapped = new ContentTransfer(shareTransfer); callback(wrapped.serialize()); }); }, // Internal dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; var objectid = infos.objectid; var class_name = infos.class_name; if (callback) args.push(callback); var o = backendDelegate.objectFromId(objectid); if (o == null) { console.debug('Cannot dispatch to unknown object: ' + objectid); return; } var Constructor = _constructorFromName(class_name); var instance = new Constructor(o, objectid); instance[method_name].apply(instance, args); } }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/0000755000015600001650000000000012645741276027430 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/0000755000015600001650000000000012645741276030706 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/yuidoc.json0000644000015600001650000000033512645740734033074 0ustar pbuserpbgroup00000000000000{ "name": "Alarms JS API", "description": "Ubuntu App Platform Alarms JavaScript API docs", "version": "0.1", "options": { "outdir": "./docsbuild", "themedir": "../../yuidoc-theme" } } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/alarm-api.js0000644000015600001650000003515712645740734033120 0ustar pbuserpbgroup00000000000000/** * AlarmApi gives access to Alarm management. * @module AlarmApi */ function createAlarmApi(backendBridge) { var PLUGIN_URI = 'Alarm'; /** * An Alarm. * @class Alarm * @constructor * @example var date = new Date(); var api = external.getUnityObject('1.0'); api.AlarmApi.api.createAndSaveAlarmFor( date, api.AlarmApi.AlarmType.OneTime, api.AlarmApi.AlarmDayOfWeek.AutoDetect, "alarm triggered", function(errorid) { console.log(api.AlarmApi.api.errorToMessage(errorid)); }); */ function Alarm(id) { this._proxy = backendBridge.createRemoteObject( PLUGIN_URI, 'Alarm', id); }; Alarm.prototype = { // properties /** * The property holds the error code occurred during the last performed operation. * * @method error * @param callback {Function(Error)} */ error: function(callback) { this._proxy.call('error', [], callback); }, /** * Retrieves the alarm date. * * The date property holds the date the alarm will be triggered. * The default value is the current date and time the alarm object was created. * Further reset calls will bring the value back to the time the reset was called. * * @method error * @param callback {Function(Date)} */ date: function(callback) { this._proxy.call('date', [] , function(datems) { var d = new Date(); d.setTime(datems); return d; }); }, /** * Sets the alarm date. * * @method setDate * @param date {Date} * @param callback (optional) {Function()} To be called after the date is set. */ setDate: function(date, callback) { this._proxy.call('setDate', [date.getTime(), callback]); }, /** * Retrieves the alarm's enabled state. * * The property specifies whether the alarm is enabled or not. * Disable dalarms are not scheduled. The default value is true * * @method enabled * @param callback {Function(Boolean)} */ enabled: function(callback) { this._proxy.call('enabled', [], callback); }, /** * Sets the alarm's enabled state. * * @method setEnabled * @param enabled {Boolean} * @param callback (optional) {Function()} To be called after the enabled state is set. */ setEnabled: function(enabled, callback) { this._proxy.call('setEnabled', [enabled, callback]); }, /** * Retrieves the alarm message. * * The property holds the message string which will be displayed when the alarm is triggered. * The default value is the localized "Alarm" text * * @method message * @param callback {Function(String)} */ message: function(callback) { this._proxy.call('message', [], callback); }, /** * Sets the alarm message. * * @method setMessage * @param message {String} * @param callback (optional) {Function()} To be called after the message is set. */ setMessage: function(message, callback) { this._proxy.call('setMessage', [message, callback]); }, /** * Retrieves the alarm sound. * * The property holds the alarm's sound to be played when the alarm is triggered. * An empty url will mean to play the default sound. * * The default value is an empty url. * * @method sound * @param callback {Function(String)} */ sound: function(callback) { this._proxy.call('sound', [], callback); }, /** * Sets the alarm sound. * * @method setSound * @param sound {String} * @param callback (optional) {Function()} To be called after the sound is set. */ setSound: function(sound, callback) { this._proxy.call('setSound', [sound, callback]); }, /** * Retrieves the alarm status. * * The property holds the status of the last performed operation * * @method status * @param callback {Function(String)} */ status: function(callback) { this._proxy.call('status', [], callback); }, /** * Retrieves the alarm type. * * The property holds the type of the alarm. * The default value is AlarmType.OneTime * * @method type * @param callback {Function(AlarmType)} */ type: function(callback) { this._proxy.call('type', [], callback); }, /** * Sets the alarm type. * * @method setType * @param type {AlarmType} * @param callback (optional) {Function()} To be called after the type is set. */ setType: function(type, callback) { this._proxy.call('setType', [type, callback]); }, /** * Retrieves the alarm day of the week. * * The property holds the days of the week the alarm is scheduled. * This property can have only one day set for one time alarms and multiple days for repeating alarms. * * @method daysOfWeek * @param callback {Function(AlarmType)} */ daysOfWeek: function(callback) { this._proxy.call('daysOfWeek', [], callback); }, /** * Sets the alarm day of the week. * * @method setDaysOfWeek * @param daysOfWeek {AlarmDayOfWeek} * @param callback (optional) {Function()} To be called after the day of the week is set. */ setDaysOfWeek: function(daysOfWeek, callback) { this._proxy.call('setDaysOfWeek', [daysOfWeek, callback]); }, // methods /** * Cancels a given Alarm. * * @method cancel */ cancel: function() { this._proxy.call('cancel', []); }, /** * Resets a given Alarm. * * @method reset */ reset: function() { this._proxy.call('reset', []); }, /** * Saves the alarm as a system wide alarm with the parameters previously set. * * @method save */ save: function() { this._proxy.call('save', []); }, // extras /** * Destroys the remote object. This proxy object is not valid anymore. * * @method destroy */ destroy: function() { this._proxy.call('destroy', []); }, }; function _constructorFromName(className) { var constructorPerName = { "Alarm": Alarm, }; return className in constructorPerName ? constructorPerName[className] : null; }; /** * The AlarmApi object * @class AlarmApi * @constructor * @example var date = new Date(); var api = external.getUnityObject('1.0'); api.AlarmApi.api.createAndSaveAlarmFor( date, api.AlarmApi.AlarmType.OneTime, api.AlarmApi.AlarmDayOfWeek.AutoDetect, "alarm triggered", function(errorid) { console.log(api.AlarmApi.api.errorToMessage(errorid)); }); */ return { /** Enumeration of the available types of Alarm. Values: OneTime: The alarm occurs only once Repeating: The alarm is a repeating one, either daily, weekly on a given day or on selected days @static @property AlarmType {Object} @example var api = external.getUnityObject('1.0'); var alarmtype = api.AlarmApi.AlarmType; // use alarmtype.OneTime or alarmtype.Repeating */ AlarmType: { // The alarm occurs only once. OneTime: "OneTime", // The alarm is a repeating one, either daily, weekly on a given day or on selected days. Repeating: "Repeating", }, /** Flags for the week days an Alarm should be triggered. Values: Monday: The alarm will kick on Mondays Tuesday: The alarm will kick on Tuesdays Wednesday: The alarm will kick on Wednesday Thursday: The alarm will kick on Thursday Friday: The alarm will kick on Friday Saturday: The alarm will kick on Saturday Sunday: The alarm will kick on Sunday AutoDetect: The alarm day will be detected from the alarm date. @static @property AlarmDayOfWeek {Integer} @example var api = external.getUnityObject('1.0'); var dayofweek = api.AlarmApi.AlarmDayOfWeek; // use dayofweek.Monday or/and dayofweek.Tuesday, etc. */ AlarmDayOfWeek: { // The alarm will kick on Mondays. Monday: 1, // The alarm will kick on Tuesdays. Tuesday: 2, // The alarm will kick on Wednesdays. Wednesday: 4, // The alarm will kick on Thursdays. Thursday: 8, // The alarm will kick on Fridays. Friday: 16, // The alarm will kick on Saturdays. Saturday: 32, // The alarm will kick on Sundays. Sunday: 64, // The alarm day will be detected from the alarm date. AutoDetect: 128, }, /** Error ids returned during AlarmApi calls. Values: NoError: Successful operation completion InvalidDate: The date specified for the alarm was invalid EarlyDate: The date specified for the alarm is an earlier date than the current one NbDaysOfWeek: The daysOfWeek parameter of the alarm was not specified OneTimeOnMoreDays: The one-time alarm was set to be kicked in several days InvalidEvent: The alarm event is invalid AdaptationError: The error occurred in alarm adaptation layer. Adaptations may define additional behind this value @static @property AlarmError {Integer} @example var date = new Date(); var api = external.getUnityObject('1.0'); api.AlarmApi.api.createAndSaveAlarmFor( date, api.AlarmApi.AlarmType.OneTime, api.AlarmApi.AlarmDayOfWeek.AutoDetect, "alarm triggered", function(errorid) { console.log(api.AlarmApi.api.errorToMessage(errorid)); }); */ AlarmError: { // Successful operation completion NoError: 0, // The date specified for the alarm was invalid InvalidDate: 1, // The date specified for the alarm is an earlier date than the current one EarlyDate: 2, // The daysOfWeek parameter of the alarm was not specified NoDaysOfWeek: 3, // The one-time alarm was set to be kicked in several days OneTimeOnMoreDays: 4, // The alarm event is invalid InvalidEvent: 5, // The error occurred in alarm adaptation layer. Adaptations may define additional behind this value AdaptationError: 6, }, /** * Creates a Alarm object. * * @method createAlarm * @param callback {Function(Alarm)} Function called with the created Alarm. */ createAlarm: function(callback) { backendBridge.call('Alarm.createAlarm' , [] , callback); }, api: { /** * Creates and saves a new alarm. * * @method api.createAndSaveAlarmFor * @param date {Date} date at which the alarm is to be triggered. * @param type {AlarmType} type of the alarm. * @param daysOfWeek {AlarmDayOfWeek} days of the week the alarm is scheduled. * @param message {String} Message to be displayed when the alarm is triggered. * @param callback (optional) {Function(AlarmError)} Function to be called when the alarm has been saved. */ createAndSaveAlarmFor: function(date, type, daysOfWeek, message, callback) { backendBridge.call('Alarm.createAndSaveAlarmFor' , [date.getTime(), type, daysOfWeek, message, callback]); }, /** * Returns a message adapted to the given error id. * * @method api.errorToMessage * @param error {AlarmError} error id. */ errorToMessage: function(error) { var messagePerError = [ "Successful operation completion", "The date specified for the alarm was invalid", "The date specified for the alarm is an earlier date than the current one", "The daysOfWeek parameter of the alarm was not specified", "The one-time alarm was set to be kicked in several days", "The alarm event is invalid", "The error occurred in alarm adaptation layer" ]; return error < messagePerError.length ? messagePerError[error] : "Invalid error id"; }, }, // Internal /** * @private * */ createObjectWrapper: function(objectType, objectId, content) { var Constructor = _constructorFromName(objectType); return new Constructor(objectId, content); }, }; }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/0000755000015600001650000000000012645741276032656 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015300000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/data.jsonunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/dat0000644000015600001650000004414212645740734033354 0ustar pbuserpbgroup00000000000000{ "project": { "name": "Alarms JS API", "description": "Ubuntu App Platform Alarms JavaScript API docs", "version": "0.1" }, "files": { "alarm-api.js": { "name": "alarm-api.js", "modules": { "AlarmApi": 1 }, "classes": { "Alarm": 1, "AlarmApi": 1 }, "fors": {}, "namespaces": {} } }, "modules": { "AlarmApi": { "name": "AlarmApi", "submodules": {}, "classes": { "Alarm": 1, "AlarmApi": 1 }, "fors": {}, "namespaces": {}, "tag": "module", "file": "alarm-api.js", "line": 254, "description": "AlarmApi gives access to Alarm management." } }, "classes": { "Alarm": { "name": "Alarm", "shortname": "Alarm", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "AlarmApi", "namespace": "", "file": "alarm-api.js", "line": 9, "description": "An Alarm.", "is_constructor": 1, "example": [ "\n\n var date = new Date();\n \n\n var api = external.getUnityObject('1.0');\n api.AlarmApi.api.createAndSaveAlarmFor(\n date,\n api.AlarmApi.AlarmType.OneTime,\n api.AlarmApi.AlarmDayOfWeek.AutoDetect,\n \"alarm triggered\",\n function(errorid) {\n console.log(api.AlarmApi.api.errorToMessage(errorid));\n });" ] }, "AlarmApi": { "name": "AlarmApi", "shortname": "AlarmApi", "classitems": [], "plugins": [], "extensions": [], "plugin_for": [], "extension_for": [], "module": "AlarmApi", "namespace": "", "file": "alarm-api.js", "line": 254, "description": "The AlarmApi object", "is_constructor": 1, "example": [ "\n\n var date = new Date();\n \n\n var api = external.getUnityObject('1.0');\n api.AlarmApi.api.createAndSaveAlarmFor(\n date,\n api.AlarmApi.AlarmType.OneTime,\n api.AlarmApi.AlarmDayOfWeek.AutoDetect,\n \"alarm triggered\",\n function(errorid) {\n console.log(api.AlarmApi.api.errorToMessage(errorid));\n });" ] } }, "classitems": [ { "file": "alarm-api.js", "line": 37, "description": "The property holds the error code occurred during the last performed operation.", "itemtype": "method", "name": "error", "params": [ { "name": "callback", "description": "", "type": "Function(Error)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 47, "description": "Retrieves the alarm date.\n\nThe date property holds the date the alarm will be triggered.\nThe default value is the current date and time the alarm object was created.\nFurther reset calls will bring the value back to the time the reset was called.", "itemtype": "method", "name": "error", "params": [ { "name": "callback", "description": "", "type": "Function(Date)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 63, "description": "Sets the alarm date.", "itemtype": "method", "name": "setDate", "params": [ { "name": "date", "description": "", "type": "Date" }, { "name": "callback", "description": "(optional) To be called after the date is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 74, "description": "Retrieves the alarm's enabled state.\n\nThe property specifies whether the alarm is enabled or not.\nDisable dalarms are not scheduled. The default value is true", "itemtype": "method", "name": "enabled", "params": [ { "name": "callback", "description": "", "type": "Function(Boolean)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 86, "description": "Sets the alarm's enabled state.", "itemtype": "method", "name": "setEnabled", "params": [ { "name": "enabled", "description": "", "type": "Boolean" }, { "name": "callback", "description": "(optional) To be called after the enabled state is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 97, "description": "Retrieves the alarm message.\n\nThe property holds the message string which will be displayed when the alarm is triggered.\nThe default value is the localized \"Alarm\" text", "itemtype": "method", "name": "message", "params": [ { "name": "callback", "description": "", "type": "Function(String)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 109, "description": "Sets the alarm message.", "itemtype": "method", "name": "setMessage", "params": [ { "name": "message", "description": "", "type": "String" }, { "name": "callback", "description": "(optional) To be called after the message is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 120, "description": "Retrieves the alarm sound.\n\nThe property holds the alarm's sound to be played when the alarm is triggered.\nAn empty url will mean to play the default sound.\n\nThe default value is an empty url.", "itemtype": "method", "name": "sound", "params": [ { "name": "callback", "description": "", "type": "Function(String)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 134, "description": "Sets the alarm sound.", "itemtype": "method", "name": "setSound", "params": [ { "name": "sound", "description": "", "type": "String" }, { "name": "callback", "description": "(optional) To be called after the sound is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 145, "description": "Retrieves the alarm status.\n\nThe property holds the status of the last performed operation", "itemtype": "method", "name": "status", "params": [ { "name": "callback", "description": "", "type": "Function(String)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 157, "description": "Retrieves the alarm type.\n\nThe property holds the type of the alarm.\nThe default value is AlarmType.OneTime", "itemtype": "method", "name": "type", "params": [ { "name": "callback", "description": "", "type": "Function(AlarmType)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 169, "description": "Sets the alarm type.", "itemtype": "method", "name": "setType", "params": [ { "name": "type", "description": "", "type": "AlarmType" }, { "name": "callback", "description": "(optional) To be called after the type is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 180, "description": "Retrieves the alarm day of the week.\n\nThe property holds the days of the week the alarm is scheduled.\nThis property can have only one day set for one time alarms and multiple days for repeating alarms.", "itemtype": "method", "name": "daysOfWeek", "params": [ { "name": "callback", "description": "", "type": "Function(AlarmType)" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 192, "description": "Sets the alarm day of the week.", "itemtype": "method", "name": "setDaysOfWeek", "params": [ { "name": "daysOfWeek", "description": "", "type": "AlarmDayOfWeek" }, { "name": "callback", "description": "(optional) To be called after the day of the week is set.", "type": "Function()" } ], "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 206, "description": "Cancels a given Alarm.", "itemtype": "method", "name": "cancel", "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 215, "description": "Resets a given Alarm.", "itemtype": "method", "name": "reset", "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 224, "description": "Saves the alarm as a system wide alarm with the parameters previously set.", "itemtype": "method", "name": "save", "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 235, "description": "Destroys the remote object. This proxy object is not valid anymore.", "itemtype": "method", "name": "destroy", "class": "Alarm", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 275, "description": "Enumeration of the available types of Alarm.\n\n Values:\n\n OneTime: The alarm occurs only once\n\n Repeating: The alarm is a repeating one,\n either daily, weekly on a given day\n or on selected days", "static": 1, "itemtype": "property", "name": "AlarmType", "type": "Object", "example": [ "\n\n var api = external.getUnityObject('1.0');\n var alarmtype = api.AlarmApi.AlarmType;\n // use alarmtype.OneTime or alarmtype.Repeating" ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 303, "description": "Flags for the week days an Alarm should be triggered.\n\n Values:\n\n Monday: The alarm will kick on Mondays\n\n Tuesday: The alarm will kick on Tuesdays\n\n Wednesday: The alarm will kick on Wednesday\n\n Thursday: The alarm will kick on Thursday\n\n Friday: The alarm will kick on Friday\n\n Saturday: The alarm will kick on Saturday\n\n Sunday: The alarm will kick on Sunday\n\n AutoDetect: The alarm day will be detected\n from the alarm date.", "static": 1, "itemtype": "property", "name": "AlarmDayOfWeek", "type": "Integer", "example": [ "\n\n var api = external.getUnityObject('1.0');\n var dayofweek = api.AlarmApi.AlarmDayOfWeek;\n // use dayofweek.Monday or/and dayofweek.Tuesday, etc." ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 360, "description": "Error ids returned during AlarmApi calls.\n\n Values:\n\n NoError: Successful operation completion\n \n InvalidDate: The date specified for the alarm was invalid\n \n EarlyDate: The date specified for the alarm is an earlier\n date than the current one\n\n NbDaysOfWeek: The daysOfWeek parameter of the alarm was not specified\n \n OneTimeOnMoreDays: The one-time alarm was set to be kicked in several days\n \n InvalidEvent: The alarm event is invalid\n \n AdaptationError: The error occurred in alarm adaptation layer.\n Adaptations may define additional behind this value", "static": 1, "itemtype": "property", "name": "AlarmError", "type": "Integer", "example": [ "\n var date = new Date();\n \n\n var api = external.getUnityObject('1.0');\n api.AlarmApi.api.createAndSaveAlarmFor(\n date,\n api.AlarmApi.AlarmType.OneTime,\n api.AlarmApi.AlarmDayOfWeek.AutoDetect,\n \"alarm triggered\",\n function(errorid) {\n console.log(api.AlarmApi.api.errorToMessage(errorid));\n });" ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 422, "description": "Creates a Alarm object.", "itemtype": "method", "name": "createAlarm", "params": [ { "name": "callback", "description": "Function called with the created Alarm.", "type": "Function(Alarm)" } ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 435, "description": "Creates and saves a new alarm.", "itemtype": "method", "name": "api.createAndSaveAlarmFor", "params": [ { "name": "date", "description": "date at which the alarm is to be triggered.", "type": "Date" }, { "name": "type", "description": "type of the alarm.", "type": "AlarmType" }, { "name": "daysOfWeek", "description": "days of the week the alarm is scheduled.", "type": "AlarmDayOfWeek" }, { "name": "message", "description": "Message to be displayed when the alarm is triggered.", "type": "String" }, { "name": "callback", "description": "(optional) Function to be called when the alarm has been saved.", "type": "Function(AlarmError)" } ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 450, "description": "Returns a message adapted to the given error id.", "itemtype": "method", "name": "api.errorToMessage", "params": [ { "name": "error", "description": "error id.", "type": "AlarmError" } ], "class": "AlarmApi", "module": "AlarmApi" }, { "file": "alarm-api.js", "line": 475, "access": "private", "tagname": "", "class": "AlarmApi", "module": "AlarmApi" } ], "warnings": [ { "message": "Missing item type", "line": " alarm-api.js:475" } ] }././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/modules/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/mod0000755000015600001650000000000012645741276033356 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016700000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/modules/AlarmApi.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/mod0000644000015600001650000000566512645740734033372 0ustar pbuserpbgroup00000000000000 AlarmApi - Alarms JS API
    API Docs for: 0.1

    AlarmApi

    AlarmApi gives access to Alarm management.

    This module has the following classes:



    Module description found: alarm-api.js:254
    ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/files/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/fil0000755000015600001650000000000012645741276033351 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/files/alarm-api.js.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/fil0000644000015600001650000004301412645740734033353 0ustar pbuserpbgroup00000000000000 alarm-api.js - Alarms JS API
    API Docs for: 0.1

    alarm-api.js

    /**
     * AlarmApi gives access to Alarm management.
    
     * @module AlarmApi
     */
    function createAlarmApi(backendBridge) {
        var PLUGIN_URI = 'Alarm';
    
    /**
     * An Alarm.
    
     * @class Alarm
     * @constructor
     * @example
    
          var date = new Date();
          <set a valid date in the future>
    
          var api = external.getUnityObject('1.0');
          api.AlarmApi.api.createAndSaveAlarmFor(
              date,
              api.AlarmApi.AlarmType.OneTime,
              api.AlarmApi.AlarmDayOfWeek.AutoDetect,
              "alarm triggered",
              function(errorid) {
                  console.log(api.AlarmApi.api.errorToMessage(errorid));
              });
     */
        function Alarm(id) {
            this._proxy = backendBridge.createRemoteObject(
                PLUGIN_URI, 'Alarm', id);
        };
        Alarm.prototype = {
    
            // properties
    
            /**
             * The property holds the error code occurred during the last performed operation.
             *
             * @method error
             * @param callback {Function(Error)}
             */
            error: function(callback) {
                this._proxy.call('error', [], callback);
            },
    
            /**
             * Retrieves the alarm date.
             *
             * The date property holds the date the alarm will be triggered.
             * The default value is the current date and time the alarm object was created.
             * Further reset calls will bring the value back to the time the reset was called.
             *
             * @method error
             * @param callback {Function(Date)}
             */
            date: function(callback) {
                this._proxy.call('date', []
                                 , function(datems) {
                                     var d = new Date(); d.setTime(datems); return d;
                                 });
            },
            /**
             * Sets the alarm date.
             *
             * @method setDate
             * @param date {Date}
             * @param callback (optional) {Function()} To be called after the date is set.
             */
            setDate: function(date, callback) {
                this._proxy.call('setDate', [date.getTime(), callback]);
            },
    
            /**
             * Retrieves the alarm's enabled state.
             *
             * The property specifies whether the alarm is enabled or not.
             * Disable dalarms are not scheduled. The default value is true
             *
             * @method enabled
             * @param callback {Function(Boolean)}
             */
            enabled: function(callback) {
                this._proxy.call('enabled', [], callback);
            },
            /**
             * Sets the alarm's enabled state.
             *
             * @method setEnabled
             * @param enabled {Boolean}
             * @param callback (optional) {Function()} To be called after the enabled state is set.
             */
            setEnabled: function(enabled, callback) {
                this._proxy.call('setEnabled', [enabled, callback]);
            },
    
            /**
             * Retrieves the alarm message.
             *
             * The property holds the message string which will be displayed when the alarm is triggered.
             * The default value is the localized "Alarm" text
             *
             * @method message
             * @param callback {Function(String)}
             */
            message: function(callback) {
                this._proxy.call('message', [], callback);
            },
            /**
             * Sets the alarm message.
             *
             * @method setMessage
             * @param message {String}
             * @param callback (optional) {Function()} To be called after the message is set.
             */
            setMessage: function(message, callback) {
                this._proxy.call('setMessage', [message, callback]);
            },
    
            /**
             * Retrieves the alarm sound.
             *
             * The property holds the alarm's sound to be played when the alarm is triggered.
             * An empty url will mean to play the default sound.
             *
             * The default value is an empty url.
             *
             * @method sound
             * @param callback {Function(String)}
             */
            sound: function(callback) {
                this._proxy.call('sound', [], callback);
            },
            /**
             * Sets the alarm sound.
             *
             * @method setSound
             * @param sound {String}
             * @param callback (optional) {Function()} To be called after the sound is set.
             */
            setSound: function(sound, callback) {
                this._proxy.call('setSound', [sound, callback]);
            },
    
            /**
             * Retrieves the alarm status.
             *
             * The property holds the status of the last performed operation
             *
             * @method status
             * @param callback {Function(String)}
             */
            status: function(callback) {
                this._proxy.call('status', [], callback);
            },
    
            /**
             * Retrieves the alarm type.
             *
             * The property holds the type of the alarm.
             * The default value is AlarmType.OneTime
             *
             * @method type
             * @param callback {Function(AlarmType)}
             */
            type: function(callback) {
                this._proxy.call('type', [], callback);
            },
            /**
             * Sets the alarm type.
             *
             * @method setType
             * @param type {AlarmType}
             * @param callback (optional) {Function()} To be called after the type is set.
             */
            setType: function(type, callback) {
                this._proxy.call('setType', [type, callback]);
            },
    
            /**
             * Retrieves the alarm day of the week.
             *
             * The property holds the days of the week the alarm is scheduled.
             * This property can have only one day set for one time alarms and multiple days for repeating alarms.
             *
             * @method daysOfWeek
             * @param callback {Function(AlarmType)}
             */
            daysOfWeek: function(callback) {
                this._proxy.call('daysOfWeek', [], callback);
            },
            /**
             * Sets the alarm day of the week.
             *
             * @method setDaysOfWeek
             * @param daysOfWeek {AlarmDayOfWeek}
             * @param callback (optional) {Function()} To be called after the day of the week is set.
             */
            setDaysOfWeek: function(daysOfWeek, callback) {
                this._proxy.call('setDaysOfWeek', [daysOfWeek, callback]);
            },
    
    
            // methods
    
            /**
             * Cancels a given Alarm.
             * 
             * @method cancel
             */
            cancel: function() {
                this._proxy.call('cancel', []);
            },
    
            /**
             * Resets a given Alarm.
             * 
             * @method reset
             */
            reset: function() {
                this._proxy.call('reset', []);
            },
    
            /**
             * Saves the alarm as a system wide alarm with the parameters previously set.
             *
             * @method save
             */
            save: function() {
                this._proxy.call('save', []);
            },
    
            // extras
    
            /**
             * Destroys the remote object. This proxy object is not valid anymore.
             *
             * @method destroy
             */
            destroy: function() {
                this._proxy.call('destroy', []);
            },
        };
    
        function _constructorFromName(className) {
            var constructorPerName = {
                "Alarm": Alarm,
            };
            return className in constructorPerName
                    ? constructorPerName[className]
                    : null;
        };
    
    /**
     * The AlarmApi object
    
     * @class AlarmApi
     * @constructor
     * @example
    
           var date = new Date();
           <set a valid date in the future>
    
           var api = external.getUnityObject('1.0');
           api.AlarmApi.api.createAndSaveAlarmFor(
              date,
              api.AlarmApi.AlarmType.OneTime,
              api.AlarmApi.AlarmDayOfWeek.AutoDetect,
              "alarm triggered",
              function(errorid) {
                  console.log(api.AlarmApi.api.errorToMessage(errorid));
              });
     */
        return {
            /**
               Enumeration of the available types of Alarm.
               
                 Values:
    
                   OneTime: The alarm occurs only once
    
                   Repeating: The alarm is a repeating one,
                       either daily, weekly on a given day
                       or on selected days
               
               @static
               @property AlarmType {Object}
               
               @example
    
                   var api = external.getUnityObject('1.0');
                   var alarmtype = api.AlarmApi.AlarmType;
                   // use alarmtype.OneTime or alarmtype.Repeating
             */
            AlarmType: {
                // The alarm occurs only once.
                OneTime: "OneTime",
    
                // The alarm is a repeating one, either daily, weekly on a given day or on selected days.
                Repeating: "Repeating",
            },
    
            /**
               Flags for the week days an Alarm should be triggered.
               
                 Values:
    
                   Monday: The alarm will kick on Mondays
    
                   Tuesday: The alarm will kick on Tuesdays
    
                   Wednesday: The alarm will kick on Wednesday
    
                   Thursday: The alarm will kick on Thursday
    
                   Friday: The alarm will kick on Friday
    
                   Saturday: The alarm will kick on Saturday
    
                   Sunday: The alarm will kick on Sunday
    
                   AutoDetect: The alarm day will be detected
                     from the alarm date.
               
               @static
               @property AlarmDayOfWeek {Integer}
               
               @example
    
                   var api = external.getUnityObject('1.0');
                   var dayofweek = api.AlarmApi.AlarmDayOfWeek;
                   // use dayofweek.Monday or/and dayofweek.Tuesday, etc.
             */
            AlarmDayOfWeek: {
                // The alarm will kick on Mondays.
                Monday: 1,
    
                // The alarm will kick on Tuesdays.
                Tuesday: 2,
    
                // The alarm will kick on Wednesdays.
                Wednesday: 4,
    
                // The alarm will kick on Thursdays.
                Thursday: 8,
    
                // The alarm will kick on Fridays.
                Friday: 16,
    
                // The alarm will kick on Saturdays.
                Saturday: 32,
    
                // The alarm will kick on Sundays.
                Sunday: 64,
    
                // The alarm day will be detected from the alarm date.
                AutoDetect: 128,
            },
    
            /**
             Error ids returned during AlarmApi calls.
             
               Values:
    
                 NoError: Successful operation completion
                 
                 InvalidDate: The date specified for the alarm was invalid
                 
                 EarlyDate: The date specified for the alarm is an earlier
                     date than the current one
    
                 NbDaysOfWeek: The daysOfWeek parameter of the alarm was not specified
                 
                 OneTimeOnMoreDays: The one-time alarm was set to be kicked in several days
                 
                 InvalidEvent: The alarm event is invalid
                 
                 AdaptationError: The error occurred in alarm adaptation layer.
                     Adaptations may define additional behind this value
             
              
             @static
             @property AlarmError {Integer}
             
             @example
                 var date = new Date();
                 <set a valid date in the future>
             
                 var api = external.getUnityObject('1.0');
                 api.AlarmApi.api.createAndSaveAlarmFor(
                   date,
                   api.AlarmApi.AlarmType.OneTime,
                   api.AlarmApi.AlarmDayOfWeek.AutoDetect,
                   "alarm triggered",
                   function(errorid) {
                     console.log(api.AlarmApi.api.errorToMessage(errorid));
                   });
             */
            AlarmError: {
                // Successful operation completion
                NoError: 0,
    
                // The date specified for the alarm was invalid
                InvalidDate: 1,
    
                // The date specified for the alarm is an earlier date than the current one
                EarlyDate: 2,
    
                // The daysOfWeek parameter of the alarm was not specified
                NoDaysOfWeek: 3,
    
                // The one-time alarm was set to be kicked in several days
                OneTimeOnMoreDays: 4,
    
                // The alarm event is invalid
                InvalidEvent: 5,
    
                // The error occurred in alarm adaptation layer. Adaptations may define additional behind this value
                AdaptationError: 6,
            },
    
            /**
             * Creates a Alarm object.
             * 
             * @method createAlarm
             * @param callback {Function(Alarm)} Function called with the created Alarm.
             */
            createAlarm: function(callback) {
                backendBridge.call('Alarm.createAlarm'
                                   , []
                                   , callback);
            },
    
            api: {
                /**
                 * Creates and saves a new alarm.
                 *
                 * @method api.createAndSaveAlarmFor
                 * @param date {Date} date at which the alarm is to be triggered.
                 * @param type {AlarmType} type of the alarm.
                 * @param daysOfWeek {AlarmDayOfWeek} days of the week the alarm is scheduled.
                 * @param message {String} Message to be displayed when the alarm is triggered.
                 * @param callback (optional) {Function(AlarmError)} Function to be called when the alarm has been saved.
                 */
                createAndSaveAlarmFor: function(date, type, daysOfWeek, message, callback) {
                    backendBridge.call('Alarm.createAndSaveAlarmFor'
                                       , [date.getTime(), type, daysOfWeek, message, callback]);
                },
    
                /**
                 * Returns a message adapted to the given error id.
                 *
                 * @method api.errorToMessage
                 * @param error {AlarmError} error id.
                 */
                errorToMessage: function(error) {
                    var messagePerError = [
                        "Successful operation completion",
                        "The date specified for the alarm was invalid",
                        "The date specified for the alarm is an earlier date than the current one",
                        "The daysOfWeek parameter of the alarm was not specified",
                        "The one-time alarm was set to be kicked in several days",
                        "The alarm event is invalid",
                        "The error occurred in alarm adaptation layer"
                      ];
                    return error < messagePerError.length
                            ? messagePerError[error]
                            : "Invalid error id";
                },
            },
    
    
            // Internal
    
            /**
             * @private
             *
             */
            createObjectWrapper: function(objectType, objectId, content) {
                var Constructor = _constructorFromName(objectType);
                return new Constructor(objectId, content);
            },
        };
    };
    
    
    
    
    ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016400000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/favicon.icounity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000001246612645740734033376 0ustar pbuserpbgroup00000000000000 h&  (  !Юmrf<0SKVhQK6>,1"}2'ɤ`FaKQ=A1y)ԻO1vjv;-dKjR[FK8/|mVK7D6Q>mSdNTA?.QD|gĠ\BVCG8aJlS_IN;7'B˜>,]AbITBN=iOhQXD=*vڷoU=S@M9aCbISBUAkRcMO;I9-jѪ]EZFS=aDaISAXDjR]H?+šÊu_D_IWB_DaHSAYEgOR=SCҦeJ_G[F\D_GSBVD`JD/ÜEnɭ`FZCYCZESAP?S?Q>ź\ˆsícLR;N9I7F6>+u.ڸp‘raΜ\KK<@1ϳ^#+$?( @ ־E*ҵZyUJ}2'i~xĽNsP>9'2!}. y+qZRݽa|hͤXAP:N;I7B1:+3%v(8-fLcJeO]HUAM:F5>/7)|/"s#=ŋvdJiRcLZER>K8C2<-5&r zνIjYѳhMjRgP_IWCO.3$8,I8~@/{A3q8-XCmRjQiQaKYDQ=I7B1;+x(ѶT(q[ӖQ;UCO>H9y?2D5jOjQjRfP^HVBN;F5?/|,xo(bE^E\HVDO>H9x>2WClRiQiRcMZFS?K8D38(D7ټd]>`H\HVCO>G8D5eMkQjRgP_JWCPE7O=kQjQjReN\GT@M:E44#qf}q3"B0cDdH`H\HVCO>E7ZElQjRhRbLYDQ>J8@/>/|D/K8B2K6gFdG`H\HVCN=H9bKkQiRgP^IVBN;G63"yҫzSgGcG`H\HUCL,eYٵlbFgNhQcL\GVBOJ8:)C޿]gLfKjRfO`JYEQ?W?eFdG_H[GUCK,oc@rXbGjQhQcL\GUAV@bEdG_H[GUCL;VCjReN[FT@K8>,<q`DhOjRfO`JXDU@^CdG`H[GUCK;TAhQbLXDQ>@-naԫ}fKcHjQhQcM\GUBYBaFaH[HUCK;P?cM_IUAN:=*J7maDfLjRfO`JXDVA\C`H\HUCKO.|7)s0">01 $49:9???././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016700000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/api-list.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000001465012645740734033373 0ustar pbuserpbgroup00000000000000YUI.add('api-list', function (Y) { var Lang = Y.Lang, YArray = Y.Array, APIList = Y.namespace('APIList'), classesNode = Y.one('#api-classes'), inputNode = Y.one('#api-filter'), modulesNode = Y.one('#api-modules'), tabviewNode = Y.one('#api-tabview'), tabs = APIList.tabs = {}, filter = APIList.filter = new Y.APIFilter({ inputNode : inputNode, maxResults: 1000, on: { results: onFilterResults } }), search = APIList.search = new Y.APISearch({ inputNode : inputNode, maxResults: 100, on: { clear : onSearchClear, results: onSearchResults } }), tabview = APIList.tabview = new Y.TabView({ srcNode : tabviewNode, panelNode: '#api-tabview-panel', render : true, on: { selectionChange: onTabSelectionChange } }), focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, { circular : true, descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a', keys : {next: 'down:40', previous: 'down:38'} }).focusManager, LIST_ITEM_TEMPLATE = '
  • ' + '{displayName}' + '
  • '; // -- Init --------------------------------------------------------------------- // Duckpunch FocusManager's key event handling to prevent it from handling key // events when a modifier is pressed. Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusPrevious', focusManager); Y.before(function (e, activeDescendant) { if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return new Y.Do.Prevent(); } }, focusManager, '_focusNext', focusManager); // Create a mapping of tabs in the tabview so we can refer to them easily later. tabview.each(function (tab, index) { var name = tab.get('label').toLowerCase(); tabs[name] = { index: index, name : name, tab : tab }; }); // Switch tabs on Ctrl/Cmd-Left/Right arrows. tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); // Focus the filter input when the `/` key is pressed. Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); // Keep the Focus Manager up to date. inputNode.on('focus', function () { focusManager.set('activeDescendant', inputNode); }); // Update all tabview links to resolved URLs. tabview.get('panelNode').all('a').each(function (link) { link.setAttribute('href', link.get('href')); }); // -- Private Functions -------------------------------------------------------- function getFilterResultNode() { return filter.get('queryType') === 'classes' ? classesNode : modulesNode; } // -- Event Handlers ----------------------------------------------------------- function onFilterResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()), resultNode = getFilterResultNode(), typePlural = filter.get('queryType'), typeSingular = typePlural === 'classes' ? 'class' : 'module'; if (e.results.length) { YArray.each(e.results, function (result) { frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { rootPath : APIList.rootPath, displayName : filter.getDisplayName(result.highlighted), name : result.text, typePlural : typePlural, typeSingular: typeSingular })); }); } else { frag.append( '
  • ' + 'No ' + typePlural + ' found.' + '
  • ' ); } resultNode.empty(true); resultNode.append(frag); focusManager.refresh(); } function onSearchClear(e) { focusManager.refresh(); } function onSearchKey(e) { var target = e.target; if (target.test('input,select,textarea') || target.get('isContentEditable')) { return; } e.preventDefault(); inputNode.focus(); focusManager.refresh(); } function onSearchResults(e) { var frag = Y.one(Y.config.doc.createDocumentFragment()); if (e.results.length) { YArray.each(e.results, function (result) { frag.append(result.display); }); } else { frag.append( '
  • ' + 'No results found. Maybe you\'ll have better luck with a ' + 'different query?' + '
  • ' ); } focusManager.refresh(); } function onTabSelectionChange(e) { var tab = e.newVal, name = tab.get('label').toLowerCase(); tabs.selected = { index: tab.get('index'), name : name, tab : tab }; switch (name) { case 'classes': // fallthru case 'modules': filter.setAttrs({ minQueryLength: 0, queryType : name }); search.set('minQueryLength', -1); // Only send a request if this isn't the initially-selected tab. if (e.prevVal) { filter.sendRequest(filter.get('value')); } break; case 'everything': filter.set('minQueryLength', -1); search.set('minQueryLength', 1); if (search.get('value')) { search.sendRequest(search.get('value')); } else { inputNode.focus(); } break; default: // WTF? We shouldn't be here! filter.set('minQueryLength', -1); search.set('minQueryLength', -1); } if (focusManager) { setTimeout(function () { focusManager.refresh(); }, 1); } } function onTabSwitchKey(e) { var currentTabIndex = tabs.selected.index; if (!(e.ctrlKey || e.metaKey)) { return; } e.preventDefault(); switch (e.keyCode) { case 37: // left arrow if (currentTabIndex > 0) { tabview.selectChild(currentTabIndex - 1); inputNode.focus(); } break; case 39: // right arrow if (currentTabIndex < (Y.Object.size(tabs) - 2)) { tabview.selectChild(currentTabIndex + 1); inputNode.focus(); } break; } } }, '3.4.0', {requires: [ 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' ]}); ././@LongLink0000000000000000000000000000016600000000000011220 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/apidocs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000002407112645740734033371 0ustar pbuserpbgroup00000000000000YUI().use( 'yuidoc-meta', 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', function (Y) { var win = Y.config.win, localStorage = win.localStorage, bdNode = Y.one('#bd'), pjax, defaultRoute, classTabView, selectedTab; // Kill pjax functionality unless serving over HTTP. if (!Y.getLocation().protocol.match(/^https?\:/)) { Y.Router.html5 = false; } // Create the default route with middleware which enables syntax highlighting // on the loaded content. defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { prettyPrint(); bdNode.removeClass('loading'); next(); }); pjax = new Y.Pjax({ container : '#docs-main', contentSelector: '#docs-main > .content', linkSelector : '#bd a', titleSelector : '#xhr-title', navigateOnHash: true, root : '/', routes : [ // -- / ---------------------------------------------------------------- { path : '/(index.html)?', callbacks: defaultRoute }, // -- /classes/* ------------------------------------------------------- { path : '/classes/:class.html*', callbacks: [defaultRoute, 'handleClasses'] }, // -- /files/* --------------------------------------------------------- { path : '/files/*file', callbacks: [defaultRoute, 'handleFiles'] }, // -- /modules/* ------------------------------------------------------- { path : '/modules/:module.html*', callbacks: defaultRoute } ] }); // -- Utility Functions -------------------------------------------------------- pjax.checkVisibility = function (tab) { tab || (tab = selectedTab); if (!tab) { return; } var panelNode = tab.get('panelNode'), visibleItems; // If no items are visible in the tab panel due to the current visibility // settings, display a message to that effect. visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { if (itemNode.getComputedStyle('display') !== 'none') { return true; } }); panelNode.all('.no-visible-items').remove(); if (!visibleItems) { if (Y.one('#index .index-item')) { panelNode.append( '
    ' + '

    ' + 'Some items are not shown due to the current visibility ' + 'settings. Use the checkboxes at the upper right of this ' + 'page to change the visibility settings.' + '

    ' + '
    ' ); } else { panelNode.append( '
    ' + '

    ' + 'This class doesn\'t provide any methods, properties, ' + 'attributes, or events.' + '

    ' + '
    ' ); } } // Hide index sections without any visible items. Y.all('.index-section').each(function (section) { var items = 0, visibleItems = 0; section.all('.index-item').each(function (itemNode) { items += 1; if (itemNode.getComputedStyle('display') !== 'none') { visibleItems += 1; } }); section.toggleClass('hidden', !visibleItems); section.toggleClass('no-columns', visibleItems < 4); }); }; pjax.initClassTabView = function () { if (!Y.all('#classdocs .api-class-tab').size()) { return; } if (classTabView) { classTabView.destroy(); selectedTab = null; } classTabView = new Y.TabView({ srcNode: '#classdocs', on: { selectionChange: pjax.onTabSelectionChange } }); pjax.updateTabState(); classTabView.render(); }; pjax.initLineNumbers = function () { var hash = win.location.hash.substring(1), container = pjax.get('container'), hasLines, node; // Add ids for each line number in the file source view. container.all('.linenums>li').each(function (lineNode, index) { lineNode.set('id', 'l' + (index + 1)); lineNode.addClass('file-line'); hasLines = true; }); // Scroll to the desired line. if (hasLines && /^l\d+$/.test(hash)) { if ((node = container.getById(hash))) { win.scroll(0, node.getY()); } } }; pjax.initRoot = function () { var terminators = /^(?:classes|files|modules)$/, parts = pjax._getPathRoot().split('/'), root = [], i, len, part; for (i = 0, len = parts.length; i < len; i += 1) { part = parts[i]; if (part.match(terminators)) { // Makes sure the path will end with a "/". root.push(''); break; } root.push(part); } pjax.set('root', root.join('/')); }; pjax.updateTabState = function (src) { var hash = win.location.hash.substring(1), defaultTab, node, tab, tabPanel; function scrollToNode() { if (node.hasClass('protected')) { Y.one('#api-show-protected').set('checked', true); pjax.updateVisibility(); } if (node.hasClass('private')) { Y.one('#api-show-private').set('checked', true); pjax.updateVisibility(); } setTimeout(function () { // For some reason, unless we re-get the node instance here, // getY() always returns 0. var node = Y.one('#classdocs').getById(hash); win.scrollTo(0, node.getY() - 70); }, 1); } if (!classTabView) { return; } if (src === 'hashchange' && !hash) { defaultTab = 'index'; } else { if (localStorage) { defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || 'index'; } else { defaultTab = 'index'; } } if (hash && (node = Y.one('#classdocs').getById(hash))) { if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } } // Scroll to the desired element if this is a hash URL. if (node) { if (classTabView.get('rendered')) { scrollToNode(); } else { classTabView.once('renderedChange', scrollToNode); } } } else { tab = Y.one('#classdocs .api-class-tab.' + defaultTab); // When the `defaultTab` node isn't found, `localStorage` is stale. if (!tab && defaultTab !== 'index') { tab = Y.one('#classdocs .api-class-tab.index'); } if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { tab.addClass('yui3-tab-selected'); } } }; pjax.updateVisibility = function () { var container = pjax.get('container'); container.toggleClass('hide-inherited', !Y.one('#api-show-inherited').get('checked')); container.toggleClass('show-deprecated', Y.one('#api-show-deprecated').get('checked')); container.toggleClass('show-protected', Y.one('#api-show-protected').get('checked')); container.toggleClass('show-private', Y.one('#api-show-private').get('checked')); pjax.checkVisibility(); }; // -- Route Handlers ----------------------------------------------------------- pjax.handleClasses = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initClassTabView(); } next(); }; pjax.handleFiles = function (req, res, next) { var status = res.ioResponse.status; // Handles success and local filesystem XHRs. if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) { pjax.initLineNumbers(); } next(); }; // -- Event Handlers ----------------------------------------------------------- pjax.onNavigate = function (e) { var hash = e.hash, originTarget = e.originEvent && e.originEvent.target, tab; if (hash) { tab = originTarget && originTarget.ancestor('.yui3-tab', true); if (hash === win.location.hash) { pjax.updateTabState('hashchange'); } else if (!tab) { win.location.hash = hash; } e.preventDefault(); return; } // Only scroll to the top of the page when the URL doesn't have a hash. this.set('scrollToTop', !e.url.match(/#.+$/)); bdNode.addClass('loading'); }; pjax.onOptionClick = function (e) { pjax.updateVisibility(); }; pjax.onTabSelectionChange = function (e) { var tab = e.newVal, tabId = tab.get('contentBox').getAttribute('href').substring(1); selectedTab = tab; // If switching from a previous tab (i.e., this is not the default tab), // replace the history entry with a hash URL that will cause this tab to // be selected if the user navigates away and then returns using the back // or forward buttons. if (e.prevVal && localStorage) { localStorage.setItem('tab_' + pjax.getPath(), tabId); } pjax.checkVisibility(tab); }; // -- Init --------------------------------------------------------------------- pjax.on('navigate', pjax.onNavigate); pjax.initRoot(); pjax.upgrade(); pjax.initClassTabView(); pjax.initLineNumbers(); pjax.updateVisibility(); Y.APIList.rootPath = pjax.get('root'); Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); Y.on('hashchange', function (e) { pjax.updateTabState('hashchange'); }, win); }); ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/tabs.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000537412645740734033376 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ././@LongLink0000000000000000000000000000017300000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/yui-prettify.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000377512645740734033401 0ustar pbuserpbgroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); ././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/api-search.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000555412645740734033376 0ustar pbuserpbgroup00000000000000YUI.add('api-search', function (Y) { var Lang = Y.Lang, Node = Y.Node, YArray = Y.Array; Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { // -- Public Properties ---------------------------------------------------- RESULT_TEMPLATE: '
  • ' + '' + '

    {name}

    ' + '{resultType}' + '
    {description}
    ' + '{class}' + '
    ' + '
  • ', // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, // -- Protected Methods ---------------------------------------------------- _apiResultFilter: function (query, results) { // Filter components out of the results. return YArray.filter(results, function (result) { return result.raw.resultType === 'component' ? false : result; }); }, _apiResultFormatter: function (query, results) { return YArray.map(results, function (result) { var raw = Y.merge(result.raw), // create a copy desc = raw.description || ''; // Convert description to text and truncate it if necessary. desc = Node.create('
    ' + desc + '
    ').get('text'); if (desc.length > 65) { desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; } else { desc = Y.Escape.html(desc); } raw['class'] || (raw['class'] = ''); raw.description = desc; // Use the highlighted result name. raw.name = result.highlighted; return Lang.sub(this.RESULT_TEMPLATE, raw); }, this); }, _apiTextLocator: function (result) { return result.displayName || result.name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultFormatter: { valueFn: function () { return this._apiResultFormatter; } }, resultFilters: { valueFn: function () { return this._apiResultFilter; } }, resultHighlighter: { value: 'phraseMatch' }, resultListLocator: { value: 'data.results' }, resultTextLocator: { valueFn: function () { return this._apiTextLocator; } }, source: { value: '/api/v1/search?q={query}&count={maxResults}' } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 'escape' ]}); ././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/js/api-filter.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000264512645740734033374 0ustar pbuserpbgroup00000000000000YUI.add('api-filter', function (Y) { Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { // -- Initializer ---------------------------------------------------------- initializer: function () { this._bindUIACBase(); this._syncUIACBase(); }, getDisplayName: function(name) { Y.each(Y.YUIDoc.meta.allModules, function(i) { if (i.name === name && i.displayName) { name = i.displayName; } }); return name; } }, { // -- Attributes ----------------------------------------------------------- ATTRS: { resultHighlighter: { value: 'phraseMatch' }, // May be set to "classes" or "modules". queryType: { value: 'classes' }, source: { valueFn: function() { var self = this; return function(q) { var data = Y.YUIDoc.meta[self.get('queryType')], out = []; Y.each(data, function(v) { if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { out.push(v); } }); return out; }; } } } }); }, '3.4.0', {requires: [ 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' ]}); ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/css/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016500000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/css/main.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000002421212645740734033366 0ustar pbuserpbgroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
       blocks. */
    pre code, pre kbd, pre samp { font-size: 100%; }
    
    /* Used to denote text that shouldn't be selectable, such as line numbers or
       shell prompts. Guess which browser this doesn't work in. */
    .noselect {
        -moz-user-select: -moz-none;
        -khtml-user-select: none;
        -webkit-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    
    /* -- Lists ----------------------------------------------------------------- */
    dd { margin: 0.2em 0 0.7em 1em; }
    dl { margin: 1em 0; }
    dt { font-weight: bold; }
    
    /* -- Tables ---------------------------------------------------------------- */
    caption, th { text-align: left; }
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    td, th {
        border: 1px solid #fff;
        padding: 5px 12px;
        vertical-align: top;
    }
    
    td { background: #E6E9F5; }
    td dl { margin: 0; }
    td dl dl { margin: 1em 0; }
    td pre:first-child { margin-top: 0; }
    
    th {
        background: #D2D7E6;/*#97A0BF*/
        border-bottom: none;
        border-top: none;
        color: #000;/*#FFF1D5*/
        font-family: 'Trebuchet MS', sans-serif;
        font-weight: bold;
        line-height: 1.3;
        white-space: nowrap;
    }
    
    
    /* -- Layout and Content ---------------------------------------------------- */
    #doc {
        margin: auto;
        min-width: 1024px;
    }
    
    #main { width: 754px; }
    #sidebar { width: 270px; margin: 0 15px; }
    
    .content { padding: 0 20px 0 25px; }
    
    /* -- Sidebar --------------------------------------------------------------- */
    .sidebox {
        background: #F9F9FC;/*E6E9F5*/
        border: 1px solid #D4D8EB;
    
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
        font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
        margin: 0 0 15px 0;
        padding-bottom: 1px;
    }
    
    .sidebox h2 {
        background: #E5E6F1;
        -moz-border-radius: 4px 4px 0 0;
        -webkit-border-radius: 4px 4px 0 0;
        border-radius: 4px 4px 0 0;
        color: #5E6BA4;
        font-weight: bold;
        font-size: 107.692%;
        margin: 0;
        padding: 4px 7px 5px;
    }
    
    .sidebox .bd {
        font-size: 84.615%;
        padding: 0 5px 0 8px;
    }
    
    .sidebox li { list-style-type: disc; color:#D4D5E3; }
    
    .sidebox ol, .sidebox ul {
        margin-left: 0;
        padding-left: 16px;
    }
    
    .sidebox ol ol, .sidebox ol ul,
    .sidebox ul ol, .sidebox ul ul {
        margin: 0;
        padding-left: 16px;
    }
    
    /* -- Table of Contents ----------------------------------------------------- */
    
    /* The #toc id refers to the single global table of contents, while the .toc
       class refers to generic TOC lists that could be used throughout the page. */
    
    .toc code, .toc kbd, .toc samp { font-size: 100%; }
    .toc li { font-weight: bold; }
    .toc li li { font-weight: normal; }
    
    /* -- Intro and Example Boxes ----------------------------------------------- */
    .intro, .example { margin-bottom: 2em; }
    
    .example {
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        border-radius: 4px;
        -moz-box-shadow: 0 0 5px #bfbfbf;
        -webkit-box-shadow: 0 0 5px #bfbfbf;
        box-shadow: 0 0 5px #bfbfbf;
        padding: 1em;
    }
    
    .intro {
        background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    }
    
    /* -- Other Styles ---------------------------------------------------------- */
    
    /* These are probably YUI-specific, and should be moved out of Selleck's default
       theme. */
    
    .button {
        border: 1px solid #dadada;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        color: #444;
        display: inline-block;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 92.308%;
        font-weight: bold;
        padding: 4px 13px 3px;
        -moz-text-shadow: 1px 1px 0 #fff;
        -webkit-text-shadow: 1px 1px 0 #fff;
        text-shadow: 1px 1px 0 #fff;
        white-space: nowrap;
    
        background: #EFEFEF; /* old browsers */
        background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    }
    
    .button:hover {
        border-color: #466899;
        color: #fff;
        text-decoration: none;
        -moz-text-shadow: 1px 1px 0 #222;
        -webkit-text-shadow: 1px 1px 0 #222;
        text-shadow: 1px 1px 0 #222;
    
        background: #6396D8; /* old browsers */
        background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    }
    
    .newwindow { text-align: center; }
    
    .header .version em {
        display: block;
        text-align: right;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        background-color: transparent;
    }
    
    .yui3-skin-sam #classdocs .yui3-tabview-panel {
        border: none;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DEDCD9;
        border-right: 1px solid #CDCBC8;
        border-left: 1px solid #CDCBC8;
        border-top: 1px solid #DADADA;
        color: #333333;
        text-decoration: none;
    }
    .yui3-skin-sam .yui3-tabview .yui3-tab-label,
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
        border: none;
        background: none;
        font-size: 100%;
        color: #000;
    }
    
    .yui3-skin-sam .yui3-tabview .yui3-tab-selected,
    .yui3-skin-sam .yui3-tabview .yui3-tab-hover {
        background: none;
        background-color: #fff;
        border-bottom-color: #FFFFFF;
        border-top: 2px solid #8193C9;
        font-weight: bold;
        color: #000;
    
    }
    
    .yui3-skin-sam .yui3-tabview-list {
        border-color: #DFDFDF;
        border-width: 0 0 1px; 
    }
    
    
    a.external {
        background-image: url(external-small.png);
        background-repeat: no-repeat;
        background-position: 0 0;
        padding-left: 16px;
    }
    
    #classdocs .item {
        border-bottom: 1px solid #466899;
        margin: 1em 0;
        padding: 1.5em;
    }
    
    #classdocs .item .params p,
        #classdocs .item .returns p,{
        display: inline;
    }
    
    #classdocs .item em code, #classdocs .item em.comment {
        color: green;
    }
    
    #classdocs .item em.comment a {
        color: green;
        text-decoration: underline;
    }
    
    #classdocs .foundat {
        font-size: 11px;
        font-style: normal;
    }
    
    .attrs .emits {
        margin-left: 2em;
        padding: .5em;
        border-left: 1px dashed #ccc;
    }
    
    abbr {
        border-bottom: 1px dashed #ccc;
        font-size: 80%;
        cursor: help;
    }
    
    .prettyprint li.L0, 
    .prettyprint li.L1, 
    .prettyprint li.L2, 
    .prettyprint li.L3, 
    .prettyprint li.L5, 
    .prettyprint li.L6, 
    .prettyprint li.L7, 
    .prettyprint li.L8 {
        list-style: decimal;
    }
    
    ul li p {
        margin-top: 0;
    }
    
    .method .name {
        font-size: 110%;
    }
    
    #hd {
        background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
        border-bottom: 1px solid #DFDFDF;
        padding: 0 15px 1px 20px;
        margin-bottom: 15px;
    }
    
    #hd img {
        margin-right: 10px;
        vertical-align: middle;
    }
    
    ././@LongLink0000000000000000000000000000016500000000000011217 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/css/logo.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000135512645740734033371 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDR=29PLTEvO_1S#ƶl{]j@H9	pHYstIME
    &	fEGIDAThv eQ;,.i]	9=Ï	QxBHB$$!	IȿTobH
    L,LAJ!z2@{}q%>D*()29zfv0v'xY|~2ܾHIȔdY.Ҭ$FH[62MT%a>$XmSUhiKY.kUdYps6#È+ټV`HU2z/[Y
    ̷]PT&[o^|ߗuǞl 5e]6UǶEu<*5d+BoIHB$$!	JnɒőIENDB`././@LongLink0000000000000000000000000000017700000000000011222 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/css/external-small.pngunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000075312645740734033372 0ustar  pbuserpbgroup00000000000000PNG
    
    
    IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb?%B@,0]VVV0affȊ=8JOy %pJջ+30¿}sʋ`n|dx
    mXa |ȹWpA+ca|u=zϰp-l\w01nCy?*Yr%cfxÿ8
    `g2ȉ0!GA[EV66>Ӏ'E]AOCAY^#.S>>#񶉝
    "ÏOv%w@FX^`ddR|8 wX
    	 OƓIENDB`././@LongLink0000000000000000000000000000016300000000000011215 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/index.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000033012645740734033361 0ustar  pbuserpbgroup00000000000000
    
        
            Redirector
            
        
        
            Click here to redirect
        
    
    ././@LongLink0000000000000000000000000000016000000000000011212 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017100000000000011214 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar  pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000020000000000000011205 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/COPYINGunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000002613612645740734033375 0ustar  pbuserpbgroup00000000000000
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    ././@LongLink0000000000000000000000000000021000000000000011206 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/prettify-min.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000004564712645740734033405 0ustar  pbuserpbgroup00000000000000/*
     * Copyright 2011 Yahoo! Inc.
     * All rights reserved.
     *-
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *     * Redistributions of source code must retain the above copyright
     *       notice, this list of conditions and the following disclaimer.
     *     * Redistributions in binary form must reproduce the above copyright
     *       notice, this list of conditions and the following disclaimer in the
     *       documentation and/or other materials provided with the distribution.
     *     * Neither the name of the Yahoo! Inc. nor the
     *       names of its contributors may be used to endorse or promote products
     *       derived from this software without specific prior written permission.
     *-
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
     * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
    ././@LongLink0000000000000000000000000000021100000000000011207 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/prettify-min.cssunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000124312645740734033365 0ustar  pbuserpbgroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}././@LongLink0000000000000000000000000000020500000000000011212 Lustar  00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/CHANGES.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000001370412645740734033372 0ustar  pbuserpbgroup00000000000000
      
        
        Change Log
      
      
        README
    
        

    Known Issues

    • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
    • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

    Change Log

    29 March 2007

    • Added tests for PHP support to address issue 3.
    • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
    • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
    • Fixed bug: was eating tabs (test)
    • Fixed entity handling so that the caveat

      Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

      is no longer applicable.
    • Added noisefree's C# patch
    • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

    4 Jul 2008

    • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
    • Fixed bug: python handling of '''string'''
    • Fixed bug: / in regex [charsets] should not end regex

    5 Jul 2008

    • Defined language extensions for Lisp and Lua

    14 Jul 2008

    • Language handlers for F#, OCAML, SQL
    • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

    6 Jan 2009

    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
    • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
    • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

    21 May 2009

    • Rewrote to improve performance on large files. See benchmarks.
    • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

    14 August 2009

    • Fixed prettifying of <code> blocks with embedded newlines.

    3 October 2009

    • Fixed prettifying of XML/HTML tags that contain uppercase letters.

    19 July 2010

    • Added support for line numbers. Bug 22
    • Added YAML support. Bug 123
    • Added VHDL support courtesy Le Poussin.
    • IE performance improvements. Bug 102 courtesy jacobly.
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • Fixed copy and paste in IE[678].
    • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
    ././@LongLink0000000000000000000000000000020400000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/vendor/prettify/README.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000001735012645740734033373 0ustar pbuserpbgroup00000000000000 Javascript code prettifier Languages : CH

    Javascript code prettifier

    Setup

    1. Download a distribution
    2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
      <link href="prettify.css" type="text/css" rel="stylesheet" />
      <script type="text/javascript" src="prettify.js"></script>
    3. Add onload="prettyPrint()" to your document's body tag.
    4. Modify the stylesheet to get the coloring you prefer

    Usage

    Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
    The original Prettier
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }
    class Voila {
    public:
      // Voila
      static const string VOILA = "Voila";
    
      // will not interfere with embedded tags.
    }

    FAQ

    Which languages does it work for?

    The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

    LISPy languages are supported via an extension: lang-lisp.js.

    And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

    If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

    How do I specify which language my code is in?

    You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

    <pre class="prettyprint lang-html">
      The lang-* class specifies the language file extensions.
      File extensions supported by default include
        "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
        "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
        "xhtml", "xml", "xsl".
    </pre>

    It doesn't work on <obfuscated code sample>?

    Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

    Which browsers does it work with?

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

    What's changed?

    See the change log

    Why doesn't Prettyprinting of strings work on WordPress?

    Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

    This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

    How do I put line numbers in my code?

    You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

    For example

    <pre class="prettyprint linenums:4"
    >// This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    <pre>
    produces
    // This is line 4.
    foo();
    bar();
    baz();
    boo();
    far();
    faz();
    

    How do I prevent a portion of markup from being marked as code?

    You can use the nocode class to identify a span of markup that is not code.

    <pre class=prettyprint>
    int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
      Continuation of comment */
    int y = bar();
    </pre>
    produces
    int x = foo();  /* This is a comment  This is not code
      Continuation of comment */
    int y = bar();
    

    For a more complete example see the issue22 testcase.

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

    addEventListener('load', prettyPrint, false);
    wrap it in a closure like
    addEventListener('load', function (event) { prettyPrint() }, false);
    so that the browser does not pass an event object to prettyPrint which will confuse it.


    ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/img/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000755000015600001650000000000012645741276033365 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017000000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/assets/img/spinner.gifunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/ass0000644000015600001650000000517512645740734033375 0ustar pbuserpbgroup00000000000000GIF89a333555666[[[^^^oooppprrr777KKKMMMbbbcccsssuuuzzzجmmm]]]\\\! NETSCAPE2.0! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB! ICCRGBG1012H HLinomntrRGB XYZ  1acspMSFTIEC sRGB!-Made by Krasimira Nejcheva (www.loadinfo.net)! ,`'dif&EꊙG[u0(02n#S`lXtd ÈTC٤q{$9c+{"}  vxz{q";BY+-ist!! ,pH,2C:3`j>5+k: BRJ ˊkΖHrNFHnNdDȑ+rSݎKP/j~iD?.tq?//V:} '>GD2%&+D+CC4:" ^ $#Ϳ !<$ _lA! ,EE--D?EE2?9B?-E99EA66̻-66ǂ69ۚӻE A ƌ 2DF~ 2ACА iȐ$;! ,??D./H=-/D-.2D2/=/?+GD)/?GDD&" *?$ 6 )D#?++26 ؅ %F%T$bZ# 6Z(DBx封0 p$9rX(! , Alarms JS API
    API Docs for: 0.1

    Welcome to Ubuntu Alarms JavaScript API Docs

    ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/classes/unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/cla0000755000015600001650000000000012645741276033336 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016700000000000011221 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/classes/AlarmApi.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/cla0000644000015600001650000003005312645740734033337 0ustar pbuserpbgroup00000000000000 AlarmApi - Alarms JS API
    API Docs for: 0.1

    Class AlarmApi

    Class defined in: alarm-api.js:254

    The AlarmApi object

    AlarmApi( )
    alarm-api.js:254
    Example
      var date = new Date();
          <set a valid date in the future>
        
          var api = external.getUnityObject('1.0');
          api.AlarmApi.api.createAndSaveAlarmFor(
             date,
             api.AlarmApi.AlarmType.OneTime,
             api.AlarmApi.AlarmDayOfWeek.AutoDetect,
             "alarm triggered",
             function(errorid) {
                 console.log(api.AlarmApi.api.errorToMessage(errorid));
             });
    api.createAndSaveAlarmFor( date, type, daysOfWeek, message, callback )
    alarm-api.js:435

    Creates and saves a new alarm.

    Parameters:
    • date <Date>

      date at which the alarm is to be triggered.

    • type <AlarmType>

      type of the alarm.

    • daysOfWeek <AlarmDayOfWeek>

      days of the week the alarm is scheduled.

    • message <String>

      Message to be displayed when the alarm is triggered.

    • callback <Function(AlarmError)>

      (optional) Function to be called when the alarm has been saved.

    api.errorToMessage( error )
    alarm-api.js:450

    Returns a message adapted to the given error id.

    Parameters:
    • error <AlarmError>

      error id.

    createAlarm( callback )
    alarm-api.js:422

    Creates a Alarm object.

    Parameters:
    • callback <Function(Alarm)>

      Function called with the created Alarm.

    AlarmDayOfWeek <Integer> (static)
    alarm-api.js:303

    Flags for the week days an Alarm should be triggered.

    Values:

    Monday: The alarm will kick on Mondays
                    
                    Tuesday: The alarm will kick on Tuesdays
                    
                    Wednesday: The alarm will kick on Wednesday
                    
                    Thursday: The alarm will kick on Thursday
                    
                    Friday: The alarm will kick on Friday
                    
                    Saturday: The alarm will kick on Saturday
                    
                    Sunday: The alarm will kick on Sunday
                    
                    AutoDetect: The alarm day will be detected
                      from the alarm date.
    Example
    var api = external.getUnityObject('1.0');
                    var dayofweek = api.AlarmApi.AlarmDayOfWeek;
                    // use dayofweek.Monday or/and dayofweek.Tuesday, etc.
    AlarmError <Integer> (static)
    alarm-api.js:360

    Error ids returned during AlarmApi calls.

    Values:

    NoError: Successful operation completion
                    
                    InvalidDate: The date specified for the alarm was invalid
                    
                    EarlyDate: The date specified for the alarm is an earlier
                        date than the current one
                    
                    NbDaysOfWeek: The daysOfWeek parameter of the alarm was not specified
                    
                    OneTimeOnMoreDays: The one-time alarm was set to be kicked in several days
                    
                    InvalidEvent: The alarm event is invalid
                    
                    AdaptationError: The error occurred in alarm adaptation layer.
                        Adaptations may define additional behind this value
    Example
    var date = new Date();
                    <set a valid date in the future>
                    
                    var api = external.getUnityObject('1.0');
                    api.AlarmApi.api.createAndSaveAlarmFor(
                      date,
                      api.AlarmApi.AlarmType.OneTime,
                      api.AlarmApi.AlarmDayOfWeek.AutoDetect,
                      "alarm triggered",
                      function(errorid) {
                        console.log(api.AlarmApi.api.errorToMessage(errorid));
                      });
    AlarmType <Object> (static)
    alarm-api.js:275

    Enumeration of the available types of Alarm.

    Values:

    OneTime: The alarm occurs only once
                    
                    Repeating: The alarm is a repeating one,
                        either daily, weekly on a given day
                        or on selected days
    Example
    var api = external.getUnityObject('1.0');
                    var alarmtype = api.AlarmApi.AlarmType;
                    // use alarmtype.OneTime or alarmtype.Repeating
    ././@LongLink0000000000000000000000000000016400000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/classes/Alarm.htmlunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/docsbuild/cla0000644000015600001650000005161212645740734033343 0ustar pbuserpbgroup00000000000000 Alarm - Alarms JS API
    API Docs for: 0.1

    Class Alarm

    Class defined in: alarm-api.js:9

    An Alarm.

    Alarm( )
    alarm-api.js:9
    Example
     var date = new Date();
         <set a valid date in the future>
        
         var api = external.getUnityObject('1.0');
         api.AlarmApi.api.createAndSaveAlarmFor(
             date,
             api.AlarmApi.AlarmType.OneTime,
             api.AlarmApi.AlarmDayOfWeek.AutoDetect,
             "alarm triggered",
             function(errorid) {
                 console.log(api.AlarmApi.api.errorToMessage(errorid));
             });
    cancel( )
    alarm-api.js:206

    Cancels a given Alarm.

    daysOfWeek( callback )
    alarm-api.js:180

    Retrieves the alarm day of the week.

    The property holds the days of the week the alarm is scheduled. This property can have only one day set for one time alarms and multiple days for repeating alarms.

    Parameters:
    • callback <Function(AlarmType)>
    destroy( )
    alarm-api.js:235

    Destroys the remote object. This proxy object is not valid anymore.

    enabled( callback )
    alarm-api.js:74

    Retrieves the alarm's enabled state.

    The property specifies whether the alarm is enabled or not. Disable dalarms are not scheduled. The default value is true

    Parameters:
    • callback <Function(Boolean)>
    error( callback )
    alarm-api.js:37

    The property holds the error code occurred during the last performed operation.

    Parameters:
    • callback <Function(Error)>
    error( callback )
    alarm-api.js:47

    Retrieves the alarm date.

    The date property holds the date the alarm will be triggered. The default value is the current date and time the alarm object was created. Further reset calls will bring the value back to the time the reset was called.

    Parameters:
    • callback <Function(Date)>
    message( callback )
    alarm-api.js:97

    Retrieves the alarm message.

    The property holds the message string which will be displayed when the alarm is triggered. The default value is the localized "Alarm" text

    Parameters:
    • callback <Function(String)>
    reset( )
    alarm-api.js:215

    Resets a given Alarm.

    save( )
    alarm-api.js:224

    Saves the alarm as a system wide alarm with the parameters previously set.

    setDate( date, callback )
    alarm-api.js:63

    Sets the alarm date.

    Parameters:
    • date <Date>
    • callback <Function()>

      (optional) To be called after the date is set.

    setDaysOfWeek( daysOfWeek, callback )
    alarm-api.js:192

    Sets the alarm day of the week.

    Parameters:
    • daysOfWeek <AlarmDayOfWeek>
    • callback <Function()>

      (optional) To be called after the day of the week is set.

    setEnabled( enabled, callback )
    alarm-api.js:86

    Sets the alarm's enabled state.

    Parameters:
    • enabled <Boolean>
    • callback <Function()>

      (optional) To be called after the enabled state is set.

    setMessage( message, callback )
    alarm-api.js:109

    Sets the alarm message.

    Parameters:
    • message <String>
    • callback <Function()>

      (optional) To be called after the message is set.

    setSound( sound, callback )
    alarm-api.js:134

    Sets the alarm sound.

    Parameters:
    • sound <String>
    • callback <Function()>

      (optional) To be called after the sound is set.

    setType( type, callback )
    alarm-api.js:169

    Sets the alarm type.

    Parameters:
    • type <AlarmType>
    • callback <Function()>

      (optional) To be called after the type is set.

    sound( callback )
    alarm-api.js:120

    Retrieves the alarm sound.

    The property holds the alarm's sound to be played when the alarm is triggered. An empty url will mean to play the default sound.

    The default value is an empty url.

    Parameters:
    • callback <Function(String)>
    status( callback )
    alarm-api.js:145

    Retrieves the alarm status.

    The property holds the status of the last performed operation

    Parameters:
    • callback <Function(String)>
    type( callback )
    alarm-api.js:157

    Retrieves the alarm type.

    The property holds the type of the alarm. The default value is AlarmType.OneTime

    Parameters:
    • callback <Function(AlarmType)>
    ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/index.handlebarsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/client/index.handleb0000644000015600001650000000006612645740734033334 0ustar pbuserpbgroup00000000000000

    Welcome to Ubuntu Alarms JavaScript API Docs

    unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/backend/0000755000015600001650000000000012645741276031017 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/bindings/alarm-api/backend/alarm-api.js0000644000015600001650000001573412645740734033230 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ .import Ubuntu.Components 0.1 as ComponentsBridge /** * * Alarm API backend binding * */ function createAlarmApi(backendDelegate) { var PLUGIN_URI = 'Ubuntu.Components'; var VERSION = 0.1; function _nameToAlarmType(name) { var alarmTypePerName = { "OneTime": ComponentsBridge.Alarm.OneTime, "Repeating": ComponentsBridge.Alarm.Repeating, }; return name in alarmTypePerName ? alarmTypePerName[name] : ComponentsBridge.Alarm.OneTime; }; function _alarmTypeToName(type) { if (type === ComponentsBridge.Alarm.OneTime) return "OneTime"; else if (type === ComponentsBridge.Alarm.Repeating) return "Repeating"; return ; }; function Alarm(alarm, objectid) { var id = objectid; if ( ! alarm) { var result = backendDelegate.createQmlObject( PLUGIN_URI, VERSION, 'Alarm'); id = result.id; alarm = result.object; } if ( ! id) { id = backendDelegate.storeQmlObject(alarm, PLUGIN_URI, VERSION, 'Account'); } this._id = id; this._object = alarm; }; Alarm.prototype = { _validate: function() { if (! this._object) throw new TypeError("Invalid object null"); }, destroy: function() { if (! this._object) return; this._object.destroy(); backendDelegate.deleteId(this._id); }, // object methods serialize: function() { return { type: 'object-proxy', apiid: 'Alarm', objecttype: 'Alarm', objectid: this._id, } }, // methods cancel: function() { this._validate(); this._object.cancel(); }, reset: function() { this._validate(); this._object.reset(); }, save: function() { this._validate(); this._object.save(); }, // properties error: function(callback) { this._validate(); callback(this._object.error); }, date: function(callback) { this._validate(); callback(this._object.date.getTime()); }, setDate: function(date, callback) { this._validate(); var _date = new Date(); _date.setTime(parseInt(date)); this._object.date = _date; if (callback && typeof(callback) === 'function') callback(); }, daysOfWeek: function(callback) { this._validate(); callback(this._object.daysOfWeek); }, setDaysOfWeek: function(daysOfWeek, callback) { this._validate(); this._object.daysOfWeek = daysOfWeek; if (callback && typeof(callback) === 'function') callback(); }, enabled: function(callback) { this._validate(); callback(this._object.enabled); }, setEnabled: function(enabled, callback) { this._validate(); this._object.enabled = enabled; if (callback && typeof(callback) === 'function') callback(); }, message: function(callback) { this._validate(); callback(this._object.message); }, setMessage: function(message, callback) { this._validate(); this._object.message = message; if (callback && typeof(callback) === 'function') callback(); }, sound: function(callback) { this._validate(); callback(this._object.sound); }, setSound: function(sound, callback) { this._validate(); this._object.sound = sound; if (callback && typeof(callback) === 'function') callback(); }, status: function(callback) { this._validate(); callback(this._object.status.toString()); }, type: function(callback) { this._validate(); callback(_alarmTypeToName(this._object.type)); }, setType: function(type, callback) { this._validate(); this._object.type = _nameToAlarmType(type); if (callback && typeof(callback) === 'function') callback(); }, // internal internal: { error: function(self) { return self._object.error; } } }; function _constructorFromName(className) { var constructorPerName = { "Alarm": Alarm, }; return className in constructorPerName ? constructorPerName[className] : null; } return { createAlarm: function(callback) { console.log('createAlarm') var alarm = new Alarm(); callback(alarm.serialize()); }, createAndSaveAlarmFor: function(date, type, daysOfWeek, message, callback) { var alarm = new Alarm(); alarm.setDate(date); alarm.setMessage(message); alarm.setType(_nameToAlarmType(type)); alarm.setDaysOfWeek(daysOfWeek); alarm.save(); if (callback && typeof(callback) === 'function') callback(alarm.internal.error(alarm)); alarm.destroy(); }, // Internal dispatchToObject: function(infos) { var args = infos.args; var callback = infos.callback; var method_name = infos.method_name; var objectid = infos.objectid; var class_name = infos.class_name; if (callback) args.push(callback); var o = backendDelegate.objectFromId(objectid); if (o == null) { console.debug('Cannot dispatch to unknown object: ' + objectid); return; } var Constructor = _constructorFromName(class_name); var instance = new Constructor(o, objectid); instance[method_name].apply(instance, args); } }; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/UnityWebApps.pro0000644000015600001650000000522612645740734027107 0ustar pbuserpbgroup00000000000000include(../../../common-project-config.pri) include(../../../common-vars.pri) TEMPLATE = subdirs SUBDIRS += plugin UNITY_API_JS_FILE = $$system($$PWD/../../../tools/inject-js-utils.py unity-webapps-api.js.in unity-webapps-api.js) inject_dependancies.target = unity-webapps-api.js inject_dependancies.depends = unity-webapps-api.js.in inject_dependancies.commands = $$PWD/../../../tools/inject-js-utils.py $< $@ QMAKE_EXTRA_TARGETS += inject_dependancies PRE_TARGETDEPS += \ unity-webapps-api.js # # deployment directives # PLUGIN_JS_FILES = \ $$system(ls *.js) \ $${UNITY_API_JS_FILE} CLIENT_JS_FILES = \ $$system(ls ./common/*/*.js) \ $$system(ls ./bindings/*/client/*.js) QML_FILES = $$system(ls *.qml) QMLDIR_FILE = qmldir QMAKE_SUBSTITUTES += qmldir.in OTHER_FILES += $$QML_FILES \ $$PLUGIN_JS_FILES \ $$CLIENT_JS_FILES \ $$system(ls ./bindings/*/backend/*.js) \ qmldir.in \ unity-webapps-api.js.in \ $${UNITY_API_JS_FILE} # # Installs # installPath = $$[QT_INSTALL_QML]/$$replace(API_URI, \\., /) qmldir_file.path = $$installPath qmldir_file.files = $$QMLDIR_FILE qml_files.path = $$installPath qml_files.files = $$QML_FILES js_files.path = $$installPath js_files.files = $$PLUGIN_JS_FILES content_hub_binding_backend_js_files.path = $$installPath/bindings/content-hub/backend/ content_hub_binding_backend_js_files.files = ./bindings/content-hub/backend/content-hub.js alarm_binding_backend_js_files.path = $$installPath/bindings/alarm-api/backend/ alarm_binding_backend_js_files.files = ./bindings/alarm-api/backend/alarm-api.js online_accounts_binding_backend_js_files.path = $$installPath/bindings/online-accounts/backend/ online_accounts_binding_backend_js_files.files = \ ./bindings/online-accounts/backend/online-accounts.js \ ./bindings/online-accounts/backend/online-accounts-client.js runtime_api_binding_backend_js_files.path = $$installPath/bindings/runtime-api/backend/ runtime_api_binding_backend_js_files.files = ./bindings/runtime-api/backend/runtime-api.js download_api_binding_backend_js_files.path = $$installPath/bindings/download-manager/backend/ download_api_binding_backend_js_files.files = ./bindings/download-manager/backend/download-api.js tools_api_binding_backend_js_files.path = $$installPath/bindings/tools/backend/ tools_api_binding_backend_js_files.files = ./bindings/tools/backend/tools.js INSTALLS += qmldir_file \ qml_files \ js_files \ content_hub_binding_backend_js_files \ alarm_binding_backend_js_files \ online_accounts_binding_backend_js_files \ runtime_api_binding_backend_js_files \ download_api_binding_backend_js_files \ tools_api_binding_backend_js_files unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/Settings.qml0000644000015600001650000000155712645740734026311 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 Item { /** * */ property bool injectExtraUbuntuApis: false property bool injectExtraContentShareCapabilities: false property bool requiresInit: true } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/UnityWebApps.js0000644000015600001650000002516312645740734026725 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ .import "UnityWebAppsUtils.js" as UnityWebAppsUtils // // sendtoPageFunc: experimental.postMessage // // FIXME(AAU): lexical bindings (e.g. the global JSON object) do not seem to be // properly bounded when a qml file calls a js closure returned // and imported from an external js file. QML bug or developer bug? // var UnityWebApps = (function () { var json = JSON; /** * \param parentItem * \param bindeeProxies * \param accessPolicy * \param injected_api_path * \param dispatched_callback */ function _UnityWebApps( parentItem, bindeeProxies, accessPolicy, injected_api_path, dispatched_callback) { this._injected_unity_api_path = injected_api_path; this._bindeeProxies = bindeeProxies; this._backends = null; this._accessPolicy = accessPolicy; this._callbackManager = UnityWebAppsUtils.makeCallbackManager(); this._dispatchedCallback = dispatched_callback this._bind(); }; _UnityWebApps.prototype = { cleanup: function() { if (this._bindeeProxies.cleanup && typeof(this._bindeeProxies.cleanup) == 'function') { this._bindeeProxies.cleanup(); } }, proxies: function() { return this._bindeeProxies; }, injectWebappUserScripts: function(userscripts) { if (this._bindeeProxies) { this._bindeeProxies.injectUserScripts( userscripts.map(function(script) { return Qt.resolvedUrl(script); })); } }, setBackends: function(backends) { this._backends = backends; }, /** * \internal * */ _bind: function () { var self = this; var cb = this._onMessageReceivedCallback.bind(self); self._bindeeProxies.messageReceivedConnect(cb); this._injectCoreBindingUserScripts(); }, /** * \internal * */ _injectCoreBindingUserScripts: function () { if (this._bindeeProxies) { this._bindeeProxies.injectUserScripts( [Qt.resolvedUrl(this._injected_unity_api_path)]); } }, /** * \internal * */ _onMessageReceivedCallback: function (message) { if (!message) return; this._onMessage(message); }, /** * \internal * */ _onMessage: function(msg) { if ( ! this._isValidWebAppsMessage(msg) && ! this._isValidCallbackMessage(msg)) { this._log ('Invalid message received: ' + json.stringify(msg)); return; } var self = this; var args = json.parse(msg.args); args = args.map (function (arg) { return self._wrapCallbackIds (arg); }); this._dispatch(msg, args); return true; }, /** * \internal * */ _dispatch: function(message, params) { var target = message.target; //TODO improve dispatch if (target === UnityWebAppsUtils.UBUNTU_WEBAPPS_BINDING_API_CALL_MESSAGE) { // Actuall call, e.g. 'Notification.showNotification("a","b") // being reduces to successive calls to associated objects: // Notification, showNotification // // TODO add proper error handling if (message.callback) { var cb = this._wrapCallbackIds (message.callback); params.push(cb); } var apiCallName = message.name; if (this._accessPolicy && this._accessPolicy.allowed && !this._accessPolicy.allowed(apiCallName)) { console.error("Unauthorize API call blocked: " + apiCallName); return; } this._log ('WebApps API message being dispatch: ' + apiCallName); if (this._dispatchedCallback && typeof(this._dispatchedCallback) === 'function') { this._dispatchedCallback({type: "dispatching", name: apiCallName}) } this._dispatchApiCall (message.name, params); } else if (target === UnityWebAppsUtils.UBUNTU_WEBAPPS_BINDING_OBJECT_METHOD_CALL_MESSAGE) { var objectid = message.objectid; var api_uri = message.api_uri; var class_name = message.class_name; var method_name = message.name; var callback = this._wrapCallbackIds (message.callback); console.debug('Dispatching object method call to: ' + api_uri + ', method: ' + method_name); this._dispatchApiCall(api_uri + ".dispatchToObject", [{args: params, callback: callback, objectid: objectid, class_name: class_name, method_name: method_name}]); } else if (target === UnityWebAppsUtils.UBUNTU_WEBAPPS_BINDING_API_CALLBACK_MESSAGE) { var id = message.id; if (! id || ! params) return; var cbfunc = this._callbackManager.get(id); if (!cbfunc || !(cbfunc instanceof Function)) { try { console.log('Invalid callback id: ' + id); } catch (e) {} return; } cbfunc.apply(null, params); } }, /** * \internal * */ _dispatchApiCall: function (name, args) { if ( ! this._backends) return; var names = name.split('.'); var reducetarget = this._backends; try { // Assumes that we are calling a 'callable' from a succession of objects var t = names.reduce ( function (prev, cur) { return (typeof prev[cur] == "function") ? (function(prev, cur) { return prev[cur].bind(prev); })(prev, cur) : prev[cur]; }, reducetarget); t.apply (null, args); if (this._dispatchedCallback && typeof(this._dispatchedCallback) === 'function') { this._dispatchedCallback({type: "called", name: name}) } } catch (err) { this._log('Error while dispatching call to ' + names.join('.') + ': ' + err); } }, /** * \internal * */ _makeWebpageCallback: function (callbackid) { var self = this; return function () { // TODO add validation higher if (!self._bindeeProxies.sendToPage || !(self._bindeeProxies.sendToPage instanceof Function)) return; var callback_args = Array.prototype.slice.call(arguments); callback_args = callback_args.map (function (arg) { return UnityWebAppsUtils.transformCallbacksToIds(arg, self._callbackManager); }); var message = UnityWebAppsUtils.formatUnityWebappsCallbackCall(callbackid, callback_args); self._bindeeProxies.sendToPage(JSON.stringify(message)); }; }, /** * \internal * * Wraps callback ids in proper callback that dispatch to the * webpage thru a proper event * */ _wrapCallbackIds: function (obj) { if ( ! obj) return obj; if ( ! UnityWebAppsUtils.isIterableObject(obj)) { return obj; } if (obj && obj.hasOwnProperty('callbackid') && obj.callbackid !== null) { return this._makeWebpageCallback (obj.callbackid); } var ret = (obj instanceof Array) ? [] : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { if (UnityWebAppsUtils.isIterableObject (obj[key])) { if (obj[key].callbackid != null) { ret[key] = this._makeWebpageCallback (obj[key].callbackid); } else { ret[key] = this._wrapCallbackIds (obj[key]); } } else { ret[key] = obj[key]; } } } return ret; }, /** * \internal * */ _log: function (msg) { try { console.debug(msg); } catch(e) {} }, /** * \internal * */ _isValidWebAppsMessage: function(message) { return message != null && message.target && message.target.indexOf('ubuntu-webapps-binding-call') === 0 && message.name && message.args; }, /** * \internal * */ _isValidCallbackMessage: function(message) { return message != null && message.target && message.target.indexOf('ubuntu-webapps-binding-callback-call') === 0 && message.args; } }; return _UnityWebApps; }) (); unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/UnityWebAppsBackendComponents.js0000644000015600001650000003066112645740734032242 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ var _backends = {}; function __set(id, component) { _backends[id] = component; }; function __areValidParams(params) { function __has(o,n) { return n in o && o[n] != null && (typeof o[n] === 'string' ? o[n] !== "" : true); }; return params && __has(params, 'name') && __has(params, 'displayName'); }; function __createQmlObject(qmlStatement, parentItem, params) { var component = null; var error = null; try { component = Qt.createQmlObject(qmlStatement, parentItem); } catch(e) { error = JSON.stringify(e.qmlErrors); } return { object: component, error: error}; }; //TODO: bad mechanism, it could possibly be that the "base" backend is // ready after the "notify" one ... which is bad and could enable calls // to notify w/o base ready var _backendReadyListeners = {}; function __onBackendReady(name) { if (!(name instanceof String) || name.length !== 0) return; var listeners = _backendReadyListeners[name]; if (listeners && listeners instanceof Array && listeners.length !== 0) { listeners.forEach(function (listener) { try { listener(name); } catch (e) {}; }); } }; function signalOnBackendReady(name, func) { if (typeof(name) != "string" || name.length === 0) return; if (!(func instanceof Function)) return; // check if backend already ready if (!!get(name)) { console.debug('Backend ready: ' + name); func(name); return; } if (!_backendReadyListeners[name]) _backendReadyListeners[name] = []; _backendReadyListeners[name].push(func); } function UnityActionsBackendAdaptor(parentItem, actionsContext) { this._actions = {}; this._actionsContext = actionsContext; }; UnityActionsBackendAdaptor.prototype.destroy = function () { this.clearActions(); } UnityActionsBackendAdaptor.prototype.__normalizeName = function (actionName) { return actionName.replace(/^\/+/, ''); } UnityActionsBackendAdaptor.prototype.__actionExists = function (actionName) { if (!actionName || typeof(actionName) != 'string' || actionName.lenght === 0) return false; return this._actions[actionName] != null && this._actions[actionName].action != null; }; UnityActionsBackendAdaptor.prototype.addAction = function (_actionText, callback, id) { var actionText = this.__normalizeName(_actionText); if (this.__actionExists(actionText)) this.clearAction(actionText); var params = ' text: "' + actionText + '";' + ' enabled: true; ' + (id ? ('name: ' + '"' + id + '"') : ''); var action = __createQmlObject('import Ubuntu.Unity.Action 1.0 as UnityActions; \ UnityActions.Action { ' + params + ' }', this._actionsContext).object; this._actionsContext.addAction(action); action.triggered.connect(callback); this._actions[actionText] = { action: action, callback: callback}; } UnityActionsBackendAdaptor.prototype.clearAction = function (_actionName) { var actionName = this.__normalizeName(_actionName); if ( ! this.__actionExists(actionName)) return; try { this._actionsContext.removeAction(this._actions[actionName].action); this._actions[actionName].action.enabled = false; this._actions[actionName].action.triggered.disconnect(this._actions[actionName].callback); this._actions[actionName] = null; } catch(e) { console.debug('Error while removing an action: ' + e); } } UnityActionsBackendAdaptor.prototype.clearActions = function () { for(var action in this._actions) { if (this._actions.hasOwnProperty(action) && this._actions[action] != null) this.clearAction(action); } } /*! \internal Extracts the properties of a given js object and tries to create a string for the definition of a QML object w/ those values. e.g. params = {name: "myname", version: 1} -> "name: 'myname'; version: 1" It assumes a lot and is fragile (no array, complex object support, error handling, etc,) FIXME: Shamefully hacky */ function __extractParams(params) { if (!params || !(params instanceof Object)) return ""; var extracted = ""; for (var p in params) { if (params.hasOwnProperty(p) && params[p] != null) { extracted += p + ":" + JSON.stringify(params[p]) + "; "; } } return extracted; } function get(id) { return _backends[id]; }; function UbuntuBindingBackendDelegate(parent) { this._parent = parent; this._id = 0; this._objects = {}; this._last_proxy_id = 0; } UbuntuBindingBackendDelegate.prototype = { createQmlObject: function(uri, version, component, properties) { var statement = 'import ' + uri + ' ' + version + '; ' + component + ' { ' + __extractParams(properties) + ' }'; var result = __createQmlObject(statement, this._parent); if (result.error != null) { console.debug('Error while creating object: ' + uri + '.' + component + ' : ' + result.error); return null; } var id = this._generateObjectId(uri, component); this._objects[id] = result.object; return {object: this._objects[id], id: id}; }, parent: function() { return this._parent; }, parentView: function() { return this._parent ? this._parent.bindee : null; }, isObjectProxyInfo: function(info) { return 'type' in info && info.type === 'object-proxy' && 'apiid' in info && 'objecttype' in info && 'objectid' in info; }, deleteId: function(id) { if (this._objects[id] != null) { delete this._objects[id]; this._objects[id] = null; } }, objectFromId: function(id) { return id != null ? this._objects[id] : null; }, storeQmlObject: function(object, uri, version, component, properties) { var id = this._generateObjectId(uri, component); console.debug('got an id: ' + id) this._objects[id] = object; return id; }, createModelAdaptorFor: function(model) { var adaptor = Qt.createQmlObject('import Ubuntu.UnityWebApps 0.1 \ as UW; UW.AbstractItemModelAdaptor {}', this._parent); adaptor.itemModel = model; return adaptor; }, _generateObjectId: function(uri, name) { var candidate = uri + name + this._id; while (this._objects[candidate] != undefined) { ++this._last_proxy_id; candidate = uri + name + this._last_proxy_id; } return candidate; } }; var backendDelegate; function createBackendDelegate(parentItem) { backendDelegate = new UbuntuBindingBackendDelegate(parentItem); } /** * \brief creates all the backends * * \param */ function createAllWithAsync(parentItem, params, eventHandlers) { if (!__areValidParams(params)) { //TODO: error reporting throw new Error("Invalid creation parameters"); } var extracted = __extractParams(params); function connectAppRaisedEvent(target) { if (target && eventHandlers && eventHandlers.onAppRaised) target.raised.connect(function() { try { eventHandlers.onAppRaised(); } catch(e){} }); } //FIXME:!!! lots of duplicated stuff var result = __createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; \ Backends.UnityWebappsBase { }', parentItem, params); if (result.error != null) { console.debug('Could not create base backend: ' + result.error); clearAll(); return false; } var apiBase = result.object; apiBase.model = parentItem.model; __set("base", apiBase); __onBackendReady("base"); // notifications result = __createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; \ Backends.UnityWebappsNotificationsBinding { name: "' + params.name + '"; }', parentItem, params); if (result.error != null) { console.debug('Could not create notifications backend: ' + result.error); clearAll(); return false; } __set("notify", result.object); __onBackendReady("notify"); // launcher result = __createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; \ Backends.UnityWebappsLauncherBinding { }', parentItem, params); if (result.error != null) { console.debug('Could not create launcher backend: ' + result.error); clearAll(); return false; } var launcher = result.object; apiBase.appInfosChanged.connect(function(appInfos) { launcher.onAppInfosChanged(appInfos); }); __set("launcher", launcher); __onBackendReady("launcher"); // media player result = __createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; \ Backends.UnityWebappsMediaPlayerBinding { }', parentItem, params); if (result.error != null) { console.debug('Could not create MediaPlayer backend: ' + result.error); clearAll(); return false; } var mediaplayer = result.object; apiBase.appInfosChanged.connect(function(appInfos) { mediaplayer.onAppInfosChanged(appInfos); }); __set("mediaplayer", mediaplayer); __onBackendReady("mediaplayer"); connectAppRaisedEvent(mediaplayer); // messaging menu result = __createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; \ Backends.UnityWebappsMessagingBinding { }', parentItem, params); if (result.error != null) { console.debug('Could not create messaging menu backend: ' + result.error); clearAll(); return false; } // model have to be manuall set var messagingmenu = result.object; apiBase.appInfosChanged.connect(function(appInfos) { messagingmenu.onAppInfosChanged(appInfos); }); __set("messaging", messagingmenu); __onBackendReady("messaging"); connectAppRaisedEvent(messagingmenu); // extra actions set for the launcher/messaging-menu if (parentItem.actionsContext) { __set("indicator-actions", new UnityActionsBackendAdaptor(parentItem, parentItem.actionsContext)); __onBackendReady("indicator-actions"); } // Unity actions/HUD //FIXME: find a better way to access parentItem.actionsContext if (parentItem.actionsContext) { __set("hud", new UnityActionsBackendAdaptor(parentItem, parentItem.actionsContext)); __onBackendReady("hud"); } } function clearAll () { if (_backends.base) { _backends.base.destroy(); _backends['base'] = null; } if (_backends.hud) { _backends.hud.destroy(); _backends['hud'] = null; } if (_backends.notify) { _backends.notify.destroy(); _backends['notify'] = null; } if (_backends.launcher) { _backends.launcher.destroy(); _backends['launcher'] = null; } if (_backends['indicator-actions']) { _backends['indicator-actions'].destroy(); _backends['indicator-actions'] = null; } if (_backends.mediaplayer) { _backends.mediaplayer.destroy(); _backends['mediaplayer'] = null; } if (_backends.messaging) { _backends.messaging.destroy(); _backends['messaging'] = null; } }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/0000755000015600001650000000000012645741276025266 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/qml-plugin.h0000644000015600001650000000176412645740734027532 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __WEBAPPS_QML_PLUGIN_H__ #define __WEBAPPS_QML_PLUGIN_H__ #include class WebappsQmlPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: void registerTypes(const char *uri); }; #endif // __WEBAPPS_QML_PLUGIN_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-launcher.h0000644000015600001650000000376412645740734032624 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_LAUNCHER_H__ #define __UNITY_WEBAPPS_LAUNCHER_H__ #include #include #include "unity-webapps-app-model.h" #include "unity-webapps-app-infos.h" class UnityWebappsLauncherPrivate; class UnityWebappsLauncher: public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) public: UnityWebappsLauncher(QObject * parent = 0); virtual ~UnityWebappsLauncher(); // API functions Q_INVOKABLE void setCount(int count); Q_INVOKABLE int getCount(); Q_INVOKABLE void clearCount(); Q_INVOKABLE void setProgress(double progress); Q_INVOKABLE double getProgress(); Q_INVOKABLE void clearProgress(); Q_INVOKABLE void setUrgent(); Q_INVOKABLE void addAction(const QString & actionName, const QString & action); Q_INVOKABLE void removeAction(const QString & actionName); Q_INVOKABLE void removeActions(); // Class functions void classBegin(); void componentComplete(); public Q_SLOTS: void onAppInfosChanged(UnityWebappsAppInfos *appInfos); Q_SIGNALS: void onActionAdded(const QString& name, const QString& action); void onActionRemoved(const QString& name); private: UnityWebappsLauncherPrivate *d_ptr; Q_DECLARE_PRIVATE(UnityWebappsLauncher) }; #endif // __UNITY_WEBAPPS_LAUNCHER_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-desktop-infos.cpp0000644000015600001650000000246112645740734033365 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "unity-webapps-desktop-infos.h" QString UnityWebappsQML::buildDesktopInfoFileForWebapp (const QString& name, const QString& domain) { return QString("%1%2").arg(UnityWebappsQML::canonicalize(name)).arg(UnityWebappsQML::canonicalize(domain)); } QString UnityWebappsQML::canonicalize(const QString& s, bool keep_whitespaces) { QString canonicalized; for (QString::const_iterator it = s.begin(); it != s.end(); ++it) { if (it->isLetterOrNumber() || (keep_whitespaces && it->isSpace())) canonicalized.append(*it); } return canonicalized; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/qml-plugin.cpp0000644000015600001650000000507512645740734030064 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "qml-plugin.h" #include #include #include "unity-webapps-api.h" #include "unity-webapps-api-notifications.h" #include "unity-webapps-api-messaging-menu.h" #include "unity-webapps-api-launcher.h" #include "unity-webapps-api-mediaplayer.h" #include "unity-webapps-app-model.h" #include "unity-webapps-app-infos.h" #include "application-api.h" #include "tools-api.h" #include "abstract-item-model-adaptor.h" #include "callback.h" #include static QObject *createApplicationApi(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine); Q_UNUSED(scriptEngine); return new ApplicationApi(); } static QObject *createToolsApi(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine); Q_UNUSED(scriptEngine); return new ToolsApi(); } void WebappsQmlPlugin::registerTypes(const char *uri) { // bindings qmlRegisterType (uri, 0, 1, "UnityWebappsBase"); qmlRegisterType (uri, 0, 1, "UnityWebappsNotificationsBinding"); qmlRegisterType (uri, 0, 1, "UnityWebappsMessagingBinding"); qmlRegisterType (uri, 0, 1, "UnityWebappsLauncherBinding"); qmlRegisterType (uri, 0, 1, "UnityWebappsMediaPlayerBinding"); // misc qmlRegisterType (uri, 0, 1, "UnityWebappsAppModel"); qmlRegisterType (uri, 0, 1, "UnityWebappsCallback"); qmlRegisterType (uri, 0, 1, "UnityWebappsAppInfos"); // TODO bump version qmlRegisterType (uri, 0, 1, "AbstractItemModelAdaptor"); // Application Api entry point qmlRegisterSingletonType(uri, 0, 1, "ApplicationApi", createApplicationApi); // Tools Api entry point qmlRegisterSingletonType(uri, 0, 2, "ToolsApi", createToolsApi); } ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-messaging-menu.cppunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-messaging-menu0000644000015600001650000002052012645740734033501 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include "unity-webapps-desktop-infos.h" #include "unity-webapps-app-infos.h" #include "unity-webapps-icon-utils.h" #include "unity-webapps-api-messaging-menu.h" #define API_CALL_HEADER() do { \ d->init(); \ if (!d->_mmapp) \ return; \ } while(0) namespace { GIcon * requestImage(const QString &iconId) { QByteArray utf8Name = QUrl::fromPercentEncoding(iconId.toUtf8()).toUtf8(); GError *error = NULL; GIcon *icon = g_icon_new_for_string(utf8Name.data(), &error); if (error) { qDebug() << "Could not load icon: " << error->message; g_error_free(error); return NULL; } return icon; } } // namespace { static void unity_webapps_messaging_menu_source_activated ( MessagingMenuApp *mmapp, const gchar *source_id, gpointer user_data); struct UnityWebappsMessagingMenuPrivate { UnityWebappsMessagingMenuPrivate (UnityWebappsMessagingMenu * qq); ~UnityWebappsMessagingMenuPrivate (); void clear(); void init(); void sourceActivated(); UnityWebappsAppInfos *_appInfos; MessagingMenuApp *_mmapp; QStringList _sources; QObject* _callback; UnityWebappsMessagingMenu * const q_ptr; Q_DECLARE_PUBLIC(UnityWebappsMessagingMenu) }; UnityWebappsMessagingMenuPrivate::UnityWebappsMessagingMenuPrivate (UnityWebappsMessagingMenu * qq) : _appInfos(0), _mmapp(0), _callback(0), q_ptr(qq) { } UnityWebappsMessagingMenuPrivate::~UnityWebappsMessagingMenuPrivate() { clear(); } void UnityWebappsMessagingMenuPrivate::sourceActivated() { Q_Q(UnityWebappsMessagingMenu); Q_EMIT q->raised(); if (_callback) QMetaObject::invokeMethod(_callback, "trigger"); } void UnityWebappsMessagingMenuPrivate::clear() { if (_mmapp && G_IS_OBJECT(_mmapp)) { g_signal_handlers_disconnect_by_func(_mmapp, (gpointer)unity_webapps_messaging_menu_source_activated, this); g_object_unref(_mmapp); _mmapp = 0; } _appInfos = 0; _callback = 0; _sources.clear(); } static void unity_webapps_messaging_menu_source_activated ( MessagingMenuApp *mmapp, const gchar *source_id, gpointer user_data) { Q_UNUSED(mmapp); Q_UNUSED(source_id); UnityWebappsMessagingMenuPrivate* self = static_cast(user_data); // FIXME make sure that we have a proper qobject (still alive) // if ( ! qobject_cast(self)) // return; if (self) self->sourceActivated(); } void UnityWebappsMessagingMenuPrivate::init() { if (Q_UNLIKELY(_mmapp != NULL)) return; if (Q_UNLIKELY(_appInfos == NULL)) { qDebug() << "Trying to initialize the MessagingMenu binding with invalid context"; return; } QString desktopId = _appInfos->desktopId(); if (desktopId.isEmpty()) { qDebug() << "MessagingMenu backend: invalid desktop id (empty)"; return; } _mmapp = messaging_menu_app_new (desktopId.toUtf8().data()); messaging_menu_app_register (_mmapp); g_signal_connect (_mmapp, "activate-source", G_CALLBACK (unity_webapps_messaging_menu_source_activated), this); } UnityWebappsMessagingMenu::UnityWebappsMessagingMenu(QObject *parent) : QObject(parent), d_ptr(new UnityWebappsMessagingMenuPrivate(this)) {} UnityWebappsMessagingMenu::~UnityWebappsMessagingMenu() { delete d_ptr; } void UnityWebappsMessagingMenu::onAppInfosChanged(UnityWebappsAppInfos *appInfos) { Q_D(UnityWebappsMessagingMenu); bool wasInit = false; if (d->_mmapp) { wasInit = true; d->clear(); } d->_appInfos = appInfos; if (wasInit) d->init(); } void UnityWebappsMessagingMenu::showIndicator(const QString& indicatorName) { Q_D(UnityWebappsMessagingMenu); API_CALL_HEADER(); if (indicatorName.isEmpty()) { qDebug() << "Invalid indicator label name: " << indicatorName; return; } QByteArray content = indicatorName.toUtf8(); const gchar *indicatorName_cstr = content.data(); if ( ! messaging_menu_app_has_source (d->_mmapp, indicatorName_cstr)) { messaging_menu_app_append_source (d->_mmapp, indicatorName_cstr, NULL, indicatorName_cstr); d->_sources.append(indicatorName); } } void UnityWebappsMessagingMenu::clearIndicator(const QString& indicatorName) { Q_D(UnityWebappsMessagingMenu); API_CALL_HEADER(); QByteArray content = indicatorName.toUtf8(); const gchar *indicatorName_cstr = content.data(); if (messaging_menu_app_has_source (d->_mmapp, indicatorName_cstr)) { messaging_menu_app_remove_source (d->_mmapp, indicatorName_cstr); d->_sources.removeAll(indicatorName); } } void UnityWebappsMessagingMenu::clearIndicators() { Q_D(UnityWebappsMessagingMenu); API_CALL_HEADER(); QStringList indicators = d->_sources; Q_FOREACH(QString indicator, indicators) { clearIndicator(indicator); } } void UnityWebappsMessagingMenu::setProperty(const QString& indicatorName, const QString& propertyName, const QVariant& value) { Q_D(UnityWebappsMessagingMenu); API_CALL_HEADER(); if (indicatorName.isEmpty()) { qDebug() << "Invalid empty indicator name"; return; } if (propertyName.isEmpty()) { qDebug() << "Invalid empty indicator property"; return; } QByteArray content = indicatorName.toUtf8(); const gchar *indicatorName_cstr = content.data(); if (propertyName.compare("icon", Qt::CaseInsensitive) == 0) { GIcon *icon = requestImage(UnityWebappsQML::getIconPathFor(value.toString())); messaging_menu_app_set_source_icon (d->_mmapp, indicatorName_cstr, icon); g_object_unref (icon); } else if (propertyName.compare("callback", Qt::CaseInsensitive) == 0) { if (QString(value.typeName()).compare("QObject*") != 0) { qDebug() << "Invalid callback type"; return; } //FIXME: ownership & lifetime management QObject * const callback = *static_cast(value.data()); if (callback->metaObject()->indexOfSlot("trigger") != -1) { qDebug() << "Invalid callback type: no trigger method"; return; } d->_callback = callback; } else if (propertyName.compare("label", Qt::CaseInsensitive) == 0) { const char *label= value.toString().toStdString().c_str(); messaging_menu_app_set_source_label (d->_mmapp, indicatorName_cstr, label); } else if (propertyName.compare("count", Qt::CaseInsensitive) == 0) { int count = value.toString().toInt(); messaging_menu_app_set_source_count (d->_mmapp, indicatorName_cstr, count); if (count != 0) messaging_menu_app_draw_attention (d->_mmapp, indicatorName_cstr); else messaging_menu_app_remove_attention (d->_mmapp, indicatorName_cstr); } } void UnityWebappsMessagingMenu::classBegin() { } void UnityWebappsMessagingMenu::componentComplete() { } ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.hunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parse0000644000015600001650000000565612645740734033524 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_APP_MANIFEST_H__ #define __UNITY_WEBAPPS_APP_MANIFEST_H__ #include #include #include #include "unity-webapps-common-priv.h" /*! * \brief Data view of a given WebApp manifest * * Describes a given WebApp and its execution environment. */ struct ManifestFileInfo { // Name of the WebApp QString name; // Domain associated with the WebApp (TLD) QString domain; // Homepage that should be used when the webapp is being launched QString homepage; // List of urls for which the WebApp applies (wildcard are allowed) QStringList includes; // List of javascript files that correspond to script names for the WebApp QStringList scripts; // List of javascript files required by the WebApp (but not included) QStringList requires; // The currently selected chrome option for this WebApp QStringList chromeOptions; // (optional) A User Agent override string to be used for the current webapp QString userAgentOverride; }; /*! * \brief Option type for ManifestFileInfo */ typedef Fallible ManifestFileInfoOption; /*! * \brief The UnityWebappsAppManifestParser class */ class UnityWebappsAppManifestParser : public QObject { public: Q_OBJECT public: UnityWebappsAppManifestParser(QObject *parent = 0); virtual ~UnityWebappsAppManifestParser(); /*! * \brief parse * \param manifest * \return */ virtual ManifestFileInfoOption parse (QFileInfo manifest); private: /*! * \brief parseArray * \param parent * \param name * \return */ QStringList parseArray(const QJsonObject& parent, const QString& name); QStringList parseChromeOptions(const QString& options); /*! * \brief parseManifestContent * \param content * \param infos * \return */ bool parseManifestContent(const QString& content, ManifestFileInfo * infos); /*! * \brief parseManifestContent * \param content * \param infos * \return */ bool parseWebappDeclaration(const QJsonObject& json, ManifestFileInfo * infos); }; #endif // __UNITY_WEBAPPS_APP_MANIFEST_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-model.cpp0000644000015600001650000004112312645740741032452 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include "unity-webapps-app-model.h" #include "unity-webapps-app-manifest-parser.h" /*! \qmltype UnityWebappsAppModel \inqmlmodule Ubuntu.UnityWebApps 0.1 \ingroup ubuntu \brief Provides a model for the list of the currently installed WebApps. Besides providing information about the currently installed webapps, it can typically be used in conjunction with the UnityWebApps QML component that already takes care of making sure that the Unity WebApps API is available to a given QML WebView. What the UnityWebappsAppModel can provide is a way to ask the WebApp QML component to inject the userscripts corresponding to a given webapp along with the API itself. \qml UnityWebApps { id: webapps name: webappName bindee: webview model: UnityWebappsAppModel {} } \endqml If the WebApp whose name is specified as part of the "name" property is found in the specified model, its scripts (along with their dependancies) will be injected. Otherwise only the API will be made available. The \l searchPath property can be use to alter the path where the model searches for installed webapps. The default search path is set to /usr/share/unity-webapps. The \l searchPath property should only be set to valid (existing and readable) paths, all other "values" are ignored. */ // TODO add local folders QString UnityWebappsAppModel::_commonScriptsDirName = "common"; QString UnityWebappsAppModel::_webappDirPrefix = "unity-webapps-"; QString UnityWebappsAppModel::doCorrectSearchPath(const QString & p) { QString fixedPath = p; if (QDir::isRelativePath(fixedPath)) { QDir d(fixedPath); d.makeAbsolute(); fixedPath = d.absolutePath(); } return fixedPath; } QString UnityWebappsAppModel::getDefaultWebappsInstallationSearchPath() { const char *WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER_ENV_VAR = "WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER"; if (qEnvironmentVariableIsSet( WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER_ENV_VAR)) { return QString::fromUtf8( qgetenv(WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER_ENV_VAR)); } return "/usr/share/unity-webapps/userscripts"; } UnityWebappsAppModel::UnityWebappsAppModel(QObject* parent) : QAbstractListModel(parent) , _searchPath(getDefaultWebappsInstallationSearchPath()) , _doSearchLocalHome(false) { load(); QObject::connect(this, SIGNAL(searchPathChanged(const QString)), SLOT(load())); } UnityWebappsAppModel::~UnityWebappsAppModel() {} QString UnityWebappsAppModel::searchPath() const { return _searchPath; } bool UnityWebappsAppModel::doSearchHomeFolder() const { return _doSearchLocalHome; } void UnityWebappsAppModel::setDoSearchHomeFolder (bool searchLocalHome) { bool reload = (searchLocalHome != _doSearchLocalHome); _doSearchLocalHome = searchLocalHome; if (reload) load(); } void UnityWebappsAppModel::setSearchPath(const QString& path) { if (_searchPath.compare(path, Qt::CaseInsensitive) == 0) return; if (path.isEmpty()) { return; } QDir searchDir(path); searchDir.makeAbsolute(); if (! searchDir.exists() || ! searchDir.isReadable()) { qDebug() << "Invalid path in webapps " "model search path update request: " << path; return; } _searchPath = doCorrectSearchPath(searchDir.path()); Q_EMIT searchPathChanged(_searchPath); } QHash UnityWebappsAppModel::roleNames() const { static QHash roles; if (roles.isEmpty()) { roles[Name] = "name"; roles[Domain] = "domain"; roles[Homepage] = "homepage"; roles[Urls] = "urls"; roles[ScriptsContent] = "content"; roles[Scripts] = "scripts"; roles[Chrome] = "chrome"; roles[UserAgentOverride] = "useragent"; roles[Path] = "path"; } return roles; } UnityWebappsAppModel::WebappFileInfoOption UnityWebappsAppModel::getWebappFiles(const QFileInfo& webAppInstallLocation) { if (!webAppInstallLocation.isDir()) { qDebug() << "Invalid webapps path found (not a proper folder): " << webAppInstallLocation.absoluteFilePath(); return WebappFileInfoOption(); } QDir installationDir = QDir(webAppInstallLocation.absoluteFilePath()); // Search for manifest files & userscript // The order here is important, the preferred filename is manifest.json // which is still used in the desktop for regulat webapps, but in order // to avoid name clashes w/ the click package manifest.json, the // webapp-properties.json filename is searches first as a valid name // and the regular manifest.json file used as a standard fallback. const QString INLINE_WEBAPP_MANIFEST_FILENAME = "webapp-properties.json"; QStringList manifestFileNames = QStringList() << INLINE_WEBAPP_MANIFEST_FILENAME << QString("manifest.json"); WebappFileInfoOption webappCandidateInfo; Q_FOREACH(QString manifestFileName, manifestFileNames) { QFileInfo manifestFileInfo = installationDir.absolutePath() + QDir::separator() + manifestFileName; if ( ! manifestFileInfo.isFile()) { continue; } QString userScriptFilename; QFileInfoList script = installationDir.entryInfoList(QStringList("*.user.js"), QDir::Files); if (script.count() >= 1) { // Arbitrarily considering the "first" one userScriptFilename = script[0].absoluteFilePath(); } webappCandidateInfo = WebappFileInfoOption ( WebappFileInfo (manifestFileInfo.absoluteFilePath(), userScriptFilename, manifestFileName == INLINE_WEBAPP_MANIFEST_FILENAME ? WebappFileInfo::IS_LOCAL_INLINE_WEBAPP : WebappFileInfo::IS_NON_LOCAL_INLINE_WEBAPP)); break; } return webappCandidateInfo; } QFileInfoList UnityWebappsAppModel::getCandidateInstalledWebappsFolders (const QString& installationSearchPath) { // If the search path was overriden (not the default system one), we add the local // path to the list of searched paths. The idea is to remove some of the potentially // overloaded cruft (notably on UbuntuTouch or for simple installs/tests) the needed // webapp file setup. // We still do some possibly unecessary work of looking up in any unity-webapp-* subdir // but in the general case that shouldn't be too much of a hassle. QDir webappsDir(installationSearchPath); QFileInfoList candidateWebappsFolders = webappsDir.entryInfoList (QStringList(_webappDirPrefix + "*") , QDir::Dirs); if (installationSearchPath != getDefaultWebappsInstallationSearchPath()) { QFileInfo localSearchPath(installationSearchPath); if (localSearchPath.isDir()) { candidateWebappsFolders.append(localSearchPath); } } return candidateWebappsFolders; } void UnityWebappsAppModel::cleanup() { _webapps.clear(); } void UnityWebappsAppModel::load() { cleanup(); QString installationSearchPath = searchPath(); if (!isValidInstall(installationSearchPath)) { return; } QFileInfoList folders = getCandidateInstalledWebappsFolders (installationSearchPath); Q_FOREACH(QFileInfo candidateWebappFolder, folders) { if (!candidateWebappFolder.isDir()) { continue; } WebappFileInfoOption webappInfos = getWebappFiles (candidateWebappFolder); if (!webappInfos.isvalid()) { continue; } UnityWebappsAppManifestParser parser; ManifestFileInfoOption manifest = parser.parse (QFileInfo (webappInfos.value().manifestFilename)); if (!manifest.isvalid()) { continue; } // FIXME: mmmh? ondemand or async? QString content = loadUserScript (QDir(candidateWebappFolder.absoluteFilePath()), manifest.value()); const QString COMMON_BASE_PATH = _searchPath + QDir::separator() + _commonScriptsDirName; //TODO: find proper common files (if any) considering the ones // in local/ that could over take addWebApp (candidateWebappFolder.absoluteFilePath(), COMMON_BASE_PATH, manifest.value(), content, webappInfos.value().isLocalInlineWebapp); } Q_EMIT modelContentChanged(); } QString UnityWebappsAppModel::loadUserScript(const QDir& userscriptPath, const ManifestFileInfo& manifest) { if (manifest.scripts.count() == 0) { return QString(); } //TODO: use QStringBuilder QString script; #define READ_USER_SCRIPT(field_name,base_path) \ Q_FOREACH(QString filename, manifest.field_name) \ { \ QFile f(base_path + QDir::separator() + filename); \ if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) \ { \ return QString(); \ } \ script += f.readAll(); \ script += "\n\n"; \ } QString installationSearchPath = _searchPath; const QString COMMON_BASE_PATH = installationSearchPath + QDir::separator() + _commonScriptsDirName; READ_USER_SCRIPT(requires,COMMON_BASE_PATH); READ_USER_SCRIPT(scripts,userscriptPath.absolutePath()); return script; } QString UnityWebappsAppModel::path(const QString & webappName) const { if (!exists(webappName)) return QString(); int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return QString(); } return data(idx, Path).toString(); } QString UnityWebappsAppModel::userAgentOverrideFor(const QString & webappName) const { if (!exists(webappName)) return QString(); int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return QString(); } return data(idx, UserAgentOverride).toString(); } QStringList UnityWebappsAppModel::getChromeOptionsFor(const QString & webappName) const { if (!exists(webappName)) return QStringList(); int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return QStringList(); } return data(idx, Chrome).toStringList(); } QString UnityWebappsAppModel::getDomainFor(const QString & webappName) const { //FIXME: very inefficient if (!exists(webappName)) return QString(); int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return QString(); } return data(idx, Domain).toString(); } bool UnityWebappsAppModel::doesUrlMatchesWebapp(const QString & webappName, const QString & url) const { if (!exists(webappName)) return false; int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return false; } // TODO: very very inefficient QStringList urls = data(idx, Urls).toStringList(); bool matches = false; Q_FOREACH(const QString& urlCandidate, urls) { QRegExp pattern(urlCandidate, Qt::CaseInsensitive, QRegExp::Wildcard); if (pattern.indexIn(url) != -1) { matches = true; break; } } return matches; } QString UnityWebappsAppModel::getDisplayNameFor(const QString & webappName) const { //FIXME: very inefficient if (!exists(webappName)) return QString(); int idx = getWebappIndex(webappName); if (Q_UNLIKELY(idx == -1)) { qDebug() << "Invalid index for a supposedly existing webapp: " << webappName; return QString(); } return data(idx, Name).toString(); } void UnityWebappsAppModel::addWebApp(const QString& userscriptLocation, const QString& requiresLocation, const ManifestFileInfo& manifest, const QString& content, bool isLocalInlineWebapp) { if (manifest.name.isEmpty()) { qDebug() << "Cannot add a webapp with an empty name"; return; } /* if (_webapps.contains(manifest)) { qDebug() << "Webapp already exists: " << manifest.name; return; } */ InstalledWebApp webapp; webapp.userscriptLocation = userscriptLocation; webapp.requiresLocation = requiresLocation; webapp.isLocalInlineWebapp = isLocalInlineWebapp; webapp.data.manifest = manifest; webapp.data.content = content; _webapps.append(webapp); } bool UnityWebappsAppModel::isValidInstall(const QString& searchPath) { return QFileInfo(searchPath).isDir() && QDir(searchPath).exists(); } int UnityWebappsAppModel::rowCount(const QModelIndex& parent) const { Q_UNUSED(parent); return _webapps.count(); } int UnityWebappsAppModel::getWebappIndex(const QString & webappName) const { if (_webapps.empty()) return -1; int idx = 0; for (QList::const_iterator it = _webapps.begin() ; it != _webapps.end() ; ++idx, ++it) { if (0 == it->data.manifest.name.toLower().compare(webappName.toLower())) { return idx; } } return -1; } bool UnityWebappsAppModel::exists(const QString & webappName) const { //FIXME: efficiency return getWebappIndex(webappName) != -1; } QVariant UnityWebappsAppModel::data(int row, int role) const { if ((row < 0) || (row >= _webapps.count())) { qDebug() << "UnityWebappsAppModel::data: Invalid index (out of bound)"; return QVariant(); } const InstalledWebApp& webapp = _webapps.at(row); switch (role) { case Name: return webapp.data.manifest.name; case Domain: return webapp.data.manifest.domain; case Homepage: return webapp.data.manifest.homepage; case Urls: return webapp.data.manifest.includes; case Chrome: return webapp.data.manifest.chromeOptions; case Scripts: { QStringList scripts; Q_FOREACH(QString require, webapp.data.manifest.requires) { scripts.append(webapp.requiresLocation + "/" + require); } Q_FOREACH(QString script, webapp.data.manifest.scripts) { scripts.append(webapp.userscriptLocation + "/" + script); } return scripts; } case ScriptsContent: return webapp.data.content; case UserAgentOverride: return webapp.data.manifest.userAgentOverride; case Path: return webapp.userscriptLocation; } return QVariant(); } QVariant UnityWebappsAppModel::data(const QModelIndex& index, int role) const { if ( ! index.isValid()) { return QVariant(); } return data(index.row(), role); } bool UnityWebappsAppModel::providesSingleInlineWebapp() const { return !_webapps.empty() && _webapps.count() == 1 && _webapps.at(0).isLocalInlineWebapp; } QString UnityWebappsAppModel::getSingleInlineWebappName() const { if (!providesSingleInlineWebapp()) return QString(); return _webapps.at(0).data.manifest.name; } ././@LongLink0000000000000000000000000000015200000000000011213 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parser.cppunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-manifest-parse0000644000015600001650000001405612645740734033516 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include "unity-webapps-app-manifest-parser.h" UnityWebappsAppManifestParser::UnityWebappsAppManifestParser(QObject *parent) :QObject(parent) {} UnityWebappsAppManifestParser::~UnityWebappsAppManifestParser() {} ManifestFileInfoOption UnityWebappsAppManifestParser::parse (QFileInfo manifest) { if (!manifest.isFile()) { qDebug() << "Invalid webapps path found: " << manifest.absoluteFilePath(); return ManifestFileInfoOption(); } QFile f(manifest.absoluteFilePath()); if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { qDebug() << "Could not open manifest file: " << manifest.absoluteFilePath(); return ManifestFileInfoOption(); } QTextStream istream(&f); istream.setCodec("UTF-8"); QString content = istream.readAll(); ManifestFileInfo infos; if (!parseManifestContent(content, &infos)) { qDebug() << "Could not open manifest file: " << manifest.absoluteFilePath(); return ManifestFileInfoOption(); } return ManifestFileInfoOption(infos); } bool UnityWebappsAppManifestParser::parseWebappDeclaration(const QJsonObject& json, ManifestFileInfo * infos) { #define VALIDATE_PROPERTY_TYPE(property,predicate) \ do { \ if ( !json.contains(QLatin1String(property)) \ || !json.value(QLatin1String(property)).predicate()) \ { \ qDebug() << "Invalid webapp webapp definition:" << property << "not found or fails predicate" << #predicate; \ return false; \ } \ } while(0) VALIDATE_PROPERTY_TYPE("name",isString); VALIDATE_PROPERTY_TYPE("domain",isString); VALIDATE_PROPERTY_TYPE("homepage",isString); VALIDATE_PROPERTY_TYPE("includes",isArray); #undef VALIDATE_PROPERTY_TYPE infos->name = json.value(QLatin1String("name")).toString(); infos->domain = json.value(QLatin1String("domain")).toString(); infos->homepage = json.value(QLatin1String("homepage")).toString(); infos->includes = parseArray(json, QLatin1String("includes")); // Script & requires (script source dependancies found in common/) // are not really mandatory, one could have a very simple webapp // that acts just as a launcher & w/ e.g. a ua override or speciic chrome if (json.contains("scripts") && json.value("scripts").isArray()) { infos->scripts = parseArray(json, QLatin1String("scripts")); } if (json.contains("requires") && json.value("requires").isArray()) { infos->requires = parseArray(json, QLatin1String("requires")); } QString chromeOption; if (json.contains("chrome") && json.value("chrome").isString()) { chromeOption = json.value("chrome").toString(); } infos->chromeOptions = parseChromeOptions(chromeOption); if (json.contains("user-agent-override") && json.value("user-agent-override").isString()) { infos->userAgentOverride = json.value("user-agent-override").toString(); } return true; } bool UnityWebappsAppManifestParser::parseManifestContent(const QString& content, ManifestFileInfo * infos) { if (! infos) return false; QJsonParseError error; QJsonDocument doc(QJsonDocument::fromJson(content.toStdString().c_str(), &error)); if (error.error != QJsonParseError::NoError) { qDebug() << "Could not parse json from manifest: " << error.errorString(); return false; } if (!doc.isObject()) return false; QJsonObject object = doc.object(); return parseWebappDeclaration(object, infos); } QStringList UnityWebappsAppManifestParser::parseChromeOptions(const QString& options) { static const QStringList DEFAULT_OPTIONS("no-chrome"); if (options.isNull() || options.isEmpty()) return DEFAULT_OPTIONS; static const QStringList VALID_CHROME_OPTIONS = (QStringList() << "no-chrome" << "back-forward-buttons" << "reload-button"); QStringList result; // strip unvalid options QStringList splittedOptions = options.split(";"); Q_FOREACH(QString option, splittedOptions) { if (VALID_CHROME_OPTIONS.contains(option.trimmed())) { result.append(option.trimmed()); } } // no-chrome has precedence if (result.contains("no-chrome")) { result.clear(); result.append("no-chrome"); } if (result.isEmpty()) { qDebug() << "Chrome display selection defaulting to no-chrome since no option was found"; result.append("no-chrome"); } return result; } QStringList UnityWebappsAppManifestParser::parseArray(const QJsonObject& parent , const QString& name) { QJsonValue value = parent.value(name); if (!value.isArray()) { //TODO shoudl be meaner than that qDebug() << "Was expecting an array for name " << name; return QStringList(); } QJsonArray array = value.toArray(); QStringList parsedArray; Q_FOREACH(QVariant v, array.toVariantList()) { if (!v.canConvert(QVariant::String)) continue; parsedArray.append(v.toString()); } return parsedArray; } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-infos.cpp0000644000015600001650000000466312645740734032502 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "unity-webapps-app-model.h" #include #include #include #include #include #include "unity-webapps-app-infos.h" UnityWebappsAppInfos::UnityWebappsAppInfos(QObject *parent) : QObject(parent), _model(NULL) {} UnityWebappsAppInfos::~UnityWebappsAppInfos() {} void UnityWebappsAppInfos::setAppName(const QString& name) { if (_appName == name) return; _appName = name; Q_EMIT appNameChanged(name); } QString UnityWebappsAppInfos::appName() const { return _appName; } void UnityWebappsAppInfos::setDisplayName(const QString& name) { if (_displayName == name) return; _displayName = name; Q_EMIT displayNameChanged(name); } QString UnityWebappsAppInfos::displayName() const { return _displayName; } void UnityWebappsAppInfos::setDomain(const QString& domain) { if (_domain == domain) return; _domain = domain; Q_EMIT domainChanged(domain); } QString UnityWebappsAppInfos::domain() const { return _domain; } void UnityWebappsAppInfos::setDesktopId(const QString& desktopId) { if (_desktopId == desktopId) return; _desktopId = desktopId; Q_EMIT desktopIdChanged(desktopId); } QString UnityWebappsAppInfos::desktopId() const { return _desktopId; } void UnityWebappsAppInfos::setIconName(const QString& name) { if (_iconName == name) return; _iconName = name; Q_EMIT iconNameChanged(name); } QString UnityWebappsAppInfos::iconName() const { return _iconName; } UnityWebappsAppModel* UnityWebappsAppInfos::model() const { return _model; } void UnityWebappsAppInfos::setModel(UnityWebappsAppModel * model) { if (model == _model) return; _model = model; Q_EMIT modelChanged(model); } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/plugin.pro0000644000015600001650000000333312645740734027306 0ustar pbuserpbgroup00000000000000include(../../../../common-project-config.pri) include(../../../../common-vars.pri) CONFIG += qt plugin no_keywords unix { CONFIG += link_pkgconfig PKGCONFIG += libnotify \ messaging-menu \ glib-2.0 \ gio-2.0 \ unity \ unity-action-qt-1 } TEMPLATE = lib TARGET = UnityWebApps DESTDIR = ../ CONFIG += \ link_pkgconfig \ plugin \ qt QT += core qml SOURCES += \ qml-plugin.cpp \ unity-webapps-api.cpp \ unity-webapps-api-notifications.cpp \ unity-webapps-api-messaging-menu.cpp \ unity-webapps-api-launcher.cpp \ unity-webapps-api-mediaplayer.cpp \ unity-webapps-app-model.cpp \ unity-webapps-app-manifest-parser.cpp \ unity-webapps-app-infos.cpp \ unity-webapps-desktop-infos.cpp \ unity-webapps-icon-utils.cpp \ callback.cpp \ abstract-item-model-adaptor.cpp \ application-api.cpp \ tools-api.cpp \ application-signal-to-qt-bridge.cpp HEADERS += \ qml-plugin.h \ unity-webapps-api.h \ unity-webapps-api-notifications.h \ unity-webapps-api-messaging-menu.h \ unity-webapps-api-launcher.h \ unity-webapps-api-mediaplayer.h \ unity-webapps-app-model.h \ unity-webapps-app-manifest-parser.h \ unity-webapps-common-priv.h \ unity-webapps-app-infos.h \ unity-webapps-desktop-infos.h \ unity-webapps-icon-utils.h \ callback.h \ abstract-item-model-adaptor.h \ application-api.h \ tools-api.h \ application-signal-to-qt-bridge.h DEFINES += \ API_URI=\\\"$${API_URI}\\\" # plugin deployment PLUGIN_INSTALL_PATH = $$[QT_INSTALL_QML]/$$replace(API_URI, \\., /) target.path = $${PLUGIN_INSTALL_PATH} INSTALLS += target ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.cppunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.0000644000015600001650000000642712645740734033350 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "application-signal-to-qt-bridge.h" #include #include #include #include #include /** * @brief The ApplicationSignalToQtBridgePrivate class * * It does the job described here: * * https://qt-project.org/doc/qt-5.0/qtdoc/unix-signals.html * * and bridges Unix signal handlers & qt objects in a proper * way. * */ class ApplicationSignalToQtBridgePrivate: public QObject { Q_OBJECT public: ApplicationSignalToQtBridgePrivate(QObject * parent) : QObject(parent), _signalSocketNotifier(NULL) {} ~ApplicationSignalToQtBridgePrivate() { delete _signalSocketNotifier; } QSocketNotifier * _signalSocketNotifier; }; int ApplicationSignalToQtBridge::signalSocketPair[2]; ApplicationSignalToQtBridge::ApplicationSignalToQtBridge(QObject *parent) : QObject(parent) , d_ptr(new ApplicationSignalToQtBridgePrivate(this)) {} ApplicationSignalToQtBridge::~ApplicationSignalToQtBridge() { delete d_ptr; } void ApplicationSignalToQtBridge::setupQtSignalListener() { Q_D(ApplicationSignalToQtBridge); if (0 != ::socketpair(AF_UNIX, SOCK_STREAM, 0, signalSocketPair)) { qFatal("Couldn't create HUP socketpair"); } d->_signalSocketNotifier = new QSocketNotifier (signalSocketPair[1], QSocketNotifier::Read, this); connect(d->_signalSocketNotifier, SIGNAL(activated(int)), this, SLOT(handleSignal(int))); } bool ApplicationSignalToQtBridge::addSignalHandlerFor(int type) { Q_D(ApplicationSignalToQtBridge); if ( ! d->_signalSocketNotifier) setupQtSignalListener(); struct sigaction sa; sa.sa_handler = ApplicationSignalToQtBridge::signalHandler; sigemptyset (&sa.sa_mask); sa.sa_flags = 0; sa.sa_flags |= SA_RESTART; return sigaction (type, &sa, 0) > 0; } void ApplicationSignalToQtBridge::signalHandler(int type) { if (0 != signalSocketPair[0]) { size_t size = ::write (signalSocketPair[0], &type, sizeof(type)); Q_UNUSED(size); } } void ApplicationSignalToQtBridge::handleSignal(int socket) { Q_D(ApplicationSignalToQtBridge); Q_UNUSED(socket); d->_signalSocketNotifier->setEnabled(false); int type = 0; size_t size = ::read (signalSocketPair[1], &type, sizeof(type)); Q_UNUSED(size); Q_EMIT onSignalRaised(type); d->_signalSocketNotifier->setEnabled(true); } #include "application-signal-to-qt-bridge.moc" unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/callback.cpp0000644000015600001650000000174112645740734027527 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "callback.h" #include #include #include UnityWebappsCallback::UnityWebappsCallback(QObject *parent) : QObject(parent) {} UnityWebappsCallback::~UnityWebappsCallback() {} void UnityWebappsCallback::trigger (QVariant user_data) { Q_EMIT triggered(user_data); } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-icon-utils.cpp0000644000015600001650000000201412645740734032660 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include "unity-webapps-icon-utils.h" QString UnityWebappsQML::getIconPathFor (const QString& iconURI) { static const QString ICON_URI_SCHEME = "icon://"; if (iconURI.startsWith (ICON_URI_SCHEME)) { return iconURI.right(iconURI.count() - ICON_URI_SCHEME.count()); } return QString(); } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-common-priv.h0000644000015600001650000000243112645740734032510 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_TOOLS_PRIV_H__ #define __UNITY_WEBAPPS_TOOLS_PRIV_H__ // T must be copy-constructible & have a default constructor template class Fallible { public: struct InvalidValueException {}; public: Fallible() : _valid(false) {} Fallible(const T& value, bool valid = true) : _valid(valid), _value(value) {} bool isvalid() const { return _valid; } T value() const { if (!_valid) throw InvalidValueException(); return _value; } private: bool _valid; T _value; }; #endif // __UNITY_WEBAPPS_TOOLS_PRIV_H__ ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-messaging-menu.hunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-messaging-menu0000644000015600001650000000366512645740734033514 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_MESSAGING_MENU_H__ #define __UNITY_WEBAPPS_MESSAGING_MENU_H__ #include #include #include "unity-webapps-app-infos.h" class UnityWebappsMessagingMenuPrivate; class UnityWebappsMessagingMenu: public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) public: UnityWebappsMessagingMenu(QObject * parent = 0); virtual ~UnityWebappsMessagingMenu(); // Supported WebApps APIs Q_INVOKABLE void showIndicator(const QString& indicatorName); Q_INVOKABLE void setProperty(const QString& indicatorName, const QString& propertyName, const QVariant& value); Q_INVOKABLE void clearIndicator(const QString& indicatorName); Q_INVOKABLE void clearIndicators(); // Class functions void classBegin(); void componentComplete(); public Q_SLOTS: void onAppInfosChanged(UnityWebappsAppInfos *appInfos); Q_SIGNALS: void raised(); void onActionAdded(const QString& name, const QString& action); void onActionRemoved(const QString& name); private: UnityWebappsMessagingMenuPrivate *d_ptr; Q_DECLARE_PRIVATE(UnityWebappsMessagingMenu) }; #endif // __UNITY_WEBAPPS_MESSAGING_MENU_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-api.cpp0000644000015600001650000001637612645740734031057 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "application-api.h" #include "application-signal-to-qt-bridge.h" #include #include #include #include #include #include #include namespace { QString nameFromScreenOrientation (Qt::ScreenOrientation orientation) { switch (orientation) { case Qt::InvertedLandscapeOrientation: return QString("InvertedLandscape"); case Qt::LandscapeOrientation: return QString("Landscape"); case Qt::PortraitOrientation: return QString("Portrait"); case Qt::InvertedPortraitOrientation: return QString("InvertedPortrait"); case Qt::PrimaryOrientation: return QString("Primary"); default: break; } return QString("Unknown"); } } class ApplicationApiEventListener : public QObject { Q_OBJECT public: ApplicationApiEventListener(QObject * parent) : QObject(parent) { if (QGuiApplication::instance()) QGuiApplication::instance()->installEventFilter(this); } ~ApplicationApiEventListener() { if (QGuiApplication::instance()) QGuiApplication::instance()->removeEventFilter(this); } bool eventFilter(QObject *obj, QEvent *event) { switch (event->type()) { case QEvent::ApplicationActivate: Q_EMIT activated(); break; case QEvent::ApplicationDeactivate: Q_EMIT deactivated(); break; default: break; } return QObject::eventFilter(obj, event); } Q_SIGNALS: void activated(); void deactivated(); }; class ApplicationApiPrivate: public QObject { Q_OBJECT public: ApplicationApiPrivate(QObject * parent) : QObject(parent), _applicationEventListener(new ApplicationApiEventListener(this)), _applicationSignalBridge(new ApplicationSignalToQtBridge(this)) {} ~ApplicationApiPrivate() { delete _applicationEventListener; delete _applicationSignalBridge; } ApplicationApiEventListener * _applicationEventListener; ApplicationSignalToQtBridge * _applicationSignalBridge; }; ApplicationApi::ApplicationApi(QObject *parent) : QObject(parent), d_ptr(new ApplicationApiPrivate(this)) { Q_D(ApplicationApi); QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &ApplicationApi::aboutToQuit); QObject::connect(d->_applicationEventListener, &ApplicationApiEventListener::activated, this, &ApplicationApi::activated); QObject::connect(d->_applicationEventListener, &ApplicationApiEventListener::deactivated, this, &ApplicationApi::deactivated); QObject::connect(d->_applicationSignalBridge, &ApplicationSignalToQtBridge::onSignalRaised, this, &ApplicationApi::signalReceived); // We explictly handle the SIGTERM signal case that is being sent // on Touch to an application being killed by the platform. // Upstart sends this signal when the application is closed from app scope. d->_applicationSignalBridge->addSignalHandlerFor(SIGTERM); QScreen * screen = QGuiApplication::primaryScreen(); if (screen) { QObject::connect(screen, &QScreen::orientationChanged, this, &ApplicationApi::screenOrientationChanged); } } ApplicationApi::~ApplicationApi() { Q_D(ApplicationApi); QObject::disconnect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &ApplicationApi::aboutToQuit); QObject::disconnect(d->_applicationEventListener, &ApplicationApiEventListener::activated, this, &ApplicationApi::activated); QObject::disconnect(d->_applicationEventListener, &ApplicationApiEventListener::deactivated, this, &ApplicationApi::deactivated); QObject::disconnect(d->_applicationSignalBridge, &ApplicationSignalToQtBridge::onSignalRaised, this, &ApplicationApi::signalReceived); QScreen * screen = QGuiApplication::primaryScreen(); if (screen) { QObject::disconnect(screen, &QScreen::orientationChanged, this, &ApplicationApi::screenOrientationChanged); } delete d_ptr; } QString ApplicationApi::getApplicationName() const { if ( ! qgetenv("APP_ID").isEmpty()) return qgetenv("APP_ID"); return QCoreApplication::applicationName(); } QString ApplicationApi::getApplicationDataPath() const { QDir dataLocation( QStandardPaths::writableLocation( QStandardPaths::DataLocation)); if (!dataLocation.exists()) { QDir::root().mkpath(dataLocation.absolutePath()); } return dataLocation.absolutePath(); } QString ApplicationApi::getApplicationScreenOrientation() const { QScreen * screen = QGuiApplication::primaryScreen(); return nameFromScreenOrientation(screen->primaryOrientation()); } QString ApplicationApi::getInputMethodName() const { return QString(getenv("QT_IM_MODULE")); } void ApplicationApi::setInputMethodVisible(bool visible) { QGuiApplication::inputMethod()->setVisible(visible); if (visible) QGuiApplication::inputMethod()->show(); else QGuiApplication::inputMethod()->hide(); } QString ApplicationApi::getApplicationPlatform() const { return QGuiApplication::platformName(); } void ApplicationApi::aboutToQuit() { Q_EMIT applicationAboutToQuit(false); } void ApplicationApi::activated() { Q_EMIT applicationActivated(); } void ApplicationApi::deactivated() { Q_EMIT applicationDeactivated(); } void ApplicationApi::signalReceived(int type) { if (type != SIGTERM && type != SIGINT) return; bool killed = (type == SIGTERM); Q_EMIT applicationAboutToQuit(killed); QCoreApplication::quit(); } void ApplicationApi::screenOrientationChanged(Qt::ScreenOrientation orientation) { Q_EMIT applicationScreenOrientationChanged( nameFromScreenOrientation( orientation)); } #include "application-api.moc" unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/abstract-item-model-adaptor.h0000644000015600001650000000310212645740734032716 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef ABSTRACT_ITEM_MODELADAPTOR_H #define ABSTRACT_ITEM_MODELADAPTOR_H #include #include #include class AbstractItemModelAdaptorPrivate; class AbstractItemModelAdaptor : public QObject { Q_OBJECT Q_PROPERTY(QObject * itemModel READ itemModel \ WRITE setItemModel NOTIFY itemModelChanged) public: explicit AbstractItemModelAdaptor(QObject *parent = 0); ~AbstractItemModelAdaptor(); Q_INVOKABLE QVariant itemAt(int index, const QString & role); Q_INVOKABLE QStringList roles(); Q_INVOKABLE int rowCount(); QObject * itemModel(); void setItemModel(QObject *); Q_SIGNALS: void itemModelChanged(); public Q_SLOTS: private: int roleIndexFromName(const QString & name); AbstractItemModelAdaptorPrivate *d_ptr; Q_DECLARE_PRIVATE(AbstractItemModelAdaptor) }; #endif // ABSTRACTITEMMODELADAPTOR_H ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-mediaplayer.cppunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-mediaplayer.cp0000644000015600001650000002354112645740734033465 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include #include "unity-webapps-desktop-infos.h" #include "unity-webapps-app-infos.h" #include "unity-webapps-api-mediaplayer.h" #define API_CALL_HEADER() do { \ d->init(); \ if (!d->_player) \ return; \ } while(0) struct UnityWebappsMediaPlayerPrivate { UnityWebappsMediaPlayerPrivate (UnityWebappsMediaPlayer * qq); ~UnityWebappsMediaPlayerPrivate (); void clear(); void init(); void onRaised(); UnityWebappsAppInfos *_appInfos; UnityMusicPlayer *_player; UnityTrackMetadata * _metadata; QObject* _raise_callback; QObject* _playpause_callback; QObject* _next_callback; QObject* _previous_callback; UnityWebappsMediaPlayer* const q_ptr; Q_DECLARE_PUBLIC(UnityWebappsMediaPlayer) }; static void _uwq_media_callback_raised (UnityMusicPlayer *player, gpointer user_data) { Q_UNUSED(player); UnityWebappsMediaPlayerPrivate* self = static_cast(user_data); if(self) self->onRaised(); } static void _uwq_media_callback_play_pause (UnityMusicPlayer *player, gpointer user_data) { Q_UNUSED(player); UnityWebappsMediaPlayerPrivate* self = static_cast(user_data); if (self && self->_playpause_callback) QMetaObject::invokeMethod(self->_playpause_callback, "trigger"); } static void _uwq_media_callback_next (UnityMusicPlayer *player, gpointer user_data) { Q_UNUSED(player); UnityWebappsMediaPlayerPrivate* self = static_cast(user_data); if (self && self->_next_callback) QMetaObject::invokeMethod(self->_next_callback, "trigger"); } static void _uwq_media_callback_previous (UnityMusicPlayer *player, gpointer user_data) { Q_UNUSED(player); UnityWebappsMediaPlayerPrivate* self = static_cast(user_data); if (self && self->_previous_callback) QMetaObject::invokeMethod(self->_previous_callback, "trigger"); } UnityWebappsMediaPlayerPrivate::UnityWebappsMediaPlayerPrivate (UnityWebappsMediaPlayer * qq) : _appInfos(0) , _player(0) , _metadata(0) , _raise_callback (0) , _playpause_callback (0) , _next_callback (0) , _previous_callback (0) , q_ptr(qq) {} UnityWebappsMediaPlayerPrivate::~UnityWebappsMediaPlayerPrivate() { clear(); } void UnityWebappsMediaPlayerPrivate::onRaised() { Q_Q(UnityWebappsMediaPlayer); Q_EMIT q->raised(); if (_raise_callback) QMetaObject::invokeMethod(_raise_callback, "trigger"); } void UnityWebappsMediaPlayerPrivate::clear() { if (_player && G_IS_OBJECT(_player)) { unity_music_player_set_is_blacklisted (_player, TRUE); g_object_unref(_player); _player = 0; } if (_metadata) { _metadata = 0; g_object_unref (_metadata); } _appInfos = 0; _raise_callback = 0; _playpause_callback = 0; _next_callback = 0; _previous_callback = 0; } void UnityWebappsMediaPlayerPrivate::init() { if (Q_UNLIKELY(_player != NULL)) return; if (Q_UNLIKELY(_appInfos == NULL)) { qDebug() << "Trying to initialize the MediaPlayer binding with invalid context"; return; } QString displayName = _appInfos->displayName(); if (displayName.isEmpty()) { qDebug() << "MediaPlayer backend: invalid display name (empty)"; return; } QString desktopId = _appInfos->desktopId(); if (desktopId.isEmpty()) { qDebug() << "MediaPlayer backend: invalid desktop id (empty)"; return; } _player = unity_music_player_new (desktopId.toUtf8().data()); unity_music_player_set_title (_player, displayName.toUtf8().data()); unity_music_player_set_is_blacklisted (_player, FALSE); g_signal_connect (_player, "raise", G_CALLBACK (_uwq_media_callback_raised), this); g_signal_connect (_player, "play_pause", G_CALLBACK (_uwq_media_callback_play_pause), this); g_signal_connect (_player, "next", G_CALLBACK (_uwq_media_callback_next), this); g_signal_connect (_player, "previous", G_CALLBACK (_uwq_media_callback_previous), this); } UnityWebappsMediaPlayer::UnityWebappsMediaPlayer(QObject *parent) : QObject(parent), d_ptr(new UnityWebappsMediaPlayerPrivate(this)) {} UnityWebappsMediaPlayer::~UnityWebappsMediaPlayer() { delete d_ptr; } void UnityWebappsMediaPlayer::onAppInfosChanged(UnityWebappsAppInfos *appInfos) { Q_D(UnityWebappsMediaPlayer); bool wasInit = false; if (d->_player) { wasInit = true; d->clear(); } d->_appInfos = appInfos; if (wasInit) d->init(); } void UnityWebappsMediaPlayer::onPlayPause (UnityWebappsCallback * callback) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); d->_playpause_callback = callback; } void UnityWebappsMediaPlayer::onPrevious (UnityWebappsCallback * callback) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); d->_previous_callback = callback; } void UnityWebappsMediaPlayer::onNext (UnityWebappsCallback * callback) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); d->_next_callback = callback; } void UnityWebappsMediaPlayer::setTrack (const QString & artist, const QString & album, const QString & title, const QString & artLocation) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); if (! d->_metadata) d->_metadata = unity_track_metadata_new (); unity_track_metadata_set_artist (d->_metadata, artist.toUtf8().data()); unity_track_metadata_set_album (d->_metadata, album.toUtf8().data()); unity_track_metadata_set_title (d->_metadata, title.toUtf8().data()); if ( ! artLocation.isEmpty()) { GFile * f = g_file_new_for_path (artLocation.toUtf8().data()); unity_track_metadata_set_art_location (d->_metadata, f); g_object_unref (G_OBJECT (f)); } unity_music_player_set_current_track (d->_player, d->_metadata); } void UnityWebappsMediaPlayer::setCanGoNext (bool state) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); unity_music_player_set_can_go_next(d->_player, state); } void UnityWebappsMediaPlayer::setCanGoPrevious (bool state) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); unity_music_player_set_can_go_previous(d->_player, state); } void UnityWebappsMediaPlayer::setCanPlay (bool state) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); unity_music_player_set_can_play(d->_player, state); } void UnityWebappsMediaPlayer::setCanPause (bool state) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); unity_music_player_set_can_pause(d->_player, state); } void UnityWebappsMediaPlayer::setPlaybackState(PlaybackState state) { Q_D(UnityWebappsMediaPlayer); API_CALL_HEADER(); unity_music_player_set_playback_state(d->_player, (UnityPlaybackState) state); } UnityWebappsMediaPlayer::PlaybackState UnityWebappsMediaPlayer::getPlaybackState () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return PLAYING; return (PlaybackState) unity_music_player_get_playback_state(d->_player); } QString UnityWebappsMediaPlayer::getTrack () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return QString(); UnityTrackMetadata * metadata = unity_music_player_get_current_track(d->_player); QString artist = unity_track_metadata_get_artist (metadata); QString title = unity_track_metadata_get_title (metadata); QString album = unity_track_metadata_get_album (metadata); QString track = QString("%1;%2;%3").arg(artist.toUtf8().toBase64().data()) .arg(title.toUtf8().toBase64().data()) .arg(album.toUtf8().toBase64().data()); qDebug() << "get track " << track; return track; } bool UnityWebappsMediaPlayer::getCanGoNext () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return false; return unity_music_player_get_can_go_next(d->_player); } bool UnityWebappsMediaPlayer::getCanGoPrevious () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return false; return unity_music_player_get_can_go_previous(d->_player); } bool UnityWebappsMediaPlayer::getCanPlay () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return false; return unity_music_player_get_can_play(d->_player); } bool UnityWebappsMediaPlayer::getCanPause () { Q_D(UnityWebappsMediaPlayer); d->init(); if (!d->_player) return false; return unity_music_player_get_can_pause(d->_player); } void UnityWebappsMediaPlayer::classBegin() { } void UnityWebappsMediaPlayer::componentComplete() { } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-mediaplayer.h0000644000015600001650000000500312645740734033303 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_MEDIA_PLAYER_H__ #define __UNITY_WEBAPPS_MEDIA_PLAYER_H__ #include #include #include "unity-webapps-app-model.h" #include "unity-webapps-app-infos.h" #include "callback.h" class UnityWebappsMediaPlayerPrivate; class UnityWebappsMediaPlayer: public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_ENUMS(PlaybackState) public: enum PlaybackState { PLAYING, PAUSED }; public: UnityWebappsMediaPlayer(QObject * parent = 0); virtual ~UnityWebappsMediaPlayer(); // API functions Q_INVOKABLE void onPlayPause (UnityWebappsCallback * callback); Q_INVOKABLE void onPrevious (UnityWebappsCallback * callback); Q_INVOKABLE void onNext (UnityWebappsCallback * callback); Q_INVOKABLE void setTrack (const QString & artist, const QString & album, const QString & title, const QString & artLocation); Q_INVOKABLE void setCanGoNext (bool state); Q_INVOKABLE void setCanGoPrevious (bool state); Q_INVOKABLE void setCanPlay (bool state); Q_INVOKABLE void setCanPause (bool state); Q_INVOKABLE QString getTrack (); Q_INVOKABLE bool getCanGoNext (); Q_INVOKABLE bool getCanGoPrevious (); Q_INVOKABLE bool getCanPlay (); Q_INVOKABLE bool getCanPause (); Q_INVOKABLE void setPlaybackState(PlaybackState state); Q_INVOKABLE PlaybackState getPlaybackState (); // class specific funcs void classBegin(); void componentComplete(); public Q_SLOTS: void onAppInfosChanged(UnityWebappsAppInfos *appInfos); Q_SIGNALS: void raised(); private: UnityWebappsMediaPlayerPrivate *d_ptr; Q_DECLARE_PRIVATE(UnityWebappsMediaPlayer) }; #endif // __UNITY_WEBAPPS_MEDIA_PLAYER_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/abstract-item-model-adaptor.cpp0000644000015600001650000000654212645740734033264 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "abstract-item-model-adaptor.h" class AbstractItemModelAdaptorPrivate: public QObject { Q_OBJECT public: AbstractItemModelAdaptorPrivate(QObject * parent) : QObject(parent), _model(NULL) {} QAbstractItemModel * _model; }; AbstractItemModelAdaptor::AbstractItemModelAdaptor(QObject *parent) : QObject(parent), d_ptr(new AbstractItemModelAdaptorPrivate(this)) {} AbstractItemModelAdaptor::~AbstractItemModelAdaptor() { delete d_ptr; } QVariant AbstractItemModelAdaptor::itemAt(int index , const QString & role) { Q_D(AbstractItemModelAdaptor); if ( ! d->_model) return QVariant(); int roleIdx = roleIndexFromName(role); if (roleIdx < 0) return QVariant(); return (d->_model == NULL || !d->_model->hasIndex(index, 0)) ? QVariant() : d->_model->data(d->_model->index(index, 0), roleIdx); } int AbstractItemModelAdaptor::roleIndexFromName(const QString & name) { Q_D(AbstractItemModelAdaptor); int index = -1; if ( ! d->_model) return index; QHash roleNames = d->_model->roleNames(); for(QHash::iterator it = roleNames.begin(); it != roleNames.end(); ++it) { if (name.compare(QString(it.value())) == 0) { index = it.key(); break; } } return index; } QStringList AbstractItemModelAdaptor::roles() { Q_D(AbstractItemModelAdaptor); QStringList currentRoles; if ( ! d->_model) return currentRoles; QHash roleNames = d->_model->roleNames(); for(QHash::iterator it = roleNames.begin(); it != roleNames.end(); ++it) { currentRoles.append(QString(it.value())); } return currentRoles; } QObject * AbstractItemModelAdaptor::itemModel() { Q_D(AbstractItemModelAdaptor); return d->_model; } int AbstractItemModelAdaptor::rowCount() { Q_D(AbstractItemModelAdaptor); if ( ! d->_model) return -1; return d->_model->rowCount(); } void AbstractItemModelAdaptor::setItemModel(QObject * model) { Q_D(AbstractItemModelAdaptor); if ( ! qobject_cast(model)) { qCritical() << "Cannot assign a QObject of " "type not QAbstractItemModel to itemModel"; return; } QAbstractItemModel * abstractItemModel = qobject_cast(model); if (abstractItemModel == d->_model) return; d->_model = abstractItemModel; Q_EMIT itemModelChanged(); } #include "abstract-item-model-adaptor.moc" ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.hunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-signal-to-qt-bridge.0000644000015600001650000000263712645740734033347 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef APPLICATIONSIGNALTOQTBRIDGE_H #define APPLICATIONSIGNALTOQTBRIDGE_H #include class ApplicationSignalToQtBridgePrivate; class ApplicationSignalToQtBridge : public QObject { Q_OBJECT public: explicit ApplicationSignalToQtBridge (QObject *parent = 0); ~ApplicationSignalToQtBridge (); bool addSignalHandlerFor(int type); public Q_SLOTS: void handleSignal(int type); Q_SIGNALS: void onSignalRaised(int type); private: void setupQtSignalListener(); // Unix signal handlers. static void signalHandler(int type); static int signalSocketPair[2]; ApplicationSignalToQtBridgePrivate *d_ptr; Q_DECLARE_PRIVATE(ApplicationSignalToQtBridge) }; #endif // APPLICATIONSIGNALTOQTBRIDGE_H unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-infos.h0000644000015600001650000000470512645740734032144 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_APP_INFOS_H__ #define __UNITY_WEBAPPS_APP_INFOS_H__ #include #include class UnityWebappsAppModel; class UnityWebappsAppInfos : public QObject { Q_OBJECT Q_PROPERTY(QString appName READ appName WRITE setAppName NOTIFY appNameChanged) Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged) Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged) Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged) Q_PROPERTY(QString desktopId READ desktopId WRITE setDesktopId NOTIFY desktopIdChanged) Q_PROPERTY(UnityWebappsAppModel* model READ model WRITE setModel NOTIFY modelChanged) public: UnityWebappsAppInfos(QObject *parent = 0); ~UnityWebappsAppInfos(); void setAppName(const QString& name); QString appName() const; void setDisplayName(const QString& name); QString displayName() const; void setDomain(const QString& domain); QString domain() const; void setIconName(const QString& name); QString iconName() const; void setDesktopId(const QString& desktopId); QString desktopId() const; UnityWebappsAppModel* model() const; void setModel(UnityWebappsAppModel *); Q_SIGNALS: void appNameChanged(const QString& name); void desktopIdChanged(const QString& desktopId); void displayNameChanged(const QString& displayName); void iconNameChanged(const QString& iconName); void domainChanged(const QString& domain); void modelChanged(UnityWebappsAppModel * model); private: QString _appName; QString _iconName; QString _displayName; QString _desktopId; QString _domain; UnityWebappsAppModel * _model; }; #endif // __UNITY_WEBAPPS_APP_INFOS_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-desktop-infos.h0000644000015600001650000000175112645740734033033 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_DESKTOP_INFOS_H__ #define __UNITY_WEBAPPS_DESKTOP_INFOS_H__ namespace UnityWebappsQML { QString buildDesktopInfoFileForWebapp (const QString& name, const QString& domain); QString canonicalize(const QString& s, bool keep_whitespaces = false); } #endif // __UNITY_WEBAPPS_DESKTOP_INFOS_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/tools-api.h0000644000015600001650000000244412645740734027350 0ustar pbuserpbgroup00000000000000/* * Copyright 2015 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef UNITY_WEBAPPS_TOOLSAPI_H #define UNITY_WEBAPPS_TOOLSAPI_H #include class ToolsApi : public QObject { Q_OBJECT Q_ENUMS(CryptographicAlgorithm) public: explicit ToolsApi(QObject *parent = 0); enum CryptographicAlgorithm { MD5, SHA1, SHA256, SHA512 }; Q_INVOKABLE QString getHmacHash( const QString &hmac, CryptographicAlgorithm algorithm, const QString& key) const; Q_INVOKABLE bool areCompatibleCorsUrl( const QUrl& url1, const QUrl& url2) const; }; #endif // UNITY_WEBAPPS_TOOLSAPI_H unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/tools-api.cpp0000644000015600001650000000570612645740734027707 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "tools-api.h" #include #include #include #include #include #include #include namespace { bool enumToQtCryptoAlgorithm( ToolsApi::CryptographicAlgorithm algorithm, QCryptographicHash::Algorithm & out) { switch(algorithm) { case ToolsApi::MD5: out = QCryptographicHash::Md5; return true; break; case ToolsApi::SHA1: out = QCryptographicHash::Sha1; return true; break; case ToolsApi::SHA256: out = QCryptographicHash::Sha256; return true; break; case ToolsApi::SHA512: out = QCryptographicHash::Sha512; return true; break; } return false; } QString getSecondLevelDomain(const QUrl& url) { QString tld = url.topLevelDomain(); QString host = url.host().left(url.host().length() - tld.length()); QStringList s = host.split(".", QString::SkipEmptyParts); return s.isEmpty() ? tld : (s.last() + tld); } } /** * @brief ToolsApi::ToolsApi * @param parent */ ToolsApi::ToolsApi(QObject *parent) : QObject(parent) {} /** * Compute a HMAC for a given message given a cryptographic key * and specific crypto algorithm. * * @brief ToolsApi::getHmacHash * @param message * @param algorithm * @param key * @return HMAC of the message */ QString ToolsApi::getHmacHash( const QString& message, ToolsApi::CryptographicAlgorithm algorithm, const QString& key) const { QCryptographicHash::Algorithm method = QCryptographicHash::Md5; if ( ! enumToQtCryptoAlgorithm(algorithm, method)) { qCritical() << "Invalid HMAC method algorithm"; return QString(); } QMessageAuthenticationCode code(method, key.toUtf8()); code.addData(message.toUtf8()); return QString::fromUtf8(code.result().toBase64()); } /** * @brief ToolsApi::isCompatibleCorsRequest * @param requestUrl * @param locationUrl * @return */ bool ToolsApi::areCompatibleCorsUrl( const QUrl& url1, const QUrl& url2) const { return url1.scheme() == url2.scheme() && url1.topLevelDomain() == url2.topLevelDomain() && getSecondLevelDomain(url1) == getSecondLevelDomain(url2); } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-icon-utils.h0000644000015600001650000000161112645740734032327 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_ICON_UTILS_H__ #define __UNITY_WEBAPPS_ICON_UTILS_H__ #include namespace UnityWebappsQML { QString getIconPathFor(const QString& iconURI); } #endif // __UNITY_WEBAPPS_ICON_UTILS_H__ ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-notifications.cppunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-notifications.0000644000015600001650000000403512645740734033514 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "unity-webapps-api-notifications.h" #include #include UnityWebappsNotification::UnityWebappsNotification(QObject *parent) : QObject(parent) {} UnityWebappsNotification::~UnityWebappsNotification() { notify_uninit(); } void UnityWebappsNotification::show(const QString& summary, const QString& body, const QString& icon) { NotifyNotification *notification; notification = notify_notification_new (summary.toUtf8().data(), body.toUtf8().data(), QFileInfo(icon).canonicalFilePath().toUtf8().data()); notify_notification_set_timeout (notification, 4); notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); GError *error = NULL; notify_notification_show (notification, &error); if (error) { qWarning() << error->message; } } void UnityWebappsNotification::setName(const QString& name) { _applicationName = name; //TODO: this is rather bad, not "closed" at all, very error prone notify_init(_applicationName.toUtf8().data()); } QString UnityWebappsNotification::name() const { return _applicationName; } void UnityWebappsNotification::classBegin() { } void UnityWebappsNotification::componentComplete() { } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api.cpp0000644000015600001650000004012412645740741031345 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "unity-webapps-api.h" #include "unity-webapps-app-infos.h" #include "unity-webapps-app-model.h" #include #include #include #include #include #include #include #include "unity-webapps-icon-utils.h" #include "unity-webapps-desktop-infos.h" namespace { QString getDesktopFilenameFor(const QString & name, const QString & domain) { return QString("%1.desktop").arg(UnityWebappsQML::buildDesktopInfoFileForWebapp(name, domain)); } } // namespace { const QString UnityWebapps::WEBAPPS_RUNNER_EXEC = "unity-webapps-runner"; UnityWebapps::UnityWebapps(QObject *parent) : QObject(parent) , _model(0) , _appInfos(0) , _handleDesktopFileUpdates(true) {} UnityWebapps::~UnityWebapps() { cleanup(); } void UnityWebapps::cleanup() { delete _appInfos; _appInfos = 0; } void UnityWebapps::init(const QString& name, const QString& url, bool isLocal, const QVariant& args) { Q_UNUSED(name); if (_appInfos != NULL) cleanup(); if (QString(args.typeName()).compare("QVariantMap") != 0) { qDebug() << "Invalid init() parameter types: " << args.typeName(); Q_EMIT initCompleted(false); return; } #define UNITY_WEBAPPS_IS_VALID(name,type) \ ( initArgs.contains(name) && initArgs.value(name).canConvert() ) QVariantMap initArgs = qvariant_cast(args); if ( ! UNITY_WEBAPPS_IS_VALID("name", QString)) { qDebug() << "Invalid init() parameter content (not found or invalid): name is mandatory"; Q_EMIT initCompleted(false); return; } QString displayName = initArgs.value("name").toString(); QString iconUrl = initArgs.contains("iconUrl") && UNITY_WEBAPPS_IS_VALID("iconUrl",QString) ? initArgs.value("iconUrl").toString() : ""; QString domain = initArgs.contains("domain") && UNITY_WEBAPPS_IS_VALID("domain",QString) ? initArgs.value("domain").toString() : ""; if ( ! isLocal && (iconUrl.isEmpty() || domain.isEmpty())) { qDebug() << "Invalid init() parameter content " "(not found or invalid): domain and iconUrl are mandatory for nonlocal apps"; Q_EMIT initCompleted(false); return; } QString desktopId; if (qgetenv("APP_ID").isEmpty()) { desktopId = getDesktopFilenameFor(displayName, domain); } else { desktopId = QString("%1.desktop").arg(QString(qgetenv("APP_ID"))); } bool success = initInternal(name, displayName, domain, iconUrl, url); if (success) buildAppInfos(name, displayName, domain, desktopId, iconUrl); Q_EMIT initCompleted(success); } UnityWebappsAppInfos * UnityWebapps::appInfos() { return _appInfos; } UnityWebappsAppModel* UnityWebapps::model() const { return _model; } void UnityWebapps::setAppModel(UnityWebappsAppModel * model) { if (_model == model) return; _model = model; } bool UnityWebapps::isConfined() const { //Cheap way to know if we work in a confined environment //FIXME: think of a better way to handle desktop/phone specifics #if defined(Q_OS_LINUX) && ! defined(Q_PROCESSOR_X86) return true; #else return false; #endif } void UnityWebapps::buildAppInfos(const QString & name, const QString & displayName, const QString & domain, const QString & desktopId, const QString & iconName) { if (_appInfos != NULL) { return; } _appInfos = new UnityWebappsAppInfos(); _appInfos->setAppName(name); _appInfos->setDisplayName(displayName); _appInfos->setDesktopId(desktopId); _appInfos->setIconName(iconName); _appInfos->setDomain(domain); _appInfos->setModel(_model); Q_EMIT appInfosChanged(_appInfos); } bool UnityWebapps::initInternal(const QString& name, const QString& displayName, const QString& domain, const QString& iconUrl, const QString& url) { Q_UNUSED(name); Q_UNUSED(iconUrl); if ( ! isValidInitForWebappAndModel(domain, displayName, url)) { qDebug() << "Invalid init() call from javascript for webapp " << name << " and current model"; return false; } return true; } bool UnityWebapps::handleDesktopFileUpdates() const { return _handleDesktopFileUpdates; } void UnityWebapps::setHandleDesktopFileUpdates (bool handle) { _handleDesktopFileUpdates = handle; } bool UnityWebapps::isValidInitForWebappAndModel (const QString & domain, const QString & displayName, const QString & url) { if (NULL == _model) return true; if ( ! _model->exists(displayName)) { return true; } QString modelAppDomain = _model->getDomainFor(displayName); if (modelAppDomain.isEmpty()) { return true; } return modelAppDomain.compare(domain, Qt::CaseInsensitive) == 0 && _model->doesUrlMatchesWebapp(displayName, url); } QString UnityWebapps::getUserSharePath() { QStringList userhomeList = QStandardPaths::standardLocations(QStandardPaths::HomeLocation); if (userhomeList.isEmpty()) { return QString(); } QDir home(userhomeList.at(0)); return home.absolutePath() + QDir::separator() + ".local/share"; } QString UnityWebapps::getLocalDesktopFilepath(const QString & desktopId) { return getUserSharePath() + QDir::separator() + "applications/" + desktopId; } QString UnityWebapps::generateActionEntryFor(const QString& actionName, const QString& name, const QString& showIn, const QString& exec) { return QString("[Desktop Action %1]\n" "Name=%2\n" "OnlyShowIn=%3\n" "Exec=%4\n\n") .arg(actionName) .arg(name) .arg(showIn) .arg(exec); } QString UnityWebapps::getUrlLaunchExec(const QString & webappName, const QString & url) { return QString("%1 --webapp='%2' %3") .arg(WEBAPPS_RUNNER_EXEC) .arg(webappName.toUtf8().toBase64().data()) .arg(url); } QString UnityWebapps::generateActionsEntry(const QString & webappName) { const size_t MAX_ACTIONS_INDEX = 9; QString content; Q_FOREACH(const QString& actionName, _actions.keys()) { if (_actions[actionName].idx > MAX_ACTIONS_INDEX) continue; QStringList showIn; QString exec; if (_actions[actionName].type & STATIC_ACTION) { exec = getUrlLaunchExec(webappName, _actions[actionName].url); showIn.append("Unity"); } if (_actions[actionName].type & LAUNCHER_ACTION) { showIn.append("Unity"); } if (_actions[actionName].type & INDICATOR_ACTION) { showIn.append("Messaging Menu"); } content.append (generateActionEntryFor (QString("S%1").arg(_actions[actionName].idx), actionName, showIn.join(";"), exec)); } return content; } QMap UnityWebapps::collectActionIndexes() { QMap indexes; Q_FOREACH(const QString& name, _actions.keys()) { indexes[_actions[name].idx] = _actions[name]; } return indexes; } int UnityWebapps::findNextAvailableActionIndex(const QMap & indexes) { int idx = 1; while (1) { if ( ! indexes.contains(idx)) break; idx++; } return idx; } QString UnityWebapps::addAction (const QString& name, UnityWebapps::ActionTypeFlags type, const QString& url) { if (_actions.contains(name)) { if ((_actions[name].type & type) && (0 == _actions[name].url.compare(url))) return QString(); _actions[name].type |= type; _actions[name].url = url; } else { _actions[name] = ActionInfos(name, type, findNextAvailableActionIndex(collectActionIndexes()), url); } updateDesktopFileContent(); return QString("S%1").arg(_actions[name].idx); } QString UnityWebapps::addLauncherAction(const QString& name) { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return QString(); return addAction(name, LAUNCHER_ACTION); } QString UnityWebapps::addIndicatorAction (const QString& name) { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return QString(); return addAction(name, INDICATOR_ACTION); } QString UnityWebapps::addStaticAction (const QString& name, const QString& url) { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return QString(); return addAction(name, STATIC_ACTION, url); } void UnityWebapps::removeLauncherAction(const QString& name) { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return; if (_actions.contains(name) && (_actions[name].type & LAUNCHER_ACTION)) { _actions[name].type &= ~LAUNCHER_ACTION; updateDesktopFileContent(); } } void UnityWebapps::removeLauncherActions() { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return; bool found = false; Q_FOREACH(const QString & actionName, _actions.keys()) { if (_actions[actionName].type & LAUNCHER_ACTION) { _actions[actionName].type &= ~LAUNCHER_ACTION; found = true; } } if (found) updateDesktopFileContent(); } QString UnityWebapps::extractFromGlobalDesktopFile(const QString & desktopFilename) { if (desktopFilename.isEmpty()) return QString(); QString DESKTOP_FILE_LOCATION = "/usr/share/applications"; // Allow an override for more granular & flexible testing purposes if (qgetenv("UNITY_WEBAPPS_QML_GLOBAL_DESKTOP_FILE_LOCATION").data() != NULL) { DESKTOP_FILE_LOCATION = QString(qgetenv("UNITY_WEBAPPS_QML_GLOBAL_DESKTOP_FILE_LOCATION")); } QFileInfo fileInfo(QString("%1/%2") .arg(DESKTOP_FILE_LOCATION) .arg(desktopFilename)); if ( ! fileInfo.isFile() || ! fileInfo.isReadable()) return QString(); QSettings desktopFileSettings(fileInfo.absoluteFilePath(), QSettings::IniFormat); desktopFileSettings.beginGroup("Desktop Entry"); QVariant execValue = desktopFileSettings.value("Exec"); // The exec line sometimes contains comma separated args in the // command line, e.g. --webappUrlPatterns=1,2,3. In this case // QSettings interprets this as a StringList instead of giving us // the raw value. QString execLine; if (execValue.type() == QVariant::StringList) { execLine = execValue.toStringList().join(","); } else { execLine = execValue.toString(); } desktopFileSettings.endGroup(); return execLine; } QString UnityWebapps::getDesktopFileContent() { if ( ! appInfos()) return QString(); QString webappName = appInfos()->displayName(); QString iconName = appInfos()->iconName(); QString desktopId = appInfos()->desktopId(); QString domain = appInfos()->domain(); QString appId = QString(desktopId).replace(".desktop", ""); QString execCommandLine = extractFromGlobalDesktopFile(appInfos()->desktopId()); if (execCommandLine.isEmpty()) { execCommandLine = QString("%4 -n '%5' -d '%6' %u") .arg(WEBAPPS_RUNNER_EXEC) .arg(QString(webappName.toUtf8().toBase64().data())) .arg(domain); } QString content = QString("[Desktop Entry]\n" "Name=%1\n" "Type=Application\n" "Icon=%2\n" "Actions=S1;S2;S3;S4;S5;S6;S7;S8;S9;S10;\n" "StartupWMClass=%3\n" "Exec=%4\n\n" "%5") .arg(webappName) .arg(UnityWebappsQML::getIconPathFor(iconName)) .arg(appId) .arg(execCommandLine) .arg( ! webappName.isEmpty() ? generateActionsEntry(webappName) : QString("")); return content; } void UnityWebapps::updateDesktopFileContent () { // There is currently an issue on Ubuntu Desktop with webapps // running in the container and bamf/unity that when // a local desktop file exists (and a webapp icon has been pinned // to the launcher through its global /usr/share desktop file), // the webapp icons are duplicated in the launcher. // Various fixes have been made to mitigate the issue in bamf // but it seems to still be around. // This is voluntarily discarded for now and left around to get // to the bottom of the issue in a timely fashion. #if 0 // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return; if ( ! handleDesktopFileUpdates()) return; if ( ! appInfos() || appInfos()->desktopId().isEmpty()) { qDebug() << "Cannot update local desktop file content"; return; } QString desktopFilePath = QDir::cleanPath (getLocalDesktopFilepath (appInfos()->desktopId())); QFile f(desktopFilePath); if ( ! f.open(QIODevice::WriteOnly)) { qWarning() << "Could not create/access desktop file: " << desktopFilePath; return; } f.write(getDesktopFileContent().toUtf8()); f.close(); #endif } void UnityWebapps::ensureLocalApplicationsPathExists() { // we bail out earlier (until we can do it w/ a builtin func) when // in a confined environment. if (isConfined ()) return; QString shareDirPath (getUserSharePath()); if (shareDirPath.isEmpty()) { return; } shareDirPath += QDir::separator() + QString("applications/"); // Create the directory if it doesn't exist QDir shareDir(shareDirPath); if (!shareDir.exists()) { shareDir.mkpath("."); } } // QMLParserStatus void UnityWebapps::classBegin() {} void UnityWebapps::componentComplete() {} unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/application-api.h0000644000015600001650000000411412645740734030507 0ustar pbuserpbgroup00000000000000/* * Copyright 2014 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef UNITY_WEBAPPS_APPLICATIONAPI_H #define UNITY_WEBAPPS_APPLICATIONAPI_H #include class ApplicationApiPrivate; class ApplicationApi : public QObject { Q_OBJECT Q_PROPERTY(QString applicationName READ getApplicationName NOTIFY applicationNameChanged) Q_PROPERTY(QString screenOrientation READ getApplicationScreenOrientation NOTIFY applicationScreenOrientationChanged) Q_PROPERTY(QString applicationDataPath READ getApplicationDataPath) Q_PROPERTY(QString applicationPlatform READ getApplicationPlatform) public: explicit ApplicationApi(QObject *parent = 0); ~ApplicationApi(); QString getApplicationName() const; QString getApplicationDataPath() const; QString getApplicationPlatform() const; QString getApplicationScreenOrientation() const; Q_INVOKABLE QString getInputMethodName() const; Q_INVOKABLE void setInputMethodVisible(bool); Q_SIGNALS: void applicationNameChanged(); void applicationAboutToQuit(bool killed); void applicationDeactivated(); void applicationActivated(); void applicationScreenOrientationChanged(QString); public Q_SLOTS: void aboutToQuit(); void deactivated(); void activated(); void screenOrientationChanged(Qt::ScreenOrientation); void signalReceived(int type); private: ApplicationApiPrivate *d_ptr; Q_DECLARE_PRIVATE(ApplicationApi) }; #endif // UNITY_WEBAPPS_APPLICATIONAPI_H unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-model.h0000644000015600001650000001434712645740734032131 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #if !defined(__UNITY_WEBAPPS_APP_MODEL_H__) #define __UNITY_WEBAPPS_APP_MODEL_H__ // Qt #include #include #include #include #include #include "unity-webapps-app-manifest-parser.h" /*! * \brief Model for the currently installed WebApps * Each installed webapp can be pulled from this model. * * TODO: No "installation" monitor is currently being setup ... * TODO: make sure that we are properly initialized w/ QML (QMLParserStatus) */ class UnityWebappsAppModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(QString searchPath READ searchPath WRITE setSearchPath NOTIFY searchPathChanged) Q_PROPERTY(bool doSearchHomeFolder READ doSearchHomeFolder WRITE setDoSearchHomeFolder) Q_ENUMS(WebAppsRoles) public: UnityWebappsAppModel(QObject* parent = 0); ~UnityWebappsAppModel(); enum WebAppsRoles { Name = Qt::UserRole + 1, Domain, Urls, Homepage, Scripts, ScriptsContent, Chrome, UserAgentOverride, Path }; // QAbstractListModel implementation QHash roleNames() const; int rowCount(const QModelIndex& parent = QModelIndex ()) const; QVariant data(const QModelIndex& index, int role) const; // Properties QString searchPath() const; void setSearchPath (const QString& path); bool doSearchHomeFolder() const; void setDoSearchHomeFolder (bool searchLocalHome); // Exposed to QML /*! * \brief providesSingleWebappName * \return */ Q_INVOKABLE bool providesSingleInlineWebapp() const; /*! * \brief providesSingleWebappName * \return */ Q_INVOKABLE QString getSingleInlineWebappName() const; /*! * \brief exists * \param webappName * \return */ Q_INVOKABLE bool exists(const QString & webappName) const; /*! * \brief getWebappIndex * \param webappName * \return */ Q_INVOKABLE int getWebappIndex(const QString & webappName) const; /*! * \brief */ Q_INVOKABLE QString getDomainFor(const QString & webappName) const; /*! * \brief */ Q_INVOKABLE QStringList getChromeOptionsFor(const QString & webappName) const; /*! * \brief */ Q_INVOKABLE QString userAgentOverrideFor(const QString & webappName) const; /*! * \brief */ Q_INVOKABLE QString path(const QString & webappName) const; /*! * \brief */ Q_INVOKABLE bool doesUrlMatchesWebapp(const QString & webappName, const QString & url) const; /*! * \brief */ Q_INVOKABLE QString getDisplayNameFor(const QString & webappName) const; /*! * \brief data * \return */ Q_INVOKABLE QVariant data(int row, int role) const; Q_SIGNALS: void searchPathChanged(const QString & path); void modelContentChanged(); private Q_SLOTS: /*! * \brief Starts loading all the WebApps */ void load(); private: /*! * \brief Agreggates simple set of data on a given candidate for a WebApp install */ struct WebappFileInfo { enum WebappType { IS_LOCAL_INLINE_WEBAPP, IS_NON_LOCAL_INLINE_WEBAPP }; WebappFileInfo () : isLocalInlineWebapp(false) {} WebappFileInfo(const QString& m, const QString& s, WebappType type) : manifestFilename(m), userscript(s), isLocalInlineWebapp(type == IS_LOCAL_INLINE_WEBAPP) {} QString manifestFilename; QString userscript; bool isLocalInlineWebapp; }; /*! * \brief Option type for WebappFileInfo */ typedef Fallible WebappFileInfoOption; /*! * \brief getWebappFiles * \param webappDir * \return */ WebappFileInfoOption getWebappFiles (const QFileInfo& webAppInstallLocatio); /*! * \brief UnityWebappsAppModel::getCandidateInstalledWebappsFolders * \return */ QFileInfoList getCandidateInstalledWebappsFolders (const QString& installationSearchPath); static QString getDefaultWebappsInstallationSearchPath(); static QString doCorrectSearchPath(const QString & p); /*! * \brief Cleanup the object and already loaded WebApps */ void cleanup(); /*! * \brief addWebApp * \param userscriptLocation * \param requiresLocation * \param manifest * \param content */ void addWebApp(const QString& userscriptLocation, const QString& requiresLocation, const ManifestFileInfo& manifest, const QString& content, bool isLocalInlineWebapp); /*! * \brief isValidInstall * \param searchpath * \return */ bool isValidInstall(const QString& searchpath); /*! * \brief loadUserScript * \param path * \param manifest * \return */ QString loadUserScript(const QDir& path, const ManifestFileInfo& manifest); private: struct InstalledWebApp { QString userscriptLocation; QString requiresLocation; bool isLocalInlineWebapp; struct { ManifestFileInfo manifest; QString content; } data; }; QList _webapps; QString _searchPath; bool _doSearchLocalHome; static QString _commonScriptsDirName; static QString _webappDirPrefix; }; #endif // __UNITY_WEBAPPS_APP_MODEL_H__ ././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-notifications.hunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-notifications.0000644000015600001650000000314412645740734033514 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_NOTIFICATIONS_H__ #define __UNITY_WEBAPPS_NOTIFICATIONS_H__ #include #include /*! * \brief The UnityWebappsNotification class */ class UnityWebappsNotification : public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QString name READ name WRITE setName) public: explicit UnityWebappsNotification(QObject *parent = 0); virtual ~UnityWebappsNotification(); /*! * \brief setName * \param name */ void setName(const QString& name); /*! * \brief name * \return */ QString name() const; // TODO: don't really need it? void classBegin(); void componentComplete(); public Q_SLOTS: void show(const QString& summary, const QString& body, const QString& icon); private: QString _applicationName; }; #endif // __UNITY_WEBAPPS_NOTIFICATIONS_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api-launcher.cpp0000644000015600001650000001072612645740734033153 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include "unity-webapps-desktop-infos.h" #include "unity-webapps-app-infos.h" #include "unity-webapps-api-launcher.h" #define API_CALL_HEADER() do { \ d->init(); \ if (!d->_launcher) \ return; \ } while(0) namespace { } // namespace { struct UnityWebappsLauncherPrivate { UnityWebappsLauncherPrivate(); ~UnityWebappsLauncherPrivate(); void clear(); void init(); UnityWebappsAppInfos *_appInfos; UnityLauncherEntry *_launcher; QObject* _callback; }; UnityWebappsLauncherPrivate::UnityWebappsLauncherPrivate() :_appInfos(0), _launcher(0), _callback(0) { } UnityWebappsLauncherPrivate::~UnityWebappsLauncherPrivate() { clear(); } void UnityWebappsLauncherPrivate::clear() { if (_launcher && G_IS_OBJECT(_launcher)) { g_object_unref (G_OBJECT (_launcher)); _launcher = 0; } _appInfos = 0; _callback = 0; } void UnityWebappsLauncherPrivate::init() { if (Q_UNLIKELY(_launcher != NULL)) return; if (Q_UNLIKELY(_appInfos == NULL)) { qDebug() << "Trying to initialize the Launcher binding with invalid context"; return; } QString desktopId = _appInfos->desktopId(); if (desktopId.isEmpty()) { qDebug() << "MessagingMenu: invalid desktop id (empty)"; return; } _launcher = unity_launcher_entry_get_for_desktop_id (desktopId.toUtf8().data()); } UnityWebappsLauncher::UnityWebappsLauncher(QObject *parent) : QObject(parent), d_ptr(new UnityWebappsLauncherPrivate()) {} UnityWebappsLauncher::~UnityWebappsLauncher() { delete d_ptr; } void UnityWebappsLauncher::onAppInfosChanged(UnityWebappsAppInfos *appInfos) { Q_D(UnityWebappsLauncher); bool wasInit = false; if (d->_launcher) { wasInit = true; d->clear(); } d->_appInfos = appInfos; if (wasInit) d->init(); } void UnityWebappsLauncher::setCount(int count) { Q_D(UnityWebappsLauncher); API_CALL_HEADER(); unity_launcher_entry_set_count (d->_launcher, count); unity_launcher_entry_set_count_visible (d->_launcher, TRUE); } int UnityWebappsLauncher::getCount() { Q_D(UnityWebappsLauncher); d->init(); if (!d->_launcher) return 0; return unity_launcher_entry_get_count(d->_launcher); } void UnityWebappsLauncher::clearCount() { Q_D(UnityWebappsLauncher); API_CALL_HEADER(); unity_launcher_entry_set_count_visible (d->_launcher, FALSE); } void UnityWebappsLauncher::setProgress(double progress) { Q_D(UnityWebappsLauncher); API_CALL_HEADER(); unity_launcher_entry_set_progress (d->_launcher, progress); unity_launcher_entry_set_progress_visible (d->_launcher, TRUE); } double UnityWebappsLauncher::getProgress() { Q_D(UnityWebappsLauncher); d->init(); if (!d->_launcher) return 0; return unity_launcher_entry_get_progress (d->_launcher); } void UnityWebappsLauncher::clearProgress() { Q_D(UnityWebappsLauncher); API_CALL_HEADER(); unity_launcher_entry_set_progress_visible (d->_launcher, FALSE); } void UnityWebappsLauncher::setUrgent() { Q_D(UnityWebappsLauncher); API_CALL_HEADER(); unity_launcher_entry_set_urgent (d->_launcher, TRUE); } void UnityWebappsLauncher::addAction(const QString & actionName, const QString & action) { Q_UNUSED(actionName); Q_UNUSED(action); } void UnityWebappsLauncher::removeAction(const QString & actionName) { Q_UNUSED(actionName); } void UnityWebappsLauncher::removeActions() { } void UnityWebappsLauncher::classBegin() { } void UnityWebappsLauncher::componentComplete() { } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/unity-webapps-api.h0000644000015600001650000001152612645740734031020 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_API_H__ #define __UNITY_WEBAPPS_API_H__ #include #include #include #include #include "callback.h" class UnityWebappsAppInfos; class UnityWebappsAppModel; class UnityWebapps : public QObject, public QQmlParserStatus { Q_OBJECT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(UnityWebappsAppModel* model READ model WRITE setAppModel) Q_PROPERTY(bool handleDesktopFileUpdates READ handleDesktopFileUpdates WRITE setHandleDesktopFileUpdates) Q_PROPERTY(UnityWebappsAppInfos* appInfos READ appInfos NOTIFY appInfosChanged) public: UnityWebapps(QObject *parent = 0); ~UnityWebapps(); UnityWebappsAppModel* model() const; void setAppModel(UnityWebappsAppModel *); bool handleDesktopFileUpdates() const; void setHandleDesktopFileUpdates (bool); // TODO: really need it? void componentComplete(); void classBegin(); Q_INVOKABLE QString addIndicatorAction (const QString& name); Q_INVOKABLE QString addStaticAction (const QString& name, const QString& url); Q_INVOKABLE QString addLauncherAction (const QString& name); Q_INVOKABLE void removeLauncherAction (const QString& name); Q_INVOKABLE void removeLauncherActions (); public Q_SLOTS: // API functions void init(const QString& name, const QString& url, bool isLocal, const QVariant& args); // class functions UnityWebappsAppInfos *appInfos(); QString getDesktopFileContent(); Q_SIGNALS: void initCompleted(bool success); void appInfosChanged(UnityWebappsAppInfos *appInfos); private: enum ActionTypeFlags { STATIC_ACTION = 0x1, INDICATOR_ACTION = 0x2, LAUNCHER_ACTION = 0x4, }; QStringList collectActionNames() const; QString getUrlLaunchExec (const QString & webappName, const QString & url); QString addAction (const QString& name, ActionTypeFlags type, const QString & url = QString()); void removeAction (const QString& name); void ensureLocalApplicationsPathExists(); QString getLocalDesktopFilepath(const QString & desktopId); void updateDesktopFileContent(); QString extractFromGlobalDesktopFile(const QString & desktopFilename); QString generateActionEntryFor(const QString& actionName, const QString & webappName, const QString& showIn, const QString& exec); QString generateActionsEntry(const QString & webappName); bool isValidInitForWebappAndModel (const QString & name, const QString& domain, const QString & displayName); bool initInternal(const QString& name, const QString& domain, const QString& displayName, const QString& iconUrl, const QString& url); void cleanup(); bool isConfined() const; void buildAppInfos(const QString & name, const QString & displayName, const QString & domain, const QString & desktopId, const QString & iconName); bool createLocalDesktopFileFor (const QString& desktopId, const QString& webappName, const QString& domain, const QString& iconName); static QString getUserSharePath(); private: struct ActionInfos { ActionInfos() {} ActionInfos(const QString & n, size_t t, size_t i, const QString & u = QString()) : name(n), type(t), url(u), idx(i) {} QString name; size_t type; QString url; size_t idx; }; QMap collectActionIndexes(); int findNextAvailableActionIndex(const QMap & indexes); QMap _actions; UnityWebappsAppModel *_model; UnityWebappsAppInfos *_appInfos; bool _handleDesktopFileUpdates; static const QString WEBAPPS_RUNNER_EXEC; }; #endif // __UNITY_WEBAPPS_API_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/plugin/callback.h0000644000015600001650000000216112645740734027171 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __UNITY_WEBAPPS_CALLBACK_H__ #define __UNITY_WEBAPPS_CALLBACK_H__ #include #include class UnityWebappsCallback : public QObject { Q_OBJECT public: UnityWebappsCallback(QObject *parent = 0); ~UnityWebappsCallback(); public Q_SLOTS: Q_INVOKABLE void trigger (QVariant user_data = QVariant()); Q_SIGNALS: void triggered(QVariant user_data = QVariant()); }; #endif // __UNITY_WEBAPPS_CALLBACK_H__ unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/UnityWebApps.qml0000644000015600001650000007724112645740741027104 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import Ubuntu.UnityWebApps 0.1 as UbuntuUnityWebApps import "UnityWebApps.js" as UnityWebAppsJs import "UnityWebAppsUtils.js" as UnityWebAppsJsUtils import "UnityWebAppsBackendComponents.js" as UnityBackends import "./bindings/runtime-api/backend/runtime-api.js" as RuntimeApiBackend import "./bindings/alarm-api/backend/alarm-api.js" as AlarmApiBackend import "./bindings/content-hub/backend/content-hub.js" as ContentHubApiBackend import "./bindings/online-accounts/backend/online-accounts.js" as OnlineAccountsApiBackend import "./bindings/online-accounts/backend/online-accounts-client.js" as OnlineAccountsClientApiBackend import "./bindings/download-manager/backend/download-api.js" as DownloadApiBackend import "./bindings/tools/backend/tools.js" as ToolsApiBackend /*! \qmltype UnityWebApps \inqmlmodule Ubuntu.UnityWebApps 0.1 \ingroup ubuntu \brief The QML component that binds to a QML WebView and exposes the Unity WebApps API to it's javascript. Examples: \qml UnityWebApps { id: webapps name: "MyApp" bindee: webView } \endqml On the page's javascript side, an event is being sent to the document when the API is exposed and ready to be used: "ubuntu-webapps-api-ready". So a typical pattern for the page's javascript could be: \code function init() { // The Unity APIs are available throuhg external.getUnityObject var Unity = external.getUnityObject(1); } if (!external.getUnityObject) { document.addEventListener ("ubuntu-webapps-api-ready", function () { init(); }); } \endcode */ Item { id: webapps /*! \qmlproperty string UnityWebApps::name Holds the name of the application that is run as a WebApp. It should be used in conjunction with a model. The 'name' property is then used while looking up for the webapp in the set of locally installed ones. The name should not change once it has been set. (?) */ property string name: "" /*! \qmlproperty string UnityWebApps::bindee Holds a reference to the object that webapps are to be injected in. The UnityWebApps QML component expects any bindee to duck-type with the following IDL signature: \code method getUnityWebappsProxies() \endcode that should return a BindeeExports: \code interface BindeeExports { method injectUserScripts(string userScriptUrls); method sendToPage(string message); method loadingStartedConnect(Callback onLoadingStarted); method messageReceivedConnect(Callback onMessageReceived); method navigateTo(string url); } \endcode */ property var bindee /*! \qmlproperty UnityWebappsAppModel UnityWebApps::model An optional model used in conjunction with the 'name' property as a location for looking up the desired webapps. */ property var model: null /*! \qmlproperty bool UnityWebApps::injectExtraUbuntuApis */ property alias injectExtraUbuntuApis: settings.injectExtraUbuntuApis /*! \qmlproperty bool UnityWebApps::injectExtraContentShareCapabilities */ property alias injectExtraContentShareCapabilities: settings.injectExtraContentShareCapabilities /*! \qmlproperty bool UnityWebApps::requiresInit */ property alias requiresInit: settings.requiresInit /*! \qmlproperty UnityActions.Context UnityWebApps::actionsContext The actions context that this element can reach out to for additional actions. */ property var actionsContext: null /*! \qmlproperty string UnityWebApps::customBackendProxies Used only for testing. Allows optional (not the default ones) mocked backends to be used. */ property var customBackendProxies: null /*! \qmlproperty string UnityWebApps::_opt_clientApiFileUrl Used only for testing. Allows optional (not the default ones) client api to be used instead of the default one. */ property string customClientApiFileUrl: "" /*! \qmlproperty string UnityWebApps::_opt_homepage Used only for testing. Allows an optional a homepage to be specified when running a local http server. */ property string _opt_homepage: "" /*! \qmlsignal UnityWebApps::userScriptsInjected() This signal is emitted when the component has completed its initialization and the userscripts have been injected into the binded webview. */ signal userScriptsInjected() /*! \qmlsignal UnityWebApps::apiCallDispatched() This signal is emitted when an api call is being dispatched to the backend. */ signal apiCallDispatched(string type, string name) Settings { id: settings injectExtraContentShareCapabilities: name && name.length && name.length !== 0 } /*! \internal PRIVATE FUNCTION: __bind Binds a given webapp object with something that is expected to support the following calls: \code interface BindeeExports { method injectUserScripts(string userScriptUrls); method sendToPage(string message); method loadingStartedConnect(Callback onLoadingStarted); method messageReceivedConnect(Callback onMessageReceived); method navigateTo(string url); } \endcode The bindee should not be null. */ function __bind(bindee, webappUserscripts) { if (!bindee) { console.debug('__bind: ERROR Invalid bindee when trying to bind the QML WebApps component') return; } if (internal.instance) { console.debug('__bind: ERROR Instance already set') return; } if (!__isValidBindee(bindee)) { console.debug('__bind: ERROR not a valid bindee') return; } // Get an instance of the bridging interface that // the bindee is supposed to provide. var bindeeProxies = bindee.getUnityWebappsProxies(); if (!__areValidBindeeProxies(bindeeProxies)) { console.debug('__bind: ERROR bindee proxies not valid') return; } var instance = new UnityWebAppsJs.UnityWebApps( webapps, bindeeProxies, __getPolicyForContent(settings), customClientApiFileUrl && customClientApiFileUrl.length !== 0 ? customClientApiFileUrl : 'unity-webapps-api.js', function(info) { apiCallDispatched(info.type, info.name) }); internal.instance = instance; if (internal.backends) internal.instance.setBackends(internal.backends) userScriptsInjected(); } /*! \internal */ function __createBackendsIfNeeded() { var backends; if (customBackendProxies != null) backends = customBackendProxies; else { backends = __makeBackendProxies(); } return backends; } /*! \internal */ function __initBackends() { if (customBackendProxies || __isValidWebAppName(webapps.name) || injectExtraUbuntuApis) { internal.backends = __createBackendsIfNeeded(); if (internal.backends && internal.instance) internal.instance.setBackends(internal.backends); } } /*! \internal PRIVATE FUNCTION: __isValidBindee */ function __isValidBindee(bindee) { var properties = [{'name': 'getUnityWebappsProxies', 'type': 'function'}]; var validator = UnityWebAppsJsUtils.makePropertyValidator(properties); return validator(bindee); } /*! \internal PRIVATE FUNCTION: __areValidBindeeProxies Validates the bindeed proxies as exported by getUnityWebappsProxies */ function __areValidBindeeProxies(proxies) { var properties = [{'name': 'sendToPage', 'type': 'function'}, {'name': 'loadingStartedConnect', 'type': 'function'}, {'name': 'messageReceivedConnect', 'type': 'function'}, {'name': 'injectUserScripts', 'type': 'function'}, {'name': 'navigateTo', 'type': 'function'}]; var validator = UnityWebAppsJsUtils.makePropertyValidator(properties); return validator(proxies); } /*! \internal PRIVATE FUNCTION: __unbind */ function __unbind() { if (internal.instance) internal.instance.cleanup(); internal.instance = null; } /*! \internal Validates that an installed webapp has been found in the current model (if any) given the webapp name. */ function __isValidWebAppForModel(webappName) { return __isValidWebAppName(webappName) && model != null && model.exists && model.exists(webappName); } /*! \internal Gathers the webapps userscript associated with the webapp whose name is passed as param. Returns the list of URIs for the associated scripts to be injected */ function __gatherWebAppUserscriptsIfAny(webappName) { var userscripts = []; if (__isValidWebAppForModel(webappName)) { var idx = model.getWebappIndex(webappName); userscripts = model.data(idx, UbuntuUnityWebApps.UnityWebappsAppModel.Scripts); // FIXME: hack userscripts = userscripts.map(function (script) { return 'file://' + script; }); } return userscripts; } /*! \internal If the component has been binded to a proper bindee (exposes proper interface) and the webapps bridge has been initialized, this make sure that the bindee is requested to navigate to a given 'homepage' url for the associated webapp. */ function __navigateToWebappHomepageInBindee(webappName) { if (__isValidWebAppForModel(webappName) && internal.instance) { var idx = model.getWebappIndex(webappName); var homepage = model.data(idx, UbuntuUnityWebApps.UnityWebappsAppModel.Homepage); if (!homepage || homepage.length === 0) { homepage = _opt_homepage; } console.debug('Requesting the bindee to navigate to homepage: ' + homepage); // We recreate a bindee object, but we call any function that requires // come custom cleanup (signals), so we are ok. var bindeeProxies = bindee.getUnityWebappsProxies(); bindeeProxies.navigateTo(homepage); } } /*! \internal If running as a known webapp, setup the scripts are that to be injected (and provided by the model), and navigate to the proper homepage. */ function __setupNamedWebappEnvironment() { if (__isValidWebAppForModel(name)) { if (internal.instance) { var userScripts = __gatherWebAppUserscriptsIfAny(name); internal.instance.injectWebappUserScripts(userScripts); } __navigateToWebappHomepageInBindee(name); } } Component.onCompleted: { if (model) { if (model.providesSingleInlineWebapp() && webapps.name.length === 0) { webapps.name = model.getSingleInlineWebappName(); } __setupNamedWebappEnvironment(); } } onCustomBackendProxiesChanged: __initBackends() /*! \internal */ onModelChanged: { if (model) { model.modelContentChanged.connect(__setupNamedWebappEnvironment) } } /*! \internal */ onBindeeChanged: { // cleanup old refs & go webapps.__unbind(); if (bindee != null) { webapps.__bind(bindee); webapps.__initBackends(); // if we are running as a named webapp __setupNamedWebappEnvironment(); } } /*! \internal */ onNameChanged: { __initBackends(); // if we are running as a proper named webapp __setupNamedWebappEnvironment(); } /*! \internal */ QtObject { id: internal property var instance: null property var backends: null } /*! \internal */ function __isValidWebAppName(name) { return name != null && typeof(name) === 'string' && name != ""; } /*! \internal */ function __injectResourceIfExtraApisAreEnabled(getResourceFunc) { if (getResourceFunc && typeof getResourceFunc === 'function' && injectExtraUbuntuApis) { return getResourceFunc(); } return null; } /*! \internal */ function __getPolicyForContent(settings) { function PassthroughPolicy() {}; PassthroughPolicy.prototype.allowed = function(signature) { return true; }; var BASIC_WEBAPPS_ALLOWED_APIS = ["init"]; function RestrictedPolicy(restrictions) { this.restrictions = restrictions || BASIC_WEBAPPS_ALLOWED_APIS; }; RestrictedPolicy.prototype.allowed = function(signature) { return this.restrictions.some(function(e) { return signature.match(e); }); }; RestrictedPolicy.prototype.add = function(signature) { if (! this.restrictions.some(function(e) { return e === signature; })) { this.restrictions.push(signature); } }; if (settings.injectExtraUbuntuApis) return new PassthroughPolicy(); var policy = new RestrictedPolicy(['init', 'addAction', 'clearAction', 'clearActions', 'acceptData', 'Launcher.*', 'Notification.*', 'Launcher.*', 'MediaPlayer.*', 'MessagingIndicator.*']); if (settings.injectExtraContentShareCapabilities) { policy.add("launchEmbeddedUI"); policy.add("ContentHub.onShareRequested"); policy.add("ToolsApi.getHmacHash"); policy.add("ToolsApi.sendHttpRequest"); } return policy; } /*! \internal PRIVATE FUNCTION: __makeBackendProxies Binds the API dispatched calls to the Unity backends. TODO move elsewhere (in js file) */ function __makeBackendProxies () { var initialized = settings.requiresInit ? false : true; function getWrappedJsCallback(jscallback) { var callback = Qt.createQmlObject('import Ubuntu.UnityWebApps 0.1 as Backends; Backends.UnityWebappsCallback { }', bindee); callback.onTriggered.connect(jscallback); return callback; }; function isValidInitCall(params) { if (! params) return false; if (params.__unity_webapps_hidden && params.__unity_webapps_hidden.local) return true; if (! params.__unity_webapps_hidden || ! params.__unity_webapps_hidden.hostname) { console.debug('Cannot find hidden initialization param'); return false; } if ( ! params.domain || typeof(params.domain) !== 'string' || params.domain.length === 0) { console.debug('Cannot find a "domain" property'); return false; } return params.__unity_webapps_hidden.hostname.indexOf(params.domain) !== -1; }; UnityBackends.clearAll(); UnityBackends.createBackendDelegate(webapps); return { init: function (params) { if (! isValidInitCall(params)) { return; } function callOnInitScriptFunc() { if (params.onInit && typeof(params.onInit) === 'function') { params.onInit(); } } if ( ! initialized) { // The 'name' property takes over the params.name property // if any is set. var webappName = name ? name : params.name; // We should be all set & ready for the backends UnityBackends.clearAll(); UnityBackends.createAllWithAsync(webapps, {name: webappName, displayName: params.name}, internal.instance ? internal.instance.proxies() : null); UnityBackends.signalOnBackendReady("base", function () { var base = UnityBackends.get("base"); function onInitCompleted(success) { console.debug('Received initCompleted signal, status: ' + success); base.initCompleted.disconnect(onInitCompleted); if (success) { initialized = true; callOnInitScriptFunc(); } }; base.initCompleted.connect(onInitCompleted); var isLocal = params.__unity_webapps_hidden && params.__unity_webapps_hidden.local; var url = params.__unity_webapps_hidden && params.__unity_webapps_hidden.url ? params.__unity_webapps_hidden.url : ""; base.init(webappName, url, isLocal, params); }); } else { callOnInitScriptFunc(); } }, addAction: function(actionName, onActionInvoked) { if (!initialized) return; // hud add action UnityBackends.get("hud").addAction(actionName, onActionInvoked); }, clearAction: function(actionName) { if (!initialized) return; // hud remove action UnityBackends.get("hud").clearAction(actionName); }, clearActions: function() { if (!initialized) return; // hud remove all action UnityBackends.get("hud").clearActions(); }, launchEmbeddedUI: function(name, callback, params) { if (!model || !webapps || !webapps.name) { console.error("launchEmbeddedUI: could not find a valid webapp model or webapp name"); return; } var path = model.path(webapps.name); if (!path || path.length === 0) { console.error("launchEmbeddedUI: Invalid or empty webapp path name"); return; } var backendDelegate = UnityBackends.backendDelegate; var parentItem = backendDelegate.parentView(); if (!parentItem || !parentItem.visible || !parentItem.height || !parentItem.width) { console.error("launchEmbeddedUI: Cannot launch the embedded UI, invalid or malformed parent item: " + parentItem); callback({result: "cancelled"}); return; } var p = parentItem.parent ? parentItem.parent : parentItem var uicomponent; function onCreated() { var args = {} for (var k in params) { if (params.hasOwnProperty(k)) { args[k] = params[k] } } // For backward compatibility if (params.hasOwnProperty("fileToShare") && typeof(params.fileToShare) === 'object' && params.fileToShare.hasOwnProperty("url")) { args.fileToShare = params.fileToShare.url } args.visible = true var uiobject = uicomponent.createObject(p, args); if ( ! uiobject.onCompleted) { console.error("launchEmbeddedUI: The local UI component to be launched does not expose a mandatory 'completed' signal"); uiobject.destroy(); return; } function _onCompleted(data, onResourceUploadedCallback) { p.visible = true; uiobject.onCompleted.disconnect(_onCompleted); callback(data, onResourceUploadedCallback); } uiobject.onCompleted.connect(_onCompleted); }; var uicomponent = Qt.createComponent(path + "/" + name + ".qml"); if (uicomponent.status === Component.Ready) onCreated() else uicomponent.statusChanged.connect(onCreated) }, Notification: { showNotification: function (summary, body, iconUrl) { if (!initialized) return; //TODO: fix that underterministic crap ("notify" being badly independantly // checked from the others) UnityBackends.signalOnBackendReady("notify", function () { UnityBackends.get("notify").show(summary, body, iconUrl); }); } }, MessagingIndicator: { showIndicator: function (name, properties) { if (!initialized) return; UnityBackends.get("messaging").showIndicator(String(name)); for (var i in properties) { if (i === "time") { UnityBackends.get("messaging").setProperty(String(name), i, UnityWebAppsJsUtils.toISODate(properties[i])); } else if (i === "count") { UnityBackends.get("messaging").setProperty(String(name), i, String(Number(properties[i]))); } else if (i === "callback") { UnityBackends.get("messaging").setProperty(String(name), i, getWrappedJsCallback (properties[i])); } else { UnityBackends.get("messaging").setProperty(String(name), i, properties[i]); } } }, clearIndicator: function (name) { if (!initialized) return; UnityBackends.get("messaging").clearIndicator(name); }, clearIndicators: function () { if (!initialized) return; UnityBackends.get("messaging").clearIndicators(); }, addAction: function (name, onActionInvoked) { if (!initialized) return; var id = UnityBackends.get("base").addIndicatorAction(name); UnityBackends.get("indicator-actions").addAction(name, onActionInvoked, id); }, }, MediaPlayer: { init: function () { console.debug('MediaPlayer.init is deprecated'); }, setTrack: function (infos) { if (!initialized) return; var album = infos.album || ''; var artist = infos.artist || ''; var title = infos.title || ''; var artLocation = ""; UnityBackends.get("mediaplayer").setTrack(artist, album, title, artLocation); }, onPrevious: function (callback) { UnityBackends.get("mediaplayer").onPrevious(getWrappedJsCallback (callback)); }, onNext: function (callback) { UnityBackends.get("mediaplayer").onNext(getWrappedJsCallback (callback)); }, onPlayPause: function (callback) { UnityBackends.get("mediaplayer").onPlayPause(getWrappedJsCallback (callback)); }, getPlaybackCtate: function (callback) { callback (UnityBackends.get("mediaplayer").getPlaybackState()); }, setPlaybackState: function (state) { UnityBackends.get("mediaplayer").setPlaybackState(state); }, setCanGoNext: function (cango) { UnityBackends.get("mediaplayer").setCanGoNext(cango); }, setCanGoPrevious: function (cango) { UnityBackends.get("mediaplayer").setCanGoPrevious(cango); }, setCanPlay: function (canplay) { UnityBackends.get("mediaplayer").setCanPlay(canplay); }, setCanPause: function (canpause) { UnityBackends.get("mediaplayer").setCanPause(canpause); }, __get: function (prop, callback) { if (!initialized) return; if (prop === "can-go-previous") { callback(UnityBackends.get("mediaplayer").getCanGoPrevious()); } else if (prop === "can-go-next") { callback(UnityBackends.get("mediaplayer").getCanGoNext()); } else if (prop === "can-play") { callback(UnityBackends.get("mediaplayer").getCanPlay()); } else if (prop === "can-pause") { callback(UnityBackends.get("mediaplayer").getCanPause()); } else if (prop === "track") { callback(UnityBackends.get("mediaplayer").getTrack()); } } }, OnlineAccounts: OnlineAccountsApiBackend.createOnlineAccountsApi(UnityBackends.backendDelegate), Alarm: __injectResourceIfExtraApisAreEnabled(function() { return AlarmApiBackend.createAlarmApi(UnityBackends.backendDelegate) }), ContentHub: ContentHubApiBackend.createContentHubApi( UnityBackends.backendDelegate, webapps), RuntimeApi: __injectResourceIfExtraApisAreEnabled(function() { return RuntimeApiBackend.createRuntimeApi(UnityBackends.backendDelegate) }), DownloadApi: __injectResourceIfExtraApisAreEnabled(function() { return DownloadApiBackend.createDownloadApi(UnityBackends.backendDelegate) }), ToolsApi: ToolsApiBackend.createToolsApi(UnityBackends.backendDelegate), Launcher: { setCount: function (count) { if (!initialized) return; UnityBackends.get("launcher").setCount(count); }, clearCount: function () { if (!initialized) return; UnityBackends.get("launcher").clearCount(); }, setProgress: function (progress) { if (!initialized) return; UnityBackends.get("launcher").setProgress(progress); }, clearProgress: function () { if (!initialized) return; UnityBackends.get("launcher").clearProgress(); }, setUrgent: function () { if (!initialized) return; UnityBackends.get("launcher").setUrgent(); }, addStaticAction: function (name, url) { if (!initialized) return; if (this.__actionNames[name]) this.removeAction(name); var id = UnityBackends.get("base").addStaticAction(name, url); this.__actionNames[name] = id; }, addAction: function (name, ontriggered) { if (!initialized) return; if (this.__actionNames[name]) this.removeAction(name); var id = UnityBackends.get("base").addLauncherAction(name); UnityBackends.get("indicator-actions").addAction(name, function () { console.debug(name + " triggered"); ontriggered(); }, id); this.__actionNames[name] = id; }, removeAction: function (name) { if (!initialized) return; if ( ! (name in this.__actionNames)) return; UnityBackends.get("base").removeLauncherAction(name, this.__actionNames[name]); UnityBackends.get("indicator-actions").clearAction(name); delete this.__actionNames[name]; }, removeActions: function () { if (!initialized) return; UnityBackends.get("base").removeLauncherActions(); for (var name in this.__actionNames) { this.removeActions(name); } }, __get: function (prop, callback) { if (!initialized) return; if (prop === "progress") { callback(UnityBackends.get("launcher").getProgress()); } else if (prop === "count") { callback(UnityBackends.get("launcher").getCount()); } }, __actionNames: {} } }; } } unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/unity-webapps-api.js.in0000644000015600001650000002640312645740734030314 0ustar pbuserpbgroup00000000000000// ==UserScript== // @inject_in_main_world // ==/UserScript== /* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ (function () { if (window.self !== window.top) { return; } // Acknowledge that the API has been fully injected var sendApiCreatedAcknowledgeEvent = function () { var e = document.createEvent ("Events"); e.initEvent ("ubuntu-webapps-api-ready", false, false); document.dispatchEvent (e); }; //@include UnityWebAppsUtils.js //@include ./bindings/alarm-api/client/alarm-api.js //@include ./bindings/content-hub/client/content-hub.js //@include ./bindings/online-accounts/client/online-accounts.js //@include ./bindings/runtime-api/client/runtime-api.js //@include ./bindings/download-manager/client/download-api.js //@include ./bindings/tools/client/tools.js //@include ./common/js/unity-backend-messaging-proxy.js //@include ./common/js/unity-binding-proxy.js //@include ./common/js/unity-binding-bridge.js var apiBuilder = function(backend) { //@include ./common/js/api-sanitizer.js var api = { init: function(props) { checkString(props.name, false); checkString(props.iconUrl, true); checkString(props.domain, true); checkString(props.login, true); checkString(props.mimeTypes, true); checkString(props.homepage, true); if (props.homepage && !/^(http|https|file):\/\//.test(props.homepage)) { throw new TypeError("incorrect argument"); } if (window.location.protocol !== 'file:') props.__unity_webapps_hidden = { hostname: window.location.hostname, url: window.location.href }; else props.__unity_webapps_hidden = {local: true}; backend.call("init", [props]); }, /** * * @method acceptData * @param mimeType {String} * @param callback {Function} */ acceptData: createArgumentsSanitizer (backend, [{ array: { element: { str: true } } }, { type: Function, js: true }], 'acceptData'), /** * * @param name {String} * @param callback {Function} */ addAction: createArgumentsSanitizer (backend, [{ str: true }, { type: Function, argAsCallbackId: 0 }] , 'addAction'), /** * * @param name {String} */ clearAction: createArgumentsSanitizer (backend, [{ str: true }], 'clearAction'), /** * */ clearActions: createArgumentsSanitizer (backend, [], 'clearActions'), /** */ launchEmbeddedUI: function(name, callback, params) { backend.call('launchEmbeddedUI', [name, callback, params]); }, /** * * MediaPlayer API * */ MediaPlayer: { init: function() {}, /** * * @param callback {Function} */ onPlayPause: createArgumentsSanitizer (backend, [{ type: Function, allowNull: true }, { dummy: true }] , 'MediaPlayer.onPlayPause'), /** * * @param callback {Function} */ onPrevious: createArgumentsSanitizer (backend, [{ type: Function, allowNull: true }, { dummy: true }] , 'MediaPlayer.onPrevious'), /** * * @param callback {Function} */ onNext: createArgumentsSanitizer (backend, [{ type: Function, allowNull: true }, { dummy: true }] , 'MediaPlayer.onNext'), /** * * @param callback {Function} */ setTrack: createArgumentsSanitizer(backend, [{ obj: { artist: { str: true, place: 0, allowNull: true }, album: { str: true, place: 1, allowNull: true }, title: { str: true, place: 2 }, artLocation: { str: true, place: 3, allowNull: true } } }] , 'MediaPlayer.setTrack'), /** * * @param callback {Function} */ setCanGoNext: createArgumentsSanitizer (backend, [{ number: true }], 'MediaPlayer.setCanGoNext'), /** * * @param callback {Function} */ setCanGoPrevious: createArgumentsSanitizer (backend, [{ number: true }], 'MediaPlayer.setCanGoPrevious'), /** * * @param callback {Function} */ setCanPlay: createArgumentsSanitizer (backend, [{ number: true }], 'MediaPlayer.setCanPlay'), /** * * @param callback {Function} */ setCanPause: createArgumentsSanitizer (backend, [{ number: true }], 'MediaPlayer.setCanPause'), /** * * @param callback {Function} */ setPlaybackState: createArgumentsSanitizer (backend, [{ number: true }], 'MediaPlayer.setPlaybackState'), /** * * @param callback {Function} */ getPlaybackState: createArgumentsSanitizer (backend, [{ type: Function }], 'MediaPlayer.getPlaybackState'), PlaybackState: {PLAYING: 0, PAUSED:1}, /** * @private */ __get: createArgumentsSanitizer(backend, [{ str: true }, { type: Function, argAsCallbackId: 0 }], 'MediaPlayer.__get') }, Notification: { /** * * @param callback {Function} */ showNotification: createArgumentsSanitizer (backend, [{ str: true }, { str: true }, { str: true, allowNull: true }] , 'Notification.showNotification') }, Launcher: { /** * * @param callback {Function} */ setCount: createArgumentsSanitizer (backend, [{ number: true }], 'Launcher.setCount'), /** * * @param callback {Function} */ clearCount: createArgumentsSanitizer (backend, [], 'Launcher.clearCount'), /** * * @param callback {Function} */ setProgress: createArgumentsSanitizer (backend, [{ number: true }], 'Launcher.setProgress'), /** * * @param callback {Function} */ clearProgress: createArgumentsSanitizer (backend, [], 'Launcher.clearProgress'), /** * * @param callback {Function} */ setUrgent: createArgumentsSanitizer (backend, [], 'Launcher.setUrgent'), /** * * @param callback {Function} */ addAction: function(arg1, arg2) { if (typeof(arg2) === 'string') backend.call('Launcher.addStaticAction', [arg1, arg2]); else backend.call('Launcher.addAction', [arg1, arg2]); }, /** * * @param callback {Function} */ removeAction: createArgumentsSanitizer (backend, [{ str: true }], 'Launcher.removeAction'), /** * * @private */ removeActions: createArgumentsSanitizer (backend, [], 'Launcher.removeActions'), /** * * @private */ __get: createArgumentsSanitizer (backend, [{ str: true }, { type: Function, argAsCallbackId: 0 }] , 'Launcher.__get') }, MessagingIndicator: { /** * * @private */ addAction: createArgumentsSanitizer (backend, [{ str: true }, { type: Function, argAsCallbackId: 0 }, { dummy: true }] , 'MessagingIndicator.addAction'), /** * * @private */ showIndicator: function(name, properties) { backend.call('MessagingIndicator.showIndicator', [name, properties]); }, /** * * @private */ clearIndicator: createArgumentsSanitizer (backend, [{ str: true }], 'MessagingIndicator.clearIndicator'), /** * * @private */ clearIndicators: createArgumentsSanitizer (backend, [], 'MessagingIndicator.clearIndicators'), }, OnlineAccounts: createOnlineAccountsApi(backend), AlarmApi: createAlarmApi(backend), ContentHub: createContentHubApi(backend), RuntimeApi: createRuntimeApi(backend), DownloadApi: createDownloadApi(backend), ToolsApi: createToolsApi(backend) }; return api; }; var apiBridge = new UnityBindingBridge(makeCallbackManager(), createMessagingProxyForCurrentWebRuntime()); var api = apiBuilder (apiBridge); apiBridge.setBindingApi(api); if (!window.external) window.external = {}; window.external.getUnityObject = function (version) { return api; }; sendApiCreatedAcknowledgeEvent(); unsafeWindow = window; }) (); unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/0000755000015600001650000000000012645741276025260 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/0000755000015600001650000000000012645741276025674 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/unity-binding-bridge.js0000644000015600001650000002026512645740741032245 0ustar pbuserpbgroup00000000000000function UnityBindingBridge(callbackManager, backendMessagingProxy) { this._proxies = {}; this._last_proxy = 0; this._callbackManager = callbackManager; this._bindingApi = null; this._backendMessagingProxy = backendMessagingProxy; this._startMessagePump(); }; UnityBindingBridge.prototype = { /** * Calls a plain raw API function. * * @method call * @param */ call: function(method_name, args, callback) { var self = this; var _args = JSON.stringify(args.map (function (arg) { return self._transformCallbacksToIds(arg); })); this._sendToBackend( JSON.stringify({target: "ubuntu-webapps-binding-call", name: method_name, args: _args, callback: callback ? this._transformCallbacksToIds(callback) : null})); }, /** * * * @method setBindingApi * @param */ setBindingApi: function(bindingApi) { this._bindingApi = bindingApi; }, /** * * * @method isObjectProxyInfo * @param */ isObjectProxyInfo: function(info) { return 'type' in info && info.type === 'object-proxy' && 'apiid' in info && 'objecttype' in info && 'objectid' in info; }, /** * * * @method * @param */ createRemoteObject: function(plugin_uri, class_name, objectid) { var id = objectid ? objectid : this._generateProxyIdFor(plugin_uri, class_name); return new UnityBindingProxy(this, id, {uri: plugin_uri, class_name: class_name}); }, /** * @method * @param */ callObjectMethod: function(objectid, api_data, method_name, params, callback) { params = params || []; var self = this; var args = JSON.stringify(params.map ( function (param) { return self._transformCallbacksToIds(param); })); this._sendToBackend( JSON.stringify({target: "ubuntu-webapps-binding-call-object-method", objectid: objectid, name: method_name, api_uri: api_data.uri, class_name: api_data.class_name, args: args, callback: callback ? this._transformCallbacksToIds(callback) : null})); }, /** * @internal */ _generateProxyIdFor: function(uri, object_name) { var candidate = uri + object_name + this._last_proxy_id; while (this._proxies[candidate] != undefined) { ++this._last_proxy_id; candidate = uri + object_name + this._last_proxy_id; } return candidate; }, /** * @internal */ _startMessagePump: function() { var self = this; this._backendMessagingProxy.addMessageHandler(function (message) { if (isUbuntuBindingCallbackCall (message)) { try { self._dispatchCallbackCall (message.id, message.args); } catch(e) { console.log('Error while dispatching callback call: ' + e) } } }); }, /** * \internal * */ _makeWebpageCallback: function (callbackid) { var self = this; return function () { var callback_args = Array.prototype.slice.call(arguments); callback_args = callback_args.map (function (arg) { return self._transformCallbacksToIds(arg); }); var message = formatUnityWebappsCallbackCall(callbackid, JSON.stringify(callback_args)); self._sendToBackend(JSON.stringify(message)); }; }, /** * \internal * * Wraps callback ids in proper callback that dispatch to the * webpage thru a proper event * */ _wrapCallbackIds: function (obj) { if ( ! obj) return obj; if ( ! isIterableObject(obj)) { return obj; } if (obj && obj.hasOwnProperty('callbackid') && obj.callbackid !== null) { return this._makeWebpageCallback (obj.callbackid); } var ret = (obj instanceof Array) ? [] : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { if (UnityWebAppsUtils.isIterableObject (obj[key])) { if (obj[key].callbackid != null) { ret[key] = this._makeWebpageCallback (obj[key].callbackid); } else { ret[key] = this._wrapCallbackIds (obj[key]); } } else { ret[key] = obj[key]; } } } return ret; }, /** * @internal */ _dispatchCallbackCall: function(id, args) { if (! id || ! args) return; var cbfunc = this._callbackManager.get(id); if (!cbfunc || !(cbfunc instanceof Function)) { try { console.log('Invalid callback id: ' + id); } catch (e) {} return; } // actual callback call var targs = this._translateArgs(args); cbfunc.apply(null, targs); }, /** * @internal */ _translateArgs: function(args) { var _args = args || []; var self = this; _args = _args.map(function(arg) { if (isUbuntuBindingObjectProxy(arg)) { var narg = self._wrapObjectProxy(arg.apiid, arg.objecttype, arg.objectid, arg.content); return narg; } else if (arg instanceof Array) { return self._translateArgs(arg); } else if (arg && arg.hasOwnProperty('callbackid') && arg.callbackid !== null) { return self._makeWebpageCallback (arg.callbackid); } return arg; }); return _args; }, /** * @internal */ _wrapObjectProxy: function(apiId, objectType, objectId, content) { if (this._bindingApi && this._bindingApi[apiId] != null) { var wrapper = this._bindingApi[apiId] .createObjectWrapper(objectType, objectId, content); return wrapper; } return null; }, /** * @internal */ _sendToBackend: function(data) { this._backendMessagingProxy.postMessage(data); }, /** * @internal */ _transformToIdIfNecessary: function(obj) { var ret = obj; if (obj instanceof Function) { var id = this._callbackManager.store(obj); ret = {callbackid: id}; } return ret; }, /** * @internal */ _transformCallbacksToIds: function(obj) { var self = this; if ( ! isIterableObject(obj)) { return self._transformToIdIfNecessary (obj); } var ret = (obj instanceof Array) ? [] : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { if (obj[key] instanceof Function) { var id = self._callbackManager.store(obj[key]); ret[key] = {callbackid: id}; } else if (isIterableObject (obj[key])) { ret[key] = self._transformCallbacksToIds (obj[key]); } else { ret[key] = obj[key]; } } } // for (var key return ret; }, }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/api-sanitizer.js0000644000015600001650000001043012645740734031005 0ustar pbuserpbgroup00000000000000function checkString(str, allowUndef) { if (allowUndef && str == undefined) { return; } if (!str || typeof(str) !== 'string') { throw new TypeError("incorrect argument"); } } function stringify(obj) { if (obj === undefined) return obj; if (obj === null) return obj; if (typeof(obj) == 'string') return obj; if (typeof(obj) == 'number') return obj; if (typeof(obj) == 'function') return String(obj); var dump = {}; for (var i in obj) { if (obj.hasOwnProperty(i)) dump[i] = stringify(obj[i]); } return dump; }; function stringifyArgs(obj) { var args = []; for (var i = 0; i < obj.length; i++) { args.push(stringify(obj[i])); } var res = JSON.stringify(args); return res.substr(1, res.length - 2); }; function createArgumentsSanitizer(backend, argsDesc, function_name) { var callback = function() { var args = []; args.push(function_name); args.push([].slice.call(arguments)); backend.call.apply(backend, args); }; return function () { var realArgs = arguments; var k = 0; function argumentSanitizer(desc, arg) { if (!desc) { throw new Error("argument description is null"); } if (desc.dummy) { k--; return null; } if (desc.array) { if (!(desc.array instanceof Object) || !(desc.array.element instanceof Object)) { throw new Error("invalid argument description"); } try { for (var j = 0; j < arg.length; j++) { argumentSanitizer(desc.array.element, arg[j]); } } catch (x) { throw new TypeError("incorrect argument"); } return arg; } if (desc.obj) { if (!(desc.obj instanceof Object)) { throw new InternalError("invalid argument description"); } var res = {}, i; for (i in desc.obj) { if (desc.obj.hasOwnProperty(i)) { res[i] = argumentSanitizer(desc.obj[i], arg[i]); } } return res; } if (desc.str) { if (desc.allowNull && !arg) { return null; } checkString(arg, false); return arg; } if (desc.number) { if (typeof(arg) !== 'number' && typeof(arg) !== 'boolean') throw new TypeError("incorrect argument"); return arg; } if (!desc.type) { throw new Error("argument description miss required parameter"); } if ((arg instanceof desc.type) || (desc.type === Function && ((typeof arg) === 'function')) || (arg === null && desc.allowNull)) { if (desc.type === Function) { if (!arg) { return null; } var id; if (desc.argAsCallbackId !== undefined) { id = realArgs[desc.argAsCallbackId]; } return function (user_data) { arg(user_data); }; } return arg; } else { throw new TypeError("incorrect argument"); } throw new Error("unreacheable"); } var args = [], i; for (i = 0; i < argsDesc.length; i++) { if (k >= realArgs.length && k > 0 && !argsDesc[i].dummy) { throw new Error("not enough arguments"); } var value = argumentSanitizer(argsDesc[i], realArgs[k]); k++; if (argsDesc[i].obj) { args = args.concat(value); } else { args.push(value); } } if (k < realArgs.length) { throw new Error("too much arguments"); } callback.apply(null, args); return null; }; }; ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/unity-backend-messaging-proxy.jsunity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/unity-backend-messaging-proxy0000644000015600001650000000246212645740734033510 0ustar pbuserpbgroup00000000000000function createMessagingProxyForCurrentWebRuntime() { if (navigator && navigator.qt && navigator.qt.postMessage) { return new UnityQtWebkitBackendMessagingProxy(); } else if (oxide) { return new UnityOxideBackendMessagingProxy(); } return null; } function UnityOxideBackendMessagingProxy() { } UnityOxideBackendMessagingProxy.prototype = { postMessage: function(content) { // a little bit of a dup from whats in UnityWebAppsUtils.js var message = JSON.parse(content); oxide.sendMessage("UnityWebappApi-Message", message) }, addMessageHandler: function(callback) { // a little bit of a dup from whats in UnityWebAppsUtils.js oxide.addMessageHandler("UnityWebappApi-Host-Message", function(content) { callback(content.args); }); }, }; function UnityQtWebkitBackendMessagingProxy() { } UnityQtWebkitBackendMessagingProxy.prototype = { postMessage: function(content) { navigator.qt.postMessage(content); }, addMessageHandler: function(callback) { if (callback && typeof callback === 'function') navigator.qt.onmessage = function(message) { var content = JSON.parse(message.data); callback(content); }; }, }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/common/js/unity-binding-proxy.js0000644000015600001650000000070212645740734032166 0ustar pbuserpbgroup00000000000000function UnityBindingProxy(backend, id, api_data) { this._backend = backend; this._id = id; this._api_data = api_data; } UnityBindingProxy.prototype = { call: function(method_name, params, callback) { this._backend.callObjectMethod( this._id, this._api_data, method_name, params, callback); }, id: function(name, params) { return this._id; }, }; unity-webapps-qml-0.1+16.04.20160114/src/Ubuntu/UnityWebApps/qmldir.in0000644000015600001650000000021112645740734025600 0ustar pbuserpbgroup00000000000000module $${API_URI} plugin $${TARGET} $${TARGET}Js 0.1 $${TARGET}.js $${TARGET}Utils 0.1 $${TARGET}Utils.js $${TARGET} 0.1 $${TARGET}.qml unity-webapps-qml-0.1+16.04.20160114/src/src.pro0000644000015600001650000000014712645740734021425 0ustar pbuserpbgroup00000000000000include(../common-project-config.pri) include(../common-vars.pri) TEMPLATE = subdirs SUBDIRS = Ubuntu unity-webapps-qml-0.1+16.04.20160114/common-installs-config.pri0000644000015600001650000000415412645740734024425 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common installation configuration for all projects. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # setup the installation prefix #----------------------------------------------------------------------------- INSTALL_PREFIX = /usr # default installation prefix # default prefix can be overriden by defining PREFIX when running qmake isEmpty( PREFIX ) { message("====") message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'") message("==== (current installation path is `$${INSTALL_PREFIX}')") } else { INSTALL_PREFIX = $${PREFIX} message("====") message("==== install prefix set to `$${INSTALL_PREFIX}'") } #----------------------------------------------------------------------------- # default installation target for applications #----------------------------------------------------------------------------- contains( TEMPLATE, app ) { target.path = $${INSTALL_PREFIX}/bin INSTALLS += target message("====") message("==== INSTALLS += target") } #----------------------------------------------------------------------------- # default installation target for libraries #----------------------------------------------------------------------------- contains( TEMPLATE, lib ) { target.path = $${INSTALL_PREFIX}/lib INSTALLS += target message("====") message("==== INSTALLS += target") } #----------------------------------------------------------------------------- # target for header files #----------------------------------------------------------------------------- !isEmpty( headers.files ) { headers.path = $${INSTALL_PREFIX}/include/$${TARGET} INSTALLS += headers message("====") message("==== INSTALLS += headers") } else { message("====") message("==== NOTE: Remember to add your API headers into `headers.files' for installation!") } # End of File OTHER_FILES += \ ../../src/Ubuntu/UnityWebApps/Settings.qml unity-webapps-qml-0.1+16.04.20160114/README0000644000015600001650000000237312645740734020210 0ustar pbuserpbgroup00000000000000unity-webapps-qml offers a QML component that depending on runtime settings and configurations: - allows one to inject the UbuntuTouch Javascript platform bindings, - allows one to inject a restricted set of API bindings when running as a webapp (see http://developer.ubuntu.com/publish/webapp/packaging-web-apps/), - allows one to load local javscript snipets that are to be dynamically injected in the webview as part of a webapp, The QML component supports Oxide and QtWebkit as a web engine backend. = Building = The build system uses qmake. To compile, simply invoke qmake and then make: $ qmake . $ make = Running = Some examples are being provided in the examples/ folder. Examples range from webapp definitions, to api bindings, etc. = Unit tests = To run the unit tests, you can use the commands below: $ make test = Automated UI tests = The unity-webapps-qml component uses autopilot (https://launchpad.net/autopilot) to test its internal sub-componenets. To run the tests, you will need to install python3-autopilot and libautopilot-qt. Then do the following: $ cd tests/autopilot/ $ autopilot3 run unity_webapps_qml You can get a list of all available tests with the following command: $ autopilot3 list unity_webapps_qml unity-webapps-qml-0.1+16.04.20160114/tools/0000755000015600001650000000000012645741276020465 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tools/js-idl/0000755000015600001650000000000012645741276021647 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tools/js-idl/README0000644000015600001650000000007312645740734022525 0ustar pbuserpbgroup00000000000000- requires nodejs - install WebIDL2: npm install webidl2 unity-webapps-qml-0.1+16.04.20160114/tools/js-idl/unity-webapps.idl0000644000015600001650000000464312645740734025155 0ustar pbuserpbgroup00000000000000dictionary UnityIndicatorProperties { Integer count; Date time; String iconURI; Callback onIndicatorActivated; }; interface UnityMessagingIndicatorInterface { method showIndicator (String name, optional UnityIndicatorProperties indicatorProperties); method clearIndicator (String name); method clearIndicators (); method addAction (String name, Callback onActionInvoked); method removeAction (String name); method removeActions (String name); method onPresenceChanged (Callback onPresenceChanged); readonly attribute String presence; }; interface UnityLauncherInterface { method setCount (Integer count); method clearCount (); method setProgress (Number progress); method clearProgress (); method setUrgent (Boolean urgnet); method addAction (String name, Callback onActionInvoked); method removeAction (String name); method removeActions (); }; interface UnityNotificationInterface { method showNotification (String summary, String body, optional String iconUrl); }; enum UnityPlaybackState { "Playing", "Paused" }; dictionary UnityTrackMetadata { String title; String? album; String? artist; String? artLocation; }; interface UnityMediaPlayerInterface { method setTrack (UnityTrackMetadata trackMetadata); method onPrevious (Callback onPreviousCallback); method onNext (Callback onNextCallback); method onPlayPause (Callback onPlayPauseCallback); method onPrevious (Callback onPreviousCallback); method onNext (Callback onNextCallback); method onPlayPause (Callback onPlayPauseCallback); method getPlaybackstate (Callback response); method setPlaybackstate (UnityPlaybackState state); method setCanGoNext (boolean cangonext); method setCanGoPrev (boolean cangoprev); method setCanPlay (boolean canplay); method setCanPause (boolean canpause); }; dictionary UnityInitParameters { String name; String iconUrl; Callback onInit; String? homepage; String? domain; }; interface Unity { method init (UnityInitParameters initializationParameters); method addAction (String actionName, Callback onActionInvoked); method removeAction (String actionName); method removeActions (); attribute UnityNotificationInterface Notification; attribute UnityMessagingIndicatorInterface MessagingIndicator; attribute UnityMediaPlayerInterface MediaPlayer; attribute UnityLauncherInterface Launcher; }; unity-webapps-qml-0.1+16.04.20160114/tools/js-idl/gen-api-from-idl.js0000755000015600001650000000345612645740734025245 0ustar pbuserpbgroup00000000000000#!/usr/bin/nodejs var WebIDL2 = require("webidl2"); var fs = require('fs'); if (process.argv.length < 3) { console.log('Invalid number of args'); process.exit(1); } var IDL_FILE = process.argv[2]; var _defs = {}; var processInterfaceDefinition = function(interfaceAst) { var name = interfaceAst.name; console.log('Interface "' + name + '"'); _defs.interfaces = _defs.interfaces || []; var iface = {name: name, members: { attributes: [], methods: [] }}; for (var i = 0; i < interfaceAst.members.length; ++i) { var member = interfaceAst.members[i]; console.log("\t" + member.name); console.log("\t\t" + member.type); if (member.type === 'operation') { var method = {name: member.name, args: []}; for (var j = 0; j < member.arguments.length; ++j) { console.log("\t\t\t" + member.arguments[j].name + ':' + member.arguments[j].idlType.idlType); method.args.push({name: member.arguments[j].name}); } iface.members.methods.push(method); } else { iface.members.attributes.push({name: member.name, type: member.idlType.idlType}); } }; _defs.interfaces.push(iface); } var generateUnityBindings = function(defs) { var unityif = defs.interfaces.filter(function (ifc) { return ifc.name === 'Unity'; }); if (!unityif.length) { console.log('Could not generate bindings'); return; } }; var processIdlFile = function (data) { var ast = WebIDL2.parse(data); for (var i = 0; i < ast.length; ++i) { console.log(ast[i].type); if (ast[i].type === "interface") { processInterfaceDefinition(ast[i]); } } generateUnityBindings(_defs); }; fs.readFile(IDL_FILE, 'utf8', function (err, data) { if (err) { console.log('Error while opening IDL file: ' + err); process.exit(1); } processIdlFile(data); }); unity-webapps-qml-0.1+16.04.20160114/tools/inject-js-utils.py0000755000015600001650000000133612645740734024067 0ustar pbuserpbgroup00000000000000#!/usr/bin/env python import os import sys import re if len(sys.argv) < 3: print "Usage: FILE_TO_INSPECT OUT_FILENAME" sys.exit(1) FILE_TO_INSPECT=sys.argv[1] OUT_FILE=sys.argv[2] #read and parse content = open(FILE_TO_INSPECT).read() include_re = re.compile('\s*//@include\s+(.*)') includes = re.findall(include_re, content) injected_includes = {} for include in includes: try: injected_includes[include] = open(include).read().replace('.pragma library', '') except: print "Could not find file: ", include sys.exit(1) for include in includes: content = content.replace('//@include ' + include, injected_includes[include]) open(OUT_FILE, "w+").write(content) print OUT_FILE unity-webapps-qml-0.1+16.04.20160114/tools/tools.pro0000644000015600001650000000012512645740734022343 0ustar pbuserpbgroup00000000000000TEMPLATE=subdirs SUBDIRS = qml-launcher OTHER_FILES = \ $$system(ls ./js-idl/*) unity-webapps-qml-0.1+16.04.20160114/tools/qml-launcher/0000755000015600001650000000000012645741276023055 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/tools/qml-launcher/qml-launcher.pro0000644000015600001650000000065212645740734026170 0ustar pbuserpbgroup00000000000000include(../../common-project-config.pri) include(../../common-vars.pri) TEMPLATE = app TARGET = unity-webapps-qml-launcher CONFIG += \ debug QT += \ core \ qml \ testlib \ quick SOURCES += \ qml-launcher.cpp include(../../common-installs-config.pri) desktop_files_installs.files = $$system(ls ./*.desktop) desktop_files_installs.path = /usr/share/applications INSTALLS += desktop_files_installs unity-webapps-qml-0.1+16.04.20160114/tools/qml-launcher/qml-launcher.cpp0000644000015600001650000001352012645740734026150 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * unity-webapps-qml is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include namespace { void loadQtTestability(const QStringList & arguments) { // The testability driver is only loaded by QApplication but not by QGuiApplication. // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own. if (arguments.contains(QLatin1String("-testability"))) { QLibrary testLib(QLatin1String("qttestability")); if (testLib.load()) { typedef void (*TasInitialize)(void); TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); if (initFunction) { initFunction(); } else { qCritical("Library qttestability resolve failed!"); } } else { qCritical("Library qttestability load failed!"); } } } } // namespace int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); if (!app.arguments().count()) { qDebug() << "Invalid inputs args"; return EXIT_FAILURE; } loadQtTestability(app.arguments()); const QString QML_MAXIMIZED_ARG = "--maximized"; const QString QML_FILE_ARG_HEADER = "--qml="; const QString QML_FILE_IMPORT_ARG_HEADER = "--import="; const QString QML_APP_ID_ARG_HEADER = "--app-id="; const QString QML_INSPECTOR_ARG_HEADER = "--inspector="; const QString ARG_HEADER = "--"; const QString VALUE_HEADER = "="; QHash properties; QString qmlfile; QString appid; QString importPath; QString inspector; bool maximized = false; Q_FOREACH(QString argument, app.arguments()) { if (argument.contains(QML_FILE_ARG_HEADER)) { qmlfile = argument.right(argument.count() - QML_FILE_ARG_HEADER.count()); } else if (argument.contains(QML_FILE_IMPORT_ARG_HEADER)) { importPath = argument.right(argument.count() - QML_FILE_IMPORT_ARG_HEADER.count()); } else if (argument.contains(QML_APP_ID_ARG_HEADER)) { appid = argument.right(argument.count() - QML_APP_ID_ARG_HEADER.count()); } else if (argument.contains(QML_INSPECTOR_ARG_HEADER)) { inspector = argument.right(argument.count() - QML_INSPECTOR_ARG_HEADER.count()); } else if (argument.contains(QML_MAXIMIZED_ARG)) { maximized = true; } else if (argument.startsWith(ARG_HEADER) && argument.right(argument.count() - ARG_HEADER.count()).contains("=")) { QString property = argument.right(argument.count() - ARG_HEADER.count()); property = property.left(property.indexOf(VALUE_HEADER)); QString value = argument.right(argument.count() - argument.indexOf(VALUE_HEADER) - 1); qDebug() << "Adding property:" << property << "," << "value:" << value; properties.insert(property, value); } else { qDebug() << "Ignoring argument:" << argument; } } if (qmlfile.isEmpty()) { qDebug() << "No (or empty) QML file specified"; return EXIT_FAILURE; } if (!qmlfile.endsWith(".qml")) { qDebug() << "Invalid QML file name"; return EXIT_FAILURE; } QFileInfo f(qmlfile); if (!f.exists() || !f.isFile()) { qDebug() << "QML file not found or not a file:" << qmlfile; return EXIT_FAILURE; } if ( ! importPath.isEmpty()) { qDebug() << "Setting import path to:" << importPath; qputenv("QML2_IMPORT_PATH", importPath.toLatin1()); } if ( ! appid.isEmpty()) { qputenv("APP_ID", appid.toLatin1()); QCoreApplication::setApplicationName(appid.toLatin1()); qDebug() << "Using:" << appid.toLatin1(); } if ( ! inspector.isEmpty()) { qDebug() << "Inspector server being set to:" << inspector; qputenv("QTWEBKIT_INSPECTOR_SERVER", inspector.toLatin1()); } QQmlEngine engine; QQmlContext *context = new QQmlContext(engine.rootContext()); QQmlComponent component(&engine, qmlfile); QObject *object = component.beginCreate(context); if (!component.isReady()) { qWarning() << component.errorString(); return -1; } if ( ! object) { qCritical() << "Cannot create object from qml base file"; return -1; } QQuickWindow* window = qobject_cast(object); QHash::iterator it; for(it = properties.begin(); properties.end() != it; ++it) { object->setProperty(it.key().toStdString().c_str(), QUrl(it.value())); } component.completeCreate(); if (window) { if (maximized) window->showMaximized(); else window->show(); } return app.exec(); } unity-webapps-qml-0.1+16.04.20160114/tools/qml-launcher/unitywebappsqmllauncher.desktop0000644000015600001650000000026312645740734031435 0ustar pbuserpbgroup00000000000000[Desktop Entry] Type=Application Terminal=false Exec=/usr/bin/unity-webapps-qml-launcher $@ Name=Unity Webapps QML Test Launcher Icon=qmlscene NoDisplay=true X-Ubuntu-Touch=true unity-webapps-qml-0.1+16.04.20160114/common-project-config.pri0000644000015600001650000000063612645740734024243 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common configuration for all projects. #----------------------------------------------------------------------------- # we don't like warnings... QMAKE_CXXFLAGS += -Werror -Wno-write-strings # Disable RTTI QMAKE_CXXFLAGS += -fno-rtti TOP_SRC_DIR = $$PWD TOP_BUILD_DIR = $${TOP_SRC_DIR}/$${BUILD_DIR} include(coverage.pri) unity-webapps-qml-0.1+16.04.20160114/COPYING0000644000015600001650000010451312645740734020362 0ustar pbuserpbgroup00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . unity-webapps-qml-0.1+16.04.20160114/webapps-qml.pro0000644000015600001650000000100012645740734022264 0ustar pbuserpbgroup00000000000000include(common-vars.pri) include(common-project-config.pri) include(docs/docs.pri ) TEMPLATE = subdirs CONFIG += ordered SUBDIRS = \ src \ tests \ examples \ tools include(common-installs-config.pri) DISTNAME = $${PROJECT_NAME}-$${PROJECT_VERSION} EXCLUDES = \ --exclude-vcs \ --exclude-from .bzrignore --exclude=$${DISTNAME}.tar.bz2 dist.commands = "tar -cvjf $${DISTNAME}.tar.bz2 $$EXCLUDES --transform='s,^,$$DISTNAME/,' *" dist.depends = distclean QMAKE_EXTRA_TARGETS += dist unity-webapps-qml-0.1+16.04.20160114/update-docs0000755000015600001650000000033112645740734021456 0ustar pbuserpbgroup00000000000000#!/bin/sh if [ ! $(which yuidoc) ]; then echo "Please install yuidocjs: sudo apt-get install npm nodejs-legacy && sudo npm -g install yuidocjs" exit 1 fi cd ./src/Ubuntu/UnityWebApps/bindings && ./yuidoc-build.sh unity-webapps-qml-0.1+16.04.20160114/coverage.pri0000644000015600001650000000355512645740734021642 0ustar pbuserpbgroup00000000000000# Coverage CONFIG(coverage) { OBJECTS_DIR = MOC_DIR = TOP_SRC_DIR = $$PWD LIBS += -lgcov QMAKE_CXXFLAGS += --coverage QMAKE_LDFLAGS += --coverage QMAKE_EXTRA_TARGETS += coverage cov QMAKE_EXTRA_TARGETS += clean-gcno clean-gcda coverage-html \ generate-coverage-html clean-coverage-html coverage-gcovr \ generate-gcovr generate-coverage-gcovr clean-coverage-gcovr clean-gcno.commands = \ "@echo Removing old coverage instrumentation"; \ "find -name '*.gcno' -print | xargs -r rm" clean-gcda.commands = \ "@echo Removing old coverage results"; \ "find -name '*.gcda' -print | xargs -r rm" coverage-html.depends = clean-gcda check generate-coverage-html generate-coverage-html.commands = \ "@echo Collecting coverage data"; \ "lcov --directory $${TOP_SRC_DIR} --capture --output-file coverage.info --no-checksum --compat-libtool"; \ "lcov --extract coverage.info \"*/src/*.cpp\" -o coverage.info"; \ "lcov --remove coverage.info \"moc_*.cpp\" -o coverage.info"; \ "LANG=C genhtml --prefix $${TOP_SRC_DIR} --output-directory coverage-html --title \"Code Coverage\" --legend --show-details coverage.info" clean-coverage-html.depends = clean-gcda clean-coverage-html.commands = \ "lcov --directory $${TOP_SRC_DIR} -z"; \ "rm -rf coverage.info coverage-html" coverage-gcovr.depends = clean-gcda check generate-coverage-gcovr generate-coverage-gcovr.commands = \ "@echo Generating coverage GCOVR report"; \ "gcovr -x -r $${TOP_SRC_DIR} -o $${TOP_SRC_DIR}/coverage.xml -e \".*/moc_.*\" -e \"tests/.*\" -e \".*\\.h\"" clean-coverage-gcovr.depends = clean-gcda clean-coverage-gcovr.commands = \ "rm -rf $${TOP_SRC_DIR}/coverage.xml" QMAKE_CLEAN += *.gcda *.gcno coverage.info coverage.xml } unity-webapps-qml-0.1+16.04.20160114/examples/0000755000015600001650000000000012645741276021143 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/basic-webview/0000755000015600001650000000000012645741276023672 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/basic-webview/main.qml0000644000015600001650000000137512645740734025335 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import QtQuick.Window 2.0 import com.canonical.Oxide 1.0 import Ubuntu.UnityWebApps 0.1 Window { width: 640 height: 640 WebView { id: webView // test url url: "file:///usr/share/unity-webapps-qml/examples/data/html/big-test.html" anchors.fill: parent context: WebContext { } function getUnityWebappsProxies() { var proxies = UnityWebAppsUtils.makeProxiesForWebViewBindee(webView); // override the default navigate to request proxies.navigateTo = function(url) {}; return proxies; } } UnityWebApps { id: webapps name: "BBCNews" bindee: webView model: UnityWebappsAppModel { } } } unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-qml-bbcnews-example.desktop0000644000015600001650000000063412645740734031207 0ustar pbuserpbgroup00000000000000[Desktop Entry] Name=BBCNewsWebappsQMLExample Type=Application Exec=/usr/bin/unity-webapps-qml-launcher --qml=/usr/share/unity-webapps-qml/examples/unity-webapps-example-bbcnews/main.qml --app-id=unity-webapps-qml-bbcnews-example Path=/usr/share/unity-webapps-qml/examples/unity-webapps-example-bbcnews GenericName=Unity WebApp QML Component for Ubuntu Example using BBCNews binding Icon=qmlscene Terminal=false unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-qml-basic-example.desktop0000644000015600001650000000052312645740734030642 0ustar pbuserpbgroup00000000000000[Desktop Entry] Type=Application Exec=qmlscene /usr/share/unity-webapps-qml/examples/basic-webview/main.qml Path=/usr/share/unity-webapps-qml/examples/basic-webview Name=Unity WebApp QML Comonent - Basic API Showcase App GenericName=Unity WebApp QML Comonent for Ubuntu Basic API Showcase App Icon=drive-multidisk-symbolicx Terminal=false unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-example-facebookmessenger/0000755000015600001650000000000012645741276031063 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-example-facebookmessenger/main.qml0000644000015600001650000000246512645740734032527 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * webbrowser-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Window 2.0 import com.canonical.Oxide 1.0 import Ubuntu.UnityWebApps 0.1 Window { width: 640 height: 640 WebView { id: webView anchors.fill: parent width: parent.width height: parent.height context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webView); } } UnityWebApps { id: webapps name: "FacebookMessenger" bindee: webView model: UnityWebappsAppModel { searchPath: '/usr/share/unity-webapps-qml/examples/data/userscripts'} } } unity-webapps-qml-0.1+16.04.20160114/examples/data/0000755000015600001650000000000012645741276022054 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/html/0000755000015600001650000000000012645741276023020 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/html/big-test.html0000644000015600001650000001750712645740734025434 0ustar pbuserpbgroup00000000000000 Unity Web API Tests
    Back

    Unity Web Launcher Actions (Quicklist) Tests

    Add Actions (and Listen for Callbacks)

    Active Test Quicklist Entries from the Launcher (1 and 2)

    Back

    Unity Launcher Web API Tests

    To use the Launcher tests you will first have to add the desktop file for the test application to the launcher! The easiest way to do this is to drag it from your user applications directly, likely ~/.local/share/applications

    Clear Launcher Properties

    Back

    Unity Web Music Player Callback Tests

    Listen for Callbacks

    Activate Test Music Player Callbacks from the Sound Menu

    Back

    Unity Web Indicator Callback Tests

    Add Indicators (with Callbacks)

    Activate Indicator with Callback 1 and 2 from the Messaging Indicator

    Indicator Callback 1: Waiting

    Indicator Callback 2: Waiting

    Back

    Unity Web Indicator Action Callback Tests

    Add Actions (with Callbacks)

    Activate Actions with Callback 1 and 2 from the Messaging Indicator

    Action Callback 1: Waiting

    Action Callback 2: Waiting

    Back

    Unity Web Notification API Tests

    unity-webapps-qml-0.1+16.04.20160114/examples/data/html/big-test.js0000644000015600001650000002132512645740734025075 0ustar pbuserpbgroup00000000000000var Unity = external.getUnityObject('1.0'); var data_uri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sKBw0vIqzujI4AAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAGhklEQVRo3t2bT0gbeRTHv/MnMRl3XAoNC81hipeOs0cTTyUFpbsbwZquWHpJKHRprYUKXiK4Pe2G6qXQlka3bEFiD7KSVldoKksKHXpK4nHH9FIa2AjdLJQ1NZpkMtmDras1ycykxiS+o87vl/nMe/N+3/fm9yOKxSJqZG0ATiupZKeSWhMKq5F2ACcAHAPQCkABsAngHcXxa2DaXtOCXQKwAuAlgPVa3BRxwMCckkoOyrFwn7zy3FF4E0cxk9Y1AcXxoIQu0B02kbb1LAGYB5BoKOBiJt2bf/HkSl5c7C8k4gfnDYYFbeuB0elepDj+AYCndQUuZtK9uVDAmwvNOvR6Uq/Rgh3G76+LtGCf/BzwaoG5XCgwkQ36L9YatBS46apvjrRYx6oJdd3AhUT88tb0+J1CIt6KOhnBsDA63RstA9dHADysGXBeXPBvTo9fQ4MYLdhhHr03RTDs8EEDt21Oj/+WFxe+RYMZabHCPHp3meL4C1qWMlXgYib91VZg4ve8uNCFBjWCYcHcnIlQHH8OwNvPAW7L/HzpD1mKNixsCeizlTxdEXhzevyZnjA2OFww2LpBCV0gGBYAoKSSkGNh5J49gpJKVhxH23p2J0cUpEjFcWWglymO/043cDZ4358N+jUlKIrjYRrygeL4itdlg/eRDfp1jStm0sgG/ciFAprf6dZbwbKJrCSwHAtfzty+8atWWObmzI5HNWR6bE6PVz1Oa/Zmfpz5odSStQ+4mElz72+c/bOYSbdqCaHWW0GQFquu9y0XCsBw5rxm2I+2NTup2dMmt3fD6PR8/ak4IUu8txNaYAHA6HTrht0e59ENCwAtA8Oax2WD/lYllZzYF/J7QlmK9sqx8EU9N37Ymdhw5rxWnY+t2cmLAHrLAuce3/fqUTnVeOmz1VVnt+Zr5VgYshT1lgSWpWivLEUdmhUO11EnZXVCX754fN+x28vkrn9c0RdeX9RNSuoxWYpCSSWv7AFWUklOlqL9uqqm1WhdgGVJ/+9mg/5+ANwOsBwLD+qdpPAmXhdgJbGq/yHFwgAwuAOcFxf7quh2fJzoUC337BGqvNc+ACAKf//V9n7km3/1ZGeDwwWqw17VGnxQYS2vPEf+xRPNTUKj0wOT2/slXViNnta6BppH74EW7A1R+NOCHS0Dw9gKTCAvLqi/glIEAE7ThcSrTo2CvC7rrqoThnw7WlulNQUAnaSSWBXUJjaP3m042D33N+TbU1pWgBZIJbXWrqZf1cq+RoFWc0pxI91OKqnkCbWivhnsY9O+snaInCCx/a2nbK1br0xcjRlsqjr7GAnAXPapNREsAIBpU4188iB1azMYie1Plgcm4xrcNkkA7xpNL9dQZ78jAaxV0qBaVEyjmJrOJi3WNZIW7K9VSqvmgA0FVPvXxHHra5I4bpUqhkkqqbk9Wi8rJOKaHEOd5CWS4k6tqF2opydcD9jMT5dUqyaCYUEw7ApNCV0vtUycFxdQWI3C5PZq0q01T1CpJLJBv+YcQwldAPCSpjh+nWBYsZhJO7T8SOb2DRAMC+okD6rDXgfQNSiJOPTuJTHYukUA6zQA0Laepby4oLljWcykt4twKYpmMarDvrTT4jHYuudxhI0W7CAt1vkdYNrWkyAt1sWjCmxwuBbx4RsT+f8f+x8cRViCYWFwuB7s1tIAAKPT85RgWPGoARudbhG79nWRu5+E0emePGreNTo9k59WS9jtZdJinTsqwCbP2BzBsE/LAhMMC5PbOwZg4whk5g2DwzVWqh7ee6GtJ2FwuEaaPZRNV30jKLE1kSwTCg8pjp9qVmDzkG+KtFgflut4lH5CQ75hgmGXmy8re5ZpW89wpRZPaSm2vcvmAsGwkSYSGBGT23uhYhOgov7k+HXm5sy5ZoA2OFwR85DvHFT2W5Kqopvj3zI3Z842cngbHK5l85DvLFT2WQI6tg8XEnFsTY/7C4n4tUaCNbm9U0an58C3D++Uhdmg/3IuFLiD7ZMpdTPSYt0wj94doTi+dhvEP5osRbmtX8YnlFTyYj1gjU7PXMvA8BjBsLU/ArDb27lQoDcXmvVq6ZYckHoSW9xjkxTHH/ohj33geXHxipJK9tcoKS0aHK4HtGCv7zGefaEeC3P52PNBORbu+1yv04JdpDu7lwxnzs9XE7qHAvxJVm8rSJHThcSrzuI/SUFJrbV/+Ba97ygeLdjXwLS9prhTEsXxK5TQ9ZJg2JocxfsPlPjVREHRwK4AAAAASUVORK5CYII="; var icon_uri = "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_homepage/picto-server.png"; function addLauncherTests() { $("#launcherTest1Button").click(function (){ Unity.Launcher.setCount(7); }); $("#launcherTest2Button").click(function (){ Unity.Launcher.setProgress(0.3); }); $("#launcherTest3Button").click(function (){ Unity.Launcher.setUrgent(); }); $("#launcherClearButton").click(function (){ Unity.Launcher.clearCount(); Unity.Launcher.clearProgress(); }); $("#launcherRemoveActionsBulk").click(function(){ Unity.Launcher.removeActions(); }); $("#launcherRemoveAction").click(function(){ Unity.Launcher.removeAction("Test Action 1"); }); $("#launcherAddActionsButton").click(function(){ var makeLauncherCallback = function(label) { return function () { $("#launcherCallbackLog").html($("#launcherCallbackLog").html()+label+"
    "); } }; Unity.Launcher.addAction("Test Action 1", makeLauncherCallback("Test Action 1")); Unity.Launcher.addAction("Test Action 2", makeLauncherCallback("Test Action 2")); }); } function addNotificationTests(){ $("#notificationTest1Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a simple test notification", null); }); $("#notificationTest2Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a test notification with an image URL", "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_homepage/picto-desktop.png"); }); $("#notificationTest3Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a test notification with a data URI", data_uri); }); } function addMediaPlayerTests(){ $("#musicPlayerInitButton").click(function(){ Unity.MediaPlayer.init("Wha"); }); $("#musicPlayerTest1Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: null}); }); $("#musicPlayerTest2Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: icon_uri}); }); $("#musicPlayerTest3Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: data_uri}); }); $("#musicPlayerPlaybackStateButton").click(function(){ Unity.MusicPlayer.getPlaybackState( function (playbackstate) { Unity.MediaPlayer.setPlaybackState( ! playbackstate); } ); }); $("#musicPlayerAddCallbacksButton").click(function(){ Unity.MediaPlayer.onNext(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"
    Next"); }); Unity.MediaPlayer.onPrevious(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"
    Previous"); }); Unity.MediaPlayer.onPlayPause(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"
    Play/Pause"); }); }); } function addIndicatorTests() { $("#clearButton").click(function (){ Unity.MessagingIndicator.clearIndicator("Simple test indicator"); Unity.MessagingIndicator.clearIndicator("Indicator with Count"); Unity.MessagingIndicator.clearIndicator("Indicator with Time"); Unity.MessagingIndicator.clearIndicator("Indicator with Icon"); Unity.MessagingIndicator.clearIndicator("Indicator with Icon (Data URI)"); Unity.MessagingIndicator.clearIndicator("Indicator with Callback (1)"); Unity.MessagingIndicator.clearIndicator("Indicator with Callback (2)"); }); $("#indicatorTest1Button").click(function (){ Unity.MessagingIndicator.showIndicator("Simple test indicator"); }); $("#indicatorTest2Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Count", {count: "103"}); }); $("#indicatorTest3Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Time", {time: new Date()}); }); $("#indicatorTest4Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Icon", {icon: icon_uri}); }); $("#indicatorTest5Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Icon (Data URI)", {icon: data_uri}); }); $("#indicatorTest6Button").click(function(){ Unity.MessagingIndicator.addAction("Test action", function(){}); }); $("#indicatorCallbackAddButton").click(function(){ var callback1 = function() { $("#indicatorCallback1Label").text("Indicator Callback 1: Success"); } var callback2 = function() { $("#indicatorCallback2Label").text("Indicator Callback 2: Success"); } Unity.MessagingIndicator.showIndicator("Indicator with Callback (1)", callback1); Unity.MessagingIndicator.showIndicator("Indicator with Callback (2)", callback2); }); $("#indicatorActionCallbackAddButton").click(function(){ var callback1 = function() { $("#indicatorActionCallback1Label").text("Action Callback 1: Success"); } var callback2 = function() { $("#indicatorActionCallback2Label").text("Action Callback 2: Success"); } Unity.MessagingIndicator.addAction("Action with Callback (1)", callback1); Unity.MessagingIndicator.addAction("Action with Callback (2)", callback2); }); } function addHUDTest() { $("#HUDAddActions").click(function(){ function addAction(name) { Unity.addAction(name, function() { $("#indicatorActionCallback2Label").text(name); }); } addAction('/HUD/haveAniceDay'); addAction('/HUD/dontBeEvil'); addAction('/HUD/Bender/killAllHumans'); }); $("#HUDRemoveActions").click(function(){ Unity.clearActions(); }); } function initializeUnityAPI () { var name = "BigUnityWebTest"; var iconUrl = "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_business/pictograms-cloud.png"; function init() { addNotificationTests(); addIndicatorTests(); addMediaPlayerTests(); addLauncherTests(); addHUDTest(); } Unity.init ({ name: name, iconUrl: iconUrl, onInit: init }); } $().ready( function() { $("#initButton").click(initializeUnityAPI); }); unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/0000755000015600001650000000000012645741276024442 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-bbcnews/0000755000015600001650000000000012645741276030672 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-bbcnews/BBCNews.user.js0000644000015600001650000000256512645740734033436 0ustar pbuserpbgroup00000000000000// ==UserScript== // @include http://www.bbc.co.uk/news/ // @include http://www.bbc.com/news/ // @require utils.js // ==/UserScript== // This placeholder gets munged with real data at build time. const WebappsGettextDict = JSON.parse(unescape( "[]" )); window.Unity = external.getUnityObject('1.0'); function isCorrectPage() { var i, ids = ['tickerHolder']; for (i = 0; i < ids.length; i++) { if (!document.getElementById(ids[i])) { return false; } } return true; } function messagingIndicatorSetup() { if (!isCorrectPage()) { return; } var recent = document.getElementById('tickerHolder'); recent.addEventListener('DOMSubtreeModified', wrapCallback(function () { var title = null, node = document.evaluate('div/div/p/a', recent, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue; if (node) { title = node.textContent; } if (title && !localStorage.getItem(title)) { localStorage.setItem(title, true); Unity.Notification.showNotification("BBC", title, null); } }), false); } Unity.init({ name: "BBC News", domain: 'bbc.co.uk', homepage: 'http://www.bbc.co.uk/news/', iconUrl: "icon://unity-webapps-bbc", onInit: wrapCallback(messagingIndicatorSetup) }); unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-bbcnews/manifest.json0000644000015600001650000000064312645740734033374 0ustar pbuserpbgroup00000000000000{ "includes": ["http://www.bbc.co.uk/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": { }, "domain": "bbc.co.uk", "homepage": "http://www.bbc.co.uk/news/", "license": "GPL-3" } unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/common/0000755000015600001650000000000012645741276025732 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/common/utils.js0000644000015600001650000002247712645740734027442 0ustar pbuserpbgroup00000000000000// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- function _(strid) { var lang = unsafeWindow.navigator.language; lang = lang.toLowerCase().replace(/-/g, '_'); while (lang) { if (WebappsGettextDict.hasOwnProperty(lang) && WebappsGettextDict[lang].hasOwnProperty(strid)) { return WebappsGettextDict[lang][strid]; } lang = lang.substr(0, lang.lastIndexOf('_')); } console.log('Gettext _() failed to find translation.') return strid; } /** * WARNING: this is only kept here for backward compatibility reasons. * This needs to be as soon as the individual scripts are SRUed and * updated to use the latest mechanism */ var _previousIndicators = []; function showIndicators(list) { if (list.length == _previousIndicators.length) { var same = true; for (var i = 0; i < list.length; i++) { if (list[i].name != _previousIndicators[i].name) same = false; if (list[i].count != _previousIndicators[i].count) same = false; } if (same) return; } _previousIndicators = list; Unity.MessagingIndicator.clearIndicators(); for (var i = 0; i < list.length; i++) { Unity.MessagingIndicator.showIndicator(list[i].name, { count: list[i].count, callback: list[i].callback }); } } function trim(str) { return str.replace(/^\s+|\s+$/g, ""); } var KEY_NAME = '____unity_indicators_sync'; function Indicators(getCounters, combineFromMultipleTabs) { this._init(getCounters, combineFromMultipleTabs); } Indicators.prototype = { _prevIndicators: null, _getCountersCb: null, _init: function(getCounters, combineFromMultipleTabs) { this._last = {}; this._timestamp = new Date(); this._prevIndicators = []; this._getCountersCb = getCounters; this._combineFromMultipleTabs = combineFromMultipleTabs; window.addEventListener('blur', this._onBlur.bind(this)); window.addEventListener('focus', this._onFocus.bind(this)); setInterval(this._updateIndicators.bind(this), 8000); this._updateIndicators(true); }, _onBlur: function() { }, _onFocus: function() { this._timestamp = new Date(); this.visited(this._currentLabel); }, _updateTotal: function(total) { if (this._combineFromMultipleTabs) { return; } if (total) { Unity.Launcher.setCount(Number(total)); } else { Unity.Launcher.clearCount(); } }, _updateIndicators: function(firstRun) { var state = localStorage.getItem(KEY_NAME); var updateState = false; try { var list = this._getCountersCb(); } catch (e) { return; } if (state) { if (!this._combineFromMultipleTabs) { state = JSON.parse(state); if (state.timestamp > this._timestamp) { this._timestamp = state.timestamp; this._prevIndicators = state.prevIndicators; this._last = state.lastValue; } else { updateState = true; } } } else { updateState = true; } if (!firstRun && !this._forceUpdate && list.length == this._prevIndicators.length) { var same = true; for (var i = 0; i < list.length; i++) { if (list[i].name != this._prevIndicators[i].name) same = false; if (list[i].count != this._prevIndicators[i].count) same = false; } if (same) return; } this._forceUpdate = false; var total = 0; if (!this._combineFromMultipleTabs) { Unity.MessagingIndicator.clearIndicators(); } for (var i = 0; i < list.length; i++) { var count = 0; if (!this._last[list[i].name]) { this._last[list[i].name] = 0; } if (this._last[list[i].name]) { if (this._last[list[i].name] < Number(list[i].count)) { count = Number(list[i].count) - this._last[list[i].name]; } else { count = 0; } } else { this._last[list[i].name] = list[i].count; } if (!count) { if (this._combineFromMultipleTabs) { Unity.MessagingIndicator.clearIndicator(list[i].name); } continue; } total += count; if (!firstRun) { Unity.MessagingIndicator.showIndicator(list[i].name, { count: count, callback: list[i].callback }); } else { this._last[list[i].name] = Number(list[i].count); } } if (!firstRun) { this._updateTotal(total); } this._prevIndicators = list; try { if (updateState) { this._saveState(); } else { localStorage.setItem(KEY_NAME, JSON.stringify(state)); } } catch (e) { setTimeout((function () {this._updateIndicators(firstRun)}).bind(this), 500); } }, _saveState: function() { localStorage.setItem(KEY_NAME, JSON.stringify({ timestamp: new Date(), prevIndicators: this._prevIndicators, lastValue: this._last })); }, visited: function(labelName) { this._currentLabel = labelName; var count = 0; for (var i = 0; i < this._prevIndicators.length; i++) { if (this._prevIndicators[i].name == labelName) { count = this._prevIndicators[i].count; } } this._forceUpdate = true; this._last[labelName] = count; this._saveState(); this._updateIndicators(false); } }; /** * On Chrommium v18 (and maybe earlier versions) the click() function * does not seem to work on otherwise proper DOM elements (that are supposed * to support click() as per the spec), e.g. SPAN elements etc. */ function launchClickEvent(node) { var doclick = node.click ? node.click.bind(node) : function () { var e = unsafeWindow.document.createEvent('MouseEvents'); e.initMouseEvent("click", true, true, unsafeWindow, 1, 1, 1, 1, 1, false, false, false, false, 0, node); node.dispatchEvent(e); }; doclick(); } function click(node) { var event = unsafeWindow.document.createEvent("MouseEvents"); event.initMouseEvent("mousedown", true, true, unsafeWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null); node.dispatchEvent(event); event = unsafeWindow.document.createEvent("MouseEvents"); event.initMouseEvent("mouseup", true, true, unsafeWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null); node.dispatchEvent(event); } function evalInPageContext(func) { var script = document.createElement('script'); script.appendChild(document.createTextNode('(' + func + ')();')); (document.body || document.head || document.documentElement).appendChild(script); } function makeRedirector(link) { return function () { evalInPageContext('function() {window.location = "' + link + '";}'); }; } function wrapCallback(callback) { return function () { try { callback.apply(window, arguments); } catch (x) { console.log(x); } }; } var MAX_PINS = 10; var FAVORITES = '____unity_favorites'; function addFavoritesInLauncher(links) { var i; if (!links) { return; } Unity.Launcher.removeActions(); links.sort(function (a, b) { if (a.count > b.count) { return -1; } if (a.count < b.count) { return 1; } return 0; }); links.splice(MAX_PINS); for (i = 0; i < links.length; i++) { if (links[i].name) { Unity.Launcher.addAction(links[i].name, makeRedirector(links[i].url)); } } } if (!window.reportTestState) { window.reportTestState = function (msg) { console.log(msg); }; } function linkVisited(url, name, second) { var i, links = localStorage.getItem(FAVORITES); if (!links) { links = []; if (!second) { setTimeout(wrapCallback(function () { linkVisited(url, name, true); }), 1000); return; } } else { links = JSON.parse(links); } if (!name) { addFavoritesInLauncher(links); return; } var obj = null; for (i = 0; i < links.length; i++) { if (links[i].url === url) { obj = links[i]; } } if (!obj) { obj = { url: url, name: name, count: 0 }; links.push(obj); } obj.count++; localStorage.setItem(FAVORITES, JSON.stringify(links)); addFavoritesInLauncher(links); } unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-facebookmessenger/0000755000015600001650000000000012645741276032731 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017100000000000011214 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-facebookmessenger/FacebookMessenger.user.jsunity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-facebookmessenger/Faceb0000644000015600001650000002754012645740734033662 0ustar pbuserpbgroup00000000000000// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // ==UserScript== // @include http://*.facebook.com/* // @include https://*.facebook.com/* // @include https://*.facebook.com // @require utils.js // ==/UserScript== // This placeholder gets munged with real data at build time. var WebappsGettextDict = JSON.parse(unescape( "%7B%22am%22%3A%20%7B%22Messages%22%3A%20%22%5Cu1218%5Cu120d%5Cu12a5%5Cu12ad%5Cu1276%5Cu127d%22%2C%20%22Notifications%22%3A%20%22%5Cu121b%5Cu1235%5Cu1273%5Cu12c8%5Cu1242%5Cu12eb%5Cu12ce%5Cu127d%22%7D%2C%20%22ar%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0627%5Cu0644%5Cu0631%5Cu0633%5Cu0627%5Cu0626%5Cu0644%22%2C%20%22Notifications%22%3A%20%22%5Cu0627%5Cu0644%5Cu062a%5Cu0646%5Cu0628%5Cu064a%5Cu0647%5Cu0627%5Cu062a%22%7D%2C%20%22ast%22%3A%20%7B%22Messages%22%3A%20%22Mensaxes%22%2C%20%22Notifications%22%3A%20%22Notificaciones%22%7D%2C%20%22be%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu0430%5Cu0432%5Cu0435%5Cu0434%5Cu0430%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu043d%5Cu0456%22%2C%20%22Notifications%22%3A%20%22%5Cu0410%5Cu043f%5Cu0430%5Cu0432%5Cu044f%5Cu0448%5Cu0447%5Cu044d%5Cu043d%5Cu043d%5Cu0456%22%7D%2C%20%22bem%22%3A%20%7B%22Messages%22%3A%20%22Amashiwi%22%2C%20%22Notifications%22%3A%20%22Ifishibisho%22%7D%2C%20%22bg%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0421%5Cu044a%5Cu043e%5Cu0431%5Cu0449%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0418%5Cu0437%5Cu0432%5Cu0435%5Cu0441%5Cu0442%5Cu044f%5Cu0432%5Cu0430%5Cu043d%5Cu0438%5Cu044f%22%7D%2C%20%22bs%22%3A%20%7B%22Messages%22%3A%20%22Poruke%22%2C%20%22Notifications%22%3A%20%22Obavje%5Cu0161tenja%22%7D%2C%20%22ca%22%3A%20%7B%22Messages%22%3A%20%22Missatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22ca%40valencia%22%3A%20%7B%22Messages%22%3A%20%22Missatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22cs%22%3A%20%7B%22Messages%22%3A%20%22Zpr%5Cu00e1vy%22%2C%20%22Notifications%22%3A%20%22Ozn%5Cu00e1men%5Cu00ed%22%7D%2C%20%22cy%22%3A%20%7B%22Messages%22%3A%20%22Negeseuon%22%2C%20%22Notifications%22%3A%20%22Hysbysiadau%22%7D%2C%20%22da%22%3A%20%7B%22Messages%22%3A%20%22Beskeder%22%2C%20%22Notifications%22%3A%20%22P%5Cu00e5mindelser%22%7D%2C%20%22de%22%3A%20%7B%22Messages%22%3A%20%22Mitteilungen%22%2C%20%22Notifications%22%3A%20%22Benachrichtigungen%22%7D%2C%20%22el%22%3A%20%7B%22Messages%22%3A%20%22%5Cu039c%5Cu03b7%5Cu03bd%5Cu03cd%5Cu03bc%5Cu03b1%5Cu03c4%5Cu03b1%22%2C%20%22Notifications%22%3A%20%22%5Cu0395%5Cu03b9%5Cu03b4%5Cu03bf%5Cu03c0%5Cu03bf%5Cu03b9%5Cu03ae%5Cu03c3%5Cu03b5%5Cu03b9%5Cu03c2%22%7D%2C%20%22en_AU%22%3A%20%7B%7D%2C%20%22en_CA%22%3A%20%7B%7D%2C%20%22en_GB%22%3A%20%7B%7D%2C%20%22en_US%22%3A%20%7B%7D%2C%20%22eo%22%3A%20%7B%22Messages%22%3A%20%22Mesa%5Cu011doj%22%2C%20%22Notifications%22%3A%20%22Atentigoj%22%7D%2C%20%22es%22%3A%20%7B%22Messages%22%3A%20%22Mensajes%22%2C%20%22Notifications%22%3A%20%22Notificaciones%22%7D%2C%20%22et%22%3A%20%7B%22Messages%22%3A%20%22S%5Cu00f5numid%22%2C%20%22Notifications%22%3A%20%22Teavitused%22%7D%2C%20%22eu%22%3A%20%7B%22Messages%22%3A%20%22Mezuak%22%2C%20%22Notifications%22%3A%20%22Jakinarazpenak%22%7D%2C%20%22fa%22%3A%20%7B%22Messages%22%3A%20%22%5Cu067e%5Cu06cc%5Cu0627%5Cu0645%5Cu200c%5Cu0647%5Cu0627%22%2C%20%22Notifications%22%3A%20%22%5Cu0622%5Cu06af%5Cu0627%5Cu0647%5Cu200c%5Cu0633%5Cu0627%5Cu0632%5Cu06cc%5Cu200c%5Cu0647%5Cu0627%22%7D%2C%20%22fi%22%3A%20%7B%22Messages%22%3A%20%22Viestit%22%2C%20%22Notifications%22%3A%20%22Ilmoitukset%22%7D%2C%20%22fr%22%3A%20%7B%7D%2C%20%22gd%22%3A%20%7B%22Messages%22%3A%20%22Teachdaireachdan%22%2C%20%22Notifications%22%3A%20%22Fiosan%22%7D%2C%20%22gl%22%3A%20%7B%22Messages%22%3A%20%22Mensaxes%22%2C%20%22Notifications%22%3A%20%22Notificaci%5Cu00f3ns%22%7D%2C%20%22gu%22%3A%20%7B%7D%2C%20%22he%22%3A%20%7B%22Messages%22%3A%20%22%5Cu05d4%5Cu05d5%5Cu05d3%5Cu05e2%5Cu05d5%5Cu05ea%22%2C%20%22Notifications%22%3A%20%22%5Cu05d4%5Cu05ea%5Cu05e8%5Cu05e2%5Cu05d5%5Cu05ea%22%7D%2C%20%22hi%22%3A%20%7B%7D%2C%20%22hr%22%3A%20%7B%7D%2C%20%22hu%22%3A%20%7B%22Messages%22%3A%20%22%5Cu00dczenetek%22%2C%20%22Notifications%22%3A%20%22%5Cu00c9rtes%5Cu00edt%5Cu00e9sek%22%7D%2C%20%22id%22%3A%20%7B%22Messages%22%3A%20%22Pesan%22%2C%20%22Notifications%22%3A%20%22Pemberitahuan%22%7D%2C%20%22is%22%3A%20%7B%22Messages%22%3A%20%22Skilabo%5Cu00f0%22%2C%20%22Notifications%22%3A%20%22Tilkynningar%22%7D%2C%20%22it%22%3A%20%7B%22Messages%22%3A%20%22Messaggi%22%2C%20%22Notifications%22%3A%20%22Notifiche%22%7D%2C%20%22ja%22%3A%20%7B%22Messages%22%3A%20%22%5Cu30e1%5Cu30c3%5Cu30bb%5Cu30fc%5Cu30b8%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22jbo%22%3A%20%7B%22Messages%22%3A%20%22notci%22%7D%2C%20%22ko%22%3A%20%7B%22Messages%22%3A%20%22%5Cuba54%5Cuc2dc%5Cuc9c0%22%2C%20%22Notifications%22%3A%20%22%5Cuc54c%5Cub9bc%22%7D%2C%20%22lt%22%3A%20%7B%22Messages%22%3A%20%22%5Cu017dinut%5Cu0117s%22%2C%20%22Notifications%22%3A%20%22Prane%5Cu0161imai%22%7D%2C%20%22lv%22%3A%20%7B%22Messages%22%3A%20%22Zi%5Cu0146ojumi%22%2C%20%22Notifications%22%3A%20%22Pazi%5Cu0146ojumi%22%7D%2C%20%22mhr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041a%5Cu0430%5Cu043b%5Cu0430%5Cu0441%5Cu044b%5Cu043c%5Cu0430%5Cu0448-%5Cu0432%5Cu043b%5Cu0430%5Cu043a%22%2C%20%22Notifications%22%3A%20%22%5Cu0423%5Cu0432%5Cu0435%5Cu0440%5Cu0442%5Cu0430%5Cu0440%5Cu044b%5Cu043c%5Cu0430%5Cu0448-%5Cu0432%5Cu043b%5Cu0430%5Cu043a%22%7D%2C%20%22mk%22%3A%20%7B%7D%2C%20%22ml%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0d38%5Cu0d28%5Cu0d4d%5Cu0d26%5Cu0d47%5Cu0d36%5Cu0d19%5Cu0d4d%5Cu0d19%5Cu0d7e%22%2C%20%22Notifications%22%3A%20%22%5Cu0d05%5Cu0d31%5Cu0d3f%5Cu0d2f%5Cu0d3f%5Cu0d2a%5Cu0d4d%5Cu0d2a%5Cu0d41%5Cu0d15%5Cu0d7e%22%7D%2C%20%22mr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0938%5Cu0902%5Cu0926%5Cu0947%5Cu0936%22%7D%2C%20%22ms%22%3A%20%7B%22Messages%22%3A%20%22Mesej%22%2C%20%22Notifications%22%3A%20%22Pemberitahuan%22%7D%2C%20%22my%22%3A%20%7B%22Messages%22%3A%20%22%5Cu1005%5Cu102c%5Cu1019%5Cu103b%5Cu102c%5Cu1038%22%2C%20%22Notifications%22%3A%20%22%5Cu1021%5Cu101e%5Cu102d%5Cu1015%5Cu1031%5Cu1038%5Cu1001%5Cu103b%5Cu1000%5Cu103a%22%7D%2C%20%22nb%22%3A%20%7B%7D%2C%20%22nl%22%3A%20%7B%22Messages%22%3A%20%22Berichten%22%2C%20%22Notifications%22%3A%20%22Notificaties%22%7D%2C%20%22oc%22%3A%20%7B%22Messages%22%3A%20%22Messatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22os%22%3A%20%7B%7D%2C%20%22pl%22%3A%20%7B%22Messages%22%3A%20%22Wiadomo%5Cu015bci%22%2C%20%22Notifications%22%3A%20%22Powiadomienia%22%7D%2C%20%22pt%22%3A%20%7B%22Messages%22%3A%20%22Mensagens%22%2C%20%22Notifications%22%3A%20%22Notifica%5Cu00e7%5Cu00f5es%22%7D%2C%20%22pt_BR%22%3A%20%7B%22Messages%22%3A%20%22Mensagens%22%2C%20%22Notifications%22%3A%20%22Notifica%5Cu00e7%5Cu00f5es%22%7D%2C%20%22ro%22%3A%20%7B%22Messages%22%3A%20%22Mesaje%22%2C%20%22Notifications%22%3A%20%22Notific%5Cu0103ri%22%7D%2C%20%22ru%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0421%5Cu043e%5Cu043e%5Cu0431%5Cu0449%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0423%5Cu0432%5Cu0435%5Cu0434%5Cu043e%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%7D%2C%20%22se%22%3A%20%7B%22Messages%22%3A%20%22Reivvet%22%2C%20%22Notifications%22%3A%20%22Muittuhusat%22%7D%2C%20%22shn%22%3A%20%7B%22Messages%22%3A%20%22%5Cu101c%5Cu102d%5Cu1075%5Cu103a%5Cu1088%5Cu1075%5Cu1082%5Cu1062%5Cu1019%5Cu103a%5Cu1038%5Cu1015%5Cu103d%5Cu1010%5Cu103a%5Cu1038%22%2C%20%22Notifications%22%3A%20%22%5Cu1076%5Cu1031%5Cu1083%5Cu1088%5Cu107d%5Cu1062%5Cu1004%5Cu1037%5Cu103a%5Cu1015%5Cu107c%5Cu103a%22%7D%2C%20%22sk%22%3A%20%7B%22Messages%22%3A%20%22Spr%5Cu00e1vy%22%2C%20%22Notifications%22%3A%20%22Ozn%5Cu00e1menia%22%7D%2C%20%22sl%22%3A%20%7B%22Messages%22%3A%20%22Sporo%5Cu010dila%22%2C%20%22Notifications%22%3A%20%22Obvestila%22%7D%2C%20%22sq%22%3A%20%7B%22Messages%22%3A%20%22Mesazhet%22%2C%20%22Notifications%22%3A%20%22Njoftime%22%7D%2C%20%22sr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu043e%5Cu0440%5Cu0443%5Cu043a%5Cu0435%22%2C%20%22Notifications%22%3A%20%22%5Cu041e%5Cu0431%5Cu0430%5Cu0432%5Cu0435%5Cu0448%5Cu0442%5Cu0435%5Cu045a%5Cu0430%22%7D%2C%20%22sv%22%3A%20%7B%7D%2C%20%22tg%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu0430%5Cu0451%5Cu043c%5Cu04b3%5Cu043e%22%2C%20%22Notifications%22%3A%20%22%5Cu041e%5Cu0433%5Cu043e%5Cu04b3%5Cu0438%5Cu04b3%5Cu043e%22%7D%2C%20%22th%22%3A%20%7B%7D%2C%20%22tr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0130letiler%22%2C%20%22Notifications%22%3A%20%22Bildirimler%22%7D%2C%20%22ug%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0626%5Cu06c7%5Cu0686%5Cu06c7%5Cu0631%5Cu0644%5Cu0627%5Cu0631%22%2C%20%22Notifications%22%3A%20%22%5Cu0626%5Cu06c7%5Cu0642%5Cu062a%5Cu06c7%5Cu0631%5Cu06c7%5Cu0634%5Cu0644%5Cu0627%5Cu0631%22%7D%2C%20%22uk%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu043e%5Cu0432%5Cu0456%5Cu0434%5Cu043e%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu043d%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0421%5Cu043f%5Cu043e%5Cu0432%5Cu0456%5Cu0449%5Cu0435%5Cu043d%5Cu043d%5Cu044f%22%7D%2C%20%22uz%22%3A%20%7B%22Messages%22%3A%20%22Xabarlar%22%2C%20%22Notifications%22%3A%20%22Eslatmalar%22%7D%2C%20%22vi%22%3A%20%7B%22Messages%22%3A%20%22Tin%20nh%5Cu1eafn%22%2C%20%22Notifications%22%3A%20%22Th%5Cu00f4ng%20b%5Cu00e1o%22%7D%2C%20%22zh_CN%22%3A%20%7B%22Messages%22%3A%20%22%5Cu6d88%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zh_HK%22%3A%20%7B%22Messages%22%3A%20%22%5Cu8a0a%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zh_TW%22%3A%20%7B%22Messages%22%3A%20%22%5Cu8a0a%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zn_CN%22%3A%20%7B%7D%7D" )); window.Unity = external.getUnityObject('1.0'); function isCorrectPage() { var i, ids = ['mercurymessagesCountValue']; for (i = 0; i < ids.length; i++) { if (!document.getElementById(ids[i])) { return false; } } return true; } function getMessageCountElement() { return document.getElementById('mercurymessagesCountValue'); } function getNotificationCountElement() { return document.getElementById('notificationsCountValue'); } function selfTest() { if (!getMessageCountElement()) { reportTestState('FAILED: getMessageCountElement is null'); return; } if (!getNotificationCountElement()) { reportTestState('FAILED: getNotificationCountElement is null'); return; } reportTestState('PASS SELF TEST'); } function messagingIndicatorSetup() { if (!isCorrectPage()) { return; } var countElement = getMessageCountElement(); var notificationElement = getNotificationCountElement(); function checkMessagesCount() { var indicators = []; function makeCallback(node) { return function () { launchClickEvent(node.parentNode); }; } indicators.push({ name: _("Messages"), count: countElement.textContent, callback: makeCallback(countElement) }); indicators.push({ name: _("Notifications"), count: notificationElement.textContent, callback: makeCallback(notificationElement) }); return indicators; } var indicatorsController = new Indicators(checkMessagesCount); if (document.location.hostname === 'apps.facebook.com') { var name = document.evaluate('//div[@role="contentinfo"]/div/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent; linkVisited(document.location.toString(), name); } console.log(JSON.stringify(checkMessagesCount())); selfTest(); } if (document.getElementById('email')) { var email = document.getElementById('email'); window.onunload = function () { localStorage.setItem('login', email.value); }; } var login = localStorage.getItem('login'); if (!login) { login = null; } Unity.init({ name: "facebook", iconUrl: "icon://unity-webapps-facebook", login: login, domain: 'facebook.com', homepage: 'https://www.facebook.com/', onInit: wrapCallback(messagingIndicatorSetup) }); ././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-facebookmessenger/manifest.jsonunity-webapps-qml-0.1+16.04.20160114/examples/data/userscripts/unity-webapps-facebookmessenger/manif0000644000015600001650000000116112645740734033743 0ustar pbuserpbgroup00000000000000{"includes":["http://*.facebook.com/*","https://*.facebook.com/*","https://*.facebook.com"],"requires":["utils.js"],"name":"FacebookMessenger","scripts":["FacebookMessenger.user.js"],"maintainer":"Webapps Team ","license":"GPL-3","manifest-version":"1.0","integration-version":"2.4.12","package-name":"FacebookMessenger","description":"Unity Webapp for FacebookMessenger","icons":{"128":"128/unity-webapps-facebook.png","48":"48/unity-webapps-facebook.png","52":"52/unity-webapps-facebook.png","64":"64/unity-webapps-facebook.png"},"domain":"facebook.com","homepage":"https://www.facebook.com/"} unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-example-bbcnews/0000755000015600001650000000000012645741276027024 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-example-bbcnews/main.qml0000644000015600001650000000267412645740734030472 0ustar pbuserpbgroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * webbrowser-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Window 2.0 import com.canonical.Oxide 1.0 import Ubuntu.UnityWebApps 0.1 Window { width: 640 height: 640 WebView { id: webView anchors.fill: parent width: parent.width height: parent.height context: WebContext { userAgent: "Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3" } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webView); } } UnityWebApps { id: webapps name: "BBCNews" bindee: webView model: UnityWebappsAppModel { searchPath: '/usr/share/unity-webapps-qml/examples/data/userscripts'} } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/0000755000015600001650000000000012645741276023507 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/0000755000015600001650000000000012645741276026610 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/main.qml.in0000644000015600001650000000104512645740734030652 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 Item { id: root focus: true width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/online-accounts/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/www/0000755000015600001650000000000012645741276027434 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/www/js/0000755000015600001650000000000012645741276030050 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/www/js/app.js0000644000015600001650000000534412645740734031172 0ustar pbuserpbgroup00000000000000window.onload = function() { document.getElementById('refreshAccounts').addEventListener('click', listAccounts); var api = external.getUnityObject('1.0'); var oa = api.OnlineAccounts; var appId = "shotwell"; oa.api.getProviders({"applicationId": appId}, function(providers) { var ul = document.querySelector('#providers ul'); for (var i = 0; i < providers.length; ++i) { var li = document.createElement('li'); var button = document.createElement('input'); button.type = 'button'; button.providerId = providers[i].providerId; button.value = 'Request account'; button.addEventListener('click', function() { oa.api.requestAccount(appId, this.providerId, function() {}); }); li.innerHTML = 'displayName: ' + providers[i].displayName + ', providerId: ' + providers[i].providerId; li.appendChild(button); ul.appendChild(li); } }); function listAccounts() { var filters = {}; var service = document.getElementById('service').value; if (service) { filters['service'] = service } var provider = document.getElementById('provider').value; if (provider) { filters['provider'] = provider } oa.api.getAccounts(filters, function(accounts) { var ul = document.querySelector('#accounts ul'); if (accounts.length === 0) { var li = document.createElement('li'); li.appendChild(document.createTextNode('No accounts found')); ul.appendChild(li); } else { for(var i = 0; i < accounts.length; ++i) { var li = document.createElement('li'); li.innerHTML = 'id: ' + accounts[i].accountId() + ', name: ' + accounts[i].displayName() + ', provider: ' + JSON.stringify(accounts[i].provider()) + ', service: ' + JSON.stringify(accounts[i].service()); ul.appendChild(li); (function(i) { function authcallback(results) { setResults('Authentication result: ' + JSON.stringify(results)); }; li.addEventListener('click', function() { accounts[i].authenticate(authcallback); }); })(i); } } }); } function setResults(data) { var results = document.getElementById('results'); results.innerHTML += data; }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/online-accounts/www/index.html0000644000015600001650000000153012645740734031426 0ustar pbuserpbgroup00000000000000 Content Hub example
    Results:
    Provider: Service:
    Active providers:
    Accounts (click on an account to authenticate):
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/0000755000015600001650000000000012645741276026726 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/main.qml.in0000644000015600001650000000111412645740734030765 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 MainView { id: root focus: true applicationName: \"helloworld\" width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/download-manager/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/www/0000755000015600001650000000000012645741276027552 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/www/js/0000755000015600001650000000000012645741276030166 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/www/js/app.js0000644000015600001650000000433612645740734031310 0ustar pbuserpbgroup00000000000000window.onload = function() { var api = external.getUnityObject('1.0'); document.getElementById('download1').addEventListener('click', function() { api.DownloadApi.downloadFile('http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png' , {} , function(download) { if (download.status === "Success") displayImageUri(download.path); setResult(JSON.stringify(download.path)) }); }); document.getElementById('download2').addEventListener('click', function() { api.DownloadApi.createDownloadManager({}, function(manager) { manager.downloadsChanged(function(downloads) { if (downloads && downloads.length !== 0) { setResult('Downloading a 10 MB image'); downloads[0].progressChanged(function(progress) { setProgress(progress); }); downloads[0].finished(function(path) { displayImageUri(path); downloads[0].destroy(); }); downloads[0].canceled(function() { setResults('Download opertaion cancelled'); }); downloads[0].start(); } }); manager.download("http://files.meetup.com/596486/La%20CANADA%20FIRES%20FROM%20CULVER%20CITY%20-%20(10%20MEG%20FILE).jpg"); }); }); function displayImageUri(image) { var res = document.getElementById('results'); var img = document.createElement('img'); img.setAttribute('src', image); img.setAttribute('height', '100px'); img.setAttribute('width', '100px'); res.appendChild(img); }; function setResult(results) { var resultEl = document.getElementById('results'); resultEl.innerHTML += results + '
    '; }; function setProgress(progress) { var resultEl = document.getElementById('progress'); resultEl.innerHTML = progress; }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/download-manager/www/index.html0000644000015600001650000000130612645740734031545 0ustar pbuserpbgroup00000000000000 Download Api example
    http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png
    http://files.meetup.com/596486/La%20CANADA%20FIRES%20FROM%20CULVER%20CITY%20-%20(10%20MEG%20FILE).jpg
    Progress: 0%
    Results:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/0000755000015600001650000000000012645741276027365 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/main.qml.in0000644000015600001650000000111712645740734031427 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 MainView { id: root focus: true applicationName: \"helloworld\" width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/content-peer-picker/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/www/0000755000015600001650000000000012645741276030211 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/www/js/0000755000015600001650000000000012645741276030625 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/www/js/app.js0000644000015600001650000000576312645740734031754 0ustar pbuserpbgroup00000000000000window.onload = function() { var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; var pictureContentType = hub.ContentType.Pictures; document.getElementById('pick').addEventListener('click', doContentPeerPicking); function doContentPeerPicking() { hub.launchContentPeerPicker( { contentType: hub.ContentType.Pictures, handler: hub.ContentHandler.Source, }, function(peer) { if ( ! peer) { nopeers(); return; } addPeerElement(peer.appId(), peer.name()); doSimpleApiImport(peer); }, function() { aborted(); } ); }; function addPeerElement(appId, name) { var selectedpeer = document.querySelector('#selected-peer'); var span = document.createElement('span'); var text = document.createTextNode('appId: ' + appId + ', name: ' + name) span.appendChild(text); selectedpeer.appendChild(span); }; var results = []; function addResult(item) { results.push({name: item.name, url: item.url}); renderResults(results); }; function displayImages(images) { var res = document.getElementById('results'); for (var i = 0; i < images.length; ++i) { var img = document.createElement('img'); img.setAttribute('src', images[i].url); img.setAttribute('height', '100px'); img.setAttribute('width', '100px'); if (images[i].name && images[i].name.length !== 0) img.setAttribute('alt', images[i].name); res.appendChild(img); } }; function aborted() { setResults('Transfer aborted'); }; function nopeers() { setResults('No peers found'); }; function setResults(results) { var resultEl = document.getElementById('results'); resultEl.innerHTML = results; }; function formatResults(results) { var content = '
      '; for (var i = 0; i < results.length; ++i) { content += '
    • ' + results[i].name + ', ' + results[i].url + '
    • '; } content += '
    '; return content; }; function renderResults(results) { setResults(formatResults(results)); displayImages(results); }; function doSimpleApiImport(peer) { hub.api.importContent(pictureContentType , peer , {scope: hub.ContentScope.App} , function(items) { for (var i = 0; i < items.length; ++i) { addResult(items[i]); } } , function() { aborted(); }); }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-peer-picker/www/index.html0000644000015600001650000000077612645740734032216 0ustar pbuserpbgroup00000000000000 Content Hub: Content Peer Picker example
    Start Content Peer picking to import content:
    Selected peer:
    Imported Image:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/0000755000015600001650000000000012645741276025741 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/main.qml.in0000644000015600001650000000105012645740734027777 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 MainView { id: root focus: true applicationName: \"runtime-api\" width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/runtime-api/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/www/0000755000015600001650000000000012645741276026565 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/www/js/0000755000015600001650000000000012645741276027201 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/www/js/app.js0000644000015600001650000000350012645740734030313 0ustar pbuserpbgroup00000000000000window.onload = function() { function setResult(message) { var results = document.getElementById('results'); results.innerHTML += message + '
    '; } var last = 0; if (localStorage.getItem("lastkilled") !== null) last = localStorage.getItem("lastkilled"); setResult('last killed: ' + last); var api = external.getUnityObject('1.0'); api.RuntimeApi.getApplication(function(application) { setResult('application name: ' + application.getApplicationName()); setResult('application info: ' + JSON.stringify(application.getPlatformInfo())); var inputMethodName = application.getInputMethodName(); if (inputMethodName.length === 0) setResult('input method: no OSK available'); else setResult('input method: ' + inputMethodName); setResult('screen orientation: ' + application.getScreenOrientation()); application.onScreenOrientationChanged(function(name) { setResult('Event: orientation changed - ' + name); }); application.onAboutToQuit(function(killed) { localStorage.setItem("lastkilled", last + 1); console.log('killed: ' + killed) setResult('onAboutToQuit: ' + killed); }); application.onDeactivated(function() { setResult('Event: application deactivated'); }); application.onActivated(function() { setResult('Event: application activated'); }); application.onInputMethodVisibilityChanged(function(visibility) { setResult('Event: onInputMethodVisibilityChanged - ' + visibility); }); application.setupUriHandler(function(uris) { setResult('Event: received URI to open w/ UriHandler - ' + JSON.stringify(uris)); }); }); }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/runtime-api/www/index.html0000644000015600001650000000052012645740734030555 0ustar pbuserpbgroup00000000000000 Runtime Api example
    Results:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/0000755000015600001650000000000012645741276024603 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/main.qml.in0000644000015600001650000000103412645740734026643 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 Item { id: root focus: true width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/alarm/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/www/0000755000015600001650000000000012645741276025427 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/www/js/0000755000015600001650000000000012645741276026043 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/www/js/app.js0000644000015600001650000000277712645740734027174 0ustar pbuserpbgroup00000000000000window.onload = function() { document.getElementById('start') .addEventListener('click', doStart); function getDate() { var datetime = document.getElementById('date').value; if (! datetime || datetime.length == 0) return null; var parts = datetime.split('T'); if (! parts || parts.length != 2) return null; var calendar = parts[0]; var time = parts[1]; parts = calendar.split('-'); if (! parts || parts.length != 3) return null; var date = new Date(parts[0], parts[1] - 1, parts[2]); var times = time.split(':'); if ( ! times || times.length != 3) return date; date.setHours(times[0]); date.setMinutes(times[1]); date.setSeconds(times[2]); return date; } function doStart() { var api = external.getUnityObject('1.0'); var date = getDate(); if ( ! date) { var results = document.getElementById('results'); results.innerHTML = "Invalid date"; return; } api.AlarmApi.api.createAndSaveAlarmFor( date, api.AlarmApi.AlarmType.OneTime, api.AlarmApi.AlarmDayOfWeek.AutoDetect, document.getElementById('message').value, function(errorid) { var results = document.getElementById('results'); results.innerHTML = api.AlarmApi.api.errorToMessage(errorid); }); }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/alarm/www/index.html0000644000015600001650000000114512645740734027423 0ustar pbuserpbgroup00000000000000 Content Hub example
    Date (expected format YYYY-MM-DDThh:mm:ss, e.g. 2014-01-22T23:44:16):
    Message:
    Start:
    Results:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/0000755000015600001650000000000012645741276025735 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/main.qml.in0000644000015600001650000000110712645740734027776 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 MainView { id: root focus: true applicationName: \"helloworld\" width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/content-hub/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/www/0000755000015600001650000000000012645741276026561 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/www/js/0000755000015600001650000000000012645741276027175 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/www/js/app.js0000644000015600001650000001230012645740734030305 0ustar pbuserpbgroup00000000000000window.onload = function() { var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; var pictureContentType = hub.ContentType.Pictures; var sourcePeers = {}; hub.getPeers( {contentType: hub.ContentType.Pictures} , function (peers) { if ( ! peers.length) return; for (var j = 0; j < peers.length; ++j) { addPeerElement(peers[j].appId(), peers[j].name()); sourcePeers[peers[j].appId()] = peers[j]; } document.getElementById('importdiv').style.display = 'block'; document.getElementById('lowLevelImportdiv').style.display = 'block'; }); document.getElementById('import').addEventListener('click', doSimpleApiImport); document.getElementById('lowLevelImport').addEventListener('click', doLowLevelImport); function addPeerElement(appId, name) { var peers = document.querySelector('#known-peers ul'); var li = document.createElement('li'); var span = document.createElement('span'); var text = document.createTextNode('appId: ' + appId + ', name: ' + name) span.appendChild(text); li.appendChild(span); li.addEventListener('click', function (e) { li.classList.toggle('selected'); }); li.setAttribute('data-appid', appId); peers.appendChild(li); }; var results = []; function addResult(item) { results.push({name: item.name, url: item.url}); renderResults(results); }; function displayImages(images) { var res = document.getElementById('results'); for (var i = 0; i < images.length; ++i) { var img = document.createElement('img'); img.setAttribute('src', images[i].url); img.setAttribute('height', '100px'); img.setAttribute('width', '100px'); if (images[i].name && images[i].name.length !== 0) img.setAttribute('alt', images[i].name); res.appendChild(img); } }; function aborted() { setResults('Transfer aborted'); }; function nopeers() { setResults('No peers found'); }; function selectonlyonepeer() { setResults('Please select only one peer'); }; function pleaseselectonepeer() { setResults('Please select one peer'); }; function setResults(results) { var resultEl = document.getElementById('results'); resultEl.innerHTML = results; }; function formatResults(results) { var content = '
      '; for (var i = 0; i < results.length; ++i) { content += '
    • ' + results[i].name + ', ' + results[i].url + '
    • '; } content += '
    '; return content; }; function renderResults(results) { setResults(formatResults(results)); displayImages(results); }; function doSimpleApiImport() { var peers = document.querySelectorAll('#known-peers ul li.selected'); if (peers.length > 1) { selectonlyonepeer(); return; } if (peers.length === 0) { pleaseselectonepeer(); return; } var peer = sourcePeers[peers[0].getAttribute('data-appid')]; if (! peer) { return; } hub.api.importContent(pictureContentType , peer , {scope: hub.ContentScope.App} , function(items) { for (var i = 0; i < items.length; ++i) { addResult(items[i]); } } , function() { aborted(); }); }; function doLowLevelImport() { var peers = document.querySelectorAll('#known-peers ul li.selected'); if (peers.length > 1) { selectonlyonepeer(); return; } if (peers.length === 0) { pleaseselectonepeer(); return; } var peer = sourcePeers[peers[0].getAttribute('data-appid')]; if (! peer) { return; } hub.getStore(hub.ContentScope.App, function(store) { peer.requestForStore(store, function(transfer) { transfer.start(function(state) { if (transferState.Aborted === state) { transfer.finalize(); peer.destroy(); transfer.destroy(); aborted(); return; } if (transferState.Charged === state) { transfer.items(function(items) { for (var i = 0; i < items.length; ++i) { addResult(items[i]); } transfer.finalize(); peer.destroy(); transfer.destroy(); }); } }); }); }); }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub/www/index.html0000644000015600001650000000177012645740734030561 0ustar pbuserpbgroup00000000000000 Content Hub example
    Known source peers (click on one and only one of them to set as the target of the import):
    Results:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/0000755000015600001650000000000012645741276027603 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000016000000000000011212 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub-html5-exporter.jsonunity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub-html5-ex0000644000015600001650000000025412645740734033414 0ustar pbuserpbgroup00000000000000{ "template": "unconfined", "policy_groups": [ "networking", "content_exchange_source", "content_exchange" ], "policy_version": 1 } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/README0000644000015600001650000000141112645740734030456 0ustar pbuserpbgroup00000000000000# make sure that you have the latest upstart app launch installed # I found that it was better to kill the content-hub-service and let it restart itself # since I saw some instances where it didn't pick up the new content hub source peer. click build . pkcon install-local com.ubuntu.developer.alexandre-abreu.content-hub-html5-exporter_0.1_all.click sudo click install --user=$USER com.ubuntu.developer.alexandre-abreu.content-hub-html5-exporter_0.1_all.click # make sure that you have a symbolic link in ~/.local/share/content-hub. It should be the same name as the APP_ID: # com.ubuntu.developer.alexandre-abreu.content-hub-html5-exporter_content-hub-html5-exporter_0.1 # and point to the content-hub-exporter.json file. ././@LongLink0000000000000000000000000000016300000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub-html5-exporter.desktopunity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub-html5-ex0000644000015600001650000000032612645740734033414 0ustar pbuserpbgroup00000000000000[Desktop Entry] Name=content-hub-html5-exporter Comment=Content Hub HTML5 Exporter application Exec=/usr/bin/ubuntu-html5-app-launcher $@ --www=www Icon=qmlscene Terminal=false Type=Application X-Ubuntu-Touch=true unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub/0000755000015600001650000000000012645741276032031 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000017400000000000011217 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub/content-hub-html5-exporter.jsonunity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/content-hub/content-0000644000015600001650000000005512645740734033501 0ustar pbuserpbgroup00000000000000{ "source": [ "pictures" ] } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/main.qml.in0000644000015600001650000000105212645740734031643 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import com.canonical.Oxide 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 Item { id: root focus: true width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/content-hub-exporter/www/index.html\" context: WebContext { } function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForWebViewBindee(webview); } } UnityWebApps { id: webapps bindee: webview injectExtraUbuntuApis: true } } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/0000755000015600001650000000000012645741276030427 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/js/0000755000015600001650000000000012645741276031043 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/js/app.js0000644000015600001650000000172112645740734032160 0ustar pbuserpbgroup00000000000000window.onload = function() { var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; function _exportRequested(transfer) { log('Received an export request'); var url = window.location.href; url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png'; log('item url: ' + url); transfer.setItems([{name: 'Ubuntu One', url: url}], function() { log('The items have been set in the ContentTransfer'); transfer.setState(hub.ContentTransfer.State.Charged); log('State set to "Charged"'); }); }; hub.onExportRequested(_exportRequested); function log(content) { var resultEl = document.getElementById('results'); resultEl.innerHTML = resultEl.innerHTML + '
    ' + content; }; }; unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/index.html0000644000015600001650000000063212645740734032423 0ustar pbuserpbgroup00000000000000 Content Hub Exporter example
    Log:
    unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/img/0000755000015600001650000000000012645741276031203 5ustar pbuserpbgroup00000000000000././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/img/ubuntuone-music.pngunity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/content-hub-exporter/www/img/ubuntuone-mu0000644000015600001650000002176212645740734033577 0ustar pbuserpbgroup00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<#oIDATx}idWuw}[fm]K6L#!l#B@1l03 `a%b,',2 BZ-ZjIz-3_wϙo|YRԍ9;|{-vmvl+vVm[۶lmn 0@#"@ێVmgȱ*=TV)E궫>;^{/ն۲=ʲgllaYֽoۯ}}UaRwot~d"R0 ھ@qښ-~ e[>1u>*5ģo+.7nJFEB'Tiq_&82n;i?w*55[_{^n`DE#%V* 'M[N~}n A@p9롭HL YƒT?*Or^ǗGZ:_ssN;?V}EN)@|Nvww  "@7]7ڿWs4`;} ұuNy|+*]ulK^%MlasνSe/K>^]@U9\9>ƛg?HD6@p:se+瀕3 f{!@|xJA@Y#XrMj풷N(ESH~)87q} 5`y8KGSon,<9KKg_Xv†r -xBca'wKa@c2z畗|x@}W?mߧU ,< >6Aq_?(srnțBE}^h_+ *ϤpgY^gl1*ڤӣ |{|'ԙ3kp;Hm7@;8蓒7$X.! ^;yA=B5҄>c!8^!R(@2 kTN3n?^dKy1 ]R^B|2t|ח Rm/ '['} O-z4 4c8>a80QWimp&fp$aJWA=!.]xbM#k a+(=D Hh0a)_9[ph{WM!R rR blPK.O@&.|}Q㻫6NH_<)5{4렦78e9|y.ߥ SB)UςoYYzm0v Ն 6"|Qh gB3¹PwqO3gNx^ύkf%J#RE=xҳ{9:ث[Z%ǜ YV4)(Q ,A#d N45~qr cM||M 7i]M݁ xq<1AYO SϲZ4Qt,Qj5y')f`'6N6j<“w^pƫ/vYx,R b^ z%c[*Mj븥IRV7_A`ƴYw0?i3~x-x 0a;'=x(jĊFlz } XS {0Vc˝Z :jhuq`k[5Kcʱ37%!T};СiLڪKpo._& EEV=|ߎ,\oY{; ~pbt,Œb']y|-*ՇH2 bNƟl {$v gq`d5[C{gCj b5v-8nO^e>hvt}e^ 9e^߸->T++EYںK |LX.Zh/`!?| ޾,K 0+ݹ $W!nߥQ@"HTl [gYBohumE]pFb^"sOh(kWA{q}z~6,}3>~zSqec+C;oph*u3qWahb3-,y _ ndROD`-7T-ȽUD#i2;lb8elF@b9AuaBUO!(AwWe蘮5A0kSSS "Z-MYro 3jC׵6S1f4k>qt !cRjs\g&|G0hySgk-̉BMzS r/. E*DN LZ 5\$>y\f1 rHwEI $qmAXon`=4rWޱu{X )Q1"k @+ ۧ7))iPՀqFz;ks4$꜂:[3{AXngH"O  N5*RD Rhہs;\\?!ztw/ &!>wxjaV{S"GHQ )M?!\ٰA1*'[UpDf `Y#DXע&CYֲ«w?WC+c<_ǧ8gQh^ RE(tZ j@E@C qjN -&x* W ሯK3vUk ZQaމgփ SNzܳ '˲a"RhSZk,"VuŰHu[F\c\PWG(Q^yſ޵ 7 5 Ai3m•n;7, 4X)%Ep?L0iwjNJa 囷0 !!h!Jh aTAWY;*ih8`3 t3"0̘c."qdoLv D"N> ;5@bn.7mbr2^Z .(B;(XقEgWDž2zz0qܹ.s(y vi(˥}yo1rE MsC.b1e ~t=-*mSzUp{#Fɦҫf/L:o6P?^lbBq[.4pe{δB@B`S!2 rH V'l"άwDtz[KO3oZ9jF<=E&+]Ӂ!^``LFĉt!X@ 97*(QEM``/m"7u5"jHY;l<R7JaIM*)X3(0t\Atuhd`!aU$h2d10R 4kcŸfRby`Ғn Єww/E#@1tUJAxcB, H nsQp,V̟=I!hkԂa4탹{ dSWOh]Y qջ,}>IV#>cƟ:ݽ] - 6eJ__e(4lǕ@cc8 wW,'D>`Ӛ _W.xQt7!ZU28# \:=T ;jaxXeXTY?6*uW\;!^KL7h-|oW=rq6G$PHo] W4mr^n7b\i }.$bP褬=+ wDO c:7UQ%ӣ GôSd˘=M Jx$x'Tz0idrA |HG{GOcRQ/a3¼Ű,ʙʦO >&' G؊0e+ œ+j- Prip x#"Mi w,EӖ WA+,S~)=E1@)h^Z,(YG9.~ͧxm"*dk28蹲nC!Z̦GC[Ҭ=γΉGAf?j^ &*1o ׁ$UԡDulD`022L Y'H4+NXK}+^꼥@'~| wӍcB`}`wD Ca9b(DְVٖ=D |$ZmR{^exN5)>Fbq\L[/UD!} QY W <h/;9X`%=ݒmㆃA`1Y 8ƍm,`^H ~ ,%7qocsu>B&pTX<`$l00^%}6fWq"w0i!!b4.kwqohȴp|qLVz/n%(G~٬_WqC-_c"Q銟>&$*ó!Arcw)=  x6\z?Xzهc+ J{xϴPs">O9v[\_C Z),V!gcӨ!`/(q^W _/xob*+ +>6!֟~Gq,?~jL ܟdTq.HfI)؊q݄{ނj3OawbC9nen.cQ,ˏX=C$ >Z ϳR@[~_LŒT MO@C3Z{?߸^]7]5ڮy83sٲ Z gZ83YΟFs!zOF,hI0o)L,r(hw2Z.v֫"~F.غL em܃ |gSx;YW0 UFu:0J$ӫHmX-V]r $Cʖ,G jJcM#a&Q49\&6A'+2B%x:w$o * G.UiMKVo$`QѪ#&OfPY:{?R6JJ*L<V(Qد UDvbպ]| KsN* +[+hּ?:ʾJj..-y-+{BmT-M.B W&)R4ozXy?2UH޽[[[s S.XY.| V5dnHp۶f/>$Z,m}9p@HD^JXV^j`\ٞSff3sxg[ yQD n!h[H]zqb9Cg8ahMOOku52-WMD}{C>Gam1`<Orr\RJ)&]|lUiR_;p =;L,> "{g|H[>zWx=1]ُo%mhc~C0p]׬\J "BDf߾}8* E9ե ", "version": "0.1" } unity-webapps-qml-0.1+16.04.20160114/examples/api-bindings/api-bindings.pro0000644000015600001650000000037612645740734026601 0ustar pbuserpbgroup00000000000000TEMPLATE = aux SUBDIRS= QML_IN_FILES = $$system(ls ./*/*.qml.in) OTHER_FILES += \ $$QML_IN_FILES \ $$system(ls ./*/www/*.html) \ $$system(ls ./*/www/js/*.js) QMAKE_SUBSTITUTES += $$QML_IN_FILES OTHER_FILES += \ $$system(ls ./*/*.qml) unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-qml-facebookmessenger-example.desktop0000644000015600001650000000065712645740734033253 0ustar pbuserpbgroup00000000000000[Desktop Entry] Name=FacebookMessengerWebappsQMLExample Type=Application Exec=/usr/bin/unity-webapps-qml-launcher --qml=/usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger/main.qml --app-id=unity-webapps-qml-facebookmessenger-example Path=/usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger GenericName=FacebookMessenger WebBrowser Container Example Icon=qmlscene Terminal=false unity-webapps-qml-0.1+16.04.20160114/examples/unity-webapps-qml-model-example.desktop0000644000015600001650000000057112645740734030664 0ustar pbuserpbgroup00000000000000[Desktop Entry] Type=Application Exec=qmlscene /usr/share/unity-webapps-qml/examples/webapps-app-model/main.qml Path=/usr/share/unity-webapps-qml/examples/webapps-apps-model Name=Unity WebApp QML Comonent - Example of WebApps Applications Model GenericName=Unity WebApp QML Comonent for Ubuntu Example of WebApps Applications Model Icon=drive-multidisk-symbolic Terminal=false unity-webapps-qml-0.1+16.04.20160114/examples/webapps-app-model/0000755000015600001650000000000012645741276024460 5ustar pbuserpbgroup00000000000000unity-webapps-qml-0.1+16.04.20160114/examples/webapps-app-model/main.qml0000644000015600001650000000112412645740734026113 0ustar pbuserpbgroup00000000000000import QtQuick 2.0 import QtQuick.Window 2.0 import Ubuntu.UnityWebApps 0.1 Window { id: rootItem width: 360 height: 360 ListView { id: webapps anchors.fill: parent model: UnityWebappsAppModel {} delegate: installedWebappsDelegate Component { id: installedWebappsDelegate Item { width: 180; height: 40 Column { Text { text: 'Name: ' + name } Text { text: 'Domain: ' + domain } } } } } } unity-webapps-qml-0.1+16.04.20160114/examples/examples.pro0000644000015600001650000000456312645740734023511 0ustar pbuserpbgroup00000000000000TEMPLATE = subdirs SUBDIRS += api-bindings OTHER_FILES += \ $$system(ls */*.qml) EXAMPLE_DATA_FILES = $$system(find ./data -type f | xargs) for(file, EXAMPLE_DATA_FILES) { OTHER_FILES += $$file } DESKTOP_EXAMPLE_FILES = \ unity-webapps-qml-basic-example.desktop \ unity-webapps-qml-bbcnews-example.desktop \ unity-webapps-qml-facebookmessenger-example.desktop \ unity-webapps-qml-model-example.desktop OTHER_FILES += $$DESKTOP_EXAMPLE_FILES desktop_files.path = /usr/share/applications desktop_files.files = $$DESKTOP_EXAMPLE_FILES common_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/common common_data_files.files = $$system(ls data/userscripts/common/*) html_data_files.path = /usr/share/unity-webapps-qml/examples/data/html html_data_files.files = $$system(ls data/html/*) bbcnews_userscript_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/unity-webapps-bbcnews bbcnews_userscript_data_files.files = $$system(ls data/userscripts/unity-webapps-bbcnews/*) bbcnews_example_install.path = /usr/share/unity-webapps-qml/examples/unity-webapps-example-bbcnews bbcnews_example_install.files = $$system(ls unity-webapps-example-bbcnews/*) facebookmessenger_userscript_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/unity-webapps-facebookmessenger facebookmessenger_userscript_data_files.files = $$system(ls data/userscripts/unity-webapps-facebookmessenger/*) facebookmessenger_example_install.path = /usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger facebookmessenger_example_install.files = $$system(ls unity-webapps-example-facebookmessenger/*) basic_webview_install.path = /usr/share/unity-webapps-qml/examples/basic-webview basic_webview_install.files = $$system(ls basic-webview/*) html5_api_bindings_install.path = /usr/share/unity-webapps-qml/examples/api-bindings html5_api_bindings_install.files = $$system(ls api-bindings/*) webapps_apps_model_install.path = /usr/share/unity-webapps-qml/examples/webapps-apps-model webapps_apps_model_install.files = $$system(ls webapps-app-model/*) INSTALLS += desktop_files \ webapps_apps_model_install \ basic_webview_install \ common_data_files \ bbcnews_example_install \ bbcnews_userscript_data_files \ facebookmessenger_example_install \ facebookmessenger_userscript_data_files \ html_data_files