/***************************************************************************
                         SP Mail project : Simple Powerful Mail
                          CMailAccounts.h  -  description
                             -------------------
    begin                : Sun Jun 22 2003
    copyright            : (C) 2003 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 __CMAILACCOUNTS_H__
#define __CMAILACCOUNTS_H__

#include <sptk3/CDialog.h>
#include <sptk3/CGroup.h>
#include <sptk3/CRegistry.h>
#include <sptk3/CListView.h>
#include <sptk3/CDataControl.h>
#include <sptk3/CComboBox.h>

class CMailAccounts : public CDialog {
private:
   CListView      *m_accountsView;
   CGroup         *m_accountInfoGroup;
   CInput         *m_accountName;
   CComboBox      *m_accountType;
   CInput         *m_serverName;
   CInput         *m_userName;
   CPasswordInput *m_userPassword;
   CRegistry      *m_registry;
private:
   static void cb_addAccount(Fl_Widget *w,void *);
   static void cb_removeAccount(Fl_Widget *w,void *);
   static void cb_accountSelected(Fl_Widget *w,void *);
   static void cb_accountUpdated(Fl_Widget *w,void *);
protected:
   void addAccount();
   void removeAccount();
   void accountUpdated();
   void accountSelected();
   void loadConfig();
   void saveConfig();
public:
   CMailAccounts(CRegistry *registry);
   ~CMailAccounts();
   bool exec();
};

#endif
