Home · Modules · All Classes · All Namespaces
avatar.h
1 
23 #ifndef _TelepathyQt_avatar_h_HEADER_GUARD_
24 #define _TelepathyQt_avatar_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <TelepathyQt/Global>
31 
32 #include <QSharedDataPointer>
33 #include <QString>
34 #include <QStringList>
35 #include <QMetaType>
36 
37 namespace Tp
38 {
39 
40 struct TP_QT_EXPORT AvatarData
41 {
42 public:
43  inline AvatarData(const QString &fileName, const QString &mimeType)
44  : fileName(fileName), mimeType(mimeType) {}
45  inline AvatarData() {}
46 
47  QString fileName;
48  QString mimeType;
49 };
50 
51 class TP_QT_EXPORT AvatarSpec
52 {
53 public:
54  AvatarSpec();
55  AvatarSpec(const QStringList &supportedMimeTypes,
56  uint minHeight, uint maxHeight, uint recommendedHeight,
57  uint minWidth, uint maxWidth, uint recommendedWidth,
58  uint maxBytes);
59  AvatarSpec(const AvatarSpec &other);
60  ~AvatarSpec();
61 
62  bool isValid() const { return mPriv.constData() != 0; }
63 
64  AvatarSpec &operator=(const AvatarSpec &other);
65 
66  QStringList supportedMimeTypes() const;
67  uint minimumHeight() const;
68  uint maximumHeight() const;
69  uint recommendedHeight() const;
70  uint minimumWidth() const;
71  uint maximumWidth() const;
72  uint recommendedWidth() const;
73  uint maximumBytes() const;
74 
75 private:
76  struct Private;
77  friend struct Private;
78  QSharedDataPointer<Private> mPriv;
79 };
80 
81 } // Tp
82 
83 Q_DECLARE_METATYPE(Tp::AvatarData)
84 Q_DECLARE_METATYPE(Tp::AvatarSpec)
85 
86 #endif
AvatarData(const QString &fileName, const QString &mimeType)
Definition: avatar.h:43
bool isValid() const
Definition: avatar.h:62
QString fileName
Definition: avatar.h:47
The AvatarData class represents a Telepathy avatar.
Definition: avatar.h:40
QString mimeType
Definition: avatar.h:48
AvatarData()
Definition: avatar.h:45
Definition: abstract-adaptor.cpp:31
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51