summaryrefslogtreecommitdiff
path: root/utils/scenemanager/project.h
blob: 4a8be8c51f01821c58eadce6c87d334188930960 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#ifndef PROJECT_H
#define PROJECT_H
#ifdef _WIN32
#pragma once
#endif

class CScene;
class mxTreeView;
class CWorkspace;

#include "itreeitem.h"

class CProject : public ITreeItem
{
public:
	CProject( CWorkspace *ws, char const *filename );
	~CProject();

	CWorkspace	*GetOwnerWorkspace();

	char const	*GetName() const;
	char const	*GetFileName() const;


	bool		IsDirty( void ) const;
	void		SetDirty( bool dirty );

	void		SetComments( char const *comments );
	char const	*GetComments( void ) const;

	int			GetSceneCount() const;
	CScene		*GetScene( int index ) const;
	void		AddScene( CScene *scene );
	void		RemoveScene( CScene *scene );

	void		ValidateTree( mxTreeView *tree, mxTreeViewItem* parent );

	void		SaveChanges();

	virtual CWorkspace	*GetWorkspace() { return NULL; }
	virtual CProject	*GetProject() { return this; }
	virtual CScene		*GetScene() { return NULL; }
	virtual CVCDFile	*GetVCDFile() { return NULL; }
	virtual CSoundEntry	*GetSoundEntry() { return NULL; }
	virtual CWaveFile	*GetWaveFile() { return NULL; }

	virtual void Checkout( bool updatestateicons = true );
	virtual void Checkin( bool updatestateicons = true );

	bool		IsCheckedOut() const;
	int			GetIconIndex() const;

	virtual void MoveChildUp( ITreeItem *child );
	virtual void MoveChildDown( ITreeItem *child );

	virtual bool		IsChildFirst( ITreeItem *child );
	virtual bool		IsChildLast( ITreeItem *child );

private:

	void		LoadFromFile();
	void		SaveToFile();

	enum
	{
		MAX_PROJECT_NAME = 128,
		MAX_PROJECT_FILENAME = 256
	};

	char		m_szName[ MAX_PROJECT_NAME ];
	char		m_szFile[ MAX_PROJECT_FILENAME ];

	char		*m_pszComments;

	bool		m_bDirty;

	CUtlVector< CScene * >	m_Scenes;

	CWorkspace	*m_pOwner;
};

#endif // PROJECT_H