identitycombo.h

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 2002 Marc Mutz <mutz@kde.org>
00003 
00004   This library is free software; you can redistribute it and/or modify it
00005   under the terms of the GNU Library General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or (at your
00007   option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful, but WITHOUT
00010   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012   License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public License
00015   along with this library; see the file COPYING.LIB.  If not, write to the
00016   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017   02110-1301, USA.
00018 */
00030 #ifndef KPIMIDENTITIES_IDENTITYCOMBO_H
00031 #define KPIMIDENTITIES_IDENTITYCOMBO_H
00032 
00033 #include "kpimidentities_export.h"
00034 #include <QtGui/QComboBox>
00035 
00036 class QString;
00037 
00038 namespace KPIMIdentities
00039 {
00040 
00041   class IdentityManager;
00042   class Identity;
00043 
00044   //KDE5: subclass from a KComboBox
00045   class KPIMIDENTITIES_EXPORT IdentityCombo : public QComboBox //krazy:exclude=qclasses
00046   {
00047       Q_OBJECT
00048     public:
00049       explicit IdentityCombo( IdentityManager *manager, QWidget *parent=0 );
00050 
00051       ~IdentityCombo();
00052       QString currentIdentityName() const;
00053       uint currentIdentity() const;
00054       void setCurrentIdentity( const QString &identityName );
00055       void setCurrentIdentity( const Identity &identity );
00056       void setCurrentIdentity( uint uoid );
00057 
00058     Q_SIGNALS:
00059 
00068       void identityChanged( uint uoid );
00069 
00070     public Q_SLOTS:
00074       void slotIdentityManagerChanged();
00075 
00076     protected Q_SLOTS:
00077       void slotEmitChanged( int );
00078       void slotUpdateTooltip( uint uoid );
00079 
00080     protected:
00081       void reloadCombo();
00082       void reloadUoidList();
00083       QList<uint> mUoidList;
00084       IdentityManager *mIdentityManager;
00085 
00086     private:
00087       //@cond PRIVATE
00088       class Private;
00089       Private *const d;
00090       //@endcond
00091   };
00092 
00093 }
00094 
00095 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys