ReactOS  0.4.15-dev-2537-g99d7768
CAppsListView Class Reference

#include <appview.h>

Inheritance diagram for CAppsListView:
Collaboration diagram for CAppsListView:

Classes

struct  SortContext
 

Public Member Functions

 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
 
INT ItemCount = 0
 
INT CheckedItemCount = 0
 
INT ColumnCount = 0
 
INT nLastHeaderID
 
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeEmpty
 
HIMAGELIST m_hImageListView
 

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

Constructor & Destructor Documentation

◆ CAppsListView()

CAppsListView::CAppsListView ( )

Definition at line 1116 of file appview.cpp.

1116  :
1118  nLastHeaderID(-1)
1119 {
1120 }
INT nLastHeaderID
Definition: appview.h:220
#define FALSE
Definition: types.h:117
BOOL bHasCheckboxes
Definition: appview.h:214

Member Function Documentation

◆ AddAvailableApplication()

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

Definition at line 1424 of file appview.cpp.

1425 {
1427  {
1428  return FALSE;
1429  }
1430 
1431  /* Load icon from file */
1432  HICON hIcon = NULL;
1433  ATL::CStringW szIconPath;
1434  if (AvlbAppInfo->RetrieveIcon(szIconPath))
1435  {
1437  szIconPath.GetString(),
1438  IMAGE_ICON,
1441  LR_LOADFROMFILE);
1442  }
1443 
1444  if (!hIcon || GetLastError() != ERROR_SUCCESS)
1445  {
1446  /* Load default icon */
1448  }
1449 
1451  DestroyIcon(hIcon);
1452 
1453  int Index = AddItem(ItemCount, IconIndex, AvlbAppInfo->m_szName, (LPARAM)CallbackParam);
1454 
1455  if (InitCheckState)
1456  {
1458  }
1459 
1460  SetItemText(Index, 1, AvlbAppInfo->m_szVersion);
1461  SetItemText(Index, 2, AvlbAppInfo->m_szDesc);
1462 
1463  ItemCount++;
1464  return TRUE;
1465 }
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:1044
ATL::CStringW m_szDesc
Definition: available.h:50
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:1201
LONG_PTR LPARAM
Definition: windef.h:208
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1282
HIMAGELIST m_hImageListView
Definition: appview.h:224
_In_ WDFCOLLECTION _In_ ULONG Index
INT ItemCount
Definition: appview.h:216
ATL::CStringW m_szVersion
Definition: available.h:48
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:222
#define IDI_MAIN
Definition: resource.h:4
ATL::CStringW m_szName
Definition: available.h:46
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 1175 of file appview.cpp.

1176 {
1177  return AddColumn(Index, const_cast<LPWSTR>(Text.GetString()), Width, Format);
1178 }
_In_ WDFCOLLECTION _In_ ULONG Index
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1175
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 1180 of file appview.cpp.

1181 {
1182  LVCOLUMNW Column;
1183 
1184  ZeroMemory(&Column, sizeof(Column));
1185 
1187  Column.iSubItem = Index;
1188  Column.pszText = lpText;
1189  Column.cx = Width;
1190  Column.fmt = Format;
1191 
1192  return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1193 }
#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:5818
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 1385 of file appview.cpp.

1386 {
1388  {
1389  return FALSE;
1390  }
1391 
1392  /* Load icon from registry */
1393  HICON hIcon = NULL;
1394  ATL::CStringW szIconPath;
1395  if (InstAppInfo->RetrieveIcon(szIconPath))
1396  {
1397  PathParseIconLocationW((LPWSTR)szIconPath.GetString());
1398 
1399  /* Load only the 1st icon from the application executable,
1400  * because all apps provide the executables which have the main icon
1401  * as 1st in the index , so we don't need other icons here */
1403  szIconPath.GetString(),
1404  0);
1405  }
1406 
1407  if (!hIcon)
1408  {
1409  /* Load default icon */
1411  }
1412 
1414  DestroyIcon(hIcon);
1415 
1416  int Index = AddItem(ItemCount, IconIndex, InstAppInfo->szDisplayName, (LPARAM)CallbackParam);
1417  SetItemText(Index, 1, InstAppInfo->szDisplayVersion.IsEmpty() ? L"---" : InstAppInfo->szDisplayVersion);
1418  SetItemText(Index, 2, InstAppInfo->szComments.IsEmpty() ? L"---" : InstAppInfo->szComments);
1419 
1420  ItemCount++;
1421  return TRUE;
1422 }
static HICON
Definition: imagelist.c:84
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
ATL::CStringW szDisplayVersion
Definition: installed.h:25
HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex)
Definition: shell32_main.c:882
ATL::CStringW szDisplayName
Definition: installed.h:24
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:1201
LONG_PTR LPARAM
Definition: windef.h:208
ATL::CStringW szComments
Definition: installed.h:35
HIMAGELIST m_hImageListView
Definition: appview.h:224
_In_ WDFCOLLECTION _In_ ULONG Index
INT ItemCount
Definition: appview.h:216
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL RetrieveIcon(ATL::CStringW &IconLocation)
Definition: installed.cpp:129
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:222
static const WCHAR L[]
Definition: oid.c:1250
#define IDI_MAIN
Definition: resource.h:4
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1087
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 1201 of file appview.cpp.

