ReactOS  0.4.15-dev-1389-g828d5fa
CAppRichEdit Class Reference

#include <appview.h>

Inheritance diagram for CAppRichEdit:
Collaboration diagram for CAppRichEdit:

Public Member Functions

BOOL ShowAvailableAppInfo (CAvailableApplicationInfo *Info)
 
VOID InsertTextWithString (UINT StringID, DWORD StringFlags, const ATL::CStringW &Text, DWORD TextFlags)
 
BOOL ShowInstalledAppInfo (CInstalledApplicationInfo *Info)
 
VOID SetWelcomeText ()
 
- Public Member Functions inherited from CUiWindow< CRichEdit >
virtual CUiBoxAsBox ()
 
HWND GetWindow ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
virtual VOID AppendTabOrderWindow (int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
 
virtual ~CUiWindow ()
 
VOID GetWindowTextW (ATL::CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 
- Public Member Functions inherited from CRichEdit
 CRichEdit ()
 
VOID SetRangeFormatting (SIZE_T Start, SIZE_T End, DWORD dwEffects)
 
LONG GetTextLen ()
 
VOID InsertText (LPCWSTR lpszText, DWORD dwEffects)
 
VOID InsertText (const ATL::CStringW &szText, DWORD dwEffects)
 
VOID SetText (LPCWSTR lpszText, DWORD dwEffects)
 
VOID SetText (const ATL::CStringW &szText, DWORD dwEffects)
 
HWND Create (HWND hwndParent)
 
virtual VOID OnLink (ENLINK *Link)
 
 ~CRichEdit ()
 

Private Member Functions

VOID LoadAndInsertText (UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
 
VOID LoadAndInsertText (UINT uStringID, DWORD StringFlags)
 
VOID InsertVersionInfo (CAvailableApplicationInfo *Info)
 
VOID InsertLicenseInfo (CAvailableApplicationInfo *Info)
 
VOID InsertLanguageInfo (CAvailableApplicationInfo *Info)
 

Additional Inherited Members

- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 
- Protected Member Functions inherited from CUiBox
 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 
- Protected Attributes inherited from CUiPrimitive
CUiPrimitivem_Parent
 

Detailed Description

Definition at line 86 of file appview.h.

Member Function Documentation

◆ InsertLanguageInfo()

VOID CAppRichEdit::InsertLanguageInfo ( CAvailableApplicationInfo Info)
private

Definition at line 314 of file appview.cpp.

315 {
316  if (!Info->HasLanguageInfo())
317  {
318  return;
319  }
320 
321  const INT nTranslations = Info->m_LanguageLCIDs.GetSize();
322  ATL::CStringW szLangInfo;
323  ATL::CStringW szLoadedTextAvailability;
324  ATL::CStringW szLoadedAInfoText;
325 
326  szLoadedAInfoText.LoadStringW(IDS_AINFO_LANGUAGES);
327 
328  if (Info->HasNativeLanguage())
329  {
330  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_AVAILABLE_TRANSLATION);
331  if (nTranslations > 1)
332  {
334  buf.LoadStringW(IDS_LANGUAGE_MORE_PLACEHOLDER);
335  szLangInfo.Format(buf, nTranslations - 1);
336  }
337  else
338  {
339  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
340  szLangInfo = L" (" + szLangInfo + L")";
341  }
342  }
343  else if (Info->HasEnglishLanguage())
344  {
345  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_ENGLISH_TRANSLATION);
346  if (nTranslations > 1)
347  {
350  szLangInfo.Format(buf, nTranslations - 1);
351  }
352  else
353  {
354  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
355  szLangInfo = L" (" + szLangInfo + L")";
356  }
357  }
358  else
359  {
360  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_NO_TRANSLATION);
361  }
362 
363  InsertText(szLoadedAInfoText, CFE_BOLD);
364  InsertText(szLoadedTextAvailability, NULL);
365  InsertText(szLangInfo, CFE_ITALIC);
366 }
#define IDS_LANGUAGE_SINGLE
Definition: resource.h:212
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:716
int32_t INT
Definition: typedefs.h:58
#define CFE_BOLD
Definition: richedit.h:406
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define IDS_AINFO_LANGUAGES
Definition: resource.h:168
#define IDS_LANGUAGE_AVAILABLE_TRANSLATION
Definition: resource.h:209
static const WCHAR L[]
Definition: oid.c:1250
#define CFE_ITALIC
Definition: richedit.h:407
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define IDS_LANGUAGE_AVAILABLE_PLACEHOLDER
Definition: resource.h:214
#define IDS_LANGUAGE_MORE_PLACEHOLDER
Definition: resource.h:213
#define NULL
Definition: types.h:112
#define IDS_LANGUAGE_NO_TRANSLATION
Definition: resource.h:210
#define IDS_LANGUAGE_ENGLISH_TRANSLATION
Definition: resource.h:211

