/*
 * Copyright (C) 2016 team-cachebox.de
 *
 * Licensed under the : GNU General Public License (GPL);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/licenses/gpl.html
 *
 * 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.
 */
package de.longri.cachebox3;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import org.oscim.backend.canvas.Bitmap;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created by Longri on 17.07.16.
 */
public class IOS_PlatformConnector extends PlatformConnector {

    @Override
    public Bitmap getRealScaledSVG(InputStream inputStream, PlatformConnector.SvgScaleType scaleType, float scaleValue) throws IOException {
        return new IOS_RealSvgBitmap(inputStream, scaleType, scaleValue);
    }


    IOS_LocationListener locationManager;

    @Override
    public void initialLocationReciver() {
        Gdx.app.log("step", "1");
        locationManager = new IOS_LocationListener();
        locationManager.createLocationManager();
    }

    @Override
    protected String _getWorkPath() {
        return _getSandBoxFileHandle("Cachebox3").file().getAbsolutePath();
    }

    @Override
    public FileHandle _getSandBoxFileHandle(String fileName) {
        return new FileHandle(new File(System.getenv("HOME"), "Library/local/" + fileName).getAbsolutePath());
    }
}

@@ -723,16 +723,177 @@
 .Bitmap;
+%0Aimport org.robovm.apple.avfoundation.AVCaptureDevice;%0Aimport org.robovm.apple.avfoundation.AVCaptureTorchMode;%0Aimport org.robovm.apple.avfoundation.AVMediaType;
 %0A%0Aimport
@@ -1070,16 +1070,793 @@
 ctor %7B%0A%0A
+    @Override%0A    protected boolean _isTorchAvailable() %7B%0A        AVCaptureDevice device = AVCaptureDevice.getDefaultDeviceForMediaType(AVMediaType.Video);%0A        return device.hasTorch();%0A    %7D%0A%0A    @Override%0A    protected boolean _isTorchOn() %7B%0A        AVCaptureDevice device = AVCaptureDevice.getDefaultDeviceForMediaType(AVMediaType.Video);%0A        return (device.getTorchMode() == AVCaptureTorchMode.On);%0A    %7D%0A%0A    @Override%0A    protected void _switchTorch() %7B%0A        AVCaptureDevice device = AVCaptureDevice.getDefaultDeviceForMediaType(AVMediaType.Video);%0A%0A        if (device.getTorchMode() == AVCaptureTorchMode.Off) %7B%0A            device.setTorchMode(AVCaptureTorchMode.On);%0A        %7D else %7B%0A            device.setTorchMode(AVCaptureTorchMode.Off);%0A        %7D%0A    %7D%0A%0A
     @Ove

implement iOS Torch