ReactOS  0.4.15-dev-3294-ge98684e
CAppsListView Class Reference

#include <appview.h>

Inheritance diagram for CAppsListView:
Collaboration diagram for CAppsListView:

Classes

struct  SortContext
 

Public Member Functions

 CAppsListView ()
 
 ~CAppsListView ()
 
VOID SetCheckboxesVisible (BOOL bIsVisible)
 
VOID ColumnClick (LPNMLISTVIEW pnmv)
 
BOOL AddColumn (INT Index, ATL::CStringW &Text, INT Width, INT Format)
 
int AddColumn (INT Index, LPWSTR lpText, INT Width, INT Format)
 
void DeleteColumn (INT Index)
 
INT AddItem (INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
 
HIMAGELIST GetImageList (int iImageList)
 
INT CompareFunc (LPARAM lParam1, LPARAM lParam2, INT iSubItem)
 
HWND Create (HWND hwndParent)
 
BOOL GetCheckState (INT item)
 
VOID SetCheckState (INT item, BOOL fCheck)
 
VOID CheckAll ()
 
PVOID GetFocusedItemData ()
 
BOOL SetDisplayAppType (APPLICATION_VIEW_TYPE AppType)
 
BOOL SetViewMode (DWORD ViewMode)
 
BOOL AddInstalledApplication (CInstalledApplicationInfo *InstAppInfo, LPVOID CallbackParam)
 
BOOL AddAvailableApplication (CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID CallbackParam)
 
VOID ItemCheckStateNotify (int iItem, BOOL bCheck)
 
- Public Member Functions inherited from CUiWindow< CListView >
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 CListView
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
void SetRedraw (BOOL redraw)
 
BOOL SetTextBkColor (COLORREF cr)
 
BOOL SetBkColor (COLORREF cr)
 
BOOL SetTextColor (COLORREF cr)
 
DWORD SetExtendedListViewStyle (DWORD dw, DWORD dwMask=0)
 
int InsertColumn (int iCol, LV_COLUMN *pcol)
 
int InsertColumn (int iCol, LPWSTR pszText, int fmt, int width=-1, int iSubItem=-1, int iImage=-1, int iOrder=-1)
 
int GetColumnWidth (int iCol)
 
HIMAGELIST SetImageList (HIMAGELIST himl, int iImageList)
 
int InsertItem (const LV_ITEM *pitem)
 
BOOL DeleteItem (int i)
 
BOOL GetItem (LV_ITEM *pitem)
 
BOOL SetItem (const LV_ITEM *pitem)
 
BOOL FindItem (int iStart, const LV_FINDINFO *plvfi)
 
int GetItemCount ()
 
BOOL DeleteAllItems ()
 
BOOL Update (int i)
 
UINT GetSelectedCount ()
 
BOOL SortItems (PFNLVCOMPARE pfnCompare, PVOID lParam)
 
BOOL EnsureVisible (int i, BOOL fPartialOK)
 
HWND EditLabel (int i)
 
int GetSelectionMark ()
 
int GetNextItem (int i, WORD flags)
 
void GetItemSpacing (SIZE &spacing, BOOL bSmallIconView=FALSE)
 
UINT GetItemState (int i, UINT mask)
 
void SetItemState (int i, UINT state, UINT mask)
 
BOOL SetItemText (int i, int subItem, LPCWSTR text)
 
void SetCheckState (int i, BOOL check)
 
int HitTest (LV_HITTESTINFO *phtInfo)
 
DWORD_PTR GetItemData (int i)
 
BOOL GetSelectedItem (LV_ITEM *pItem)
 
void GetItemText (int iItem, int iSubItem, LPTSTR pszText, int cchTextMax)
 
BOOL GetItemPosition (int nItem, POINT *pPoint)
 
BOOL SetItemPosition (int nItem, POINT *pPoint)
 
BOOL Arrange (UINT nCode)
 

Static Public Member Functions

static INT CALLBACK s_CompareFunc (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 

Private Attributes

BOOL bIsAscending = TRUE
 
BOOL bHasCheckboxes = FALSE
 
INT ItemCount = 0
 
INT CheckedItemCount = 0
 
INT ColumnCount = 0
 
INT nLastHeaderID = -1
 
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeEmpty
 
HIMAGELIST m_hImageListView = NULL
 

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 203 of file appview.h.

Constructor & Destructor Documentation

◆ CAppsListView()

CAppsListView::CAppsListView ( )

Definition at line 1118 of file appview.cpp.

1119 {
1120 }

◆ ~CAppsListView()

CAppsListView::~CAppsListView ( )

Definition at line 1122 of file appview.cpp.

1123 {
1124  if (m_hImageListView)
1125  {
1127  }
1128 }
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST m_hImageListView
Definition: appview.h:223

Member Function Documentation

◆ AddAvailableApplication()

BOOL CAppsListView::AddAvailableApplication ( CAvailableApplicationInfo AvlbAppInfo,
BOOL  InitCheckState,
LPVOID  CallbackParam 
)

Definition at line 1432 of file appview.cpp.

1433 {
1435  {
1436  return FALSE;
1437  }
1438 
1439  /* Load icon from file */
1440  HICON hIcon = NULL;
1441  ATL::CStringW szIconPath;
1442  if (AvlbAppInfo->RetrieveIcon(szIconPath))
1443  {
1445  szIconPath.GetString(),
1446  IMAGE_ICON,
1449  LR_LOADFROMFILE);
1450  }
1451 
1452  if (!hIcon || GetLastError() != ERROR_SUCCESS)
1453  {
1454  /* Load default icon */
1456  }
1457 
1459  DestroyIcon(hIcon);
1460 
1461  int Index = AddItem(ItemCount, IconIndex, AvlbAppInfo->m_szName, (LPARAM)CallbackParam);
1462 
1463  if (InitCheckState)
1464  {
1466  }
1467 
1468  SetItemText(Index, 1, AvlbAppInfo->m_szVersion);
1469  SetItemText(Index, 2, AvlbAppInfo->m_szDesc);
1470 
1471  ItemCount++;
1472  return TRUE;
1473 }
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
#define LISTVIEW_ICON_SIZE
Definition: appview.h:23
#define LR_LOADFROMFILE
Definition: winuser.h:1082
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
ATL::CStringW m_szDesc
Definition: available.h:51
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define FALSE
Definition: types.h:117
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1209
LONG_PTR LPARAM
Definition: windef.h:208
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1290
HIMAGELIST m_hImageListView
Definition: appview.h:223
_In_ WDFCOLLECTION _In_ ULONG Index
INT ItemCount
Definition: appview.h:215
ATL::CStringW m_szVersion
Definition: available.h:49
PCXSTR GetString() const
Definition: atlsimpstr.h:361
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
static const WCHAR IconIndex[]
Definition: install.c:52
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:221
#define IDI_MAIN
Definition: resource.h:4
ATL::CStringW m_szName
Definition: available.h:47
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
BOOL RetrieveIcon(ATL::CStringW &IconLocation) const
Definition: available.cpp:289
#define NULL
Definition: types.h:112
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CApplicationView::AddAvailableApplication().

◆ AddColumn() [1/2]

BOOL CAppsListView::AddColumn ( INT  Index,
ATL::CStringW Text,
INT  Width,
INT  Format 
)

Definition at line 1183 of file appview.cpp.

1184 {
1185  return AddColumn(Index, const_cast<LPWSTR>(Text.GetString()), Width, Format);
1186 }
_In_ WDFCOLLECTION _In_ ULONG Index
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1183
char * Text
Definition: combotst.c:136

Referenced by SetDisplayAppType().

◆ AddColumn() [2/2]

int CAppsListView::AddColumn ( INT  Index,
LPWSTR  lpText,
INT  Width,
INT  Format 
)

Definition at line 1188 of file appview.cpp.

1189 {
1190  LVCOLUMNW Column;
1191 
1192  ZeroMemory(&Column, sizeof(Column));
1193 
1195  Column.iSubItem = Index;
1196  Column.pszText = lpText;
1197  Column.cx = Width;
1198  Column.fmt = Format;
1199 
1200  return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1201 }
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVCF_TEXT
Definition: commctrl.h:2588
#define ZeroMemory
Definition: winbase.h:1664
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2634
LONG_PTR LPARAM
Definition: windef.h:208
_In_ WDFCOLLECTION _In_ ULONG Index
LPWSTR pszText
Definition: commctrl.h:2567
#define LVCF_FMT
Definition: commctrl.h:2586
#define SendMessage
Definition: winuser.h:5819
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1216

◆ AddInstalledApplication()

BOOL CAppsListView::AddInstalledApplication ( CInstalledApplicationInfo InstAppInfo,
LPVOID  CallbackParam 
)

Definition at line 1393 of file appview.cpp.

1394 {
1396  {
1397  return FALSE;
1398  }
1399 
1400  /* Load icon from registry */
1401  HICON hIcon = NULL;
1402  ATL::CStringW szIconPath;
1403  if (InstAppInfo->RetrieveIcon(szIconPath))
1404  {
1405  PathParseIconLocationW((LPWSTR)szIconPath.GetString());
1406 
1407  /* Load only the 1st icon from the application executable,
1408  * because all apps provide the executables which have the main icon
1409  * as 1st in the index , so we don't need other icons here */
1411  szIconPath.GetString(),
1412  0);
1413  }
1414 
1415  if (!hIcon)
1416  {
1417  /* Load default icon */
1419  }
1420 
1422  DestroyIcon(hIcon);
1423 
1424  int Index = AddItem(ItemCount, IconIndex, InstAppInfo->szDisplayName, (LPARAM)CallbackParam);
1425  SetItemText(Index, 1, InstAppInfo->szDisplayVersion.IsEmpty() ? L"---" : InstAppInfo->szDisplayVersion);
1426  SetItemText(Index, 2, InstAppInfo->szComments.IsEmpty() ? L"---" : InstAppInfo->szComments);
1427 
1428  ItemCount++;
1429  return TRUE;
1430 }
static HICON
Definition: imagelist.c:84
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
Definition: shell32_main.c:882
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define FALSE
Definition: types.h:117
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1209
LONG_PTR LPARAM
Definition: windef.h:208
HIMAGELIST m_hImageListView
Definition: appview.h:223
_In_ WDFCOLLECTION _In_ ULONG Index
INT ItemCount
Definition: appview.h:215
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL RetrieveIcon(ATL::CStringW &IconLocation)
Definition: installed.cpp:128
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
static const WCHAR IconIndex[]
Definition: install.c:52
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:221
static const WCHAR L[]
Definition: oid.c:1250
#define IDI_MAIN
Definition: resource.h:4
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
bool IsEmpty() const
Definition: atlsimpstr.h:379
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
#define NULL
Definition: types.h:112
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CApplicationView::AddInstalledApplication().

