kmobiletools
addressbookentryitem.cpp
Go to the documentation of this file.00001 /*************************************************************************** 00002 Copyright (C) 2007 by Matthias Lechner <matthias@lmme.de> 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program 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 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 ***************************************************************************/ 00019 00020 #include "addressbookentryitem.h" 00021 00022 AddressbookEntryItem::AddressbookEntryItem( QListWidget* parent ) 00023 : QListWidgetItem( parent, QListWidgetItem::UserType ) 00024 { 00025 m_state = AddressbookEntryItem::Default; 00026 m_defaultFont = font(); 00027 } 00028 00029 00030 AddressbookEntryItem::~AddressbookEntryItem() 00031 { 00032 } 00033 00034 void AddressbookEntryItem::setAddressee( const KMobileTools::AddressbookEntry& addressee ) 00035 { 00036 m_entry = addressee; 00037 } 00038 00039 KMobileTools::AddressbookEntry AddressbookEntryItem::addressee() const 00040 { 00041 return m_entry; 00042 } 00043 00044 void AddressbookEntryItem::setState( AddressbookEntryItem::State state ) { 00045 m_state = state; 00046 00047 QFont font = m_defaultFont; 00048 switch( state ) { 00049 case AddressbookEntryItem::Default: 00050 break; 00051 00052 case AddressbookEntryItem::AdditionRequested: 00053 font.setWeight( 35 ); 00054 break; 00055 00056 case AddressbookEntryItem::EditingRequested: 00057 font.setItalic( true ); 00058 break; 00059 00060 case AddressbookEntryItem::RemovalRequested: 00061 font.setStrikeOut( true ); 00062 break; 00063 } 00064 setFont( font ); 00065 } 00066 00067 AddressbookEntryItem::State AddressbookEntryItem::state() const { 00068 return m_state; 00069 }
KDE 4.2 API Reference