/***************************************************************************
                         SP Mail project : Simple Powerful Mail
                          main.cpp  -  description
                             -------------------
    begin                : Sun Jun 22 2003
    copyright            : (C) 2003-2006 by Alexey Parshin
    email                : alexeyp@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __CIMAPFOLDERS_H__
#define __CIMAPFOLDERS_H__

#include <sptk3/CRegistry.h>
#include <sptk3/CTreeView.h>

#include "CImapAccount.h"

#include <map>

/// @addtogroup gui GUI Classes
/// @{

class CImapFolders : public CTreeView {
   CRegistry&                 	        m_registry;
   std::map<std::string,CImapAccount *>	m_accountsMap;
protected:
   static void folder_clicked(Fl_Widget *w,void *);
   void createFolders();
public:
   CImapFolders(CRegistry& registry);
   ~CImapFolders();

   CImapAccount& account(std::string accountName) { return *m_accountsMap[accountName]; }

   void loadAccounts();
   void readAccounts();
   void clear();
};

/// @}

#endif
