ReactOS 0.4.16-dev-1610-g4f61d2e
CInputProcessorProfiles Class Reference
Inheritance diagram for CInputProcessorProfiles:
Collaboration diagram for CInputProcessorProfiles:

Public Member Functions

 CInputProcessorProfiles ()
 
virtual ~CInputProcessorProfiles ()
 
STDMETHODIMP QueryInterface (REFIID iid, LPVOID *ppvObj) override
 
 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
STDMETHODIMP Register (_In_ REFCLSID rclsid) override
 
STDMETHODIMP Unregister (_In_ REFCLSID rclsid) override
 
STDMETHODIMP AddLanguageProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ const WCHAR *pchDesc, _In_ ULONG cchDesc, _In_ const WCHAR *pchIconFile, _In_ ULONG cchFile, _In_ ULONG uIconIndex) override
 
STDMETHODIMP RemoveLanguageProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile) override
 
STDMETHODIMP EnumInputProcessorInfo (_Out_ IEnumGUID **ppEnum) override
 
STDMETHODIMP GetDefaultLanguageProfile (_In_ LANGID langid, _In_ REFGUID catid, _Out_ CLSID *pclsid, _Out_ GUID *pguidProfile) override
 
STDMETHODIMP SetDefaultLanguageProfile (_In_ LANGID langid, _In_ REFCLSID rclsid, _In_ REFGUID guidProfiles) override
 
STDMETHODIMP ActivateLanguageProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfiles) override
 
STDMETHODIMP GetActiveLanguageProfile (_In_ REFCLSID rclsid, _Out_ LANGID *plangid, _Out_ GUID *pguidProfile) override
 
STDMETHODIMP GetLanguageProfileDescription (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _Out_ BSTR *pbstrProfile) override
 
STDMETHODIMP GetCurrentLanguage (_Out_ LANGID *plangid) override
 
STDMETHODIMP ChangeCurrentLanguage (_In_ LANGID langid) override
 
STDMETHODIMP GetLanguageList (_Out_ LANGID **ppLangId, _Out_ ULONG *pulCount) override
 
STDMETHODIMP EnumLanguageProfiles (_In_ LANGID langid, _Out_ IEnumTfLanguageProfiles **ppEnum) override
 
STDMETHODIMP EnableLanguageProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ BOOL fEnable) override
 
STDMETHODIMP IsEnabledLanguageProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _Out_ BOOL *pfEnable) override
 
STDMETHODIMP EnableLanguageProfileByDefault (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ BOOL fEnable) override
 
STDMETHODIMP SubstituteKeyboardLayout (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ HKL hKL) override
 
STDMETHODIMP AdviseSink (_In_ REFIID riid, _In_ IUnknown *punk, _Out_ DWORD *pdwCookie) override
 
STDMETHODIMP UnadviseSink (_In_ DWORD dwCookie) override
 
STDMETHODIMP ActivateProfile (_In_ DWORD dwProfileType, _In_ LANGID langid, _In_ REFCLSID clsid, _In_ REFGUID guidProfile, _In_ HKL hkl, _In_ DWORD dwFlags) override
 
STDMETHODIMP DeactivateProfile (_In_ DWORD dwProfileType, _In_ LANGID langid, _In_ REFCLSID clsid, _In_ REFGUID guidProfile, _In_ HKL hkl, _In_ DWORD dwFlags) override
 
STDMETHODIMP GetProfile (_In_ DWORD dwProfileType, _In_ LANGID langid, _In_ REFCLSID clsid, _In_ REFGUID guidProfile, _In_ HKL hkl, _Out_ TF_INPUTPROCESSORPROFILE *pProfile) override
 
STDMETHODIMP EnumProfiles (_In_ LANGID langid, _Out_ IEnumTfInputProcessorProfiles **ppEnum) override
 
STDMETHODIMP ReleaseInputProcessor (_In_ REFCLSID rclsid, _In_ DWORD dwFlags) override
 
STDMETHODIMP RegisterProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ const WCHAR *pchDesc, _In_ ULONG cchDesc, _In_ const WCHAR *pchIconFile, _In_ ULONG cchFile, _In_ ULONG uIconIndex, _In_ HKL hklsubstitute, _In_ DWORD dwPreferredLayout, _In_ BOOL bEnabledByDefault, _In_ DWORD dwFlags) override
 
STDMETHODIMP UnregisterProfile (_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _In_ DWORD dwFlags) override
 
STDMETHODIMP GetActiveProfile (_In_ REFGUID catid, _Out_ TF_INPUTPROCESSORPROFILE *pProfile) override
 
- Public Member Functions inherited from ITfSource
HRESULT AdviseSink ([in] REFIID riid, [in, iid_is(riid)] IUnknown *punk, [out] DWORD *pdwCookie)
 
HRESULT UnadviseSink ([in] DWORD dwCookie)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Static Public Member Functions

static HRESULT CreateInstance (IUnknown *pUnkOuter, CInputProcessorProfiles **ppOut)
 

Protected Attributes

LONG m_cRefs
 
LANGID m_currentLanguage
 
struct list m_LanguageProfileNotifySink
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 16 of file inputprocessor.cpp.

Constructor & Destructor Documentation

◆ CInputProcessorProfiles()

CInputProcessorProfiles::CInputProcessorProfiles ( )

Definition at line 293 of file inputprocessor.cpp.

294 : m_cRefs(1)
296{
298}
static void list_init(struct list_entry *head)
Definition: list.h:51
struct list m_LanguageProfileNotifySink
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216

Referenced by CreateInstance().

◆ ~CInputProcessorProfiles()

CInputProcessorProfiles::~CInputProcessorProfiles ( )
virtual

Definition at line 300 of file inputprocessor.cpp.

301{
302 TRACE("destroying %p\n", this);
304}
EXTERN_C void free_sinks(struct list *sink_list)
Definition: msctf.cpp:297
#define TRACE(s)
Definition: solgame.cpp:4

Member Function Documentation

◆ ActivateLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::ActivateLanguageProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfiles 
)
override

Definition at line 526 of file inputprocessor.cpp.

530{
531 HRESULT hr;
533 TF_LANGUAGEPROFILE LanguageProfile;
534
535 TRACE("(%p) %s %x %s\n", this, debugstr_guid(&rclsid), langid, debugstr_guid(&guidProfiles));
536
538 return E_INVALIDARG;
539
540 if (get_active_textservice(rclsid, NULL))
541 {
542 TRACE("Already Active\n");
543 return E_FAIL;
544 }
545
546 hr = IsEnabledLanguageProfile(rclsid, langid, guidProfiles, &enabled);
547 if (FAILED(hr) || !enabled)
548 {
549 TRACE("Not Enabled\n");
550 return E_FAIL;
551 }
552
553 LanguageProfile.clsid = rclsid;
554 LanguageProfile.langid = langid;
555 LanguageProfile.guidProfile = guidProfiles;
556 LanguageProfile.fActive = TRUE;
557 return add_active_textservice(&LanguageProfile);
558}
STDMETHODIMP IsEnabledLanguageProfile(_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile, _Out_ BOOL *pfEnable) override
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
EXTERN_C HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
Definition: msctf.cpp:369
EXTERN_C BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *profile)
Definition: msctf.cpp:432
LANGID langid
Definition: msctf.idl:626
HRESULT hr
Definition: shlfolder.c:183

◆ ActivateProfile()

STDMETHODIMP CInputProcessorProfiles::ActivateProfile ( _In_ DWORD  dwProfileType,
_In_ LANGID  langid,
_In_ REFCLSID  clsid,
_In_ REFGUID  guidProfile,
_In_ HKL  hkl,
_In_ DWORD  dwFlags 
)
override

Definition at line 756 of file inputprocessor.cpp.

763{
764 FIXME("(%p)->(%d %x %s %s %p %x)\n", this, dwProfileType, langid, debugstr_guid(&clsid),
766 return E_NOTIMPL;
767}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
LPCWSTR LPCWSTR LPCWSTR DWORD dwFlags
Definition: env.c:37
const CLSID * clsid
Definition: msctf.cpp:50
GUID guidProfile
Definition: msctf.idl:628
HKL hkl
Definition: msctf.idl:632

◆ AddLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::AddLanguageProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ const WCHAR pchDesc,
_In_ ULONG  cchDesc,
_In_ const WCHAR pchIconFile,
_In_ ULONG  cchFile,
_In_ ULONG  uIconIndex 
)
override

