summaryrefslogtreecommitdiff
path: root/library/storage.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /library/storage.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'library/storage.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/storage.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/library/storage.h b/library/storage.h
new file mode 100644
index 0000000..66a9f9d
--- a/dev/null
+++ b/library/storage.h
@@ -0,0 +1,80 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef __storage_h__
21#define __storage_h__
22
23#include <qobject.h>
24#include <qlist.h>
25
26class FileSystem;
27class QCopChannel;
28
29class StorageInfo : public QObject
30{
31 Q_OBJECT
32public:
33 StorageInfo( QObject *parent=0 );
34
35 const QList<FileSystem> &fileSystems() const { return mFileSystems; }
36 const FileSystem *fileSystemOf( const QString &filename );
37
38signals:
39 void disksChanged();
40
41public slots:
42 void update();
43
44private slots:
45 void cardMessage( const QCString& msg, const QByteArray& data );
46private:
47 QList<FileSystem> mFileSystems;
48 QCopChannel *channel;
49};
50
51class FileSystem
52{
53public:
54 const QString &disk() const { return fsdisk; }
55 const QString &path() const { return fspath; }
56 const QString &name() const { return humanname; }
57 const QString &options() const { return opts; }
58 long blockSize() const { return blkSize; }
59 long totalBlocks() const { return totalBlks; }
60 long availBlocks() const { return availBlks; }
61 bool isRemovable() const { return removable; }
62 bool isWritable() const { return opts.contains("rw"); }
63
64private:
65 friend class StorageInfo;
66 FileSystem( const QString &disk, const QString &path, const QString &humanname, bool rem, const QString &opts );
67 void update();
68
69 QString fsdisk;
70 QString fspath;
71 QString humanname;
72 long blkSize;
73 long totalBlks;
74 long availBlks;
75 bool removable;
76 QString opts;
77};
78
79
80#endif