ReactOS  0.4.15-dev-1392-g3014417
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 1115 of file appview.cpp.

1115  :
1117  nLastHeaderID(-1)
1118 {
1119 }
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 1423 of file appview.cpp.

1424 {
1426  {
1427  return FALSE;
1428  }
1429 
1430  /* Load icon from file */
1431  HICON hIcon = NULL;
1432  ATL::CStringW szIconPath;
1433  if (AvlbAppInfo->RetrieveIcon(szIconPath))
1434  {
1436  szIconPath.GetString(),
1437  IMAGE_ICON,
1440  LR_LOADFROMFILE);
1441  }
1442 
1443  if (!hIcon || GetLastError() != ERROR_SUCCESS)
1444  {
1445  /* Load default icon */
1447  }
1448 
1450  DestroyIcon(hIcon);
1451 
1452  int Index = AddItem(ItemCount, IconIndex, AvlbAppInfo->m_szName, (LPARAM)CallbackParam);
1453 
1454  if (InitCheckState)
1455  {
1457  }
1458 
1459  SetItemText(Index, 1, AvlbAppInfo->m_szVersion);
1460  SetItemText(Index, 2, AvlbAppInfo->m_szDesc);
1461 
1462  ItemCount++;
1463  return TRUE;
1464 }
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:1200
LONG_PTR LPARAM
Definition: windef.h:208
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1281
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 1174 of file appview.cpp.

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

1180 {
1181  LVCOLUMNW Column;
1182 
1183  ZeroMemory(&Column, sizeof(Column));
1184 
1186  Column.iSubItem = Index;
1187  Column.pszText = lpText;
1188  Column.cx = Width;
1189  Column.fmt = Format;
1190 
1191  return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1192 }
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
#define ZeroMemory
Definition: winbase.h:1648
#define LVCF_SUBITEM
Definition: commctrl.h:2585
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2630
LONG_PTR LPARAM
Definition: windef.h:208
_In_ WDFCOLLECTION _In_ ULONG Index
LPWSTR pszText
Definition: commctrl.h:2563
#define LVCF_FMT
Definition: commctrl.h:2582
#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 1384 of file appview.cpp.

1385 {
1387  {
1388  return FALSE;
1389  }
1390 
1391  /* Load icon from registry */
1392  HICON hIcon = NULL;
1393  ATL::CStringW szIconPath;
1394  if (InstAppInfo->RetrieveIcon(szIconPath))
1395  {
1396  PathParseIconLocationW((LPWSTR)szIconPath.GetString());
1397 
1398  /* Load only the 1st icon from the application executable,
1399  * because all apps provide the executables which have the main icon
1400  * as 1st in the index , so we don't need other icons here */
1402  szIconPath.GetString(),
1403  0);
1404  }
1405 
1406  if (!hIcon)
1407  {
1408  /* Load default icon */
1410  }
1411 
1413  DestroyIcon(hIcon);
1414 
1415  int Index = AddItem(ItemCount, IconIndex, InstAppInfo->szDisplayName, (LPARAM)CallbackParam);
1416  SetItemText(Index, 1, InstAppInfo->szDisplayVersion.IsEmpty() ? L"---" : InstAppInfo->szDisplayVersion);
1417  SetItemText(Index, 2, InstAppInfo->szComments.IsEmpty() ? L"---" : InstAppInfo->szComments);
1418 
1419  ItemCount++;
1420  return TRUE;
1421 }
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:881
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:1200
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 1200 of file appview.cpp.

1201 {
1202  LVITEMW Item;
1203 
1204  ZeroMemory(&Item, sizeof(Item));
1205 
1206  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
1207  Item.pszText = const_cast<LPWSTR>(lpText);
1208  Item.lParam = lParam;
1209  Item.iItem = ItemIndex;
1210  Item.iImage = IconIndex;
1211 
1212  if (IconIndex >= 0)
1213  {
1214  Item.iImage = IconIndex;
1215  Item.mask |= LVIF_IMAGE;
1216  }
1217  return InsertItem(&Item);
1218 }
#define ZeroMemory
Definition: winbase.h:1648
#define LVIF_TEXT
Definition: commctrl.h:2305
#define LVIF_IMAGE
Definition: commctrl.h:2306
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:2307
#define LVIF_STATE
Definition: commctrl.h:2308
LPARAM lParam
Definition: combotst.c:139

