ReactOS 0.4.17-dev-116-ga4b6fe9
CicProfile Class Reference

#include <profile.h>

Inheritance diagram for CicProfile:
Collaboration diagram for CicProfile:

Classes

struct  tagLANG_PROF_ENUM_ARG
 

Public Member Functions

 CicProfile ()
 @implemented
 
virtual ~CicProfile ()
 @implemented
 
STDMETHODIMP QueryInterface (REFIID riid, LPVOID *ppvObj) override
 @implemented
 
 STDMETHODIMP_ (ULONG) AddRef() override
 
 STDMETHODIMP_ (ULONG) Release() override
 
HRESULT GetActiveLanguageProfile (_In_ HKL hKL, _In_ REFGUID catid, _Out_ TF_LANGUAGEPROFILE *pProfile)
 @implemented
 
HRESULT GetLangId (_Out_ LANGID *pLangID)
 @implemented
 
HRESULT GetCodePageA (_Out_ UINT *puCodePage)
 @implemented
 
HRESULT InitProfileInstance (_Inout_ TLS *pTLS)
 @implemented
 
HRESULT IsIME (HKL hKL)
 @implemented
 
- 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 CALLBACK LanguageProfilesCallback (_In_ TF_LANGUAGEPROFILE profile, _Inout_opt_ LPARAM lParam)
 @implemented
 

Protected Types

typedef struct CicProfile::tagLANG_PROF_ENUM_ARG LANG_PROF_ENUM_ARG
 
typedef struct CicProfile::tagLANG_PROF_ENUM_ARGPLANG_PROF_ENUM_ARG
 

Static Protected Member Functions

static INT CALLBACK ActiveLanguageProfileNotifySinkCallback (REFGUID rguid1, REFGUID rguid2, BOOL fActivated, LPVOID pUserData)
 @implemented
 

Protected Attributes

ITfInputProcessorProfiles * m_pIPProfiles
 
CActiveLanguageProfileNotifySinkm_pActiveLanguageProfileNotifySink
 
LANGID m_LangID1
 
WORD m_padding1
 
DWORD m_dwFlags
 
UINT m_nCodePage
 
LANGID m_LangID2
 
WORD m_padding2
 
DWORD m_dwUnknown1
 
LONG m_cRefs
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 12 of file profile.h.

Member Typedef Documentation

◆ LANG_PROF_ENUM_ARG

◆ PLANG_PROF_ENUM_ARG

Constructor & Destructor Documentation

◆ CicProfile()

CicProfile::CicProfile ( )

@implemented

Definition at line 67 of file profile.cpp.

68{
69 m_dwFlags = 0;
70 m_cRefs = 1;
73 m_LangID1 = 0;
75 m_LangID2 = 0;
76 m_dwUnknown1 = 0;
77}
DWORD m_dwFlags
Definition: profile.h:25
UINT m_nCodePage
Definition: profile.h:26
LANGID m_LangID1
Definition: profile.h:23
DWORD m_dwUnknown1
Definition: profile.h:29
LONG m_cRefs
Definition: profile.h:30
LANGID m_LangID2
Definition: profile.h:27
ITfInputProcessorProfiles * m_pIPProfiles
Definition: profile.h:21
CActiveLanguageProfileNotifySink * m_pActiveLanguageProfileNotifySink
Definition: profile.h:22
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109

◆ ~CicProfile()

CicProfile::~CicProfile ( )
virtual

@implemented

Definition at line 80 of file profile.cpp.

81{
82 if (m_pIPProfiles)
83 {
84 if (m_LangID1)
85 m_pIPProfiles->ChangeCurrentLanguage(m_LangID1);
86
87 m_pIPProfiles->Release();
89 }
90
92 {
96 }
97}
HRESULT _Unadvise()
@implemented
Definition: sinks.cpp:502
ULONG Release()

Member Function Documentation

◆ ActiveLanguageProfileNotifySinkCallback()

INT CALLBACK CicProfile::ActiveLanguageProfileNotifySinkCallback ( REFGUID  rguid1,
REFGUID  rguid2,
BOOL  fActivated,
LPVOID  pUserData 
)
staticprotected

@implemented

Definition at line 125 of file profile.cpp.

130{
131 CicProfile *pThis = (CicProfile *)pUserData;
132 pThis->m_dwFlags &= ~0xE;
133 return 0;
134}

Referenced by InitProfileInstance().

