| OLD | NEW |
| 1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
| 2 #include "PluginUserSettings.h" | 2 #include "PluginUserSettings.h" |
| 3 #include <algorithm> | 3 #include <algorithm> |
| 4 #include "PluginSettings.h" | 4 #include "PluginSettings.h" |
| 5 #include "PluginClient.h" | 5 #include "PluginClient.h" |
| 6 #include "../shared/Dictionary.h" | 6 #include "../shared/Dictionary.h" |
| 7 | 7 |
| 8 static const CString s_GetMessage = L"GetMessage"; | 8 static const CString s_GetMessage = L"GetMessage"; |
| 9 static const CString s_GetLanguageCount = L"GetLanguageCount"; | 9 static const CString s_GetLanguageCount = L"GetLanguageCount"; |
| 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; | 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; |
| 11 static const CString s_GetLanguageTitleByIndex = L"GetLanguageTitleByIndex"; | 11 static const CString s_GetLanguageTitleByIndex = L"GetLanguageTitleByIndex"; |
| 12 static const CString s_SetLanguage = L"SetLanguage"; | 12 static const CString s_SetLanguage = L"SetLanguage"; |
| 13 static const CString s_GetLanguage = L"GetLanguage"; | 13 static const CString s_GetLanguage = L"GetLanguage"; |
| 14 static const CString s_GetWhitelistDomains = L"GetWhitelistDomains"; | 14 static const CString s_GetWhitelistDomains = L"GetWhitelistDomains"; |
| 15 static const CString s_AddWhitelistDomain = L"AddWhitelistDomain"; | 15 static const CString s_AddWhitelistDomain = L"AddWhitelistDomain"; |
| 16 static const CString s_RemoveWhitelistDomain = L"RemoveWhitelistDomain"; | 16 static const CString s_RemoveWhitelistDomain = L"RemoveWhitelistDomain"; |
| 17 static const CString s_GetAppLocale = L"GetAppLocale"; |
| 18 static const CString s_GetDocumentationLink = L"GetDocumentationLink"; |
| 17 | 19 |
| 18 static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLangu
ageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitel
istDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain}; | 20 static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLangu
ageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitel
istDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain, s_GetAppLocale, s_Get
DocumentationLink}; |
| 19 | 21 |
| 20 CPluginUserSettings::CPluginUserSettings() | 22 CPluginUserSettings::CPluginUserSettings() |
| 21 { | 23 { |
| 22 } | 24 } |
| 23 | 25 |
| 24 | 26 |
| 25 STDMETHODIMP CPluginUserSettings::QueryInterface(REFIID riid, void **ppvObj) | 27 STDMETHODIMP CPluginUserSettings::QueryInterface(REFIID riid, void **ppvObj) |
| 26 { | 28 { |
| 27 if (IID_IUnknown == riid || IID_IDispatch == riid) | 29 if (IID_IUnknown == riid || IID_IDispatch == riid) |
| 28 { | 30 { |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 300 |
| 299 if (VT_BSTR != pDispparams->rgvarg[0].vt) | 301 if (VT_BSTR != pDispparams->rgvarg[0].vt) |
| 300 return DISP_E_TYPEMISMATCH; | 302 return DISP_E_TYPEMISMATCH; |
| 301 | 303 |
| 302 CComBSTR domain = pDispparams->rgvarg[0].bstrVal; | 304 CComBSTR domain = pDispparams->rgvarg[0].bstrVal; |
| 303 if (domain.Length()) | 305 if (domain.Length()) |
| 304 { | 306 { |
| 305 settings->RemoveWhiteListedDomain((BSTR)domain); | 307 settings->RemoveWhiteListedDomain((BSTR)domain); |
| 306 } | 308 } |
| 307 } | 309 } |
| 310 else if (s_GetAppLocale == method) |
| 311 { |
| 312 if (0 != pDispparams->cArgs) |
| 313 return DISP_E_BADPARAMCOUNT; |
| 314 |
| 315 pVarResult->vt = VT_BSTR; |
| 316 pVarResult->bstrVal = SysAllocString(settings->GetAppLocale()); |
| 317 } |
| 318 else if (s_GetDocumentationLink == method) |
| 319 { |
| 320 if (0 != pDispparams->cArgs) |
| 321 return DISP_E_BADPARAMCOUNT; |
| 322 |
| 323 pVarResult->vt = VT_BSTR; |
| 324 pVarResult->bstrVal = SysAllocString(settings->GetDocumentationLink()); |
| 325 } |
| 308 else | 326 else |
| 309 return DISP_E_MEMBERNOTFOUND; | 327 return DISP_E_MEMBERNOTFOUND; |
| 310 | 328 |
| 311 return S_OK; | 329 return S_OK; |
| 312 } | 330 } |
| 313 | 331 |
| OLD | NEW |