// Copyright (c) 2006 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #pragma once #include "IMAPFolder.h" #include "Collection.h" #include "../Persistence/PersistentIMAPFolder.h" namespace HM { class IMAPFolders : public Collection { public: IMAPFolders(__int64 iAccountID, __int64 iParentFolderID); IMAPFolders(); virtual ~IMAPFolders(); void Refresh(); std::shared_ptr GetItemByDBIDRecursive(__int64 lFolderID); std::shared_ptr GetFolderByName(const String &sName, bool bRecursive = false); std::shared_ptr GetFolderByFullPath(const String &sPath); std::shared_ptr GetFolderByFullPath(const std::vector &vecFolders); void RemoveFolder(std::shared_ptr pFolder); void CreatePath(std::shared_ptr pParentContainer, const std::vector &vecFolderPath, bool bAutoSubscribe); virtual bool PreSaveObject(std::shared_ptr pObject, XNode *node); __int64 GetParentID(); // Returns the ID of the IMAP folder in which these folder exists. If this is // a top level collection, -1 is returned. __int64 GetAccountID(); // Returns the ID of the account in which these folders exist protected: virtual String GetCollectionName() const; private: bool GetIsPublicFolders_() const; __int64 account_id_; __int64 parent_folder_id_; }; }