Referenced by AddAvailableApplication(), and AddInstalledApplication().

◆ CheckAll()

VOID CAppsListView::CheckAll ( )

Definition at line 1289 of file appview.cpp.

1290 {
1291  if (bHasCheckboxes)
1292  {
1293  if (CheckedItemCount == ItemCount)
1294  {
1295  // clear all
1296  SetCheckState(-1, FALSE);
1297  }
1298  else
1299  {
1300  // check all
1301  SetCheckState(-1, TRUE);
1302  }
1303  }
1304 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1281
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 1135 of file appview.cpp.

1136 {
1137  HWND hHeader;
1138  HDITEMW hColumn;
1139  INT nHeaderID = pnmv->iSubItem;
1140 
1142  return;
1143 
1144  hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1145  ZeroMemory(&hColumn, sizeof(hColumn));
1146 
1147  /* If the sorting column changed, remove the sorting style from the old column */
1148  if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1149  {
1150  bIsAscending = TRUE; // also reset sorting method to ascending
1151  hColumn.mask = HDI_FORMAT;
1152  Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1153  hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1154  Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1155  }
1156 
1157  /* Set the sorting style to the new column */
1158  hColumn.mask = HDI_FORMAT;
1159  Header_GetItem(hHeader, nHeaderID, &hColumn);
1160 
1161  hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1162  hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1163  Header_SetItem(hHeader, nHeaderID, &hColumn);
1164 
1165  /* Sort the list, using the current values of nHeaderID and bIsAscending */
1166  SortContext ctx = { this, nHeaderID };
1168 
1169  /* Save new values */
1170  nLastHeaderID = nHeaderID;
1172 }
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:1648
#define HDF_SORTUP
Definition: commctrl.h:720
int32_t INT
Definition: typedefs.h:58
#define HDI_FORMAT
Definition: commctrl.h:701
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:747
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1225
#define HDF_SORTDOWN
Definition: commctrl.h:721
#define GWL_STYLE
Definition: winuser.h:846
UINT mask
Definition: commctrl.h:680
#define LVM_GETHEADER
Definition: commctrl.h:2646
#define SendMessage
Definition: winuser.h:5818
#define LVS_NOSORTHEADER
Definition: commctrl.h:2281
#define GetWindowLongPtr
Definition: treelist.c:73
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:754
int fmt
Definition: commctrl.h:685
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 1231 of file appview.cpp.

1232 {
1233  ATL::CStringW Item1, Item2;
1234  LVFINDINFOW IndexInfo;
1235  INT Index;
1236 
1237  IndexInfo.flags = LVFI_PARAM;
1238 
1239  IndexInfo.lParam = lParam1;
1240  Index = FindItem(-1, &IndexInfo);
1241  GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1242  Item1.ReleaseBuffer();
1243 
1244  IndexInfo.lParam = lParam2;
1245  Index = FindItem(-1, &IndexInfo);
1246  GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1247  Item2.ReleaseBuffer();
1248 
1249  return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1250 }
BOOL bIsAscending
Definition: appview.h:213
LPARAM lParam
Definition: commctrl.h:2454
int32_t INT
Definition: typedefs.h:58
#define LVFI_PARAM
Definition: commctrl.h:2432
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:35
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:653

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1252 of file appview.cpp.

1253 {
1254  RECT r = { 205, 28, 465, 250 };
1256 
1258 
1259  if (hwnd)
1260  {
1262  }
1263 
1267  0, 1);
1268 
1269  // currently, this two Imagelist is the same one.
1272 
1273  return hwnd;
1274 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVSIL_SMALL
Definition: commctrl.h:2295
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2263
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LISTVIEW_ICON_SIZE
Definition: appview.h:23
#define LVS_REPORT
Definition: commctrl.h:2258
#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:2264
static HWND hwndParent
Definition: cryptui.c:300
#define LVS_AUTOARRANGE
Definition: commctrl.h:2268
INT GetSystemColorDepth()
Definition: misc.cpp:489
HIMAGELIST m_hImageListView
Definition: appview.h:224
#define LVS_SINGLESEL
Definition: commctrl.h:2262
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ILC_MASK
Definition: commctrl.h:347
#define LVSIL_NORMAL
Definition: commctrl.h:2294
#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:1121

Referenced by CApplicationView::CreateListView().

◆ DeleteColumn()

void CAppsListView::DeleteColumn ( INT  Index)

Definition at line 1194 of file appview.cpp.

1195 {
1197  return;
1198 }
_In_ WDFCOLLECTION _In_ ULONG Index
#define LVM_DELETECOLUMN
Definition: commctrl.h:2634
#define SendMessage
Definition: winuser.h:5818

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1276 of file appview.cpp.

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

◆ GetFocusedItemData()

PVOID CAppsListView::GetFocusedItemData ( )

Definition at line 1306 of file appview.cpp.

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

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

◆ ItemCheckStateNotify()

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

Definition at line 1467 of file appview.cpp.

1468 {
1469  if (bCheck)
1470  {
1471  CheckedItemCount++;
1472  }
1473  else
1474  {
1475  CheckedItemCount--;
1476  }
1477 }
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 1225 of file appview.cpp.

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

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1121 of file appview.cpp.

1122 {
1123  if (bIsVisible)
1124  {
1126  }
1127  else
1128  {
1130  }
1131 
1132  bHasCheckboxes = bIsVisible;
1133 }
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47
BOOL bHasCheckboxes
Definition: appview.h:214
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2727

Referenced by Create(), and SetDisplayAppType().

◆ SetCheckState()

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

Definition at line 1281 of file appview.cpp.

1282 {
1283  if (bHasCheckboxes)
1284  {
1286  }
1287 }
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2322
BOOL bHasCheckboxes
Definition: appview.h:214
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2324
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 1316 of file appview.cpp.

1317 {
1318  if (!DeleteAllItems()) return FALSE;
1319  ApplicationViewType = AppType;
1320 
1321  bIsAscending = TRUE;
1322 
1323  ItemCount = 0;
1324  CheckedItemCount = 0;
1325 
1326  // delete old columns
1327  while (ColumnCount)
1328  {
1330  }
1331 
1333 
1334  // add new columns
1336  switch (AppType)
1337  {
1339 
1340  /* Add columns to ListView */
1341  szText.LoadStringW(IDS_APP_NAME);
1343 
1344  szText.LoadStringW(IDS_APP_INST_VERSION);
1346 
1347  szText.LoadStringW(IDS_APP_DESCRIPTION);
1349 
1350  // disable checkboxes
1352  break;
1353 
1355 
1356  /* Add columns to ListView */
1357  szText.LoadStringW(IDS_APP_NAME);
1359 
1360  szText.LoadStringW(IDS_APP_INST_VERSION);
1362 
1363  szText.LoadStringW(IDS_APP_DESCRIPTION);
1365 
1366  // enable checkboxes
1368  break;
1369 
1370  case AppViewTypeEmpty:
1371  default:
1372  break;
1373  }
1374 
1375 
1376  return TRUE;
1377 }
BOOL bIsAscending
Definition: appview.h:213
#define TRUE
Definition: types.h:120
void DeleteColumn(INT Index)
Definition: appview.cpp:1194
#define LVCFMT_RIGHT
Definition: commctrl.h:2595
#define LVCFMT_LEFT
Definition: commctrl.h:2594
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:552
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:1174
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:1121

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1379 of file appview.cpp.

1380 {
1381  return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1382 }
UINT_PTR WPARAM
Definition: windef.h:207
#define LVM_SETVIEW
Definition: commctrl.h:2842
#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: