summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-02-26 14:32:39 (GMT)
committerTobias Markmann <tm@ayena.de>2012-11-11 16:38:00 (GMT)
commit684559ff499077e33d3d5e4b9ecb39afa240d067 (patch)
tree7c0f03ddb4c73e1d2d2ddd54fe3f3b9640291e75 /Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h
parentbe6fd0b4b580d81bfe33975c28ee7a939d6c6723 (diff)
downloadswift-contrib-684559ff499077e33d3d5e4b9ecb39afa240d067.zip
swift-contrib-684559ff499077e33d3d5e4b9ecb39afa240d067.tar.bz2
Adding basic vCard edit/show support.
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h
new file mode 100644
index 0000000..2fb7e0a
--- /dev/null
+++ b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2012 Tobias Markmann
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <QMenu>
+#include <QSignalMapper>
+#include <QWidget>
+
+#include <Swiften/Base/ByteArray.h>
+
+namespace Ui {
+ class QtVCardPhotoAndNameFields;
+}
+
+
+namespace Swift {
+
+ class QtVCardPhotoAndNameFields : public QWidget {
+ Q_OBJECT
+ Q_PROPERTY(bool editable READ isEditable WRITE setEditable)
+
+ public :
+ explicit QtVCardPhotoAndNameFields(QWidget* parent = 0);
+ ~QtVCardPhotoAndNameFields();
+
+ bool isEditable() const;
+ void setEditable(bool);
+
+ QMenu* getAddFieldMenu() const;
+
+ void setAvatar(const ByteArray& data, const std::string& type);
+ ByteArray getAvatarData() const;
+ std::string getAvatarType() const;
+
+ void setFormattedName(const QString formattedName);
+ QString getFormattedName() const;
+
+ void setNickname(const QString nickname);
+ QString getNickname() const;
+
+ void setPrefix(const QString prefix);
+ QString getPrefix() const;
+
+ void setGivenName(const QString givenName);
+ QString getGivenName() const;
+
+ void setMiddleName(const QString middleName);
+ QString getMiddleName() const;
+
+ void setFamilyName(const QString familyName);
+ QString getFamilyName() const;
+
+ void setSuffix(const QString suffix);
+ QString getSuffix() const;
+
+ public slots:
+ void showField(const QString& widgetName);
+
+ private:
+ void prepareAddFieldMenu();
+
+ private:
+ Ui::QtVCardPhotoAndNameFields* ui;
+ bool editable;
+
+ QMenu* addFieldMenu;
+ QSignalMapper* actionSignalMapper;
+ };
+
+}