/*
Weather Protocol plugin for Miranda NG
Copyright (C) 2012-25 Miranda NG team
Copyright (c) 2005-2011 Boris Krasnovskiy All Rights Reserved
Copyright (c) 2002-2005 Calvin Che
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
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, see .
*/
/* This file contains the includes, weather constants/declarations,
the structs, and the primitives for some of the functions.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "resource.h"
#include "version.h"
#include "proto.h"
/////////////////////////////////////////////////////////////////////////////////////////
// CONSTANTS
// name
#define MODULENAME "Weather"
#define DEFCURRENTWEATHER "WeatherCondition"
#define WEATHERCONDITION "Current"
// weather conditions
enum EWeatherCondition
{
SUNNY,
NA,
PCLOUDY,
CLOUDY,
RAIN,
RSHOWER,
FOG,
SNOW,
SSHOWER,
LIGHT,
MAX_COND
};
// limits
#define MAX_TEXT_SIZE 4096
#define MAX_DATA_LEN 1024
// more info list column width
#define LIST_COLUMN 150
// others
#define NODATA TranslateT("N/A")
#define UM_SETCONTACT 40000
// weather update error codes
#define INVALID_ID_FORMAT 10
#define INVALID_SVC 11
#define INVALID_ID 12
#define SVC_NOT_FOUND 20
#define NETLIB_ERROR 30
#define DATA_EMPTY 40
#define DOC_NOT_FOUND 42
#define DOC_TOO_SHORT 43
#define UNKNOWN_ERROR 99
#define SM_WEATHERALERT 16
#define WM_UPDATEDATA (WM_USER + 2687)
struct WeatherReply : public JsonReply
{
WeatherReply(MHttpResponse *response) :
JsonReply(response)
{
delete response;
}
};
/////////////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
extern HWND hPopupWindow;
extern MWindowList hDataWindowList, hWindowList;
extern HANDLE hTBButton;
extern HGENMENU hMwinMenu;
extern bool g_bIsUtf;
/////////////////////////////////////////////////////////////////////////////////////////
// functions in weather_conv.c
void ClearStatusIcons();
void CaseConv(wchar_t *str);
void TrimString(char *str);
void TrimString(wchar_t *str);
void ConvertBackslashes(char *str);
char *GetSearchStr(char *dis);
CMStringW GetDisplay(WEATHERINFO *w, const wchar_t *dis);
void GetVarsDescr(CMStringW &str);
wchar_t *GetError(int code);
/////////////////////////////////////////////////////////////////////////////////////////
// functions in weather_info.c
const wchar_t *GetDefaultText(int c);
/////////////////////////////////////////////////////////////////////////////////////////
// function from multiwin module
void UpdateMwinData(MCONTACT hContact);