Referenced by ShowAvailableAppInfo().

◆ InsertLicenseInfo()

VOID CAppRichEdit::InsertLicenseInfo ( CAvailableApplicationInfo Info)
private

Definition at line 291 of file appview.cpp.

292 {
293  ATL::CStringW szLicense;
294  switch (Info->m_LicenseType)
295  {
296  case LICENSE_OPENSOURCE:
297  szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE);
298  break;
299  case LICENSE_FREEWARE:
300  szLicense.LoadStringW(IDS_LICENSE_FREEWARE);
301  break;
302  case LICENSE_TRIAL:
303  szLicense.LoadStringW(IDS_LICENSE_TRIAL);
304  break;
305  default:
307  return;
308  }
309 
310  szLicense += L" (" + Info->m_szLicense + L")";
312 }
#define IDS_AINFO_LICENSE
Definition: resource.h:165
#define CFE_BOLD
Definition: richedit.h:406
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_LICENSE_FREEWARE
Definition: resource.h:205
#define IDS_LICENSE_TRIAL
Definition: resource.h:206
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: appview.cpp:240
#define IDS_LICENSE_OPENSOURCE
Definition: resource.h:204

Referenced by ShowAvailableAppInfo().

◆ InsertTextWithString()

VOID CAppRichEdit::InsertTextWithString ( UINT  StringID,
DWORD  StringFlags,
const ATL::CStringW Text,
DWORD  TextFlags 
)
inline

Definition at line 386 of file appview.cpp.

387 {
388  if (!Text.IsEmpty())
389  {
390  LoadAndInsertText(StringID, Text, StringFlags, TextFlags);
391  }
392 }
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: appview.cpp:240
char * Text
Definition: combotst.c:136

Referenced by ShowInstalledAppInfo().

◆ InsertVersionInfo()

VOID CAppRichEdit::InsertVersionInfo ( CAvailableApplicationInfo Info)
private

Definition at line 265 of file appview.cpp.

266 {
267  if (Info->IsInstalled())
268  {
269  if (Info->HasInstalledVersion())
270  {
271  if (Info->HasUpdate())
273  else
275 
276  LoadAndInsertText(IDS_AINFO_VERSION, Info->m_szInstalledVersion, CFE_BOLD, 0);
277  }
278  else
279  {
281  }
282  }
283  else
284  {
286  }
287 
289 }
#define IDS_AINFO_VERSION
Definition: resource.h:161
#define IDS_STATUS_INSTALLED
Definition: resource.h:194
#define IDS_AINFO_AVAILABLEVERSION
Definition: resource.h:167
#define CFE_BOLD
Definition: richedit.h:406
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define IDS_STATUS_UPDATE_AVAILABLE
Definition: resource.h:197
#define IDS_STATUS_NOTINSTALLED
Definition: resource.h:195
#define CFE_ITALIC
Definition: richedit.h:407
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: appview.cpp:240

Referenced by ShowAvailableAppInfo().

◆ LoadAndInsertText() [1/2]

VOID CAppRichEdit::LoadAndInsertText ( UINT  uStringID,
const ATL::CStringW szText,
DWORD  StringFlags,
DWORD  TextFlags 
)
private

Definition at line 240 of file appview.cpp.

244 {
245  ATL::CStringW szLoadedText;
246  if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
247  {
248  InsertText(szLoadedText, StringFlags);
249  InsertText(szText, TextFlags);
250  }
251 }
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72

Referenced by InsertLicenseInfo(), InsertTextWithString(), InsertVersionInfo(), and ShowAvailableAppInfo().

◆ LoadAndInsertText() [2/2]

VOID CAppRichEdit::LoadAndInsertText ( UINT  uStringID,
DWORD  StringFlags 
)
private

Definition at line 253 of file appview.cpp.

255 {
256  ATL::CStringW szLoadedText;
257  if (szLoadedText.LoadStringW(uStringID))
258  {
259  InsertText(L"\n", 0);
260  InsertText(szLoadedText, StringFlags);
261  InsertText(L"\n", 0);
262  }
263 }
static const WCHAR L[]
Definition: oid.c:1250
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72

◆ SetWelcomeText()

VOID CAppRichEdit::SetWelcomeText ( )

