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.

88 lines
1.9 KiB

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