Definition at line 374 of file inputprocessor.cpp.

383{
384 HKEY tipkey, fmtkey;
385 WCHAR buf[39], fullkey[100];
386 DWORD disposition = 0;
388
389 TRACE("(%p) %s %x %s %s %s %i\n", this, debugstr_guid(&rclsid), langid,
390 debugstr_guid(&guidProfile), debugstr_wn(pchDesc, cchDesc),
391 debugstr_wn(pchIconFile, cchFile), uIconIndex);
392
393 StringFromGUID2(rclsid, buf, _countof(buf));
394 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s", szwSystemTIPKey, buf);
395
396 error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, fullkey, 0, KEY_READ | KEY_WRITE, &tipkey);
397 if (error != ERROR_SUCCESS)
398 return E_FAIL;
399
401 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\0x%08x\\%s", L"LanguageProfile", langid, buf);
402
403 error = RegCreateKeyExW(tipkey, fullkey, 0, NULL, 0, KEY_READ | KEY_WRITE,
404 NULL, &fmtkey, &disposition);
405 if (error == ERROR_SUCCESS)
406 {
407 DWORD zero = 0x0;
408 RegSetValueExW(fmtkey, L"Description", 0, REG_SZ, (PBYTE)pchDesc, cchDesc * sizeof(WCHAR));
409 RegSetValueExW(fmtkey, L"IconFile", 0, REG_SZ, (PBYTE)pchIconFile, cchFile * sizeof(WCHAR));
410 RegSetValueExW(fmtkey, L"IconIndex", 0, REG_DWORD, (PBYTE)&uIconIndex, sizeof(uIconIndex));
411 if (disposition == REG_CREATED_NEW_KEY)
412 RegSetValueExW(fmtkey, L"Enable", 0, REG_DWORD, (PBYTE)&zero, sizeof(DWORD));
413 RegCloseKey(fmtkey);
415 }
416 RegCloseKey(tipkey);
417
418 return (error == ERROR_SUCCESS) ? S_OK : E_FAIL;
419}
#define szwSystemTIPKey
Definition: precomp.h:105
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define L(x)
Definition: resources.c:13
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void add_userkey(_In_ REFCLSID rclsid, _In_ LANGID langid, _In_ REFGUID guidProfile)
#define S_OK
Definition: intsafe.h:52
#define debugstr_wn
Definition: kernel32.h:33
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
#define KEY_WRITE
Definition: nt_native.h:1031
BYTE * PBYTE
Definition: pedump.c:66
#define REG_DWORD
Definition: sdbapi.c:598
int zero
Definition: sehframes.cpp:29
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ AdviseSink()

STDMETHODIMP CInputProcessorProfiles::AdviseSink ( _In_ REFIID  riid,
_In_ IUnknown punk,
_Out_ DWORD pdwCookie 
)
override

Definition at line 856 of file inputprocessor.cpp.

860{
861 TRACE("(%p) %s %p %p\n", this, debugstr_guid(&riid), punk, pdwCookie);
862
863 if (cicIsNullPtr(&riid) || !punk || !pdwCookie)
864 return E_INVALIDARG;
865
866 if (riid == IID_ITfLanguageProfileNotifySink)
867 return advise_sink(&m_LanguageProfileNotifySink, IID_ITfLanguageProfileNotifySink,
868 COOKIE_MAGIC_IPPSINK, punk, pdwCookie);
869
870 FIXME("(%p) Unhandled Sink: %s\n", this, debugstr_guid(&riid));
871 return E_NOTIMPL;
872}
#define COOKIE_MAGIC_IPPSINK
Definition: precomp.h:36
static bool cicIsNullPtr(LPCVOID ptr)
Definition: cicbase.h:40
REFIID riid
Definition: atlbase.h:39
EXTERN_C HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie)
Definition: msctf.cpp:259

