AeClient.h 1.8 KB
//
// AeClient.h
//
// This abstract base class represents clients of the
// asset database which need to be notified whenever a
// change is made to asset data.
//
// The asset database notifies clients of data modifications
// through the virtual update messages - UpdateAsset,
// UpdateNewAsset, etc.
//
// At certain times, there may be a batch of modifications
// made to the database such as reading in an entire bank files
// assets.  In this case, the database can be told to suspend
// updates until all data changes have been made.  Then,
// when UpdateResume is called, all the necessary updates can
// take place at once.
//
// Note that when suspending updates, the database still calls
// the update routines but the suspended flag will be true.  This
// means that the client is responsible for suspending all or part
// of the update process.  This is important since editors may
// want to update internal data right away and only suspend UI processing.
//

#ifndef __AeClient__
#define __AeClient__

#include "AeTypes.h"


#define kInvalidRef	-1

typedef int TClientRef;

class AeAssetBase;
class AeAsset;


class AeClient
{
public:
                        AeClient (void);
    virtual	       	~AeClient (void);

    virtual void       	SetAssetBase (AeAssetBase *);
    AeAssetBase *	GetAssetBase (void) { return fAssetBase; }

    void		SetRef (TClientRef ref) { fRef = ref; }
    TClientRef		GetRef (void) { return fRef; }

    virtual void	CreateAsset (AeAsset *, Boolean);
    virtual void       	UpdateAsset (AeAsset *, Boolean);
    virtual void	DeleteAsset (AeAsset *, Boolean);
    virtual void	SelectAsset (AeAsset *, Boolean);
    virtual void	OnlineAsset (AeAsset *, Boolean);
    virtual void	UpdateResume (void);

protected:

    AeAssetBase *      	fAssetBase;
    TClientRef		fRef;
};

#endif __AeClient__