| 1 | #pragma once |
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 3 | |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
| 9 | struct LOC_STRING |
| 10 | { |
| 11 | LPWSTR wzId; |
| 12 | LPWSTR wzText; |
| 13 | BOOL bOverridable; |
| 14 | }; |
| 15 | |
| 16 | const int LOC_CONTROL_NOT_SET = INT_MAX; |
| 17 | |
| 18 | struct LOC_CONTROL |
| 19 | { |
| 20 | LPWSTR wzControl; |
| 21 | int nX; |
| 22 | int nY; |
| 23 | int nWidth; |
| 24 | int nHeight; |
| 25 | LPWSTR wzText; |
| 26 | }; |
| 27 | |
| 28 | const int WIX_LOCALIZATION_LANGUAGE_NOT_SET = INT_MAX; |
| 29 | |
| 30 | struct WIX_LOCALIZATION |
| 31 | { |
| 32 | DWORD dwLangId; |
| 33 | |
| 34 | DWORD cLocStrings; |
| 35 | LOC_STRING* rgLocStrings; |
| 36 | |
| 37 | DWORD cLocControls; |
| 38 | LOC_CONTROL* rgLocControls; |
| 39 | }; |
| 40 | |
| 41 | /******************************************************************** |
| 42 | LocProbeForFile - Searches for a localization file on disk. |
| 43 | |
| 44 | *******************************************************************/ |
| 45 | HRESULT DAPI LocProbeForFile( |
| 46 | __in_z LPCWSTR wzBasePath, |
| 47 | __in_z LPCWSTR wzLocFileName, |
| 48 | __in_z_opt LPCWSTR wzLanguage, |
| 49 | __deref_out_z LPWSTR* psczPath |
| 50 | ); |
| 51 | |
| 52 | /******************************************************************** |
| 53 | LocLoadFromFile - Loads a localization file |
| 54 | |
| 55 | *******************************************************************/ |
| 56 | HRESULT DAPI LocLoadFromFile( |
| 57 | __in_z LPCWSTR wzWxlFile, |
| 58 | __out WIX_LOCALIZATION** ppWixLoc |
| 59 | ); |
| 60 | |
| 61 | /******************************************************************** |
| 62 | LocLoadFromResource - loads a localization file from a module's data |
| 63 | resource. |
| 64 | |
| 65 | NOTE: The resource data must be UTF-8 encoded. |
| 66 | *******************************************************************/ |
| 67 | HRESULT DAPI LocLoadFromResource( |
| 68 | __in HMODULE hModule, |
| 69 | __in_z LPCSTR szResource, |
| 70 | __out WIX_LOCALIZATION** ppWixLoc |
| 71 | ); |
| 72 | |
| 73 | /******************************************************************** |
| 74 | LocFree - free memory allocated when loading a localization file |
| 75 | |
| 76 | *******************************************************************/ |
| 77 | void DAPI LocFree( |
| 78 | __in_opt WIX_LOCALIZATION* pWixLoc |
| 79 | ); |
| 80 | |
| 81 | /******************************************************************** |
| 82 | LocLocalizeString - replace any #(loc.id) in a string with the |
| 83 | correct sub string |
| 84 | *******************************************************************/ |
| 85 | HRESULT DAPI LocLocalizeString( |
| 86 | __in const WIX_LOCALIZATION* pWixLoc, |
| 87 | __deref_out_z LPWSTR* psczInput |
| 88 | ); |
| 89 | |
| 90 | /******************************************************************** |
| 91 | LocGetControl - returns a control's localization information |
| 92 | *******************************************************************/ |
| 93 | HRESULT DAPI LocGetControl( |
| 94 | __in const WIX_LOCALIZATION* pWixLoc, |
| 95 | __in_z LPCWSTR wzId, |
| 96 | __out LOC_CONTROL** ppLocControl |
| 97 | ); |
| 98 | |
| 99 | /******************************************************************** |
| 100 | LocGetString - returns a string's localization information |
| 101 | *******************************************************************/ |
| 102 | extern "C" HRESULT DAPI LocGetString( |
| 103 | __in const WIX_LOCALIZATION* pWixLoc, |
| 104 | __in_z LPCWSTR wzId, |
| 105 | __out LOC_STRING** ppLocString |
| 106 | ); |
| 107 | |
| 108 | /******************************************************************** |
| 109 | LocAddString - adds a localization string |
| 110 | *******************************************************************/ |
| 111 | extern "C" HRESULT DAPI LocAddString( |
| 112 | __in WIX_LOCALIZATION* pWixLoc, |
| 113 | __in_z LPCWSTR wzId, |
| 114 | __in_z LPCWSTR wzLocString, |
| 115 | __in BOOL bOverridable |
| 116 | ); |
| 117 | |
| 118 | #ifdef __cplusplus |
| 119 | } |
| 120 | #endif |