filelist.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __FILE_LIST_VIEW_H__
  2. #define __FILE_LIST_VIEW_H__
  3. #define FITEM_FILE 0x0
  4. #define FITEM_DIR 0x1
  5. struct file_item
  6. {
  7. char* name;
  8. rt_uint32_t type;
  9. rt_uint32_t size;
  10. /* files under same directory */
  11. rtgui_list_t list;
  12. };
  13. /** Gets the type of a filelist view */
  14. #define FILELIST_VIEW_TYPE (filelist_view_type_get())
  15. /** Casts the object to a filelist */
  16. #define FILELIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), FILELIST_VIEW_TYPE, filelist_view_t))
  17. /** Checks if the object is a filelist view */
  18. #define IS_FILELIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), FILELIST_VIEW_TYPE))
  19. struct filelist_view
  20. {
  21. struct rtgui_view parent;
  22. /* widget private data */
  23. /* total number of items */
  24. rt_uint32_t count;
  25. /* the selected item */
  26. struct file_item* selected;
  27. /* current directory */
  28. rt_uint8_t* current_directory;
  29. rt_uint8_t* pattern;
  30. /* the number of item in a page */
  31. rt_uint16_t page_items;
  32. /* item_list */
  33. rtgui_list_t item_list;
  34. };
  35. typedef struct filelist_view filelist_view_t;
  36. #endif