◆ ChangeCurrentLanguage()

STDMETHODIMP CInputProcessorProfiles::ChangeCurrentLanguage ( _In_ LANGID  langid)
override

Definition at line 606 of file inputprocessor.cpp.

607{
609 struct list *cursor;
610 BOOL accept;
611
612 FIXME("STUB:(%p)\n", this);
613
615 {
616 accept = TRUE;
617 sink->OnLanguageChange(langid, &accept);
618 if (!accept)
619 return E_FAIL;
620 }
621
622 /* TODO: On successful language change call OnLanguageChanged sink */
623 return E_NOTIMPL;
624}
#define SINK_FOR_EACH(cursor, list, type, elem)
Definition: precomp.h:96
Definition: list.h:37
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
const char cursor[]
Definition: icontest.c:13
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23

◆ CreateInstance()

HRESULT CInputProcessorProfiles::CreateInstance ( IUnknown pUnkOuter,
CInputProcessorProfiles **  ppOut 
)
static

Definition at line 884 of file inputprocessor.cpp.

885{
886 if (pUnkOuter)
888
890 if (!This)
891 return E_OUTOFMEMORY;
892
893 *ppOut = This;
894 TRACE("returning %p\n", *ppOut);
895 return S_OK;
896}
#define cicNoThrow
Definition: cicbase.h:46
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

Referenced by InputProcessorProfiles_Constructor().

◆ DeactivateProfile()

STDMETHODIMP CInputProcessorProfiles::DeactivateProfile ( _In_ DWORD  dwProfileType,
_In_ LANGID  langid,
_In_ REFCLSID  clsid,
_In_ REFGUID  guidProfile,
_In_ HKL  hkl,
_In_ DWORD  dwFlags 
)
override

Definition at line 769 of file inputprocessor.cpp.

776{
777 FIXME("(%p)->(%d %x %s %s %p %x)\n", this, dwProfileType, langid, debugstr_guid(&clsid),
779 return E_NOTIMPL;
780}

◆ EnableLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::EnableLanguageProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ BOOL  fEnable 
)
override

Definition at line 652 of file inputprocessor.cpp.

657{
658 HKEY key;
659 WCHAR buf[39], buf2[39], fullkey[168];
661
662 TRACE("(%p) %s %x %s %i\n", this, debugstr_guid(&rclsid), langid, debugstr_guid(&guidProfile), fEnable);
663
664 StringFromGUID2(rclsid, buf, _countof(buf));
666 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s\\%s\\0x%08x\\%s", szwSystemTIPKey, buf,
667 L"LanguageProfile", langid, buf2);
668
670 if (error != ERROR_SUCCESS)
671 return E_FAIL;
672
673 RegSetValueExW(key, L"Enable", 0, REG_DWORD, (LPBYTE)&fEnable, sizeof(fEnable));
675 return S_OK;
676}
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_CURRENT_USER
Definition: winreg.h:11

◆ EnableLanguageProfileByDefault()

STDMETHODIMP CInputProcessorProfiles::EnableLanguageProfileByDefault ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ BOOL  fEnable 
)
override

Definition at line 720 of file inputprocessor.cpp.

725{
726 HKEY key;
727 WCHAR buf[39], buf2[39], fullkey[168];
729
730 TRACE("(%p) %s %x %s %i\n", this, debugstr_guid(&rclsid), langid, debugstr_guid(&guidProfile), fEnable);
731
732 StringFromGUID2(rclsid, buf, _countof(buf));
734 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s\\%s\\0x%08x\\%s", szwSystemTIPKey,
735 buf, L"LanguageProfile", langid, buf2);
736
738 if (error != ERROR_SUCCESS)
739 return E_FAIL;
740
741 RegSetValueExW(key, L"Enable", 0, REG_DWORD, (PBYTE)&fEnable, sizeof(fEnable));
743 return S_OK;
744}

◆ EnumInputProcessorInfo()

STDMETHODIMP CInputProcessorProfiles::EnumInputProcessorInfo ( _Out_ IEnumGUID **  ppEnum)
override

Definition at line 430 of file inputprocessor.cpp.