◆ AddItem()

INT CAppsListView::AddItem ( INT  ItemIndex,
INT  IconIndex,
LPCWSTR  lpText,
LPARAM  lParam 
)

Definition at line 1209 of file appview.cpp.

1210 {
1211  LVITEMW Item;
1212 
1213  ZeroMemory(&Item, sizeof(Item));
1214 
1215  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
1216  Item.pszText = const_cast<LPWSTR>(lpText);
1217  Item.lParam = lParam;
1218  Item.iItem = ItemIndex;
1219  Item.iImage = IconIndex;
1220 
1221  if (IconIndex >= 0)
1222  {
1223  Item.iImage = IconIndex;
1224  Item.mask |= LVIF_IMAGE;
1225  }
1226  return InsertItem(&Item);
1227 }
#define ZeroMemory
Definition: winbase.h:1664
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVIF_IMAGE
Definition: commctrl.h:2310
static const WCHAR IconIndex[]
Definition: install.c:52
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_STATE
Definition: commctrl.h:2312
LPARAM lParam
Definition: combotst.c:139

Referenced by AddAvailableApplication(), and AddInstalledApplication().

◆ CheckAll()

VOID CAppsListView::CheckAll ( )

Definition at line 1298 of file appview.cpp.

1299 {
1300  if (bHasCheckboxes)
1301  {
1302  if (CheckedItemCount == ItemCount)
1303  {
1304  // clear all
1305  SetCheckState(-1, FALSE);
1306  }
1307  else
1308  {
1309  // check all
1310  SetCheckState(-1, TRUE);
1311  }
1312  }
1313 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1290
BOOL bHasCheckboxes
Definition: appview.h:213
INT ItemCount
Definition: appview.h:215
INT CheckedItemCount
Definition: appview.h:216

Referenced by CApplicationView::CheckAll().

◆ ColumnClick()

VOID CAppsListView::ColumnClick ( LPNMLISTVIEW  pnmv)

Definition at line 1144 of file appview.cpp.

1145 {
1146  HWND hHeader;
1147  HDITEMW hColumn;
1148  INT nHeaderID = pnmv->iSubItem;
1149 
1151  return;
1152 
1153  hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1154  ZeroMemory(&hColumn, sizeof(hColumn));
1155 
1156  /* If the sorting column changed, remove the sorting style from the old column */
1157  if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1158  {
1159  bIsAscending = TRUE; // also reset sorting method to ascending
1160  hColumn.mask = HDI_FORMAT;
1161  Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1162  hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1163  Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1164  }
1165 
1166  /* Set the sorting style to the new column */
1167  hColumn.mask = HDI_FORMAT;
1168  Header_GetItem(hHeader, nHeaderID, &hColumn);
1169 
1170  hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1171  hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1172  Header_SetItem(hHeader, nHeaderID, &hColumn);
1173 
1174  /* Sort the list, using the current values of nHeaderID and bIsAscending */
1175  SortContext ctx = { this, nHeaderID };
1177 
1178  /* Save new values */
1179  nLastHeaderID = nHeaderID;
1181 }
BOOL bIsAscending
Definition: appview.h:212
INT nLastHeaderID
Definition: appview.h:219
#define TRUE
Definition: types.h:120
HANDLE HWND
Definition: compat.h:19
#define ZeroMemory
Definition: winbase.h:1664
#define HDF_SORTUP
Definition: commctrl.h:724
int32_t INT
Definition: typedefs.h:58
#define HDI_FORMAT
Definition: commctrl.h:705
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1234
#define HDF_SORTDOWN
Definition: commctrl.h:725
#define GWL_STYLE
Definition: winuser.h:846
UINT mask
Definition: commctrl.h:684
#define LVM_GETHEADER
Definition: commctrl.h:2650
#define SendMessage
Definition: winuser.h:5819
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define GetWindowLongPtr
Definition: treelist.c:73
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
int fmt
Definition: commctrl.h:689
BOOL SortItems(PFNLVCOMPARE pfnCompare, PVOID lParam)
Definition: rosctrls.h:141

Referenced by CApplicationView::ProcessWindowMessage().

◆ CompareFunc()

INT CAppsListView::CompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
INT  iSubItem 
)

