• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

addresseeconfig.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 
00024 #include "addresseeconfig.h"
00025 #include "kabprefs.h"
00026 
00027 #include <QtCore/QList>
00028 
00029 using namespace KABC;
00030 
00031 AddresseeConfig::AddresseeConfig()
00032 {
00033   mAddressee = Addressee();
00034 }
00035 
00036 AddresseeConfig::AddresseeConfig( const Addressee &addr )
00037 {
00038   mAddressee = addr;
00039 }
00040 
00041 void AddresseeConfig::setAddressee( const Addressee &addr )
00042 {
00043   mAddressee = addr;
00044 }
00045 
00046 Addressee AddresseeConfig::addressee()
00047 {
00048   return mAddressee;
00049 }
00050 
00051 void AddresseeConfig::setAutomaticNameParsing( bool value )
00052 {
00053   KConfig config( "kaddressbook_addrconfig" );
00054 
00055   KConfigGroup group( &config, mAddressee.uid() );
00056   group.writeEntry( "AutomaticNameParsing", value );
00057 
00058   config.sync();
00059 }
00060 
00061 bool AddresseeConfig::automaticNameParsing()
00062 {
00063   KConfig config( "kaddressbook_addrconfig" );
00064 
00065   KConfigGroup group( &config, mAddressee.uid() );
00066   return group.readEntry( "AutomaticNameParsing",
00067                                KABPrefs::instance()->automaticNameParsing() );
00068 }
00069 
00070 void AddresseeConfig::setNoDefaultAddrTypes( const QList<KABC::Address::Type> &types )
00071 {
00072   KConfig config( "kaddressbook_addrconfig" );
00073 
00074   QList<int> list;
00075   for ( int i = 0; i < types.count(); ++i )
00076     list.append( types[ i ] );
00077 
00078   KConfigGroup group( &config, mAddressee.uid() );
00079   group.writeEntry( "NoDefaultAddrTypes", list );
00080 
00081   config.sync();
00082 }
00083 
00084 QList<KABC::Address::Type> AddresseeConfig::noDefaultAddrTypes() const
00085 {
00086   KConfig config( "kaddressbook_addrconfig" );
00087   KConfigGroup group( &config, mAddressee.uid() );
00088 
00089   QList<int> list = group.readEntry( "NoDefaultAddrTypes", QList<int>() );
00090 
00091   QList<KABC::Address::Type> types;
00092   for ( int i = 0; i < list.count(); ++i )
00093     types.append( KABC::Address::Type( list[ i ] ) );
00094 
00095   return types;
00096 }
00097 
00098 void AddresseeConfig::setCustomFields( const QStringList &fields )
00099 {
00100   KConfig config( "kaddressbook_addrconfig" );
00101   KConfigGroup group( &config, mAddressee.uid() );
00102 
00103   group.writeEntry( "LocalCustomFields", fields );
00104 
00105   config.sync();
00106 }
00107 
00108 QStringList AddresseeConfig::customFields() const
00109 {
00110   KConfig config( "kaddressbook_addrconfig" );
00111   KConfigGroup group( &config, mAddressee.uid() );
00112 
00113   return group.readEntry( "LocalCustomFields" , QStringList() );
00114 }
00115 
00116 void AddresseeConfig::remove()
00117 {
00118   KConfig config( "kaddressbook_addrconfig" );
00119   config.deleteGroup( mAddressee.uid() );
00120 }

kaddressbook

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim 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