431{
432 TRACE("(%p) %p\n", this, ppEnum);
433
435}
static HRESULT CreateInstance(CProfilesEnumGuid **ppOut)

◆ EnumLanguageProfiles()

STDMETHODIMP CInputProcessorProfiles::EnumLanguageProfiles ( _In_ LANGID  langid,
_Out_ IEnumTfLanguageProfiles **  ppEnum 
)
override

Definition at line 637 of file inputprocessor.cpp.

640{
641 TRACE("(%p) %x %p\n", this, langid, ppEnum);
642
643 if (!ppEnum)
644 return E_INVALIDARG;
645
646 CEnumTfLanguageProfiles *profenum;
648 *ppEnum = static_cast<IEnumTfLanguageProfiles *>(profenum);
649 return hr;
650}
static HRESULT CreateInstance(LANGID langid, CEnumTfLanguageProfiles **out)

◆ EnumProfiles()

STDMETHODIMP CInputProcessorProfiles::EnumProfiles ( _In_ LANGID  langid,
_Out_ IEnumTfInputProcessorProfiles **  ppEnum 
)
override

Definition at line 795 of file inputprocessor.cpp.

798{
799 TRACE("(%p)->(%x %p)\n", this, langid, ppEnum);
800
802 if (!enum_profiles)
803 return E_OUTOFMEMORY;
804
805 *ppEnum = static_cast<IEnumTfInputProcessorProfiles *>(enum_profiles);
806 return S_OK;
807}

◆ GetActiveLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::GetActiveLanguageProfile ( _In_ REFCLSID  rclsid,
_Out_ LANGID plangid,
_Out_ GUID pguidProfile 
)
override

Definition at line 560 of file inputprocessor.cpp.

564{
566
567 TRACE("(%p) %s %p %p\n", this, debugstr_guid(&rclsid), plangid, pguidProfile);
568
569 if (cicIsNullPtr(&rclsid) || !plangid || !pguidProfile)
570 return E_INVALIDARG;
571
572 if (get_active_textservice(rclsid, &profile))
573 {
574 *plangid = profile.langid;
575 *pguidProfile = profile.guidProfile;
576 return S_OK;
577 }
578 else
579 {
580 *pguidProfile = GUID_NULL;
581 return S_FALSE;
582 }
583}
#define profile
Definition: kernel32.h:12
#define GUID_NULL
Definition: ks.h:106
#define S_FALSE
Definition: winerror.h:3451

◆ GetActiveProfile()

STDMETHODIMP CInputProcessorProfiles::GetActiveProfile ( _In_ REFGUID  catid,
_Out_ TF_INPUTPROCESSORPROFILE pProfile 
)
override

Definition at line 848 of file inputprocessor.cpp.

851{
852 FIXME("(%p)->(%s %p)\n", this, debugstr_guid(&catid), pProfile);
853 return E_NOTIMPL;
854}
GUID catid
Definition: msctf.idl:629

◆ GetCurrentLanguage()

STDMETHODIMP CInputProcessorProfiles::GetCurrentLanguage ( _Out_ LANGID plangid)
override

Definition at line 595 of file inputprocessor.cpp.

596{
597 TRACE("(%p) 0x%x\n", this, m_currentLanguage);
598
599 if (!plangid)
600 return E_INVALIDARG;
601
602 *plangid = m_currentLanguage;
603 return S_OK;
604}

◆ GetDefaultLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::GetDefaultLanguageProfile ( _In_ LANGID  langid,
_In_ REFGUID  catid,
_Out_ CLSID pclsid,
_Out_ GUID pguidProfile 
)
override

Definition at line 437 of file inputprocessor.cpp.