Definition at line 1240 of file appview.cpp.

1241 {
1242  ATL::CStringW Item1, Item2;
1243  LVFINDINFOW IndexInfo;
1244  INT Index;
1245 
1246  IndexInfo.flags = LVFI_PARAM;
1247 
1248  IndexInfo.lParam = lParam1;
1249  Index = FindItem(-1, &IndexInfo);
1250  GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1251  Item1.ReleaseBuffer();
1252 
1253  IndexInfo.lParam = lParam2;
1254  Index = FindItem(-1, &IndexInfo);
1255  GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1256  Item2.ReleaseBuffer();
1257 
1258  return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1259 }
BOOL bIsAscending
Definition: appview.h:212
LPARAM lParam
Definition: commctrl.h:2458
int32_t INT
Definition: typedefs.h:58
#define LVFI_PARAM
Definition: commctrl.h:2436
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
void GetItemText(int iItem, int iSubItem, LPTSTR pszText, int cchTextMax)
Definition: rosctrls.h:221
_In_ WDFCOLLECTION _In_ ULONG Index
BOOL FindItem(int iStart, const LV_FINDINFO *plvfi)
Definition: rosctrls.h:116
#define MAX_STR_LEN
Definition: defines.h:34
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:690

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1261 of file appview.cpp.

