ReactOS  0.4.15-dev-1033-gd7d716a
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 308 of file appview.cpp.

309 {
310  if (!Info->HasLanguageInfo())
311  {
312  return;
313  }
314 
315  const INT nTranslations = Info->m_LanguageLCIDs.GetSize();
316  ATL::CStringW szLangInfo;
317  ATL::CStringW szLoadedTextAvailability;
318  ATL::CStringW szLoadedAInfoText;
319 
320  szLoadedAInfoText.LoadStringW(IDS_AINFO_LANGUAGES);
321 
322  if (Info->HasNativeLanguage())
323  {
324  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_AVAILABLE_TRANSLATION);
325  if (nTranslations > 1)
326  {
328  buf.LoadStringW(IDS_LANGUAGE_MORE_PLACEHOLDER);
329  szLangInfo.Format(buf, nTranslations - 1);
330  }
331  else
332  {
333  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
334  szLangInfo = L" (" + szLangInfo + L")";
335  }
336  }
337  else if (Info->HasEnglishLanguage())
338  {
339  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_ENGLISH_TRANSLATION);
340  if (nTranslations > 1)
341  {
344  szLangInfo.Format(buf, nTranslations - 1);
345  }
346  else
347  {
348  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
349  szLangInfo = L" (" + szLangInfo + L")";
350  }
351  }
352  else
353  {
354  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_NO_TRANSLATION);
355  }
356 
357  InsertText(szLoadedAInfoText, CFE_BOLD);
358  InsertText(szLoadedTextAvailability, NULL);
359  InsertText(szLangInfo, CFE_ITALIC);
360 }
#define IDS_LANGUAGE_SINGLE
Definition: resource.h:212
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:716
int32_t INT
Definition: typedefs.h:58
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
smooth NULL
Definition: ftsmooth.c:416
#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 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 285 of file appview.cpp.

286 {
287  ATL::CStringW szLicense;
288  switch (Info->m_LicenseType)
289  {
290  case LICENSE_OPENSOURCE:
291  szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE);
292  break;
293  case LICENSE_FREEWARE:
294  szLicense.LoadStringW(IDS_LICENSE_FREEWARE);
295  break;
296  case LICENSE_TRIAL:
297  szLicense.LoadStringW(IDS_LICENSE_TRIAL);
298  break;
299  default:
301  return;
302  }
303 
304  szLicense += L" (" + Info->m_szLicense + L")";
306 }
#define IDS_AINFO_LICENSE
Definition: resource.h:165
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
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:234
#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 380 of file appview.cpp.

381 {
382  if (!Text.IsEmpty())
383  {
384  LoadAndInsertText(StringID, Text, StringFlags, TextFlags);
385  }
386 }
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: appview.cpp:234
char * Text
Definition: combotst.c:136

Referenced by ShowInstalledAppInfo().

◆ InsertVersionInfo()

VOID CAppRichEdit::InsertVersionInfo ( CAvailableApplicationInfo Info)
private

Definition at line 259 of file appview.cpp.

260 {
261  if (Info->IsInstalled())
262  {
263  if (Info->HasInstalledVersion())
264  {
265  if (Info->HasUpdate())
267  else
269 
270  LoadAndInsertText(IDS_AINFO_VERSION, Info->m_szInstalledVersion, CFE_BOLD, 0);
271  }
272  else
273  {
275  }
276  }
277  else
278  {
280  }
281 
283 }
#define IDS_AINFO_VERSION
Definition: resource.h:161
#define IDS_STATUS_INSTALLED
Definition: resource.h:194
#define IDS_AINFO_AVAILABLEVERSION
Definition: resource.h:167
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
#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:234

Referenced by ShowAvailableAppInfo().

◆ LoadAndInsertText() [1/2]

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

Definition at line 234 of file appview.cpp.

238 {
239  ATL::CStringW szLoadedText;
240  if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
241  {
242  InsertText(szLoadedText, StringFlags);
243  InsertText(szText, TextFlags);
244  }
245 }
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 247 of file appview.cpp.

249 {
250  ATL::CStringW szLoadedText;
251  if (szLoadedText.LoadStringW(uStringID))
252  {
253  InsertText(L"\n", 0);
254  InsertText(szLoadedText, StringFlags);
255  InsertText(L"\n", 0);
256  }
257 }
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 415 of file appview.cpp.

416 {
418 
419  szText.LoadStringW(IDS_WELCOME_TITLE);
421 
422  szText.LoadStringW(IDS_WELCOME_TEXT);
423  InsertText(szText, 0);
424 
425  szText.LoadStringW(IDS_WELCOME_URL);
427 }
#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 362 of file appview.cpp.

363 {
364  if (!Info) return FALSE;
365 
366  SetText(Info->m_szName, CFE_BOLD);
370 
376 
377  return TRUE;
378 }
#define TRUE
Definition: types.h:120
VOID InsertLicenseInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:285
#define IDS_AINFO_URLSITE
Definition: resource.h:164
#define CFE_LINK
Definition: richedit.h:411
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
#define FALSE
Definition: types.h:117
VOID InsertLanguageInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:308
VOID InsertVersionInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:259
#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:234
#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 388 of file appview.cpp.

389 {
390  if (!Info) return FALSE;
391 
392  SetText(Info->szDisplayName, CFE_BOLD);
393  InsertText(L"\n", 0);
394 
395  InsertTextWithString(IDS_INFO_VERSION, CFE_BOLD, Info->szDisplayVersion, 0);
400  InsertTextWithString(IDS_INFO_HELPPHONE, CFE_BOLD, Info->szHelpTelephone, 0);
407  InsertTextWithString(IDS_INFO_INSTLOCATION, CFE_BOLD, Info->szInstallLocation, 0);
408  InsertTextWithString(IDS_INFO_INSTALLSRC, CFE_BOLD, Info->szInstallSource, 0);
409  InsertTextWithString(IDS_INFO_UNINSTALLSTR, CFE_BOLD, Info->szUninstallString, 0);
411 
412  return TRUE;
413 }
#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
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
#define IDS_INFO_COMMENTS
Definition: resource.h:153
#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:380
#define IDS_INFO_INFOABOUT
Definition: resource.h:152

Referenced by CAppInfoDisplay::ShowInstalledAppInfo().


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