442{
443 WCHAR fullkey[168], buf[39];
444 HKEY hKey;
445 DWORD count;
447
448 TRACE("%p) %x %s %p %p\n", this, langid, debugstr_guid(&catid), pclsid, pguidProfile);
449
450 if (cicIsNullPtr(&catid) || !pclsid || !pguidProfile)
451 return E_INVALIDARG;
452
454 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s\\0x%08x\\%s", szwSystemCTFKey,
455 L"Assemblies", langid, buf);
456
458 if (error != ERROR_SUCCESS)
459 return S_FALSE;
460
461 count = sizeof(buf);
462 error = RegQueryValueExW(hKey, L"Default", 0, NULL, (PBYTE)buf, &count);
463 if (error != ERROR_SUCCESS)
464 {
466 return S_FALSE;
467 }
468 CLSIDFromString(buf, pclsid);
469
470 error = RegQueryValueExW(hKey, L"Profile", 0, NULL, (PBYTE)buf, &count);
471 if (error == ERROR_SUCCESS)
472 CLSIDFromString(buf, pguidProfile);
473
475
476 return S_OK;
477}
#define szwSystemCTFKey
Definition: precomp.h:106
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
FxAutoRegKey hKey
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ GetLanguageList()

STDMETHODIMP CInputProcessorProfiles::GetLanguageList ( _Out_ LANGID **  ppLangId,
_Out_ ULONG pulCount 
)
override

Definition at line 626 of file inputprocessor.cpp.

629{
630 FIXME("Semi-STUB:(%p)\n", this);
631 *ppLangId = (LANGID *)CoTaskMemAlloc(sizeof(LANGID));
632 **ppLangId = m_currentLanguage;
633 *pulCount = 1;
634 return S_OK;
635}
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
USHORT LANGID
Definition: mui.h:9

◆ GetLanguageProfileDescription()

STDMETHODIMP CInputProcessorProfiles::GetLanguageProfileDescription ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_Out_ BSTR pbstrProfile 
)
override

Definition at line 585 of file inputprocessor.cpp.

590{
591 FIXME("STUB:(%p)\n", this);
592 return E_NOTIMPL;
593}

◆ GetProfile()

STDMETHODIMP CInputProcessorProfiles::GetProfile ( _In_ DWORD  dwProfileType,
_In_ LANGID  langid,
_In_ REFCLSID  clsid,
_In_ REFGUID  guidProfile,
_In_ HKL  hkl,
_Out_ TF_INPUTPROCESSORPROFILE pProfile 
)
override

Definition at line 782 of file inputprocessor.cpp.

789{
790 FIXME("(%p)->(%d %x %s %s %p %p)\n", this, dwProfileType, langid, debugstr_guid(&clsid),
791 debugstr_guid(&guidProfile), hkl, pProfile);
792 return E_NOTIMPL;
793}

◆ IsEnabledLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::IsEnabledLanguageProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_Out_ BOOL pfEnable 
)
override

Definition at line 678 of file inputprocessor.cpp.

683{
684 HKEY key;
685 WCHAR buf[39], buf2[39], fullkey[168];
687
688 TRACE("(%p) %s, %i, %s, %p\n", this, debugstr_guid(&rclsid), langid, debugstr_guid(&guidProfile), pfEnable);
689
690 if (!pfEnable)
691 return E_INVALIDARG;
692
693 StringFromGUID2(rclsid, buf, _countof(buf));
695 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s\\%s\\0x%08x\\%s", szwSystemTIPKey,
696 buf, L"LanguageProfile", langid, buf2);
697
699 if (error == ERROR_SUCCESS)
700 {
701 DWORD count = sizeof(DWORD);
702 error = RegQueryValueExW(key, L"Enable", 0, NULL, (LPBYTE)pfEnable, &count);
704 }
705
706 if (error != ERROR_SUCCESS) /* Try Default */
707 {
709 if (error == ERROR_SUCCESS)
710 {
711 DWORD count = sizeof(DWORD);
712 error = RegQueryValueExW(key, L"Enable", 0, NULL, (LPBYTE)pfEnable, &count);
714 }
715 }
716
717 return (error == ERROR_SUCCESS) ? S_OK : E_FAIL;
718}
#define DWORD
Definition: nt_native.h:44

Referenced by ActivateLanguageProfile().

◆ QueryInterface()

STDMETHODIMP CInputProcessorProfiles::QueryInterface ( REFIID  iid,
LPVOID ppvObj 
)
override

Definition at line 306 of file inputprocessor.cpp.