1262 {
1263  RECT r = { 205, 28, 465, 250 };
1265 
1267 
1268  if (hwnd)
1269  {
1271  }
1272 
1276  0, 1);
1277 
1278  // currently, this two Imagelist is the same one.
1281 
1282  return hwnd;
1283 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LISTVIEW_ICON_SIZE
Definition: appview.h:23
#define LVS_REPORT
Definition: commctrl.h:2262
#define WS_CHILD
Definition: pedump.c:617
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2270
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define FALSE
Definition: types.h:117
#define LVS_SORTASCENDING
Definition: commctrl.h:2268
static HWND hwndParent
Definition: cryptui.c:300
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272
INT GetSystemColorDepth()
Definition: misc.cpp:369
HIMAGELIST m_hImageListView
Definition: appview.h:223
#define LVS_SINGLESEL
Definition: commctrl.h:2266
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ILC_MASK
Definition: commctrl.h:351
#define LVSIL_NORMAL
Definition: commctrl.h:2298
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define NULL
Definition: types.h:112
HIMAGELIST SetImageList(HIMAGELIST himl, int iImageList)
Definition: rosctrls.h:91
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1130

Referenced by CApplicationView::CreateListView().

◆ DeleteColumn()

void CAppsListView::DeleteColumn ( INT  Index)

