summaryrefslogtreecommitdiffstats
blob: f78f6bf16067e0986d5cb9185b8410cf1d4b0b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (c) 2012 Tobias Markmann
 * Licensed under the simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include "QtVCardGeneralField.h"

#include <QHBoxLayout>

namespace Swift {

QtVCardGeneralField::QtVCardGeneralField(QWidget* parent, bool editable) :
	QWidget(parent) {
	setEditable(editable);
}

void QtVCardGeneralField::initialize() {
	setLayout(new QHBoxLayout);
	preferredCheckBox = new QCheckBox(this);
	layout()->addWidget(preferredCheckBox);
	label = new QLabel(this);
	layout()->addWidget(label);
	tagComboBox = new QtTagComboBox(this);
	setupContentWidgets();
	layout()->addWidget(tagComboBox);

}

bool QtVCardGeneralField::isEditable() const {
	return editable;
}

void QtVCardGeneralField::setEditable(bool editable) {
	this->editable = editable;
	editableChanged(this->editable);
}

void QtVCardGeneralField::setPreferred(const bool preferred) {
	preferredCheckBox->setChecked(preferred);
}

bool QtVCardGeneralField::getPreferred() const {
	return preferredCheckBox->isChecked();
}

QtTagComboBox *QtVCardGeneralField::getTagComboBox() {
	return tagComboBox;
}

}