1202 {
1203  LVITEMW Item;
1204 
1205  ZeroMemory(&Item, sizeof(Item));
1206 
1207  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
1208  Item.pszText = const_cast<LPWSTR>(lpText);
1209  Item.lParam = lParam;
1210  Item.iItem = ItemIndex;
1211  Item.iImage = IconIndex;
1212 
1213  if (IconIndex >= 0)
1214  {
1215  Item.iImage = IconIndex;
1216  Item.mask |= LVIF_IMAGE;
1217  }
1218  return InsertItem(&Item);
1219 }
#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 1290 of file appview.cpp.

1291 {
1292  if (bHasCheckboxes)
1293  {
1294  if (CheckedItemCount == ItemCount)
1295  {
1296  // clear all
1297  SetCheckState(-1, FALSE);
1298  }
1299  else
1300  {
1301  // check all
1302  SetCheckState(-1, TRUE);
1303  }
1304  }
1305 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1282
BOOL bHasCheckboxes
Definition: appview.h:214
INT ItemCount
Definition: appview.h:216
INT CheckedItemCount
Definition: appview.h:217

Referenced by CApplicationView::CheckAll().

◆ ColumnClick()

VOID CAppsListView::ColumnClick ( LPNMLISTVIEW  pnmv)

Definition at line 1136 of file appview.cpp.

1137 {
1138  HWND hHeader;
1139  HDITEMW hColumn;
1140  INT nHeaderID = pnmv->iSubItem;
1141 
1143  return;
1144 
1145  hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1146  ZeroMemory(&hColumn, sizeof(hColumn));
1147 
1148  /* If the sorting column changed, remove the sorting style from the old column */
1149  if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1150  {
1151  bIsAscending = TRUE; // also reset sorting method to ascending
1152  hColumn.mask = HDI_FORMAT;
1153  Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1154  hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1155  Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1156  }
1157 
1158  /* Set the sorting style to the new column */
1159  hColumn.mask = HDI_FORMAT;
1160  Header_GetItem(hHeader, nHeaderID, &hColumn);
1161 
1162  hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1163  hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1164  Header_SetItem(hHeader, nHeaderID, &hColumn);
1165 
1166  /* Sort the list, using the current values of nHeaderID and bIsAscending */
1167  SortContext ctx = { this, nHeaderID };
1169 
1170  /* Save new values */
1171  nLastHeaderID = nHeaderID;
1173 }
BOOL bIsAscending
Definition: appview.h:213
INT nLastHeaderID
Definition: appview.h:220
#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:1226
#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:5818
#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 1232 of file appview.cpp.

1233 {
1234  ATL::CStringW Item1, Item2;
1235  LVFINDINFOW IndexInfo;
1236  INT Index;
1237 
1238  IndexInfo.flags = LVFI_PARAM;
1239 
1240  IndexInfo.lParam = lParam1;
1241  Index = FindItem(-1, &IndexInfo);
1242  GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1243  Item1.ReleaseBuffer();
1244 
1245  IndexInfo.lParam = lParam2;
1246  Index = FindItem(-1, &IndexInfo);
1247  GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1248  Item2.ReleaseBuffer();
1249 
1250  return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1251 }
BOOL bIsAscending
Definition: appview.h:213
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:653

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1253 of file appview.cpp.

1254 {
1255  RECT r = { 205, 28, 465, 250 };
1257 
1259 
1260  if (hwnd)
1261  {
1263  }
1264 
1268  0, 1);
1269 
1270  // currently, this two Imagelist is the same one.
1273 
1274  return hwnd;
1275 }
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
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:489
HIMAGELIST m_hImageListView
Definition: appview.h:224
#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:1122

Referenced by CApplicationView::CreateListView().

◆ DeleteColumn()

void CAppsListView::DeleteColumn ( INT  Index)

Definition at line 1195 of file appview.cpp.

1196 {
1198  return;
1199 }
_In_ WDFCOLLECTION _In_ ULONG Index
#define LVM_DELETECOLUMN
Definition: commctrl.h:2638
#define SendMessage
Definition: winuser.h:5818

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1277 of file appview.cpp.

