1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Touchgui/plugins/org.apache.cordova.splashscreen/src/ubuntu/splashscreen.cpp Thu Jun 04 14:50:33 2015 +0200 1.3 @@ -0,0 +1,42 @@ 1.4 +/* 1.5 + * 1.6 + * Copyright 2013 Canonical Ltd. 1.7 + * 1.8 + * Licensed to the Apache Software Foundation (ASF) under one 1.9 + * or more contributor license agreements. See the NOTICE file 1.10 + * distributed with this work for additional information 1.11 + * regarding copyright ownership. The ASF licenses this file 1.12 + * to you under the Apache License, Version 2.0 (the 1.13 + * "License"); you may not use this file except in compliance 1.14 + * with the License. You may obtain a copy of the License at 1.15 + * 1.16 + * http://www.apache.org/licenses/LICENSE-2.0 1.17 + * 1.18 + * Unless required by applicable law or agreed to in writing, 1.19 + * software distributed under the License is distributed on an 1.20 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1.21 + * KIND, either express or implied. See the License for the 1.22 + * specific language governing permissions and limitations 1.23 + * under the License. 1.24 + * 1.25 +*/ 1.26 + 1.27 +#include <QQuickItem> 1.28 + 1.29 +#include "splashscreen.h" 1.30 +#include <cordova.h> 1.31 + 1.32 +#define SPLASHSCREEN_STATE_NAME "splashscreen" 1.33 + 1.34 +Splashscreen::Splashscreen(Cordova *cordova): CPlugin(cordova) { 1.35 +} 1.36 + 1.37 +void Splashscreen::show(int, int) { 1.38 + m_cordova->rootObject()->setProperty("splashscreenPath", m_cordova->getSplashscreenPath()); 1.39 + 1.40 + m_cordova->pushViewState(SPLASHSCREEN_STATE_NAME); 1.41 +} 1.42 + 1.43 +void Splashscreen::hide(int, int) { 1.44 + m_cordova->popViewState(SPLASHSCREEN_STATE_NAME); 1.45 +}