Definition at line 421 of file appview.cpp.

422 {
424 
425  szText.LoadStringW(IDS_WELCOME_TITLE);
427 
428  szText.LoadStringW(IDS_WELCOME_TEXT);
429  InsertText(szText, 0);
430 
431  szText.LoadStringW(IDS_WELCOME_URL);
433 }
#define IDS_WELCOME_TITLE
Definition: resource.h:96
#define IDS_WELCOME_TEXT
Definition: resource.h:97
#define CFE_BOLD
Definition: richedit.h:406
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define CFM_LINK
Definition: richedit.h:337
#define IDS_WELCOME_URL
Definition: resource.h:98
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84

Referenced by CAppInfoDisplay::SetWelcomeText().

◆ ShowAvailableAppInfo()

BOOL CAppRichEdit::ShowAvailableAppInfo ( CAvailableApplicationInfo Info)

Definition at line 368 of file appview.cpp.

369 {
370  if (!Info) return FALSE;
371 
372  SetText(Info->m_szName, CFE_BOLD);
376 
382 
383  return TRUE;
384 }
#define TRUE
Definition: types.h:120
VOID InsertLicenseInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:291
#define IDS_AINFO_URLSITE
Definition: resource.h:164
#define CFE_LINK
Definition: richedit.h:411
#define CFE_BOLD
Definition: richedit.h:406
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
VOID InsertLanguageInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:314
VOID InsertVersionInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:265
#define IDS_AINFO_SIZE
Definition: resource.h:163
#define IDS_AINFO_URLDOWNLOAD
Definition: resource.h:166
#define IDS_AINFO_PACKAGE_NAME
Definition: resource.h:172
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: appview.cpp:240
#define IDS_AINFO_DESCRIPTION
Definition: resource.h:162
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84

Referenced by CAppInfoDisplay::ShowAvailableAppInfo().

◆ ShowInstalledAppInfo()

BOOL CAppRichEdit::ShowInstalledAppInfo ( CInstalledApplicationInfo Info)

Definition at line 394 of file appview.cpp.

395 {
396  if (!Info) return FALSE;
397 
398  SetText(Info->szDisplayName, CFE_BOLD);
399  InsertText(L"\n", 0);
400 
401  InsertTextWithString(IDS_INFO_VERSION, CFE_BOLD, Info->szDisplayVersion, 0);
406  InsertTextWithString(IDS_INFO_HELPPHONE, CFE_BOLD, Info->szHelpTelephone, 0);
413  InsertTextWithString(IDS_INFO_INSTLOCATION, CFE_BOLD, Info->szInstallLocation, 0);
414  InsertTextWithString(IDS_INFO_INSTALLSRC, CFE_BOLD, Info->szInstallSource, 0);
415  InsertTextWithString(IDS_INFO_UNINSTALLSTR, CFE_BOLD, Info->szUninstallString, 0);
417 
418  return TRUE;
419 }
#define IDS_INFO_INSTALLDATE
Definition: resource.h:158
#define IDS_INFO_PUBLISHER
Definition: resource.h:144
#define TRUE
Definition: types.h:120
#define IDS_INFO_INSTALLSRC
Definition: resource.h:155
#define IDS_INFO_README
Definition: resource.h:147
#define CFE_BOLD
Definition: richedit.h:406
#define IDS_INFO_COMMENTS
Definition: resource.h:153
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
#define IDS_INFO_CONTACT
Definition: resource.h:150
#define IDS_INFO_VERSION
Definition: resource.h:142
static const WCHAR L[]
Definition: oid.c:1250
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define CFM_LINK
Definition: richedit.h:337
#define IDS_INFO_UNINSTALLSTR
Definition: resource.h:156
#define IDS_INFO_UPDATEINFO
Definition: resource.h:151
#define IDS_INFO_PRODUCTID
Definition: resource.h:149
#define IDS_INFO_HELPPHONE
Definition: resource.h:146
#define IDS_INFO_MODIFYPATH
Definition: resource.h:157
#define IDS_INFO_INSTLOCATION
Definition: resource.h:154
#define IDS_INFO_HELPLINK
Definition: resource.h:145
#define IDS_INFO_REGOWNER
Definition: resource.h:148
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84
VOID InsertTextWithString(UINT StringID, DWORD StringFlags, const ATL::CStringW &Text, DWORD TextFlags)
Definition: appview.cpp:386
#define IDS_INFO_INFOABOUT
Definition: resource.h:152

Referenced by CAppInfoDisplay::ShowInstalledAppInfo().


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