Definition at line 1203 of file appview.cpp.

1204 {
1206  return;
1207 }
_In_ WDFCOLLECTION _In_ ULONG Index
#define LVM_DELETECOLUMN
Definition: commctrl.h:2638
#define SendMessage
Definition: winuser.h:5819

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1285 of file appview.cpp.

1286 {
1287  return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1288 }
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326
UINT GetItemState(int i, UINT mask)
Definition: rosctrls.h:173
static ATOM item
Definition: dde.c:856

◆ GetFocusedItemData()

PVOID CAppsListView::GetFocusedItemData ( )

Definition at line 1315 of file appview.cpp.

1316 {
1318  if (item == -1)
1319  {
1320  return (PVOID)0;
1321  }
1322  return (PVOID)GetItemData(item);
1323 }
DWORD_PTR GetItemData(int i)
Definition: rosctrls.h:204
int GetSelectionMark()
Definition: rosctrls.h:156
int32_t INT
Definition: typedefs.h:58
static ATOM item
Definition: dde.c:856

Referenced by CApplicationView::GetFocusedItemData().

◆ GetImageList()

HIMAGELIST CAppsListView::GetImageList ( int  iImageList)

Definition at line 1229 of file appview.cpp.

1230 {
1231  return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1232 }
#define LVM_GETIMAGELIST
Definition: commctrl.h:2295
#define SendMessage
Definition: winuser.h:5819

◆ ItemCheckStateNotify()

VOID CAppsListView::ItemCheckStateNotify ( int  iItem,
BOOL  bCheck 
)

Definition at line 1476 of file appview.cpp.

1477 {
1478  if (bCheck)
1479  {
1480  CheckedItemCount++;
1481  }
1482  else
1483  {
1484  CheckedItemCount--;
1485  }
1486 }
INT CheckedItemCount
Definition: appview.h:216

Referenced by CApplicationView::ProcessWindowMessage().

◆ s_CompareFunc()

INT CALLBACK CAppsListView::s_CompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
LPARAM  lParamSort 
)
static

Definition at line 1234 of file appview.cpp.

1235 {
1236  SortContext *ctx = ((SortContext *)lParamSort);
1237  return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1238 }

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1130 of file appview.cpp.

1131 {
1132  if (bIsVisible)
1133  {
1135  }
1136  else
1137  {
1139  }
1140 
1141  bHasCheckboxes = bIsVisible;
1142 }
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47
BOOL bHasCheckboxes
Definition: appview.h:213
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2731

Referenced by Create(), and SetDisplayAppType().

◆ SetCheckState()

VOID CAppsListView::SetCheckState ( INT  item,
BOOL  fCheck 
)

Definition at line 1290 of file appview.cpp.

