• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KLanguageButton Class Reference

#include <klanguagebutton.h>

Inheritance diagram for KLanguageButton:

Inheritance graph
[legend]

List of all members.


Detailed Description

KLanguageButton is a pushbutton which allows a language to be selected from a popup list.

Languages are identified by their ISO 639-1 codes, e.g. en, pt_BR.

Definition at line 41 of file klanguagebutton.h.


Signals

void activated (const QString &languageCode)
void highlighted (const QString &languageCode)

Public Member Functions

void clear ()
bool contains (const QString &languageCode) const
int count () const
QString current () const
void insertLanguage (const QString &languageCode, const QString &name=QString(), int index=-1)
void insertSeparator (int index=-1)
 KLanguageButton (const QString &text, QWidget *parent=0)
 KLanguageButton (QWidget *parent=0)
void loadAllLanguages ()
void setCurrentItem (const QString &languageCode)
void setLocale (const KLocale *locale)
void setText (const QString &text)
void showLanguageCodes (bool show)
virtual ~KLanguageButton ()

Constructor & Destructor Documentation

KLanguageButton::KLanguageButton ( QWidget *  parent = 0  )  [explicit]

Constructs a button whose text is determined by the current language in the popup list.

Parameters:
parent the parent of the button

Definition at line 76 of file klanguagebutton.cpp.

KLanguageButton::KLanguageButton ( const QString &  text,
QWidget *  parent = 0 
) [explicit]

Constructs a button with static text.

Parameters:
text the text of the button
parent the parent of the button

Definition at line 82 of file klanguagebutton.cpp.

KLanguageButton::~KLanguageButton (  )  [virtual]

Deconstructor.

Definition at line 110 of file klanguagebutton.cpp.


Member Function Documentation

void KLanguageButton::activated ( const QString &  languageCode  )  [signal]

This signal is emitted when a new item is activated.

Parameters:
languageCode code of the activated language

void KLanguageButton::clear (  ) 

Removes all combobox items.

Definition at line 210 of file klanguagebutton.cpp.

bool KLanguageButton::contains ( const QString &  languageCode  )  const

Checks whether the specified language is in the popup list.

Parameters:
languageCode the language's code
Returns:
true if in the list

Definition at line 225 of file klanguagebutton.cpp.

int KLanguageButton::count (  )  const

Returns the number of items in the combo box.

Definition at line 205 of file klanguagebutton.cpp.

QString KLanguageButton::current (  )  const

Returns the language code of the combobox's current item.

Returns:
the current item's language code

Definition at line 230 of file klanguagebutton.cpp.

void KLanguageButton::highlighted ( const QString &  languageCode  )  [signal]

This signal is emitted when a new item is highlighted.

Parameters:
languageCode code of the highlighted language

void KLanguageButton::insertLanguage ( const QString &  languageCode,
const QString &  name = QString(),
int  index = -1 
)

Inserts a language into the combo box.

Normally the display name of the language is obtained automatically, but if either the language code does not exist, or there are special display requirements, the name of the language can be specified in name.

Parameters:
languageCode the code for the language
name language name. If empty, the name is obtained automatically.
index the insertion position, or -1 to insert in alphabetical order

Definition at line 131 of file klanguagebutton.cpp.

void KLanguageButton::insertSeparator ( int  index = -1  ) 

Inserts a separator item into the combo box.

A negative index will append the item.

Parameters:
index the insertion position

Definition at line 159 of file klanguagebutton.cpp.

void KLanguageButton::loadAllLanguages (  ) 

Load all known languages into the popup list.

The current language in the list is set to the default language for the current locale (as modified by setLocale()).

Definition at line 167 of file klanguagebutton.cpp.

void KLanguageButton::setCurrentItem ( const QString &  languageCode  ) 

Sets a given language to be the current item.

Parameters:
languageCode the language's code

Definition at line 244 of file klanguagebutton.cpp.

void KLanguageButton::setLocale ( const KLocale *  locale  ) 

Sets the locale to display language names.

By default, KGlobal::locale() is used.

Parameters:
locale locale to use

Definition at line 121 of file klanguagebutton.cpp.

void KLanguageButton::setText ( const QString &  text  ) 

Sets a static button text.

Parameters:
text button text

Definition at line 115 of file klanguagebutton.cpp.

void KLanguageButton::showLanguageCodes ( bool  show  ) 

Specifies whether language codes should be shown alongside language names in the popup.

Calling this method does not affect any previously inserted language texts, so it should normally be called before populating the list.

Parameters:
show true to show codes, false to hide codes

Definition at line 126 of file klanguagebutton.cpp.


The documentation for this class was generated from the following files:
  • klanguagebutton.h
  • klanguagebutton.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal