Branch data Line data Source code
1 : : /* 2 : : * Copyright (C) 2021 James Westman <james@jwestman.net> 3 : : * 4 : : * This library is free software; you can redistribute it and/or 5 : : * modify it under the terms of the GNU Lesser General Public 6 : : * License as published by the Free Software Foundation; either 7 : : * version 2.1 of the License, or (at your option) any later version. 8 : : * 9 : : * This library is distributed in the hope that it will be useful, 10 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 : : * Lesser General Public License for more details. 13 : : * 14 : : * You should have received a copy of the GNU Lesser General Public 15 : : * License along with this library; if not, see <https://www.gnu.org/licenses/>. 16 : : */ 17 : : 18 : : #pragma once 19 : : 20 : : #include <shumate/shumate-data-source.h> 21 : : 22 : : G_BEGIN_DECLS 23 : : 24 : : 25 : : #define SHUMATE_TYPE_TILE_DOWNLOADER (shumate_tile_downloader_get_type()) 26 [ - + # # : 27 : G_DECLARE_FINAL_TYPE (ShumateTileDownloader, shumate_tile_downloader, SHUMATE, TILE_DOWNLOADER, ShumateDataSource) # # ] 27 : : 28 : : ShumateTileDownloader *shumate_tile_downloader_new (const char *url_template); 29 : : 30 : : 31 : : /** 32 : : * SHUMATE_TILE_DOWNLOADER_ERROR: 33 : : * 34 : : * Error domain for errors that may occur while fetching tiles from the network 35 : : * using [class@TileDownloader]. Errors in this domain will be from the 36 : : * [enum@TileDownloaderError] enum. 37 : : */ 38 : : #define SHUMATE_TILE_DOWNLOADER_ERROR shumate_tile_downloader_error_quark () 39 : : GQuark shumate_tile_downloader_error_quark (void); 40 : : 41 : : /** 42 : : * ShumateTileDownloaderError: 43 : : * @SHUMATE_TILE_DOWNLOADER_ERROR_FAILED: An unspecified error occurred during the operation. 44 : : * @SHUMATE_TILE_DOWNLOADER_ERROR_BAD_RESPONSE: An unsuccessful HTTP response was received from the server. 45 : : * @SHUMATE_TILE_DOWNLOADER_ERROR_COULD_NOT_CONNECT: The server could not be reached. 46 : : * @SHUMATE_TILE_DOWNLOADER_ERROR_MALFORMED_URL: The provided URL isn't valid 47 : : * @SHUMATE_TILE_DOWNLOADER_ERROR_OFFLINE: The tile source has been marked as offline. 48 : : * 49 : : * Error codes in the #SHUMATE_TILE_DOWNLOADER_ERROR domain. 50 : : */ 51 : : typedef enum { 52 : : SHUMATE_TILE_DOWNLOADER_ERROR_FAILED, 53 : : SHUMATE_TILE_DOWNLOADER_ERROR_BAD_RESPONSE, 54 : : SHUMATE_TILE_DOWNLOADER_ERROR_COULD_NOT_CONNECT, 55 : : SHUMATE_TILE_DOWNLOADER_ERROR_MALFORMED_URL, 56 : : SHUMATE_TILE_DOWNLOADER_ERROR_OFFLINE, 57 : : } ShumateTileDownloaderError; 58 : : 59 : : 60 : : G_END_DECLS