1291 {
1292  if (bHasCheckboxes)
1293  {
1295  }
1296 }
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326
BOOL bHasCheckboxes
Definition: appview.h:213
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2328
static ATOM item
Definition: dde.c:856
void SetItemState(int i, UINT state, UINT mask)
Definition: rosctrls.h:178

Referenced by AddAvailableApplication(), and CheckAll().

◆ SetDisplayAppType()

BOOL CAppsListView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1325 of file appview.cpp.

1326 {
1327  if (!DeleteAllItems()) return FALSE;
1328  ApplicationViewType = AppType;
1329 
1330  bIsAscending = TRUE;
1331 
1332  ItemCount = 0;
1333  CheckedItemCount = 0;
1334 
1335  // delete old columns
1336  while (ColumnCount)
1337  {
1339  }
1340 
1342 
1343  // add new columns
1345  switch (AppType)
1346  {
1348 
1349  /* Add columns to ListView */
1350  szText.LoadStringW(IDS_APP_NAME);
1352 
1353  szText.LoadStringW(IDS_APP_INST_VERSION);
1355 
1356  szText.LoadStringW(IDS_APP_DESCRIPTION);
1358 
1359  // disable checkboxes
1361  break;
1362 
1364 
1365  /* Add columns to ListView */
1366  szText.LoadStringW(IDS_APP_NAME);
1368 
1369  szText.LoadStringW(IDS_APP_INST_VERSION);
1371 
1372  szText.LoadStringW(IDS_APP_DESCRIPTION);
1374 
1375  // enable checkboxes
1377  break;
1378 
1379  case AppViewTypeEmpty:
1380  default:
1381  break;
1382  }
1383 
1384 
1385  return TRUE;
1386 }
BOOL bIsAscending
Definition: appview.h:212
#define TRUE
Definition: types.h:120
void DeleteColumn(INT Index)
Definition: appview.cpp:1203
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
BOOL DeleteAllItems()
Definition: rosctrls.h:126
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
#define IDS_APP_DESCRIPTION
Definition: resource.h:139
INT ColumnCount
Definition: appview.h:217
HIMAGELIST m_hImageListView
Definition: appview.h:223
INT ItemCount
Definition: appview.h:215
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1183
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:221
#define IDS_APP_NAME
Definition: resource.h:137
#define IDS_APP_INST_VERSION
Definition: resource.h:138
INT CheckedItemCount
Definition: appview.h:216
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1130

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1388 of file appview.cpp.

1389 {
1390  return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1391 }
UINT_PTR WPARAM
Definition: windef.h:207
#define LVM_SETVIEW
Definition: commctrl.h:2846
#define SendMessage
Definition: winuser.h:5819

Referenced by CApplicationView::OnCommand().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CAppsListView::ApplicationViewType = AppViewTypeEmpty
private

Definition at line 221 of file appview.h.

Referenced by AddAvailableApplication(), AddInstalledApplication(), and SetDisplayAppType().

◆ bHasCheckboxes

BOOL CAppsListView::bHasCheckboxes = FALSE
private

Definition at line 213 of file appview.h.

Referenced by CheckAll(), SetCheckboxesVisible(), and SetCheckState().

◆ bIsAscending

BOOL CAppsListView::bIsAscending = TRUE
private

Definition at line 212 of file appview.h.

Referenced by ColumnClick(), CompareFunc(), and SetDisplayAppType().

◆ CheckedItemCount

INT CAppsListView::CheckedItemCount = 0
private

Definition at line 216 of file appview.h.

Referenced by CheckAll(), ItemCheckStateNotify(), and SetDisplayAppType().

◆ ColumnCount

INT CAppsListView::ColumnCount = 0
private

Definition at line 217 of file appview.h.

Referenced by SetDisplayAppType().

◆ ItemCount

INT CAppsListView::ItemCount = 0
private

◆ m_hImageListView

HIMAGELIST CAppsListView::m_hImageListView = NULL
private

◆ nLastHeaderID

INT CAppsListView::nLastHeaderID = -1
private

Definition at line 219 of file appview.h.

Referenced by ColumnClick().


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