lib

KoChangeCaseDia.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C)  2001 Montel Laurent <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public 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
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include <klocale.h>
00021 
00022 #include <qvbox.h>
00023 #include <qwhatsthis.h>
00024 #include <qbuttongroup.h>
00025 #include <qradiobutton.h>
00026 
00027 #include "KoChangeCaseDia.h"
00028 
00029 
00030 KoChangeCaseDia::KoChangeCaseDia( QWidget *parent, const char *name )
00031     : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
00032 {
00033 
00034     setCaption( i18n("Change Case") );
00035     QVBox *page = makeVBoxMainWidget();
00036 
00037     QButtonGroup *grp = new QButtonGroup( 1, QGroupBox::Horizontal, i18n( "Case" ),page );
00038     grp->setRadioButtonExclusive( TRUE );
00039     grp->layout();
00040     m_upperCase=new QRadioButton( i18n("&Uppercase"), grp );
00041     m_lowerCase=new QRadioButton( i18n("&Lowercase"), grp );
00042 
00043     m_titleCase=new QRadioButton( i18n("T&itle case"), grp );
00044 
00045     m_toggleCase=new QRadioButton( i18n("&Toggle case"), grp );
00046     m_sentenceCase=new QRadioButton( i18n("Sentence case"), grp );
00047     QWhatsThis::add( m_sentenceCase, i18n("Convert first letter of a sentence to uppercase."));
00048 
00049     m_upperCase->setChecked(true);
00050     grp->setRadioButtonExclusive( TRUE );
00051 
00052 }
00053 
00054 KoChangeCaseDia::TypeOfCase KoChangeCaseDia::getTypeOfCase()
00055 {
00056     TypeOfCase type=UpperCase;
00057     if( m_upperCase->isChecked())
00058         type=UpperCase;
00059     else if(m_lowerCase->isChecked())
00060         type=LowerCase;
00061     else if(m_titleCase->isChecked())
00062         type=TitleCase;
00063     else if( m_toggleCase->isChecked())
00064         type=ToggleCase;
00065     else if( m_sentenceCase->isChecked())
00066         type=SentenceCase;
00067     return type;
00068 }
00069 
00070 #include "KoChangeCaseDia.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys