2
// Copyright (C) 2009 Robert Dyer
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
9
// This program 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
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
using System.Collections.Generic;
21
namespace WeatherDocklet
24
/// A weather source provides information about the weather data and
25
/// allows requesting updates to that data.
27
public interface IWeatherSource
30
/// The number of days forecast available from this weather source.
32
int ForecastDays { get; }
35
/// The current city, obtained from the weather source.
40
/// The Location's latitude.
42
double Latitude { get; }
45
/// The Location's longitude.
47
double Longitude { get; }
50
/// The Location's sunrise time.
52
DateTime SunRise { get; }
55
/// The Location's sunset time.
57
DateTime SunSet { get; }
60
/// The current temperature obtained from the weather source.
65
/// The current 'feels like' temperature obtained from the weather source.
67
int FeelsLike { get; }
70
/// The current conditions obtained from the weather source.
72
string Condition { get; }
75
/// The current wind speed obtained from the weather source.
80
/// The current wind direction obtained from the weather source.
82
string WindDirection { get; }
85
/// The current humidity obtained from the weather source.
87
string Humidity { get; }
90
/// An icon name for the current conditions obtained from the weather source.
95
/// An array of the current forecasts obtained from the weather source.
97
WeatherForecast[] Forecasts { get; }
100
/// The displayed name for this weather source.
105
/// A description for this weather source.
107
string About { get; }
110
/// Indicates if the source supports heat index/wind chill.
112
bool SupportsFeelsLike { get; }
115
/// Indicates the weather source is currently reloading the weather data.
117
event Action WeatherReloading;
120
/// Indicates there was an error reloading the weather data.
122
event EventHandler<WeatherErrorArgs> WeatherError;
125
/// Indicates the weather was successfully updated.
127
event Action WeatherUpdated;
130
/// Reloads the weather data using the weather source.
132
void ReloadWeatherData ();
135
/// Displays the radar in the default browser using this weather source's specified URL.
140
/// Displays the forecast in the default browser using this weather source's specified URL.
142
/// <param name="day">
143
/// A <see cref="System.Int32"/> representing how many days away to show the forecast for.
145
void ShowForecast (int day);
148
/// Returns if it is currently night.
151
/// A <see cref="System.Boolean"/> indicating if it is night.
156
/// Searches for a location code.
158
/// <param name="location">
159
/// A <see cref="System.String"/> location to search for.
162
/// A <see cref="IEnumerable"/> to iterate over pairs of strings, which represent
163
/// a location name and location code.
165
IEnumerable<string> SearchLocation (string location);