fileprops.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef KFILEPROPS_H
00020 #define KFILEPROPS_H
00021 
00022 #include <qstring.h>
00023 
00024 #include <kfilemetainfo.h>
00025 
00026 class FileProps
00027 {
00028 public:
00029     FileProps( const QString& path, const QStringList& suppliedGroups );
00030     virtual ~FileProps();
00031 
00032     bool isValid() const;
00033 
00034     QString fileName() const { return m_info->path(); }
00035     
00036     QStringList supportedGroups() const;
00037     QStringList availableGroups() const;
00038     QStringList translatedGroups();
00039 
00040     const QStringList& groupsToUse() const { return m_groupsToUse; }
00041     bool userSuppliedGroups() const { return m_userSuppliedGroups; }
00042 
00043     QStringList supportedKeys( const QString& group ) const;
00044     QStringList availableKeys( const QString& group ) const;
00045     QStringList preferredKeys( const QString& group ) const;
00046 
00047     QStringList supportedKeys() const { return m_info->supportedKeys(); }
00048     QStringList preferredKeys() const { return m_info->preferredKeys(); }
00049 
00050     QString getValue( const QString& group, const QString& key ) const;
00051     bool setValue( const QString& group,
00052                    const QString& key, const QString &value );
00053 
00054     QStringList allValues( const QString& group ) const;
00055     QStringList preferredValues( const QString& group ) const;
00056 
00057     bool isReadOnly( const QString& group, const QString& key );
00058 
00059 private:
00060     static QString createKeyValue( const KFileMetaInfoGroup& g,
00061                                    const QString& key );
00062     static QStringList createKeyValueList( const KFileMetaInfoGroup&,
00063                                            const QStringList& );
00064     bool sync();
00065 
00066     KFileMetaInfo *m_info;
00067     bool m_dirty;
00068     bool m_userSuppliedGroups;
00069 
00070     QStringList m_groupsToUse;
00071 
00072 };
00073 
00074 #endif // KFILEPROPS_H
 
This file is part of the documentation for kio Library Version 3.2.0.