// Copyright (C) Stichting Deltares 2017. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets 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 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System;
using BruTile;
namespace Core.Components.BruTile.IO
{
///
/// Interface for an object that can retrieve raw tile-image data based on a .
///
public interface ITileFetcher : IDisposable
{
///
/// Event raised when the tile fetcher has received a tile.
///
/// These events can be fired asynchronously.
event EventHandler TileReceived;
///
/// Event raised when the tile request queue is empty.
///
/// These events can be fired asynchronously.
event EventHandler QueueEmpty;
///
/// Gets the tile from cache or queues a fetch request.
///
/// The tile info.
/// The tile data if a match can be found in the cache, otherwise null
/// is returned.
/// If no tile can be returned, you can use and
/// events for handling tile retrieval once the queued
/// request has been served.
/// Thrown when calling this method while
/// this instance is disposed.
/// Thrown when this operation is not
/// supported on the current platform or the caller does not have the required permission.
byte[] GetTile(TileInfo tileInfo);
///
/// Stops all pending tile requests.
/// Thrown when calling this method while
/// this instance is disposed.
///
void DropAllPendingTileRequests();
///
/// Determines if this instance is idle and has no tile requests unserved.
///
/// Thrown when calling this method while
/// this instance is disposed.
bool IsReady();
}
}