summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-02-26 14:32:39 (GMT)
committerSwift Review <review@swift.im>2013-01-12 09:38:51 (GMT)
commit25b10f8d2b77bc5b3a40aac8d2edd5d42e1b6585 (patch)
treedb398f92b820ff03cb301c91ada51b226f212065 /Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
parent4ed137080a3d80d20a2cead47f741e3dd2f2d42e (diff)
downloadswift-25b10f8d2b77bc5b3a40aac8d2edd5d42e1b6585.zip
swift-25b10f8d2b77bc5b3a40aac8d2edd5d42e1b6585.tar.bz2
Adding basic vCard edit/show support.
Change-Id: I3104efcb9d56cfcaafda45eac2a51d2702f5245b License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
new file mode 100644
index 0000000..4afe692
--- /dev/null
+++ b/Swift/QtUI/QtVCardWidget/QtVCardGeneralField.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2012 Tobias Markmann
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QLabel>
+#include <QWidget>
+
+#include "QtCloseButton.h"
+#include "QtTagComboBox.h"
+
+namespace Swift {
+
+/*
+ * covers features like:
+ * - preffered (star ceckbox)
+ * - combo check boxh
+ * - label
+ * - remove button
+ */
+class QtVCardGeneralField : public QWidget {
+ Q_OBJECT
+ Q_PROPERTY(bool editable READ isEditable WRITE setEditable NOTIFY editableChanged)
+ Q_PROPERTY(bool empty READ isEmpty)
+
+ public:
+ explicit QtVCardGeneralField(QWidget* parent = 0, QGridLayout* layout = 0, bool editable = false, int row = 0, QString label = QString(),
+ bool preferrable = true, bool taggable = true);
+ virtual ~QtVCardGeneralField();
+
+ void initialize();
+
+ virtual bool isEditable() const;
+ virtual void setEditable(bool);
+
+ virtual bool isEmpty() const = 0;
+
+ void setPreferred(const bool preferred);
+ bool getPreferred() const;
+
+ protected:
+ virtual void setupContentWidgets() = 0;
+ virtual void customCleanup();
+
+ QtTagComboBox* getTagComboBox() const;
+ QGridLayout* getGridLayout() const;
+
+ signals:
+ void editableChanged(bool);
+ void deleteField(QtVCardGeneralField*);
+
+ public slots:
+ void handleCloseButtonClicked();
+
+ protected:
+ QList<QWidget*> childWidgets;
+
+ private:
+ bool editable;
+ bool preferrable;
+ bool taggable;
+ QGridLayout* layout;
+ int row;
+ QCheckBox* preferredCheckBox;
+ QLabel* label;
+ QString labelText;
+ QtTagComboBox* tagComboBox;
+ QLabel* tagLabel;
+ QtCloseButton* closeButton;
+};
+
+}