307{
308 *ppvObj = NULL;
309
310 if (iid == IID_IUnknown || iid == IID_ITfInputProcessorProfiles)
311 *ppvObj = static_cast<ITfInputProcessorProfiles *>(this);
312 else if (iid == IID_ITfInputProcessorProfileMgr)
313 *ppvObj = static_cast<ITfInputProcessorProfileMgr *>(this);
314 else if (iid == IID_ITfSource)
315 *ppvObj = static_cast<ITfSource *>(this);
316
317 if (!*ppvObj)
318 {
319 WARN("unsupported interface: %s\n", debugstr_guid(&iid));
320 return E_NOINTERFACE;
321 }
322
323 AddRef();
324 return S_OK;
325}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
ULONG AddRef()
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ Register()

STDMETHODIMP CInputProcessorProfiles::Register ( _In_ REFCLSID  rclsid)
override

Definition at line 340 of file inputprocessor.cpp.

341{
342 HKEY tipkey;
343 WCHAR buf[39], fullkey[68];
344
345 TRACE("(%p) %s\n", this, debugstr_guid(&rclsid));
346
347 StringFromGUID2(rclsid, buf, _countof(buf));
348 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s", szwSystemTIPKey, buf);
349
351 &tipkey, NULL) != ERROR_SUCCESS)
352 {
353 return E_FAIL;
354 }
355
356 RegCloseKey(tipkey);
357 return S_OK;
358}

◆ RegisterProfile()

STDMETHODIMP CInputProcessorProfiles::RegisterProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ const WCHAR pchDesc,
_In_ ULONG  cchDesc,
_In_ const WCHAR pchIconFile,
_In_ ULONG  cchFile,
_In_ ULONG  uIconIndex,
_In_ HKL  hklsubstitute,
_In_ DWORD  dwPreferredLayout,
_In_ BOOL  bEnabledByDefault,
_In_ DWORD  dwFlags 
)
override

Definition at line 817 of file inputprocessor.cpp.

830{
831 FIXME("(%p)->(%s %x %s %s %d %s %u %u %p %x %x %x)\n", this, debugstr_guid(&rclsid), langid,
832 debugstr_guid(&guidProfile), debugstr_w(pchDesc), cchDesc, debugstr_w(pchIconFile),
833 cchFile, uIconIndex, hklsubstitute, dwPreferredLayout, bEnabledByDefault, dwFlags);
834 return E_NOTIMPL;
835}
#define debugstr_w
Definition: kernel32.h:32

◆ ReleaseInputProcessor()

STDMETHODIMP CInputProcessorProfiles::ReleaseInputProcessor ( _In_ REFCLSID  rclsid,
_In_ DWORD  dwFlags 
)
override

Definition at line 809 of file inputprocessor.cpp.

812{
813 FIXME("(%p)->(%s %x)\n", this, debugstr_guid(&rclsid), dwFlags);
814 return E_NOTIMPL;
815}

◆ RemoveLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::RemoveLanguageProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile 
)
override

Definition at line 421 of file inputprocessor.cpp.

425{
426 FIXME("STUB:(%p)\n", this);
427 return E_NOTIMPL;
428}

◆ SetDefaultLanguageProfile()

STDMETHODIMP CInputProcessorProfiles::SetDefaultLanguageProfile ( _In_ LANGID  langid,
_In_ REFCLSID  rclsid,
_In_ REFGUID  guidProfiles 
)
override

Definition at line 479 of file inputprocessor.cpp.

