summaryrefslogtreecommitdiff
path: root/include/delphi/m_langpack.inc
blob: 4aacf9ecea1dc9b25dfc9fffe8d39cf194e55d5e (plain)
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
{
Miranda IM: the free IM client for Microsoft* Windows*

Copyright 2000-2006 Miranda ICQ/IM project, 
all portions of this codebase are copyrighted to the people 
listed in contributors.txt.

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; either version 2
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 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.
}

{$IFNDEF M_LANGPACK}
{$DEFINE M_LANGPACK}

const

{
 translates a single string into the user's local language    v0.1.1.0+
 wParam=LANG_* flags
 lParam=(LPARAM)(const AnsiChar*)szEnglish
 returns a pointer to the localised string. If there is no known translation
 it will return szEnglish. The return value does not need to be freed in any way
 Note that the Translate() macro as defined below will crash plugins that are
 loaded into Miranda 0.1.0.1 and earlier. If anyone's actually using one of
 these versions, I pity them.
}
  MS_LANGPACK_TRANSLATESTRING:PAnsiChar = 'LangPack/TranslateString';
(*
{
 translates a dialog into the user's local language    v0.1.1.0+
 wParam=0
 lParam=(LPARAM)(LANGPACKTRANSLATEDIALOG* )&lptd
 returns 0 on success, nonzero on failure
 This service only knows about the following controls:
 Window titles, STATIC, EDIT, Hyperlink, BUTTON
}
type
  IntArray = array [0..1000] of integer;
  PLANGPACKTRANSLATEDIALOG = ^TLANGPACKTRANSLATEDIALOG;
  TLANGPACKTRANSLATEDIALOG = record
    cbSize        :int;
    flags         :DWORD;
    hwndDlg       :HWND;
    ignoreControls:^IntArray; // zero-terminated list of control IDs *not* to translate
  end;

const
  LPTDF_NOIGNOREEDIT = 1; // translate all edit controls. By default
                          // non-read-only edit controls are not translated
  LPTDF_NOTITLE      = 2; //do not translate the title of the dialog

const
 MS_LANGPACK_TRANSLATEDIALOG:PAnsiChar = 'LangPack/TranslateDialog';
*)
{
 translates a menu into the user's local language    v0.1.1.0+
 wParam=(WPARAM)(HMENU)hMenu
 lParam=0
 returns 0 on success, nonzero on failure
}
  MS_LANGPACK_TRANSLATEMENU:PAnsiChar = 'LangPack/TranslateMenu';

{
 returns the codepage used in the language pack     v0.4.3.0+
 wParam=0
 lParam=0
 returns the codepage stated in the langpack, or CP_ACP if no langpack is present
}
  MS_LANGPACK_GETCODEPAGE:PAnsiChar = 'LangPack/GetCodePage';

{
  returns the locale id associated with the language pack    v0.4.3.0+
  wParam=0
  lParam=0
  returns the Windows locale id stated in the langpack, or LOCALE_USER_DEFAULT if no langpack is present
}
  MS_LANGPACK_GETLOCALE:PAnsiChar = 'LangPack/GetLocale';

{
  returns the strdup/wcsdup of lparam according to the langpack  v0.4.3.0+
  wParam=0
  lParam=(LPARAM)(AnsiChar*)source string
  returns a string converted from AnsiChar* to TCHAR* using the langpack codepage. 
  This string should be freed using mir_free() then
}
  MS_LANGPACK_PCHARTOTCHAR:PAnsiChar = 'LangPack/PcharToTchar';

{
  initializes the plugin-specific translation context  v0.10.0+
  wParam=pointer to the langpack handle
  lParam=PLUGININFOEX* of the caller plugin
  always returns 0
}
  MS_LANGPACK_REGISTER:PAnsiChar = 'LangPack/Register';

{
  reloads langpack
  wParam=0 (ignored)
  lParam=(LPARAM)(TCHAR*)langpack file name or NULL to reload the current one
  always returns 0
}
  MS_LANGPACK_RELOAD:PAnsiChar = 'LangPack/Reload';

  ME_LANGPACK_CHANGE:PAnsiChar = 'LangPack/Changed';

{
  retrieves the hLangpack of a plugin by its HINSTANCE
  wParam = 0 (ignored)
  lParam = (LPARAM)(HINSTANCE)plugin's base address
  returns hLangpack if found, or 0 if error occurred
}
  MS_LANGPACK_LOOKUPHANDLE:PAnsiChar = 'LangPack/LookupHandle';

{$ENDIF}