1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org> |
3 | |
4 | library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation, version 2. |
7 | |
8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | Boston, MA 02110-1301, USA. |
17 | */ |
18 | |
19 | #ifndef KFILEPROPS_H |
20 | #define KFILEPROPS_H |
21 | |
22 | #include <QtCore/QString> |
23 | |
24 | #include <kfilemetainfo.h> |
25 | #include <kurl.h> |
26 | |
27 | class FileProps |
28 | { |
29 | public: |
30 | FileProps( const QString& path); |
31 | virtual ~FileProps(); |
32 | |
33 | bool isValid() const; |
34 | |
35 | QString fileName() const { return m_info->url().path(); } |
36 | |
37 | QStringList supportedKeys() const; |
38 | QStringList availableKeys() const; |
39 | |
40 | QString getValue( const QString& key ) const; |
41 | bool setValue( const QString& key, const QString &value ); |
42 | |
43 | QStringList allValues() const; |
44 | |
45 | bool isReadOnly( const QString& key ); |
46 | |
47 | private: |
48 | static QString createKeyValue( const KFileMetaInfoItem& item ); |
49 | static QStringList createKeyValueList( const KFileMetaInfoItemList& items); |
50 | bool sync(); |
51 | |
52 | KFileMetaInfo *m_info; |
53 | bool m_dirty; |
54 | |
55 | }; |
56 | |
57 | #endif // KFILEPROPS_H |
58 | |