AeAssetBinUI.h 1.58 KB
#ifndef __AeAssetBinUI__
#define __AeAssetBinUI__

#include <Xm/Xm.h>
#include "AeAsset.h"

template<class T> class GList;
class AeClient;
class AeBinEditor;
class AeBinView;
class AeAssetBin;
class AeAssetUI;
class AeFieldUI;
class AeAsset;


class AeAssetBinUI
{
public:
                                AeAssetBinUI (AeAssetBin *, AeClient *);
    virtual			~AeAssetBinUI (void);

    void			SetName (const char * name);
    char *			GetName (void) { return fName; }
    TAssetType 			GetType (void);
    AeAssetBin *		GetBin (void) { return fBin; }

    Boolean			HasChildren (void) { return fChildBinUI != NULL; }

    int				GetNumFields (void);
    GList<AeFieldUI *> *       	GetFieldUIList (void) { return fFieldUIList; }
    void			AppendFieldUI (AeFieldUI *);

    void			GetFieldLabels (String * labelArray);
    void			GetFieldWidths (short * widthArray);
    void			GetFieldAligns (unsigned char * alignArray);
    void			GetFieldMaxLens (int * maxLenArray);
    void			SetNeedsWidthRecalc (Boolean recalc);

    void			UpdateHierarchy (void);
    void			UpdateAssetUIFields (AeBinView *, AeAssetUI *, int row);

    // really only friends should have access to these functions
    void			SetListFieldData (Widget list);
    void			SetChildBinUI (AeAssetBinUI * binUI) { fChildBinUI = binUI; }


private:
    void			calcWidth (GList<AeAsset *> *, AeFieldUI *,
					   int & maxWidth);

    TString63			fName;
    AeAssetBin *		fBin;
    AeAssetBinUI *		fChildBinUI;
    
    AeClient *			fClient;	// needed ONLY for calcWidth

    GList<AeFieldUI *> *    	fFieldUIList;
};


#endif __AeAssetBinUI__