Home · All Classes · All Namespaces · Modules · Functions · Files
key-file.h
00001 
00023 #ifndef _TelepathyQt4_key_file_h_HEADER_GUARD_
00024 #define _TelepathyQt4_key_file_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/Global>
00031 
00032 #include <QMetaType>
00033 #include <QtGlobal>
00034 
00035 class QString;
00036 class QStringList;
00037 
00038 namespace Tp
00039 {
00040 
00041 class TELEPATHY_QT4_EXPORT KeyFile
00042 {
00043 public:
00044     enum Status {
00045         None = 0,
00046         NoError,
00047         NotFoundError,
00048         AccessError,
00049         FormatError,
00050     };
00051 
00052     KeyFile();
00053     KeyFile(const KeyFile &other);
00054     KeyFile(const QString &fileName);
00055     ~KeyFile();
00056 
00057     KeyFile &operator=(const KeyFile &other);
00058 
00059     void setFileName(const QString &fileName);
00060     QString fileName() const;
00061 
00062     Status status() const;
00063 
00064     void setGroup(const QString &group);
00065     QString group() const;
00066 
00067     QStringList allGroups() const;
00068     QStringList allKeys() const;
00069     QStringList keys() const;
00070     bool contains(const QString &key) const;
00071 
00072     QString rawValue(const QString &key) const;
00073     QString value(const QString &key) const;
00074     QStringList valueAsStringList(const QString &key) const;
00075 
00076     static bool unescapeString(const QByteArray &data, int from, int to,
00077         QString &result);
00078     static bool unescapeStringList(const QByteArray &data, int from, int to,
00079         QStringList &result);
00080 
00081 private:
00082     struct Private;
00083     friend struct Private;
00084     Private *mPriv;
00085 };
00086 
00087 }
00088 
00089 Q_DECLARE_METATYPE(Tp::KeyFile);
00090 
00091 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.6.5