◆ GetActiveLanguageProfile()

HRESULT CicProfile::GetActiveLanguageProfile ( _In_ HKL  hKL,
_In_ REFGUID  catid,
_Out_ TF_LANGUAGEPROFILE pProfile 
)

@implemented

Definition at line 221 of file profile.cpp.

225{
227 HRESULT hr = m_pIPProfiles->EnumLanguageProfiles(LOWORD(hKL), &pEnum);
228 if (FAILED(hr))
229 return S_FALSE;
230
232 arg.catid = catid;
233
235 enumValue(pEnum, LanguageProfilesCallback, (LPARAM)&arg);
236 DWORD ret = enumValue.DoEnum();
237 if (ret != ERROR_SUCCESS || !pProfile)
238 return S_FALSE;
239 *pProfile = arg.profile;
240 return S_OK;
241}
struct CicProfile::tagLANG_PROF_ENUM_ARG LANG_PROF_ENUM_ARG
static HRESULT CALLBACK LanguageProfilesCallback(_In_ TF_LANGUAGEPROFILE profile, _Inout_opt_ LPARAM lParam)
@implemented
Definition: profile.cpp:17
HRESULT hr
Definition: delayimp.cpp:573
#define ERROR_SUCCESS
Definition: deptool.c:10
return ret
Definition: mutex.c:146
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
LONG_PTR LPARAM
Definition: minwindef.h:175
GUID catid
Definition: msctf.idl:629
#define LOWORD(l)
Definition: pedump.c:82
void * arg
Definition: msvc.h:10
#define S_FALSE
Definition: winerror.h:3451

Referenced by CicBridge::ConfigureGeneral(), and CicBridge::ConfigureRegisterWord().

◆ GetCodePageA()

HRESULT CicProfile::GetCodePageA ( _Out_ UINT puCodePage)

@implemented

Definition at line 137 of file profile.cpp.

138{
139 if (!puCodePage)
140 return E_INVALIDARG;
141
142 if (m_dwFlags & 2)
143 {
144 *puCodePage = m_nCodePage;
145 return S_OK;
146 }
147
148 *puCodePage = 0;
149
152 if (FAILED(hr))
153 return E_FAIL;
154
155 WCHAR szBuff[12];
157 if (cch)
158 {
159 szBuff[cch] = 0;
160 m_nCodePage = *puCodePage = wcstoul(szBuff, NULL, 10);
161 m_dwFlags |= 2;
162 }
163
164 return S_OK;
165}
HRESULT GetLangId(_Out_ LANGID *pLangID)
@implemented
Definition: profile.cpp:168
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2912
USHORT LANGID
Definition: mui.h:9
short WCHAR
Definition: pedump.c:58
_In_ UINT _In_ UINT cch
Definition: shellapi.h:432
#define _countof(array)
Definition: sndvol32.h:70
int32_t INT
Definition: typedefs.h:58
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:45

Referenced by CFnDocFeed::DocFeed(), CFnDocFeed::StartReconvert(), and CFnDocFeed::StartUndoCompositionString().

◆ GetLangId()

HRESULT CicProfile::GetLangId ( _Out_ LANGID pLangID)

@implemented

Definition at line 168 of file profile.cpp.

169{
170 *pLangID = 0;
171
172 if (!m_pIPProfiles)
173 return E_FAIL;
174
175 if (m_dwFlags & 4)
176 {
177 *pLangID = m_LangID2;
178 return S_OK;
179 }
180
181 HRESULT hr = m_pIPProfiles->GetCurrentLanguage(pLangID);
182 if (SUCCEEDED(hr))
183 {
184 m_dwFlags |= 4;
185 m_LangID2 = *pLangID;
186 }
187
188 return hr;
189}
#define SUCCEEDED(hr)
Definition: intsafe.h:50

Referenced by GetCodePageA(), CIMEUIWindowHandler::ImeUIMsImeHandler(), IsEALang(), CicBridge::Notify(), and CicInputContext::OnCleanupContext().

◆ InitProfileInstance()

HRESULT CicProfile::InitProfileInstance ( _Inout_ TLS pTLS)

@implemented

Definition at line 193 of file profile.cpp.

194{
196 if (FAILED(hr))
197 return hr;
198
200 {
204 if (!pSink)
205 {
206 m_pIPProfiles->Release();
208 return E_FAIL;
209 }
211 }
212
213 if (pTLS->m_pThreadMgr)
214 m_pActiveLanguageProfileNotifySink->_Advise(pTLS->m_pThreadMgr);
215
216 return hr;
217}
#define cicNoThrow
Definition: cicbase.h:49
HRESULT _Advise(ITfThreadMgr *pThreadMgr)
@implemented
Definition: sinks.cpp:472
static INT CALLBACK ActiveLanguageProfileNotifySinkCallback(REFGUID rguid1, REFGUID rguid2, BOOL fActivated, LPVOID pUserData)
@implemented
Definition: profile.cpp:125
HRESULT WINAPI TF_CreateInputProcessorProfiles(ITfInputProcessorProfiles **ppipr)
Definition: msctf.cpp:651

◆ IsIME()

HRESULT CicProfile::IsIME ( HKL  hKL)

@implemented

Definition at line 244 of file profile.cpp.

245{
247 HRESULT hr = m_pIPProfiles->EnumLanguageProfiles(LOWORD(hKL), &pEnum);
248 if (FAILED(hr))
249 return S_FALSE;
250
252 enumValue(pEnum, LanguageProfilesCallback);
253 DWORD ret = enumValue.DoEnum();
254 return (ret == ERROR_SUCCESS) ? S_OK : S_FALSE;
255}

Referenced by CtfImeIsIME().

◆ LanguageProfilesCallback()

HRESULT CicProfile::LanguageProfilesCallback ( _In_ TF_LANGUAGEPROFILE  profile,
_Inout_opt_ LPARAM  lParam 
)
static

@implemented

Definition at line 17 of file profile.cpp.

20{
21 if (!profile.fActive || !memcmp(&profile.clsid, &GUID_NULL, sizeof(GUID_NULL)))
22 return S_FALSE;
24 if (!pArg)
25 return S_OK;
26 if (memcmp(&profile.catid, &pArg->catid, sizeof(profile.catid)) != 0)
27 return S_FALSE;
28 pArg->profile = profile;
29 return S_OK;
30}
struct CicProfile::tagLANG_PROF_ENUM_ARG * PLANG_PROF_ENUM_ARG
LPARAM lParam
Definition: combotst.c:139
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
#define profile
Definition: kernel32.h:12
#define GUID_NULL
Definition: ks.h:106

Referenced by GetActiveLanguageProfile(), and IsIME().

◆ QueryInterface()

STDMETHODIMP CicProfile::QueryInterface ( REFIID  riid,
LPVOID ppvObj 
)
override

@implemented

Definition at line 100 of file profile.cpp.

101{
102 *ppvObj = NULL;
103 return E_NOINTERFACE;
104}
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ STDMETHODIMP_() [1/2]

CicProfile::STDMETHODIMP_ ( ULONG  )
override

◆ STDMETHODIMP_() [2/2]

CicProfile::STDMETHODIMP_ ( ULONG  )
override

Member Data Documentation

◆ m_cRefs

LONG CicProfile::m_cRefs
protected

Definition at line 30 of file profile.h.

Referenced by CicProfile(), and STDMETHODIMP_().

◆ m_dwFlags

DWORD CicProfile::m_dwFlags
protected

◆ m_dwUnknown1

DWORD CicProfile::m_dwUnknown1
protected

Definition at line 29 of file profile.h.

Referenced by CicProfile().

◆ m_LangID1

LANGID CicProfile::m_LangID1
protected

Definition at line 23 of file profile.h.

Referenced by CicProfile(), and ~CicProfile().

◆ m_LangID2

LANGID CicProfile::m_LangID2
protected

Definition at line 27 of file profile.h.

Referenced by CicProfile(), and GetLangId().

◆ m_nCodePage

UINT CicProfile::m_nCodePage
protected

Definition at line 26 of file profile.h.

Referenced by CicProfile(), and GetCodePageA().

◆ m_pActiveLanguageProfileNotifySink

CActiveLanguageProfileNotifySink* CicProfile::m_pActiveLanguageProfileNotifySink
protected

Definition at line 22 of file profile.h.

Referenced by CicProfile(), InitProfileInstance(), and ~CicProfile().

◆ m_padding1

WORD CicProfile::m_padding1
protected

Definition at line 24 of file profile.h.

◆ m_padding2

WORD CicProfile::m_padding2
protected

Definition at line 28 of file profile.h.

◆ m_pIPProfiles

ITfInputProcessorProfiles* CicProfile::m_pIPProfiles
protected

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