483{
484 WCHAR fullkey[168], buf[39];
485 HKEY hKey;
486 GUID catid;
487 HRESULT hr;
488 ITfCategoryMgr *catmgr;
490 static const GUID * tipcats[3] = { &GUID_TFCAT_TIP_KEYBOARD,
493
494 TRACE("(%p) %x %s %s\n", this, langid, debugstr_guid(&rclsid), debugstr_guid(&guidProfiles));
495
496 if (cicIsNullPtr(&rclsid) || cicIsNullPtr(&guidProfiles))
497 return E_INVALIDARG;
498
500 if (FAILED(hr))
501 return hr;
502
503 if (catmgr->FindClosestCategory(rclsid, &catid, tipcats, _countof(tipcats)) != S_OK)
504 hr = catmgr->FindClosestCategory(rclsid, &catid, NULL, 0);
505 catmgr->Release();
506 if (FAILED(hr))
507 return E_FAIL;
508
510 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s\\0x%08x\\%s", szwSystemCTFKey, L"Assemblies", langid, buf);
511
513 NULL, &hKey, NULL);
514 if (error != ERROR_SUCCESS)
515 return E_FAIL;
516
517 StringFromGUID2(rclsid, buf, _countof(buf));
518 RegSetValueExW(hKey, L"Default", 0, REG_SZ, (PBYTE)buf, sizeof(buf));
519 StringFromGUID2(guidProfiles, buf, _countof(buf));
520 RegSetValueExW(hKey, L"Profile", 0, REG_SZ, (PBYTE)buf, sizeof(buf));
522
523 return S_OK;
524}
EXTERN_C HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
HRESULT FindClosestCategory([in] REFGUID rguid, [out] GUID *pcatid, [in, size_is(ulCount)] const GUID **ppcatidList, [in] ULONG ulCount)
ULONG Release()
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:81
EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH
Definition: msctf.idl:82
EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING
Definition: msctf.idl:83

◆ STDMETHODIMP_() [1/2]

CInputProcessorProfiles::STDMETHODIMP_ ( ULONG  )
override

◆ STDMETHODIMP_() [2/2]

CInputProcessorProfiles::STDMETHODIMP_ ( ULONG  )
override

◆ SubstituteKeyboardLayout()

STDMETHODIMP CInputProcessorProfiles::SubstituteKeyboardLayout ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ HKL  hKL 
)
override

Definition at line 746 of file inputprocessor.cpp.

751{
752 FIXME("STUB:(%p)\n", this);
753 return E_NOTIMPL;
754}

◆ UnadviseSink()

STDMETHODIMP CInputProcessorProfiles::UnadviseSink ( _In_ DWORD  dwCookie)
override

Definition at line 874 of file inputprocessor.cpp.

875{
876 TRACE("(%p) %x\n", this, dwCookie);
877
878 if (get_Cookie_magic(dwCookie) != COOKIE_MAGIC_IPPSINK)
879 return E_INVALIDARG;
880
881 return unadvise_sink(dwCookie);
882}
EXTERN_C DWORD get_Cookie_magic(DWORD id)
Definition: msctf.cpp:203
EXTERN_C HRESULT unadvise_sink(DWORD cookie)
Definition: msctf.cpp:286

◆ Unregister()

STDMETHODIMP CInputProcessorProfiles::Unregister ( _In_ REFCLSID  rclsid)
override

Definition at line 360 of file inputprocessor.cpp.

361{
362 WCHAR buf[39], fullkey[68];
363
364 TRACE("(%p) %s\n", this, debugstr_guid(&rclsid));
365
366 StringFromGUID2(rclsid, buf, _countof(buf));
367 StringCchPrintfW(fullkey, _countof(fullkey), L"%s\\%s", szwSystemTIPKey, buf);
368
371 return S_OK;
372}
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)

◆ UnregisterProfile()

STDMETHODIMP CInputProcessorProfiles::UnregisterProfile ( _In_ REFCLSID  rclsid,
_In_ LANGID  langid,
_In_ REFGUID  guidProfile,
_In_ DWORD  dwFlags 
)
override

Definition at line 837 of file inputprocessor.cpp.

842{
843 FIXME("(%p)->(%s %x %s %x)\n", this, debugstr_guid(&rclsid), langid,
845 return E_NOTIMPL;
846}

Member Data Documentation

◆ m_cRefs

LONG CInputProcessorProfiles::m_cRefs
protected

Definition at line 160 of file inputprocessor.cpp.

Referenced by STDMETHODIMP_().

◆ m_currentLanguage

LANGID CInputProcessorProfiles::m_currentLanguage
protected

◆ m_LanguageProfileNotifySink

struct list CInputProcessorProfiles::m_LanguageProfileNotifySink
protected

The documentation for this class was generated from the following file: