Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

AlbumFolder.h

Go to the documentation of this file.
00001 //
00002 // AlbumFolder.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_ALBUMFOLDER_H__168CEF4D_1C6F_4E24_A647_299CBAEA6670__INCLUDED_)
00023 #define AFX_ALBUMFOLDER_H__168CEF4D_1C6F_4E24_A647_299CBAEA6670__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CLibrary;
00028 class CLibraryFile;
00029 class CCollectionFile;
00030 class CSchema;
00031 class CSchemaMember;
00032 class CXMLElement;
00033 
00034 
00035 class CAlbumFolder : public CComObject
00036 {
00037 // Construction
00038 public:
00039         CAlbumFolder(CAlbumFolder* pParent = NULL, LPCTSTR pszSchemaURI = NULL, LPCTSTR pszName = NULL, BOOL bAutoDelete = FALSE);
00040         virtual ~CAlbumFolder();
00041 
00042         DECLARE_DYNAMIC(CAlbumFolder)
00043 
00044 // Attributes
00045 public:
00046         CAlbumFolder*   m_pParent;
00047         CObList                 m_pFolders;
00048         CObList                 m_pFiles;
00049 public:
00050         CString                 m_sSchemaURI;
00051         CSchema*                m_pSchema;
00052         CXMLElement*    m_pXML;
00053         BOOL                    m_bCollSHA1;
00054         SHA1                    m_pCollSHA1;
00055 public:
00056         CString                 m_sName;
00057         BOOL                    m_bExpanded;
00058         BOOL                    m_bAutoDelete;
00059         CString                 m_sBestView;
00060 public:
00061         DWORD                           m_nUpdateCookie;
00062         DWORD                           m_nSelectCookie;
00063         DWORD                           m_nListCookie;
00064         CCollectionFile*        m_pCollection;
00065 
00066 // Operations
00067 public:
00068         CAlbumFolder*   AddFolder(LPCTSTR pszSchemaURI = NULL, LPCTSTR pszName = NULL, BOOL bAutoDelete = FALSE);
00069         POSITION                GetFolderIterator() const;
00070         CAlbumFolder*   GetNextFolder(POSITION& pos) const;
00071         CAlbumFolder*   GetFolder(LPCTSTR pszName) const;
00072         CAlbumFolder*   GetFolderByURI(LPCTSTR pszURI) const;
00073         int                             GetFolderCount() const;
00074         BOOL                    CheckFolder(CAlbumFolder* pFolder, BOOL bRecursive = FALSE) const;
00075         CAlbumFolder*   GetTarget(CSchemaMember* pMember, LPCTSTR pszValue) const;
00076         CAlbumFolder*   FindCollection(SHA1* pSHA1);
00077 public:
00078         void                    AddFile(CLibraryFile* pFile);
00079         POSITION                GetFileIterator() const;
00080         CLibraryFile*   GetNextFile(POSITION& pos) const;
00081         int                             GetFileCount() const;
00082         int                             GetSharedCount() const;
00083         void                    RemoveFile(CLibraryFile* pFile);
00084         CAlbumFolder*   FindFile(CLibraryFile* pFile) const;
00085         int                             GetFileList(CLibraryList* pList, BOOL bRecursive) const;
00086 public:
00087         void                    Delete(BOOL bIfEmpty = FALSE);
00088         BOOL                    SetMetadata(CXMLElement* pXML);
00089         BOOL                    MetaFromFile(CLibraryFile* pFile);
00090         BOOL                    MetaToFiles(BOOL bAggressive = FALSE);
00091         BOOL                    OrganiseFile(CLibraryFile* pFile);
00092         BOOL                    MountCollection(SHA1* pSHA1, CCollectionFile* pCollection, BOOL bForce = FALSE);
00093         CCollectionFile*GetCollection();
00094         CString                 GetBestView() const;
00095 protected:
00096         void                    SetCollection(SHA1* pSHA1, CCollectionFile* pCollection);
00097         void                    OnFolderDelete(CAlbumFolder* pFolder);
00098         void                    OnFileDelete(CLibraryFile* pFile);
00099         void                    Serialize(CArchive& ar, int nVersion);
00100         void                    Clear();
00101 
00102         friend class CLibrary;
00103         friend class CLibraryFolders;
00104         friend class CLibraryFrame;
00105         friend class CLibraryTreeView;
00106 };
00107 
00108 #endif // !defined(AFX_ALBUMFOLDER_H__168CEF4D_1C6F_4E24_A647_299CBAEA6670__INCLUDED_)

Generated on Thu Dec 15 10:39:33 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2