KDEUI
klanguagebutton.h
Go to the documentation of this file.
00001 /* 00002 * klangbutton.h - Button with language selection drop down menu. 00003 * Derived from the KLangCombo class by Hans Petter Bieker. 00004 * 00005 * Copyright (c) 1999-2003 Hans Petter Bieker <bieker@kde.org> 00006 * (c) 2001 Martijn Klingens <klingens@kde.org> 00007 * (c) 2007 David Jarvie <software@astrojar.org.uk> 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Library General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Library General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Library General Public License 00020 * along with this library; see the file COPYING.LIB. If not, write to 00021 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00022 * Boston, MA 02110-1301, USA. 00023 */ 00024 00025 #ifndef KLANGUAGEBUTTON_H 00026 #define KLANGUAGEBUTTON_H 00027 00028 #include <kdeui_export.h> 00029 #include <QtGui/QWidget> 00030 00031 class QAction; 00032 class KLocale; 00033 class KLanguageButtonPrivate; 00034 00046 class KDEUI_EXPORT KLanguageButton : public QWidget 00047 { 00048 Q_OBJECT 00049 00050 public: 00057 explicit KLanguageButton(QWidget * parent = 0); 00058 00065 explicit KLanguageButton(const QString & text, QWidget * parent = 0 ); 00066 00070 virtual ~KLanguageButton(); 00071 00077 void setLocale( const KLocale *locale ); 00078 00084 void setText( const QString &text ); 00085 00094 void showLanguageCodes( bool show ); 00095 00101 void loadAllLanguages(); 00102 00113 void insertLanguage( const QString &languageCode, const QString &name = QString(), int index = -1 ); 00114 00120 void insertSeparator( int index = -1 ); 00121 00125 int count() const; 00126 00130 void clear(); 00131 00137 QString current() const; 00138 00145 bool contains( const QString &languageCode ) const; 00146 00152 void setCurrentItem( const QString &languageCode ); 00153 00154 Q_SIGNALS: 00160 void activated( const QString &languageCode ); 00166 void highlighted( const QString &languageCode ); 00167 00168 private Q_SLOTS: 00169 void slotTriggered( QAction* ); 00170 void slotHovered( QAction* ); 00171 00172 private: 00173 KLanguageButtonPrivate * const d; 00174 }; 00175 00176 #endif
KDE 4.6 API Reference