📄 cpublickeysview.h
字号:
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: CPublicKeysView.h,v 1.3 2002/08/06 20:09:24 dallen Exp $
____________________________________________________________________________*/
#ifndef Included_CPublicKeysView_h // [
#define Included_CPublicKeysView_h
#include "pgpPubTypes.h"
#include "CList.h"
#include "CString.h"
#include "CListView.h"
_PGP_BEGIN
// Class CPublicKeysView
class CPublicKeysView : public CListView
{
public:
enum
{
kUserIDColFlag = 0x0001,
kValidityColFlag = 0x0002,
kSizeColFlag = 0x0004,
};
struct PubKeyItem : public CListableObject<PubKeyItem>
{
// These 6 fields to be filled in by client.
PGPBoolean isOnlyKeyIDValid;
PGPKeyDBObjRef key;
PGPKeyDBObjRef subKey;
PGPKeyID keyID;
PGPBoolean readOnly;
PGPBoolean locked;
// Remaining fields used solely by class CPublicKeysView.
PGPUInt32 icon;
PGPUInt32 validity;
PGPUInt32 trust;
char userID[kPGPMaxUserIDSize + 1];
char sizeStr[30];
};
private:
enum {PixelsLeftMargin = 2};
struct PKViewDrawElements;
public:
CPublicKeysView();
CPublicKeysView(HWND hWnd);
~CPublicKeysView() { }
PGPInt32 FindKeyIDIndex(const CPGPKeyID& keyID) const;
void GetSelectedItems(CArray<PubKeyItem>& items,
PGPUInt32& numItems) const;
void SelectIndex(PGPInt32 i);
void SelectAllItems();
void AddKey(const CPGPKey& key, const CPGPKey &subKey);
void AddKey(const CPGPKeyID& keyID, PGPBoolean readOnly,
PGPBoolean locked);
void RemoveKeyAtIndex(PGPInt32 i);
void SetActiveColumns(PGPUInt32 columns);
void SortOnColumn(PGPUInt32 column);
void Initialize(const CPGPdiskContext *pContext,
PGPBoolean singleSelect = FALSE,
PGPBoolean marginalInvalid = FALSE,
PGPBoolean displayMarginal = TRUE);
void Clear();
private:
const CPGPdiskContext *mPContext;
CList<PubKeyItem> mItemList;
PKViewDrawElements *mPDE;
PGPBoolean mSingleSelect;
PGPBoolean mMarginalInvalid;
PGPBoolean mDisplayMarginal;
PGPBoolean mSortAscending;
PGPUInt32 mLastSortColumn;
PGPUInt32 mActiveColumns;
PGPUInt32 mUserIDColIndex;
PGPUInt32 mSizeColIndex;
PGPUInt32 mValidityColIndex;
PGPUInt32 ConvertFromPGPValidity(PGPUInt32 uPGPValidity) const;
PGPUInt32 ConvertFromPGPTrust(PGPUInt32 uPGPTrust) const;
void GetUnknownUserIDString(const CPGPKeyID& keyID,
CString& userID) const;
int PubKeyViewCompareProcAux(const PubKeyItem *pKey1,
const PubKeyItem *pKey2);
static int CALLBACK PubKeyViewCompareProc(LPARAM lParam1,
LPARAM lParam2, LPARAM lParamSort);
void DrawBar(CDC& itemDC, const CRect& ptrBarRect,
PGPInt32 dataValue, PGPInt32 maxValue, PGPBoolean isSelected) const;
void DrawNoviceButton(CDC& itemDC, const CRect& ptrBarRect,
PGPInt32 dataValue, PGPInt32 maxValue, PGPBoolean isSelected) const;
void DrawTrueFalseButton(CDC& itemDC, const CRect& ptrBarRect,
PGPBoolean trueFalse, PGPBoolean isSelected) const;
void DrawItemColumn(CDC& itemDC, const char *userID,
const CRect& prcClip) const;
void DrawKeyItemAux(LPDRAWITEMSTRUCT pDIS, PGPBoolean isFocused) const;
void DrawKeyItem(LPDRAWITEMSTRUCT pDIS) const;
PubKeyItem * GetItemAtIndex(PGPInt32 i) const;
PGPInt32 GetIndexOfItem(const PubKeyItem *pKey) const;
void LookupUnknownKeys();
void UpdateKeyItemInfo(PubKeyItem *pItem);
void AddKeyItem(PubKeyItem *pItem);
void RemoveKeyItem(PubKeyItem *pItem);
void CreateDrawElements();
void DeleteDrawElements();
void UpdateColumns();
void GenerateMeasureItem() const;
BOOL OnDrawItem(PGPUInt16 ctrlId, LPDRAWITEMSTRUCT pDIS);
void OnKeyDown(PGPUInt32 vKey, PGPUInt32 keyData);
BOOL OnMeasureItem(PGPUInt16 ctrlId, LPMEASUREITEMSTRUCT pMIS);
void OnNcDestroy();
PGPUInt32 OnNotify(PGPUInt16 ctrlId, LPNMHDR pNMHDR);
void OnSysColorChange();
};
_PGP_END
#endif // ] Included_CPublicKeysView_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -