- /************************************************************************
- * chxavmediafolderinfo.h
- * ----------------------
- *
- * Synopsis:
- * Contains the declaration of the CHXAvMediaFolderInfo class. This class
- * encapsulates all the info regarding the files and folders pressent
- * in memory or the mmc.
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *****************************************************************************/
- #ifndef _chxavmediafolderinfo_h_
- #define _chxavmediafolderinfo_h_
- // Helix includes...
- #include "hxstring.h"
- #include "hxurl.h"
- #include "hxwintyp.h"
- #include "hxcom.h"
- #include "hxcomm.h"
- #include "hxmon.h"
- // Includes from this project...
- #include "chxbody.h"
- #include "chxavrefptr.h"
- #include "chxavfileutil.h"
- #include "chxavmisc.h"
- #include "chxavmiscconstants.h"
- #include "chxsmartptr.h"
- // class CHXAvMediaFolderInfo...
- class CHXAvMediaFolderInfo :
- public CHXBody
- {
- public:
- // ctor and dtor
- CHXAvMediaFolderInfo();
- virtual ~CHXAvMediaFolderInfo();
- private:
- // disallow assignment and copy
- CHXAvMediaFolderInfo(const CHXAvMediaFolderInfo& rhs);
- CHXAvMediaFolderInfo& operator=(const CHXAvMediaFolderInfo& rhs);
- public:
- // types
- enum PathCreateType
- {
- PATH_ENSURE,
- PATH_OPTIONAL
- };
- enum StateFlags
- {
- STATE_CHANGED = 0x01,
- VOLID_CHANGED = 0x02
- };
- // methods
- void InitL(const TDesC& rootPath, PathCreateType pathType);
- const CHXAvFile::DriveInfo& GetDriveInfo() const;
- void SetCurrentPathL(const TDesC& path);
- const TDesC& GetRoot() const;
- const TDesC& GetCurrentPath() const;
- bool IsMmcFolder() const;
- HBufC* AllocListDescriptionL() const;
- bool IsCurrentPathValid() const;
- void UpdateDriveInfo();
- TUint32 UpdateDriveInfoCheckState();
- private:
- // implementation
- private:
- // data
- refptr<HBufC> m_spRootPath;
- refptr<HBufC> m_spCurrentPath;
- CHXAvFile::DriveInfo m_driveInfo;
- };
- typedef CHXSmartPtr<CHXAvMediaFolderInfo> CHXAvMediaFolderInfoPtr;
- inline
- bool CHXAvMediaFolderInfo::IsMmcFolder() const
- {
- return m_driveInfo.idxDrive == CHXAvMisc::KIdxMmcDrive;
- }
- ///////////////////////////////////
- // absolute root path
- inline
- const TDesC& CHXAvMediaFolderInfo::GetRoot() const
- {
- return *m_spRootPath;
- }
- ///////////////////////////////////
- // current folder, relative to root
- inline
- const TDesC& CHXAvMediaFolderInfo::GetCurrentPath() const
- {
- HX_ASSERT(m_spCurrentPath);
- return *m_spCurrentPath;
- }
- ///////////////////////////////////
- // get info from last drive check
- inline
- void CHXAvMediaFolderInfo::UpdateDriveInfo()
- {
- m_driveInfo = CHXAvFile::GetDriveInfo(*m_spRootPath);
- }
- ///////////////////////////////////
- // get info from last drive check
- inline
- const CHXAvFile::DriveInfo& CHXAvMediaFolderInfo::GetDriveInfo() const
- {
- return m_driveInfo;
- }
- #endif // _chxavmediafolderinfo_h_