VirtualTreeNode.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. // VirtualTreeNode.h : main header file for the Virtual Tree Class
  13. //
  14. #ifndef VIRTUALTREENODE_H
  15. #define VIRTUALTREENODE_H 1
  16. enum BrowsingMode {
  17. BM_ICONS_SMALL = 0,
  18. BM_ICONS_MEDIUM,
  19. BM_ICONS_LARGE,
  20. BM_DESCRIPTION,
  21. BM_FILENAME,
  22. BM_ICONS_MICRO,
  23. };
  24. #define NO_OF_ICONS 16
  25. class CDropVirtualTreeNode {
  26. public:
  27. char dvtn_chrDragName[256];
  28. };
  29. class CVirtualTreeNode {
  30. public:
  31. BOOL vtn_bIsDirectory; // set if this is directory
  32. CListNode vtn_lnInDirectory;
  33. CListHead vtn_lhChildren; // valid if this is a directory
  34. CVirtualTreeNode *vnt_pvtnParent; // NULL if this is root
  35. ULONG vtn_Handle; // internaly use ULONG, later cast to HTREEITEM
  36. INDEX vtn_itIconType; // INDEX of representing icon in list of icons
  37. enum BrowsingMode vtn_bmBrowsingMode;// how to display items - as icons, text, ...
  38. BOOL vtn_bSelected; // (if item) is this item curently selected
  39. CTextureData *vtn_pTextureData; // here we will load textures or thumb nails
  40. CTString vtn_strName; // (if directory) name in virtual tree
  41. CTFileName vtn_fnItem; // (if item) file name
  42. // Functions
  43. CVirtualTreeNode(); // constructor and
  44. ~CVirtualTreeNode(); // destructor
  45. void MakeRoot(void);
  46. void Dump(CTStream *pFile);
  47. void Read_t( CTStream *pFile, CVirtualTreeNode* pParent); // read function
  48. void Write_t( CTStream *pFile); // write function
  49. void MoveToDirectory(CVirtualTreeNode *pVTNDst);
  50. };
  51. #endif // VIRTUALTREENODE_H