#ifndef __KHIMAIRA_CREDWND_H
#define __KHIMAIRA_CREDWND_H
#define KHUI_CREDWND_CLASS_NAME L"NetIDMgrCredWnd"
#define KHUI_CREDWND_FLAG_ATTRNAME L"CredWndFlags"
extern khm_int32 khui_cw_flag_id;
#define CW_EXPSTATE_NONE 0x00000000
#define CW_EXPSTATE_WARN 0x00000400
#define CW_EXPSTATE_CRITICAL 0x00000800
#define CW_EXPSTATE_EXPIRED 0x00000c00
#define CW_EXPSTATE_MASK 0x00000c00
typedef struct khui_credwnd_outline_t {
khm_int32 flags;
khm_int32 start;
khm_int32 length;
khm_int32 level;
khm_int32 col;
wchar_t *header;
khm_int32 attr_id;
void * data;
khm_size cb_data;
khm_size idx_start;
khm_size idx_end;
TDCL(struct khui_credwnd_outline_t);
} khui_credwnd_outline;
#define KHUI_CW_O_EXPAND 0x00000001
#define KHUI_CW_O_STICKY 0x00000002
#define KHUI_CW_O_VISIBLE 0x00000004
#define KHUI_CW_O_SHOWFLAG 0x00000008
#define KHUI_CW_O_SELECTED 0x00000010
#define KHUI_CW_O_DATAALLOC 0x00000020
#define KHUI_CW_O_NOOUTLINE 0x00000040
#define KHUI_CW_O_RELIDENT 0x00000080
#define KHUI_CW_O_EMPTY 0x00000100
typedef struct khui_credwnd_row_t {
khm_int32 flags;
khm_int32 col;
khm_handle data;
khm_size idx_start;
khm_size idx_end;
RECT r_ext;
} khui_credwnd_row;
#define KHUI_CW_ROW_CRED 0x00000002
#define KHUI_CW_ROW_HEADER 0x00000004
#define KHUI_CW_ROW_TIMERSET 0x00000008
#define KHUI_CW_ROW_SELECTED 0x00000010
#define KHUI_CW_ROW_EXPVIEW 0x00000020
#define KHUI_CW_ROW_INITIAL 512
#define KHUI_CW_ROW_INCREMENT 512
typedef struct khui_credwnd_col_t {
khm_int32 attr_id;
khm_int32 width;
khm_int32 x;
khm_int32 flags;
khm_int32 sort_index;
wchar_t * title;
} khui_credwnd_col;
#define KHUI_CW_COL_INITIAL 16
#define KHUI_CW_COL_INCREMENT 16
#define KHUI_CW_COL_AUTOSIZE 0x00000001
#define KHUI_CW_COL_SORT_INC 0x00000002
#define KHUI_CW_COL_SORT_DEC 0x00000004
#define KHUI_CW_COL_GROUP 0x00000008
#define KHUI_CW_COL_FIXED_WIDTH 0x00000010
#define KHUI_CW_COL_FIXED_POS 0x00000020
#define KHUI_CW_COL_META 0x00000040
#define KHUI_CW_COL_FILLER 0x00000080
#define CW_CA_FLAGS -1
#define CW_CANAME_FLAGS L"_CWFlags"
#define CW_CA_TYPEICON -2
#define CW_CANAME_TYPEICON L"_CWTypeIcon"
#define cw_is_custom_attr(i) ((i)<0)
typedef struct tag_khui_credwnd_ident {
khm_handle ident;
khm_int32 ident_flags;
khm_int32 credtype;
wchar_t name[KCDB_IDENT_MAXCCH_NAME];
wchar_t credtype_name[KCDB_MAXCCH_NAME];
khm_size credcount;
khm_size id_credcount;
khm_size init_credcount;
FILETIME ft_expire;
} khui_credwnd_ident;
#define CW_IDENT_ALLOC_INCR 4
#define CW_EXP_ROW_MULT 2
typedef struct khui_credwnd_tbl_t {
HWND hwnd;
khm_handle csp_view;
khm_int32 scr_top;
khm_int32 scr_left;
khm_int32 ext_width;
khm_int32 ext_height;
khm_int32 cell_height;
HWND hwnd_header;
khm_int32 header_height;
HWND hwnd_notif;
khui_credwnd_col * cols;
khui_credwnd_row * rows;
int n_cols;
int n_total_cols;
int n_rows;
int n_total_rows;
khui_credwnd_outline * outline;
khm_int32 flags;
int cursor_row;
int anchor_row;
khm_int32 hpad;
khm_int32 vpad;
khm_int32 hpad_h;
khm_int32 threshold_warn;
khm_int32 threshold_critical;
HFONT hf_normal;
HFONT hf_header;
HFONT hf_bold;
HFONT hf_bold_header;
HBRUSH hb_normal;
HBRUSH hb_grey;
HBRUSH hb_s;
HBRUSH hb_hdr_bg;
HBRUSH hb_hdr_bg_cred;
HBRUSH hb_hdr_bg_exp;
HBRUSH hb_hdr_bg_warn;
HBRUSH hb_hdr_bg_crit;
HBRUSH hb_hdr_bg_s;
HBRUSH hb_hdr_bg_cred_s;
HBRUSH hb_hdr_bg_exp_s;
HBRUSH hb_hdr_bg_warn_s;
HBRUSH hb_hdr_bg_crit_s;
COLORREF cr_normal;
COLORREF cr_s;
COLORREF cr_hdr_normal;
COLORREF cr_hdr_s;
COLORREF cr_hdr_gray;
COLORREF cr_hdr_gray_s;
COLORREF cr_hdr_outline;
HCURSOR hc_hand;
khui_ilist * ilist;
HICON hi_lg_ident;
khm_int32 mouse_state;
khm_int32 mouse_row;
khm_int32 mouse_col;
khui_bitmap kbm_logo_shade;
khm_handle credset;
khui_credwnd_ident * idents;
khm_size n_idents;
khm_size nc_idents;
khm_int32 view_all_idents;
} khui_credwnd_tbl;
#define KHUI_MAXCB_HEADING 256
#define KHUI_CW_TBL_INITIALIZED 0x00000001
#define KHUI_CW_TBL_COL_DIRTY 0x00000002
#define KHUI_CW_TBL_ROW_DIRTY 0x00000004
#define KHUI_CW_TBL_ACTIVE 0x00000100
#define KHUI_CW_TBL_CUSTVIEW 0x00000200
#define KHUI_CW_TBL_COLSKIP 0x00000400
#define KHUI_CW_TBL_EXPIDENT 0x00000800
#define KHUI_CW_TBL_NOHEADER 0x00001000
#define CW_MOUSE_NONE 0x00000000
#define CW_MOUSE_WIDGET 0x00000001
#define CW_MOUSE_LDOWN 0x00000002
#define CW_MOUSE_ROW 0x00000004
#define CW_MOUSE_WOUTLINE 0x00000008
#define CW_MOUSE_WSTICKY 0x00000010
#define CW_MOUSE_WICON 0x00000020
#define CW_MOUSE_WMASK 0x00000039
void khm_unregister_credwnd_class(void);
void khm_register_credwnd_class(void);
HWND khm_create_credwnd(HWND parent);
LRESULT CALLBACK khm_credwnd_proc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
void cw_load_view(khui_credwnd_tbl * tbl, wchar_t * viewname, HWND hwnd);
void cw_update_creds(khui_credwnd_tbl * tbl);
void cw_unload_view(khui_credwnd_tbl * tbl);
void cw_hditem_from_tbl_col(khui_credwnd_col * col, HDITEM *phi);
int cw_update_extents(khui_credwnd_tbl * tbl, khm_boolean update_scroll);
void cw_insert_header_cols(khui_credwnd_tbl * tbl);
void khm_get_cw_element_font(HDC hdc, wchar_t * name, BOOL use_default,
LOGFONT * pfont);
void khm_set_cw_element_font(wchar_t * name, LOGFONT * pfont);
void khm_draw_identity_menu_item(HWND hwnd, LPDRAWITEMSTRUCT lpd, khui_action * act);
void khm_measure_identity_menu_item(HWND hwnd, LPMEASUREITEMSTRUCT lpm, khui_action * act);
#endif