#ifndef __FILE_ENTRY_H__
#define __FILE_ENTRY_H__
#include "IUpdateable.h"
#include <qdict.h>
#include <qlist.h>
#include <qpixmap.h>
#include <qstring.h>
namespace Perforce {
class DirEntry;
class FileEntry;
typedef QList< FileEntry > FileEntryList;
class FileEntry {
public:
friend DirEntry;
const QString& getDepotFile() const
{ return _depotFile; }
void setDepotFile( const QString& s )
{ _depotFile = s; }
const QString& getName() const
{ return _name; }
void setName( const QString& n )
{ _name = n; }
const QString& getClientFile() const
{ return _clientFile; }
void setClientFile( const QString& s )
{ _clientFile = s; }
const int getRevision() const
{ return _revision; }
void setRevision( int r )
{ _revision = r; }
const QString& getAction() const
{ return _action; }
void setAction( const QString& s )
{ _action = s; }
const QString& getChange() const
{ return _change; }
void setChange( const QString& s )
{ _change = s; }
const QString& getType() const
{ return _type; }
void setType( const QString& s )
{ _type = s; }
const QString& getUser() const
{ return _user; }
void setUser( const QString& u )
{ _user = u; }
const QString& getClient() const
{ return _client; }
void setClient( const QString& c )
{ _client = c; }
QString getGuiLabel() const;
static QPixmap getPixmapForFileType( const QString& ext );
static const FileEntryList& getFileEntries( const QString depotPath );
static FileEntry* createFileEntry( StrDict* varList );
private:
QString _name;
QString _depotFile;
QString _clientFile;
int _revision;
QString _action;
QString _change;
QString _type;
QString _user;
QString _client;
//======================================================================
// This structure is goind to be used by the DirEntry class
struct FileEntryCache : IUpdateable< Perforce::FileEntryList > {
FileEntryCache() : _parent( NULL ) { }
QString _depotPath;
DirEntry* _parent;
void HandleError( Error* err );
void OutputStat( StrDict* varList );
void updateCache();
};
static QDict< FileEntryCache > _fileEntryCaches;
};
} // end namespace
#endif