aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-weather.h
blob: 6933137ed28c5d993c01f94234136d6f609b3e4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-summary-weather.h
 *
 * Copyright (C) 2001 Ximian, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Iain Holmes
 */

#ifndef __E_SUMMARY_WEATHER_H__
#define __E_SUMMARY_WEATHER_H__

#include <time.h>

#include "e-summary-type.h"
#include "e-summary-shown.h"

typedef struct _ESummaryWeather ESummaryWeather;

#define WEATHER_LOCATION_NAME_MAX_LEN 100
#define WEATHER_LOCATION_CODE_LEN 4
#define WEATHER_LOCATION_ZONE_LEN 7
#define WEATHER_LOCATION_RADAR_LEN 3

typedef struct _ESummaryWeatherLocation {
    char *name;
    char *code;
    char *zone;
    char *radar;
} ESummaryWeatherLocation;

typedef enum _ESummaryWeatherWindDir {
    WIND_VARIABLE,
    WIND_N,
    WIND_NNE,
    WIND_NE,
    WIND_ENE,
    WIND_E,
    WIND_ESE,
    WIND_SE,
    WIND_SSE,
    WIND_S,
    WIND_SSW,
    WIND_SW,
    WIND_WSW,
    WIND_W,
    WIND_WNW,
    WIND_NW,
    WIND_NNW
} ESummaryWeatherWindDir;

typedef enum _ESummaryWeatherSky {
    SKY_CLEAR,
    SKY_BROKEN,
    SKY_SCATTERED,
    SKY_FEW,
    SKY_OVERCAST
} ESummaryWeatherSky;

typedef enum _ESummaryWeatherConditionPhenomenon {
       PHENOMENON_NONE,

       PHENOMENON_DRIZZLE,
       PHENOMENON_RAIN,
       PHENOMENON_SNOW,
       PHENOMENON_SNOW_GRAINS,
       PHENOMENON_ICE_CRYSTALS,
       PHENOMENON_ICE_PELLETS,
       PHENOMENON_HAIL,
       PHENOMENON_SMALL_HAIL,
       PHENOMENON_UNKNOWN_PRECIPITATION,
       
       PHENOMENON_MIST,
       PHENOMENON_FOG,
       PHENOMENON_SMOKE,
       PHENOMENON_VOLCANIC_ASH,
       PHENOMENON_SAND,
       PHENOMENON_HAZE,
       PHENOMENON_SPRAY,
       PHENOMENON_DUST,
       
       PHENOMENON_SQUALL,
       PHENOMENON_SANDSTORM,
       PHENOMENON_DUSTSTORM,
       PHENOMENON_FUNNEL_CLOUD,
       PHENOMENON_TORNADO,
       PHENOMENON_DUST_WHIRLS
} ESummaryWeatherConditionPhenomenon;

typedef enum _ESummaryWeatherConditionQualifier {
       QUALIFIER_NONE,

       QUALIFIER_VICINITY,
       
       QUALIFIER_LIGHT,
       QUALIFIER_MODERATE,
       QUALIFIER_HEAVY,
       QUALIFIER_SHALLOW,
       QUALIFIER_PATCHES,
       QUALIFIER_PARTIAL,
       QUALIFIER_THUNDERSTORM,
       QUALIFIER_BLOWING,
       QUALIFIER_SHOWERS,
       QUALIFIER_DRIFTING,
       QUALIFIER_FREEZING
} ESummaryWeatherConditionQualifier;

typedef struct _ESummaryWeatherConditions {
    gboolean significant;
    ESummaryWeatherConditionPhenomenon phenomenon;
    ESummaryWeatherConditionQualifier qualifier;
} ESummaryWeatherConditions;

typedef enum _ESummaryWeatherUnits {
    UNITS_IMPERIAL,
    UNITS_METRIC
} ESummaryWeatherUnits;

typedef enum _ESummaryWeatherForecastType {
    FORECAST_STATE,
    FORECAST_ZONE
} ESummaryWeatherForecastType;

typedef double ESummaryWeatherTemperature;
typedef int ESummaryWeatherHumidity;
typedef int ESummaryWeatherWindSpeed;
typedef double ESummaryWeatherPressure;
typedef double ESummaryWeatherVisibility;

typedef time_t ESummaryWeatherUpdate;

char *e_summary_weather_get_html (ESummary *summary);
void e_summary_weather_init (ESummary *summary);
void e_summary_weather_reconfigure (ESummary *summary);
void e_summary_weather_fill_etable (ESummaryShown *ess);
const char *e_summary_weather_code_to_name (const char *code);
void e_summary_weather_free (ESummary *summary);
gboolean e_summary_weather_update (ESummary *summary);

#endif