forked from soui-demo/SoftMaster
/
soft_list_adapter.h
44 lines (39 loc) · 969 Bytes
/
soft_list_adapter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SOFT_LIST_ADAPTER_H_
#define SOFT_LIST_ADAPTER_H_
#include <helper/SAdapterBase.h>
class SoftListAdapter :
public SMcAdapterBase
{
#define NUMSCALE 100000
public:
struct SOFTINFO
{
const wchar_t * pszSkinName;
const wchar_t * pszName;
const wchar_t * pszDesc;
float fScore;
DWORD dwSize;
const wchar_t * pszInstallTime;
const wchar_t * pszUseTime;
};
SArray<SOFTINFO> m_softInfo;
public:
SoftListAdapter();
~SoftListAdapter();
protected:
struct SORTCTX
{
int iCol;
SHDSORTFLAG stFlag;
};
void Init();
virtual int getCount();
SStringT getSizeText(DWORD dwSize);
void getView(int position, SWindow * pItem, pugi::xml_node xmlTemplate);
bool OnButtonClick(EventArgs *pEvt);
void DeleteItem(int iPosition);
SStringW GetColumnName(int iCol) const;
bool OnSort(int iCol, SHDSORTFLAG * stFlags, int nCols);
static int __cdecl SortCmp(void *context, const void * p1, const void * p2);
};
#endif