Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

blokkalaccountmanager.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 - 2008 by Martin Mueller                           *
00003  *   orvio@orvio.de                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef BLOKKALACCOUNTMANAGER_H
00021 #define BLOKKALACCOUNTMANAGER_H
00022 
00023 #include <QtCore/QObject>
00024 
00025 #include "blokkal_export.h"
00026 
00027 class QDomElement;
00028 
00029 namespace Blokkal {
00030 class Account;
00031 class AccountConfig;
00032 class Protocol;
00033 
00037 typedef QList< Blokkal::Account * > AccountList;
00038 
00039 class AccountManagerPrivate;
00040 
00049 class BLOKKAL_EXPORT AccountManager : public QObject
00050 {
00051 friend class AccountManagerPrivate;
00052 Q_OBJECT
00053 public:
00060         static Blokkal::AccountManager * self( void );
00061 
00067         Blokkal::AccountList accounts( void );
00068 
00077         Blokkal::Account * registerAccount( Blokkal::Account * account );
00078 
00086         Blokkal::Account * account( const QString & id );
00087         
00088 
00089 public Q_SLOTS:
00093         void loadAccounts( void );
00094 
00098         void saveAccounts( void );
00099 
00100 Q_SIGNALS:
00106         void accountRegistered( Blokkal::Account * account );
00107 
00115         void accountUnregistered( Blokkal::Account * account );
00116         
00117 protected Q_SLOTS:
00122         void unregisterAccount( Blokkal::Account * account );
00123 
00124 protected:
00134         QDomElement accountNode( const QString & id );
00135 
00136 private:
00137         AccountManager( void );
00141         ~AccountManager( void );
00142         friend class AccountConfig;
00143 };
00144 
00145 }
00146 
00147 #endif