klanguagebutton.h
/*
* klangbutton.h - Button with language selection drop down menu.
* Derived from the KLangCombo class by Hans Petter Bieker.
*
* Copyright (c) 1999-2003 Hans Petter Bieker <bieker@kde.org>
* (c) 2001 Martijn Klingens <klingens@kde.org>
*
* Requires the Qt widget libraries, available at no cost at
* http://www.troll.no/
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __KLANGBUTTON_H__
#define __KLANGBUTTON_H__
#include <qwidget.h>
#include <kdelibs_export.h>
class KLanguageButtonPrivate;
class QIconSet;
class QPopupMenu;
class KDEUI_EXPORT KLanguageButton : public QWidget
{
Q_OBJECT
public:
KLanguageButton(QWidget * parent = 0, const char * name = 0);
KLanguageButton(const QString & text, QWidget * parent = 0, const char * name = 0);
virtual ~KLanguageButton();
void insertItem( const QIconSet& icon, const QString &text,
const QString & id, const QString &submenu = QString::null,
int index = -1 );
void insertItem( const QString &text, const QString & id,
const QString &submenu = QString::null, int index = -1 );
void insertSeparator( const QString &submenu = QString::null,
int index = -1 );
void insertSubmenu( const QIconSet & icon, const QString &text,
const QString & id, const QString &submenu = QString::null,
int index = -1);
void insertSubmenu( const QString &text, const QString & id,
const QString &submenu = QString::null, int index = -1);
void insertLanguage( const QString& path, const QString& name,
const QString& sub = QString::null,
const QString &submenu = QString::null, int index = -1);
int count() const;
void clear();
void setText(const QString & text);
QString current() const;
bool contains( const QString & id ) const;
void setCurrentItem( const QString & id );
QString id( int i ) const;
signals:
void activated( const QString & id );
void highlighted( const QString & id );
private slots:
void slotActivated( int );
void slotHighlighted( int );
private:
int currentItem() const;
void setCurrentItem( int );
void init(const char * name);
// work space for the new class
QStringList *m_ids;
QPopupMenu *m_popup, *m_oldPopup;
int m_current;
KLanguageButtonPrivate * d;
};
#endif
KLanguageButton
KLanguageButton provides a combobox with a 2-D dataset.
Definition: klanguagebutton.h:47

KDE Home | KDE Accessibility Home | Description of Access Keys