﻿using System;
using System.Runtime.InteropServices;

namespace Adverty5
{
    public static class Adverty
    {
#pragma warning disable CA1401
        [DllImport(APIConfig.LIBRARY_NAME, CharSet = APIConfig.ADVERTY_NATIVE_CHAR_SET)]
        public static extern void Start(LaunchData launchData);

        [DllImport(APIConfig.LIBRARY_NAME, CharSet = APIConfig.ADVERTY_NATIVE_CHAR_SET)]
        public static extern void Stop();

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern void Update();

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern int RegisterAdPlacement(AdPlacementDescription description,
                                                     AdPlacementCallbacks callbacks);

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern void UnregisterAdPlacement(int adPlacementId);

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern void SendDataForViewabilityCheck(int adPlacementId, IntPtr vertices, int vertexCount,
                                                              IntPtr modelMatrix, IntPtr viewMatrix,
                                                              IntPtr projectionMatrix, int screenWidth,
                                                              int screenHeight);

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern void SendDataForScreenSpaceViewabilityCheck(int adPlacementId,
                                                                         IntPtr placementPointsOnScreen,
                                                                         int pointsCount, int screenWidth,
                                                                         int screenHeight);

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern bool ClickOnAdPlacement(int adPlacementId);

        [DllImport(APIConfig.LIBRARY_NAME)]
        public static extern IntPtr GetSDKVersion();
#pragma warning restore CA1401
    }
}