1278 {
1279  return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1280 }
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 1307 of file appview.cpp.

1308 {
1310  if (item == -1)
1311  {
1312  return (PVOID)0;
1313  }
1314  return (PVOID)GetItemData(item);
1315 }
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 1221 of file appview.cpp.

1222 {
1223  return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1224 }
#define LVM_GETIMAGELIST
Definition: commctrl.h:2295
#define SendMessage
Definition: winuser.h:5818

◆ ItemCheckStateNotify()

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

Definition at line 1468 of file appview.cpp.

1469 {
1470  if (bCheck)
1471  {
1472  CheckedItemCount++;
1473  }
1474  else
1475  {
1476  CheckedItemCount--;
1477  }
1478 }
INT CheckedItemCount
Definition: appview.h:217

Referenced by CApplicationView::ProcessWindowMessage().

◆ s_CompareFunc()

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

Definition at line 1226 of file appview.cpp.

1227 {
1228  SortContext *ctx = ((SortContext *)lParamSort);
1229  return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1230 }

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1122 of file appview.cpp.

1123 {
1124  if (bIsVisible)
1125  {
1127  }
1128  else
1129  {
1131  }
1132 
1133  bHasCheckboxes = bIsVisible;
1134 }
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47
BOOL bHasCheckboxes
Definition: appview.h:214
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2731

Referenced by Create(), and SetDisplayAppType().

◆ SetCheckState()

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

Definition at line 1282 of file appview.cpp.

1283 {
1284  if (bHasCheckboxes)
1285  {
1287  }
1288 }
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326
BOOL bHasCheckboxes
Definition: appview.h:214
#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 1317 of file appview.cpp.

1318 {
1319  if (!DeleteAllItems()) return FALSE;
1320  ApplicationViewType = AppType;
1321 
1322  bIsAscending = TRUE;
1323 
1324  ItemCount = 0;
1325  CheckedItemCount = 0;
1326 
1327  // delete old columns
1328  while (ColumnCount)
1329  {
1331  }
1332 
1334 
1335  // add new columns
1337  switch (AppType)
1338  {
1340 
1341  /* Add columns to ListView */
1342  szText.LoadStringW(IDS_APP_NAME);
1344 
1345  szText.LoadStringW(IDS_APP_INST_VERSION);
1347 
1348  szText.LoadStringW(IDS_APP_DESCRIPTION);
1350 
1351  // disable checkboxes
1353  break;
1354 
1356 
1357  /* Add columns to ListView */
1358  szText.LoadStringW(IDS_APP_NAME);
1360 
1361  szText.LoadStringW(IDS_APP_INST_VERSION);
1363 
1364  szText.LoadStringW(IDS_APP_DESCRIPTION);
1366 
1367  // enable checkboxes
1369  break;
1370 
1371  case AppViewTypeEmpty:
1372  default:
1373  break;
1374  }
1375 
1376 
1377  return TRUE;
1378 }
BOOL bIsAscending
Definition: appview.h:213
#define TRUE
Definition: types.h:120
void DeleteColumn(INT Index)
Definition: appview.cpp:1195
#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:218
HIMAGELIST m_hImageListView
Definition: appview.h:224
INT ItemCount
Definition: appview.h:216
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1175
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:222
#define IDS_APP_NAME
Definition: resource.h:137
#define IDS_APP_INST_VERSION
Definition: resource.h:138
INT CheckedItemCount
Definition: appview.h:217
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1122

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1380 of file appview.cpp.

1381 {
1382  return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1383 }
UINT_PTR WPARAM
Definition: windef.h:207
#define LVM_SETVIEW
Definition: commctrl.h:2846
#define SendMessage
Definition: winuser.h:5818

Referenced by CApplicationView::OnCommand().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CAppsListView::ApplicationViewType = AppViewTypeEmpty
private

Definition at line 222 of file appview.h.

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

◆ bHasCheckboxes

BOOL CAppsListView::bHasCheckboxes
private

Definition at line 214 of file appview.h.

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

◆ bIsAscending

BOOL CAppsListView::bIsAscending = TRUE
private

Definition at line 213 of file appview.h.

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

◆ CheckedItemCount

INT CAppsListView::CheckedItemCount = 0
private

Definition at line 217 of file appview.h.

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

◆ ColumnCount

INT CAppsListView::ColumnCount = 0
private

Definition at line 218 of file appview.h.

Referenced by SetDisplayAppType().

◆ ItemCount

INT CAppsListView::ItemCount = 0
private

◆ m_hImageListView

HIMAGELIST CAppsListView::m_hImageListView
private

◆ nLastHeaderID

INT CAppsListView::nLastHeaderID
private

Definition at line 220 of file appview.h.

Referenced by ColumnClick().


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