akonadi/contact
22 #include "secrecyeditwidget.h"
24 #include <QVBoxLayout>
26 #include <kabc/addressee.h>
27 #include <kabc/secrecy.h>
28 #include <kcombobox.h>
30 SecrecyEditWidget::SecrecyEditWidget(
QWidget *parent)
36 mSecrecyCombo =
new KComboBox(
this);
39 const KABC::Secrecy::TypeList list = KABC::Secrecy::typeList();
40 KABC::Secrecy::TypeList::ConstIterator it;
43 KABC::Secrecy::TypeList::ConstIterator end(list.constEnd());
44 for (it = list.constBegin(); it != end; ++it) {
45 mSecrecyCombo->insertItem(*it, KABC::Secrecy::typeLabel(*it));
49 SecrecyEditWidget::~SecrecyEditWidget()
53 void SecrecyEditWidget::setReadOnly(
bool readOnly)
55 mSecrecyCombo->setEnabled(!readOnly);
58 void SecrecyEditWidget::loadContact(
const KABC::Addressee &contact)
60 if (contact.secrecy().type() != KABC::Secrecy::Invalid) {
61 mSecrecyCombo->setCurrentIndex(contact.secrecy().type());
65 void SecrecyEditWidget::storeContact(KABC::Addressee &contact)
const
67 KABC::Secrecy secrecy;
68 secrecy.setType((KABC::Secrecy::Type)mSecrecyCombo->currentIndex());
70 contact.setSecrecy(secrecy);
void setMargin(int margin)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:19 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.