Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WORKSPACE_H
  7. #define WORKSPACE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class CProject;
  12. class mxTreeView;
  13. #include "itreeitem.h"
  14. class CWorkspace : public ITreeItem
  15. {
  16. public:
  17. CWorkspace( char const *filename );
  18. ~CWorkspace();
  19. char const *GetName() const;
  20. char const *GetFileName() const { return m_szFile; }
  21. bool IsDirty( void ) const;
  22. void SetDirty( bool dirty );
  23. int GetProjectCount() const;
  24. CProject *GetProject( int index ) const;
  25. void AddProject( CProject *project );
  26. CProject *FindProjectFile( char const *filename ) const;
  27. void RemoveProject( CProject *project );
  28. void ValidateTree( mxTreeView *tree, mxTreeViewItem *parent );
  29. bool CanClose( void );
  30. void SaveChanges();
  31. virtual CWorkspace *GetWorkspace() { return this; }
  32. virtual CProject *GetProject() { return NULL; }
  33. virtual CScene *GetScene() { return NULL; }
  34. virtual CVCDFile *GetVCDFile() { return NULL; }
  35. virtual CSoundEntry *GetSoundEntry() { return NULL; }
  36. virtual CWaveFile *GetWaveFile() { return NULL; }
  37. char const *GetVSSUserName() const;
  38. char const *GetVSSProject() const;
  39. void SetVSSUserName( char const *username );
  40. void SetVSSProject( char const *projectname );
  41. virtual void Checkout( bool updatestateicons = true );
  42. virtual void Checkin( bool updatestateicons = true );
  43. bool IsCheckedOut() const;
  44. int GetIconIndex() const;
  45. virtual void MoveChildUp( ITreeItem *item );
  46. virtual void MoveChildDown( ITreeItem *item );
  47. virtual bool IsChildFirst( ITreeItem *child );
  48. virtual bool IsChildLast( ITreeItem *child );
  49. private:
  50. void LoadFromFile();
  51. void SaveToFile();
  52. enum
  53. {
  54. MAX_WORKSPACE_NAME = 128,
  55. MAX_WORKSPACE_FILENAME = 256
  56. };
  57. char m_szName[ MAX_WORKSPACE_NAME ];
  58. char m_szFile[ MAX_WORKSPACE_FILENAME ];
  59. char m_szVSSUserName[ MAX_WORKSPACE_NAME ];
  60. char m_szVSSProject[ MAX_WORKSPACE_NAME ];
  61. bool m_bDirty;
  62. CUtlVector< CProject * > m_Projects;
  63. };
  64. #endif // WORKSPACE_H