Blokkal
an Extendable KDE Blogging Client
SourceForge.net Logo

providercombobox.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 BLOKKAL_UiPROVIDERCOMBOBOX_H
00021 #define BLOKKAL_UiPROVIDERCOMBOBOX_H
00022 
00023 #include "../blokkal_export.h"
00024 
00025 #include <kcombobox.h>
00026 
00027 class QIcon;
00028 
00029 namespace Blokkal {
00030 
00031 namespace Ui {
00032 
00033 class ProviderInformation;
00037 typedef QList<Blokkal::Ui::ProviderInformation> ProviderList;
00038 
00046 class BLOKKAL_EXPORT ProviderComboBox : public KComboBox
00047 {
00048 Q_OBJECT
00049 public:
00054         ProviderComboBox( QWidget * parent = 0 );
00055         
00059         virtual ~ProviderComboBox( void );
00060 
00066         void setProviders( const ProviderList & providers );
00067 
00073         void addProviders( const ProviderList & providers );
00074 
00079         QString currentProvider( void ) const;
00080 
00081 public Q_SLOTS:
00088         void setCurrentProvider( const QString & id );
00089 
00090 Q_SIGNALS:
00095         void providerSelected( const QString & id );
00096 
00097 private Q_SLOTS:
00098         void emitProviderSelected( int index );
00099 
00100 private:
00101         class Private;
00102         Private * const d;
00103 
00104 };
00105 
00112 class BLOKKAL_EXPORT ProviderInformation {
00113 public:
00119         ProviderInformation( const QString & id = QString::null,
00120                              const QString & name = QString::null );
00121 
00128         ProviderInformation( const QString & id,
00129                              const QString & name,
00130                              const QIcon & icon );
00131 
00136         ProviderInformation( const Blokkal::Ui::ProviderInformation & provider );
00137 
00141         ~ProviderInformation( void );
00142 
00148         const QString & id( void ) const;
00149 
00154         const QString & name( void ) const;
00155 
00160         const QIcon & icon( void ) const;
00161 
00166         Blokkal::Ui::ProviderInformation & operator=( const Blokkal::Ui::ProviderInformation & provider );
00167 
00168 private:
00169         class Private;
00170         const Private * d;
00171 };
00172 }
00173 
00174 }
00175 
00176 #endif