listview.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 21k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. // LISTVIEW PRIVATE DECLARATIONS
  2. #ifndef _INC_LISTVIEW
  3. #define _INC_LISTVIEW
  4. // Timer IDs
  5. #define IDT_NAMEEDIT 42
  6. #define IDT_SCROLLWAIT  43
  7. #define IDT_MARQUEE     44
  8. //
  9. //  use g_cxIconSpacing   when you want the the global system metric
  10. //  use lv_cxIconSpacing  when you want the padded size of "icon" in a ListView
  11. //
  12. extern int g_cxIcon;
  13. extern int g_cyIcon;
  14. #define lv_cxIconSpacing  (plv->cxIcon + (g_cxIconSpacing - g_cxIcon))
  15. #define lv_cyIconSpacing  (plv->cyIcon + (g_cyIconSpacing - g_cyIcon))
  16. #define  g_cxIconOffset ((g_cxIconSpacing - g_cxIcon) / 2)
  17. #define  g_cyIconOffset (g_cyBorder * 2)    // NOTE: Must be >= cyIconMargin!
  18. #define DT_LV       (DT_CENTER | DT_SINGLELINE | DT_NOPREFIX | DT_EDITCONTROL)
  19. #define DT_LVWRAP   (DT_CENTER | DT_WORDBREAK | DT_NOPREFIX | DT_EDITCONTROL)
  20. #define CCHLABELMAX MAX_PATH  // BUGBUG dangerous???
  21. BOOL FAR ListView_Init(HINSTANCE hinst);
  22. LRESULT CALLBACK _export ListView_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  23. #define ListView_DefProc  DefWindowProc
  24. typedef struct _IMAGE IMAGE;
  25. // Report view sub-item structure
  26. typedef struct _LISTITEM    // li
  27. {
  28.     LPSTR pszText;
  29.     POINT pt;
  30.     short iImage;
  31.     short cxSingleLabel;
  32.     short cxMultiLabel;
  33.     short cyMultiLabel;
  34.     WORD state;     // LVIS_*
  35.     LPARAM lParam;
  36. } LISTITEM;
  37. // special value for pt.y or cyLabel indicating recomputation needed
  38. // NOTE: icon ordering code considers (RECOMPUTE, RECOMPUTE) at end
  39. // of all icons
  40. //
  41. #ifdef WIN32
  42. #define RECOMPUTE  (DWORD)0x7FFFFFFF
  43. #define SRECOMPUTE ((short)0x7FFF)
  44. #else
  45. #define RECOMPUTE  0x7FFF
  46. #define SRECOMPUTE 0x7FFF
  47. #endif
  48. #define COLUMN_VIEW
  49. #define LV_HDPA_GROW   16  // Grow chunk size for DPAs
  50. #define LV_HIML_GROW   8   // Grow chunk size for ImageLists
  51. typedef struct _LV
  52. {
  53.     HDPA hdpa;          // item array structure
  54.     HWND hwnd;          // window handle
  55.     HWND hwndParent; // parent window to notify
  56.     UINT flags; // LVF_ state bits
  57.     DWORD style;
  58.     HFONT hfontLabel;   // font to use for labels
  59.     COLORREF clrBk;     // Background color
  60.     COLORREF clrBkSave; // Background color saved during disable
  61.     COLORREF clrText;   // text color
  62.     COLORREF clrTextBk; // text background color
  63.     HBRUSH hbrBk;
  64.     HANDLE hheap;        // The heap to use to allocate memory from.
  65.     int cyLabelChar;    // height of '0' in hfont
  66.     int cxLabelChar;    // width of '0'
  67.     int cxEllipses;     // width of "..."
  68.     int iDrag;          // index of item being dragged
  69.     int iFocus;         // index of currently-focused item
  70.     int iMark;          // index of "mark" for range selection
  71.     int iItemDrawing;   // item currently being drawn
  72.     int iFirstChangedNoRedraw;  // Index of first item added during no redraw.
  73.     UINT stateCallbackMask; // item state callback mask
  74.     SIZE sizeClient;      // current client rectangle
  75.     UINT nSelected;
  76.     int iPuntChar;
  77.     HRGN hrgnInval;
  78.     // Small icon view fields
  79.     HIMAGELIST himlSmall;   // small icons
  80.     int cxSmIcon;          // image list x-icon size
  81.     int cySmIcon;          // image list y-icon size
  82.     int xOrigin;        // Horizontal scroll posiiton
  83.     int cxItem;         // Width of small icon items
  84.     int cyItem;         // item height
  85.     int cItemCol;       // Number of items per column
  86.     // Icon view fields
  87.     HIMAGELIST himl;
  88.     int cxIcon;             // image list x-icon size
  89.     int cyIcon;             // image list y-icon size
  90.     HDPA hdpaZOrder;        // Large icon Z-order array
  91.     POINT ptOrigin;         // Scroll position
  92.     RECT rcView;            // Bounds of all icons (ptOrigin relative)
  93.     HWND hwndEdit;          // edit field for edit-label-in-place
  94.     int iEdit;              // item being edited
  95.     WNDPROC pfnEditWndProc; // edit field subclass proc
  96.     BOOL fNoDismissEdit;    // don't dismiss in-place edit control
  97.     // Report view fields
  98.     int cCol;
  99.     HDPA hdpaSubItems;
  100.     HWND hwndHdr;           // Header control
  101.     int yTop;
  102.     int xTotalColumnWidth;  // Total width of all columns
  103.     POINTL ptlRptOrigin;    // Origin of Report.
  104.     int iSelCol;            // to handle column width changing. changing col
  105.     int iSelOldWidth;       // to handle column width changing. changing col width
  106.     int cyItemSave;        // in ownerdrawfixed mode, we put the height into cyItem.  use this to save the old value
  107.     // state image stuff
  108.     HIMAGELIST himlState;
  109.     int cxState;
  110.     int cyState;
  111. #ifdef IEWIN31_25
  112.     int  cxScrollPage;
  113.     int  cyScrollPage;
  114. #endif
  115. } LV;
  116. #define LV_StateImageValue(pitem) ((int)(((DWORD)((pitem)->state) >> 12) & 0xF))
  117. #define LV_StateImageIndex(pitem) (LV_StateImageValue(pitem) - 1)
  118. // listview flag values
  119. #define LVF_FOCUSED     0x0001
  120. #define LVF_VISIBLE     0x0002
  121. #define LVF_ERASE       0x0004  /* is hrgnInval to be erased? */
  122. #define LVF_NMEDITPEND  0x0008
  123. #define LVF_REDRAW      0x0010  /* Value from WM_SETREDRAW message */
  124. #define LVF_ICONPOSSML  0x0020  /* X, Y coords are in small icon view */
  125. #define LVF_INRECOMPUTE 0x0040  /* Check to make sure we are not recursing */
  126. #define LVF_FONTCREATED 0x0100  /* we created the LV font */
  127. #define LVF_SCROLLWAIT  0x0200  /* we're waiting to scroll */
  128. #define LVF_COLSIZESET  0x0400  /* Has the caller explictly set width for list view */
  129. #define LVF_USERBKCLR   0x0800  /* user set the bk color (don't follow syscolorchange) */
  130. #ifdef FE_IME
  131. #define LVF_DONTDRAWCOMP   0x4000 /* do not draw IME composition if true */
  132. #define LVF_INSERTINGCOMP  0x8000 /* Avoid recursion */
  133. #endif
  134. #define ENTIRE_REGION   1
  135. // listview DrawItem flags
  136. #define LVDI_NOIMAGE 0x0001 // don't draw image
  137. #define LVDI_TRANSTEXT 0x0002 // draw text transparently in black
  138. #define LVDI_NOWAYFOCUS 0x0004 // don't allow focus to drawing
  139. #define LVDI_FOCUS 0x0008 // focus is set (for drawing)
  140. #define LVDI_SELECTED           0x0010  // draw selected text
  141. // listview child control ids
  142. #define LVID_HEADER             0
  143. // Instance data pointer access functions
  144. #define ListView_GetPtr(hwnd)      (LV*)GetWindowInt(hwnd, 0)
  145. #define ListView_SetPtr(hwnd, p)   (LV*)SetWindowInt(hwnd, 0, (UINT)(p))
  146. // view type check functions
  147. #define ListView_IsIconView(plv)    (((plv)->style & (UINT)LVS_TYPEMASK) == (UINT)LVS_ICON)
  148. #define ListView_IsSmallView(plv)   (((plv)->style & (UINT)LVS_TYPEMASK) == (UINT)LVS_SMALLICON)
  149. #define ListView_IsListView(plv)    (((plv)->style & (UINT)LVS_TYPEMASK) == (UINT)LVS_LIST)
  150. #define ListView_IsReportView(plv)  (((plv)->style & (UINT)LVS_TYPEMASK) == (UINT)LVS_REPORT)
  151. // Some helper macros for checking some of the flags...
  152. #define ListView_RedrawEnabled(plv) ((plv->flags & (LVF_REDRAW | LVF_VISIBLE)) == (LVF_REDRAW|LVF_VISIBLE))
  153. // The hdpaZorder is acutally an array of DWORDS which contains the
  154. // indexes of the items and not actual pointers...
  155. // NOTE: linear search! this can be slow
  156. #define ListView_ZOrderIndex(plv, i) DPA_GetPtrIndex((plv)->hdpaZOrder, (void FAR*)i)
  157. // Message handler functions (listview.c):
  158. LRESULT CALLBACK _export ListView_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  159. BOOL NEAR ListView_OnCreate(LV* plv, CREATESTRUCT FAR* lpCreateStruct);
  160. void NEAR ListView_OnNCDestroy(LV* plv);
  161. void NEAR ListView_OnPaint(LV* plv, HDC hdc);
  162. BOOL NEAR ListView_OnEraseBkgnd(LV* plv, HDC hdc);
  163. void NEAR ListView_OnCommand(LV* plv, int id, HWND hwndCtl, UINT codeNotify);
  164. void NEAR ListView_OnEnable(LV* plv, BOOL fEnable);
  165. BOOL NEAR ListView_OnWindowPosChanging(LV* plv, WINDOWPOS FAR* lpwpos);
  166. void NEAR ListView_OnWindowPosChanged(LV* plv, const WINDOWPOS FAR* lpwpos);
  167. void NEAR ListView_OnSetFocus(LV* plv, HWND hwndOldFocus);
  168. void NEAR ListView_OnKillFocus(LV* plv, HWND hwndNewFocus);
  169. void NEAR ListView_OnKey(LV* plv, UINT vk, BOOL fDown, int cRepeat, UINT flags);
  170. #ifdef  FE_IME
  171. BOOL NEAR ListView_OnImeComposition(LV* plv, WPARAM wParam, LPARAM lParam);
  172. BOOL FAR PASCAL SameDBCSChars(LPSTR lpsz, WORD w);
  173. #endif
  174. void NEAR ListView_OnChar(LV* plv, UINT ch, int cRepeat);
  175. void NEAR ListView_OnButtonDown(LV* plv, BOOL fDoubleClick, int x, int y, UINT keyFlags);
  176. void NEAR ListView_OnMouseMove(LV* plv, int x, int y, UINT keyFlags);
  177. void NEAR ListView_OnLButtonUp(LV* plv, int x, int y, UINT keyFlags);
  178. void NEAR ListView_OnCancelMode(LV* plv);
  179. void NEAR ListView_OnTimer(LV* plv, UINT id);
  180. void NEAR ListView_SetupPendingNameEdit(LV* plv);
  181. #define ListView_CancelPendingEdit(plv) ListView_CancelPendingTimer(plv, LVF_NMEDITPEND, IDT_NAMEEDIT)
  182. #define ListView_CancelScrollWait(plv) ListView_CancelPendingTimer(plv, LVF_SCROLLWAIT, IDT_SCROLLWAIT)
  183. BOOL NEAR ListView_CancelPendingTimer(LV* plv, UINT fFlag, int idTimer);
  184. void NEAR ListView_OnHScroll(LV* plv, HWND hwndCtl, UINT code, int pos);
  185. void NEAR ListView_OnVScroll(LV* plv, HWND hwndCtl, UINT code, int pos);
  186. BOOL NEAR ListView_CommonArrange(LV* plv, UINT style, HDPA hdpaSort);
  187. BOOL NEAR ListView_OnSetCursor(LV* plv, HWND hwndCursor, UINT codeHitTest, UINT msg);
  188. UINT NEAR ListView_OnGetDlgCode(LV* plv, MSG FAR* lpmsg);
  189. HBRUSH NEAR ListView_OnCtlColor(LV* plv, HDC hdc, HWND hwndChild, int type);
  190. void NEAR ListView_OnSetFont(LV* plvCtl, HFONT hfont, BOOL fRedraw);
  191. HFONT NEAR ListView_OnGetFont(LV* plv);
  192. void NEAR ListViews_OnTimer(LV* plv, UINT id);
  193. void NEAR ListView_OnWinIniChange(LV* plv, WPARAM wParam);
  194. void NEAR PASCAL ListView_OnSysColorChange(LV* plv);
  195. void NEAR ListView_OnSetRedraw(LV* plv, BOOL fRedraw);
  196. HIMAGELIST NEAR ListView_OnCreateDragImage(LV *plv, int iItem, LPPOINT lpptUpLeft);
  197. BOOL FAR PASCAL ListView_ISetColumnWidth(LV* plv, int iCol, int cx, BOOL fExplicit);
  198. typedef void (FAR PASCAL *SCROLLPROC)(LV*, int dx, int dy);
  199. void FAR PASCAL ListView_ComOnScroll(LV* plv, UINT code, int posNew, int sb,
  200.                                      int cLine, int cPage,
  201.                                      SCROLLPROC);
  202. BOOL NEAR ListView_OnSetBkColor(LV* plv, COLORREF clrBk);
  203. HIMAGELIST NEAR ListView_OnSetImageList(LV* plv, HIMAGELIST himl, BOOL fSmallImages);
  204. BOOL NEAR ListView_OnDeleteAllItems(LV* plv);
  205. int  NEAR ListView_OnInsertItem(LV* plv, const LV_ITEM FAR* plvi);
  206. BOOL NEAR ListView_OnDeleteItem(LV* plv, int i);
  207. BOOL NEAR ListView_OnReplaceItem(LV* plv, const LV_ITEM FAR* plvi);
  208. int  NEAR ListView_OnFindItem(LV* plv, int iStart, const LV_FINDINFO FAR* plvfi);
  209. BOOL NEAR ListView_OnSetItemPosition(LV* plv, int i, int x, int y);
  210. BOOL NEAR ListView_OnSetItem(LV* plv, const LV_ITEM FAR* plvi);
  211. BOOL NEAR ListView_OnGetItem(LV* plv, LV_ITEM FAR* plvi);
  212. BOOL NEAR ListView_OnGetItemPosition(LV* plv, int i, POINT FAR* ppt);
  213. BOOL NEAR ListView_OnEnsureVisible(LV* plv, int i, BOOL fPartialOK);
  214. BOOL NEAR ListView_OnScroll(LV* plv, int dx, int dy);
  215. int NEAR ListView_OnHitTest(LV* plv, LV_HITTESTINFO FAR* pinfo);
  216. int NEAR ListView_OnGetStringWidth(LV* plv, LPCSTR psz);
  217. BOOL NEAR ListView_OnGetItemRect(LV* plv, int i, RECT FAR* prc);
  218. int NEAR ListView_OnInsertItem(LV* plv, const LV_ITEM FAR* plvi);
  219. BOOL NEAR ListView_OnRedrawItems(LV* plv, int iFirst, int iLast);
  220. int NEAR ListView_OnGetNextItem(LV* plv, int i, UINT flags);
  221. BOOL NEAR ListView_OnSetColumnWidth(LV* plv, int iCol, int cx);
  222. int NEAR ListView_OnGetColumnWidth(LV* plv, int iCol);
  223. void NEAR ListView_OnStyleChanged(LV* plv, UINT gwl, LPSTYLESTRUCT pinfo);
  224. int NEAR ListView_OnGetTopIndex(LV* plv);
  225. int NEAR ListView_OnGetCountPerPage(LV* plv);
  226. BOOL NEAR ListView_OnGetOrigin(LV* plv, POINT FAR* ppt);
  227. int NEAR PASCAL ListView_OnGetItemText(LV* plv, int i, LV_ITEM FAR *lvitem);
  228. BOOL WINAPI ListView_OnSetItemText(LV* plv, int i, int iSubItem, LPCSTR pszText);
  229. HIMAGELIST NEAR ListView_OnGetImageList(LV* plv, int iImageList);
  230. UINT NEAR PASCAL ListView_OnGetItemState(LV* plv, int i, UINT mask);
  231. BOOL NEAR PASCAL ListView_OnSetItemState(LV* plv, int i, UINT data, UINT mask);
  232. // Private functions (listview.c):
  233. BOOL NEAR ListView_Notify(LV* plv, int i, int iSubItem, int code);
  234. void NEAR ListView_GetRects(LV* plv, int i,
  235.         RECT FAR* prcIcon, RECT FAR* prcLabel,
  236.         RECT FAR* prcBounds, RECT FAR* prcSelectBounds);
  237. BOOL NEAR ListView_DrawItem(LV* plv, int i, HDC hdc, LPPOINT lpptOrg,
  238. RECT FAR* prcClip, UINT flags);
  239. void NEAR ListView_InvalidateItem(LV* plv, int i, BOOL fSelectionOnly, UINT fRedraw);
  240. BOOL NEAR ListView_StartDrag(LV* plv, int iDrag, int x, int y);
  241. void NEAR ListView_TypeChange(LV* plv, DWORD styleOld);
  242. void NEAR PASCAL ListView_DeleteHrgnInval(LV* plv);
  243. void NEAR ListView_Redraw(LV* plv, HDC hdc, RECT FAR* prc);
  244. void NEAR ListView_RedrawSelection(LV* plv);
  245. BOOL NEAR ListView_FreeItem(LV* plv, LISTITEM FAR* pitem);
  246. LISTITEM FAR* NEAR ListView_CreateItem(LV* plv, const LV_ITEM FAR* plvi);
  247. void NEAR ListView_UpdateScrollBars(LV* plv);
  248. void FAR PASCAL ListView_Scroll2(LV* plv, int dx, int dy);
  249. int NEAR ListView_SetFocusSel(LV* plv, int iNewFocus, BOOL fSelect, BOOL fDeselectAll, BOOL fToggleSel);
  250. #define ListView_Count(plv)                 DPA_GetPtrCount((plv)->hdpa)
  251. #define ListView_GetItemPtr(plv, i)         ((LISTITEM FAR*)(DWORD)DPA_GetPtr((plv)->hdpa, (i)))
  252. #ifdef DEBUG
  253. #define ListView_FastGetItemPtr(plv, i)     ((LISTITEM FAR*)DPA_GetPtr((plv)->hdpa, (i)))
  254. #define ListView_FastGetZItemPtr(plv, i)    ((LISTITEM FAR*)DPA_GetPtr((plv)->hdpa, 
  255.                                                   (int)OFFSETOF(DPA_GetPtr((plv)->hdpaZOrder, (i)))))
  256. // Macros for getting and setting item state info for those listviews who have
  257. // no item data.
  258. #define ListView_NIDGetItemCXLabel(plv, i)  ((SHORT)HIWORD(DPA_GetPtr((plv)->hdpa, (i))))
  259. #define ListView_NIDGetItemState(plv, i)    ((WORD)LOWORD(DPA_GetPtr((plv)->hdpa, (i))))
  260. #define ListView_NIDSetItemCXLabel(plv, i, val) DPA_SetPtr((plv)->hdpa, (i), (void *)MAKELONG(ListView_NIDGetItemState((plv), (i)),(val)))
  261. #define ListView_NIDSetItemState(plv, i, val) DPA_SetPtr((plv)->hdpa, (i), (void *)MAKELONG((val),ListView_NIDGetItemCXLabel((plv), (i))))
  262. #else
  263. #define ListView_FastGetItemPtr(plv, i)     ((LISTITEM FAR*)DPA_FastGetPtr((plv)->hdpa, (i)))
  264. #define ListView_FastGetZItemPtr(plv, i)    ((LISTITEM FAR*)DPA_FastGetPtr((plv)->hdpa, 
  265.                                                   (int)OFFSETOF(DPA_FastGetPtr((plv)->hdpaZOrder, (i)))))
  266. #define ListView_NIDGetItemCXLabel(plv, i)  ((SHORT)HIWORD(DPA_FastGetPtr((plv)->hdpa, (i))))
  267. #define ListView_NIDGetItemState(plv, i)    ((WORD)LOWORD(DPA_FastGetPtr((plv)->hdpa, (i))))
  268. #define ListView_NIDSetItemCXLabel(plv, i, val) DPA_SetPtr((plv)->hdpa, (i), (void *)MAKELONG(ListView_NIDGetItemState((plv), (i)),(val)))
  269. #define ListView_NIDSetItemState(plv, i, val) DPA_SetPtr((plv)->hdpa, (i), (void *)MAKELONG((val),ListView_NIDGetItemCXLabel((plv), (i))))
  270. #endif
  271. BOOL NEAR ListView_CalcMetrics();
  272. void NEAR PASCAL ListView_ColorChange();
  273. BOOL NEAR ListView_NeedsEllipses(HDC hdc, LPCSTR pszText, RECT FAR* prc, int FAR* pcchDraw, int cxEllipses);
  274. int NEAR ListView_CompareString(LV* plv, int i, LPCSTR pszFind, UINT flags, int iLen);
  275. int NEAR ListView_GetLinkedTextWidth(HDC hdc, LPCSTR psz, UINT cch, BOOL bLink);
  276. // lvicon.c functions
  277. BOOL NEAR ListView_OnArrange(LV* plv, UINT style);
  278. HWND NEAR ListView_OnEditLabel(LV* plv, int i, LPSTR pszText);
  279. void NEAR PASCAL ListView_IDrawItem(LV* plv, int i, HDC hdc, LPPOINT lpptOrg, RECT FAR* prcClip, UINT flags);
  280. int  NEAR ListView_IItemHitTest(LV* plv, int x, int y, UINT FAR* pflags);
  281. void NEAR ListView_IGetRects(LV* plv, LISTITEM FAR* pitem, RECT FAR* prcIcon,
  282.         RECT FAR* prcLabel, LPRECT prcBounds);
  283. void NEAR ListView_ScaleIconPositions(LV* plv, BOOL fSmallIconView);
  284. void NEAR PASCAL _ListView_GetRectsFromItem(LV* plv, BOOL bSmallIconView,
  285.                                             LISTITEM FAR *pitem,
  286.                                             LPRECT prcIcon, LPRECT prcLabel, LPRECT prcBounds, LPRECT prcSelectBounds);
  287. void NEAR ListView_Recompute(LV* plv);
  288. HDC NEAR ListView_RecomputeLabelSize(LV* plv, LISTITEM FAR* pitem, int i, HDC hdc);
  289. BOOL NEAR ListView_SetIconPos(LV* plv, LISTITEM FAR* pitem, int iSlot, int cSlot);
  290. int NEAR ListView_FindFreeSlot(LV* plv, int i, int iSlot, int cSlot, BOOL FAR* pfUpdateSB, BOOL FAR* pfAppend, HDC FAR* phdc);
  291. void NEAR ListView_GetViewRect2(LV* plv, RECT FAR* prcView, int cx, int cy);
  292. int CALLBACK ArrangeIconCompare(LISTITEM FAR* pitem1, LISTITEM FAR* pitem2, LPARAM lParam);
  293. int NEAR ListView_GetSlotCount(LV* plv, BOOL fWithoutScroll);
  294. void NEAR ListView_IUpdateScrollBars(LV* plv);
  295. DWORD NEAR ListView_GetClientRect(LV* plv, RECT FAR* prcClient, BOOL fSubScrolls, RECT FAR *prcViewRect);
  296. void NEAR ListView_SetEditSize(LV* plv);
  297. BOOL NEAR ListView_DismissEdit(LV* plv, BOOL fCancel);
  298. LRESULT CALLBACK _export ListView_EditWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  299. void NEAR ListView_IOnScroll(LV* plv, UINT code, int posNew, BOOL fVert);
  300. void FAR PASCAL ListView_IScroll2(LV* plv, int dx, int dy);
  301. // REVIEW: these are useful for other controls, use other header file?
  302. void FAR PASCAL SetEditInPlaceSize(HWND hwndEdit, RECT FAR *prc, HFONT hFont, BOOL fNoWrap);
  303. HWND FAR PASCAL CreateEditInPlaceWindow(HWND hwnd, LPCSTR lpText, int cbText, LONG style, HFONT hFont);
  304. UINT NEAR PASCAL ListView_DrawImage(LV* plv, LV_ITEM FAR* pitem, HDC hdc, int x, int y, UINT fDraw);
  305. #ifdef FE_IME
  306. void NEAR PASCAL ListView_SizeIME(HWND hwnd);
  307. void NEAR PASCAL ListView_InsertComposition(HWND hwnd, WPARAM wParam, LPARAM lParam, LV *plv);
  308. void NEAR PASCAL ListView_PaintComposition(HWND hwnd, LV *plv);
  309. #endif
  310. // lvsmall.c functions:
  311. void NEAR PASCAL ListView_SDrawItem(LV* plv, int i, HDC hdc, LPPOINT lpptOrg, RECT FAR* prcClip, UINT flags);
  312. void NEAR ListView_SGetRects(LV* plv, LISTITEM FAR* pitem, RECT FAR* prcIcon,
  313.         RECT FAR* prcLabel, LPRECT prcBounds);
  314. int NEAR ListView_SItemHitTest(LV* plv, int x, int y, UINT FAR* pflags);
  315. void NEAR ListView_SUpdateScrollBars(LV* plv);
  316. void NEAR ListView_SOnScroll(LV* plv, UINT code, int posNew);
  317. int NEAR ListView_LookupString(LV* plv, LPCSTR lpszLookup, UINT flags, int iStart);
  318. // lvlist.c functions:
  319. void NEAR PASCAL ListView_LDrawItem(LV* plv, int i, LISTITEM FAR* pitem, HDC hdc, LPPOINT lpptOrg, RECT FAR* prcClip, UINT flags);
  320. void NEAR ListView_LGetRects(LV* plv, int i, RECT FAR* prcIcon,
  321.         RECT FAR* prcLabel, RECT FAR *prcBounds, RECT FAR* prcSelectBounds);
  322. int NEAR ListView_LItemHitTest(LV* plv, int x, int y, UINT FAR* pflags);
  323. void NEAR ListView_LUpdateScrollBars(LV* plv);
  324. void NEAR ListView_LOnScroll(LV* plv, UINT code, int posNew);
  325. void FAR PASCAL ListView_LScroll2(LV* plv, int dx, int dy);
  326. BOOL FAR PASCAL ListView_MaybeResizeListColumns(LV* plv, int iFirst, int iLast);
  327. // lvrept.c functions:
  328. int NEAR ListView_OnInsertColumn(LV* plv, int iCol, const LV_COLUMN FAR* pcol);
  329. BOOL NEAR ListView_OnDeleteColumn(LV* plv, int iCol);
  330. BOOL NEAR ListView_OnGetColumn(LV* plv, int iCol, LV_COLUMN FAR* pcol);
  331. BOOL NEAR ListView_OnSetColumn(LV* plv, int iCol, const LV_COLUMN FAR* pcol);
  332. BOOL NEAR ListView_ROnEnsureVisible(LV* plv, int i, BOOL fPartialOK);
  333. void NEAR PASCAL ListView_RInitialize(LV* plv, BOOL fInval);
  334. #define ListView_RYHitTest(plv, cy)  ((int)(((cy) + plv->ptlRptOrigin.y - plv->yTop) / plv->cyItem))
  335. BOOL NEAR ListView_SetSubItem(LV* plv, const LV_ITEM FAR* plvi);
  336. int NEAR ListView_RGetColumnWidth(LV* plv, int iCol);
  337. BOOL NEAR ListView_RSetColumnWidth(LV* plv, int iCol, int cx);
  338. LPSTR NEAR ListView_GetSubItemText(LV* plv, int i, int iCol);
  339. void NEAR ListView_RDestroy(LV* plv);
  340. LPSTR NEAR ListView_RGetItemText(LV* plv, int i, int iCol);
  341. int NEAR ListView_RItemHitTest(LV* plv, int x, int y, UINT FAR* pflags);
  342. void NEAR ListView_ROnScroll(LV* plv, UINT code, int posNew, UINT sb);
  343. void FAR PASCAL ListView_RScroll2(LV* plv, int dx, int dy);
  344. void NEAR ListView_RUpdateScrollBars(LV* plv);
  345. BOOL NEAR PASCAL ListView_RDrawItem(LV* plv, int i, LISTITEM FAR* pitem, HDC hdc, LPPOINT lpptOrg, RECT FAR* prcClip, UINT flags);
  346. void NEAR ListView_RGetRects(LV* plv, int iItem, RECT FAR* prcIcon,
  347.         RECT FAR* prcLabel, RECT FAR* prcBounds, RECT FAR* prcSelectBounds);
  348. BOOL NEAR ListView_ROnNotify(LV* plv, int idFrom, NMHDR FAR* pnmhdr);
  349. void NEAR ListView_FreeColumnData(HDPA hdpa);
  350. BOOL FAR PASCAL SameChars(LPSTR lpsz, char c);
  351. #define ListView_GetSubItemDPA(plv, idpa) 
  352.     ((HDPA)DPA_GetPtr((plv)->hdpaSubItems, (idpa)))
  353. // lvfile.c functions
  354. // BOOL NEAR ListView_OnWrite(LV* plv, STREAM FAR* pstm, UINT flags);
  355. // HWND NEAR ListView_OnRead(STREAM FAR* pstm, LV_READINFO FAR* pinfo);
  356. int  NEAR ListView_Arrow(LV* plv, int iStart, UINT vk);
  357. //============ External declarations =======================================
  358. //extern HFONT g_hfontLabel;
  359. extern HBRUSH g_hbrActiveLabel;
  360. extern HBRUSH g_hbrInactiveLabel;
  361. extern HBRUSH g_hbrBackground;
  362. #endif  //!_INC_LISTVIEW