diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-21 07:45:29 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-21 07:45:29 +0000 |
commit | 7c52284b294cb33bc2e5d747e2e3c14d8ab937ae (patch) | |
tree | ba7bbf82a8ca0852deee158068330365f0f97e97 /utils/themeeditor/quazip/quazipnewinfo.h | |
parent | b72f475d44cf83c10c99eaf765b1c55cfdc00bb0 (diff) | |
download | rockbox-7c52284b294cb33bc2e5d747e2e3c14d8ab937ae.tar.gz rockbox-7c52284b294cb33bc2e5d747e2e3c14d8ab937ae.zip |
Theme Editor: Implemented download and decompression of font pack in the preferences dialog. Dialog will also allow the user to set a directory for a custom target database, but the update button doesn't work yet. Also fixed the file filters for open file/open project actions and resized the preferences dialog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27509 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/quazip/quazipnewinfo.h')
-rw-r--r-- | utils/themeeditor/quazip/quazipnewinfo.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/utils/themeeditor/quazip/quazipnewinfo.h b/utils/themeeditor/quazip/quazipnewinfo.h new file mode 100644 index 0000000000..93ff1a2fc0 --- /dev/null +++ b/utils/themeeditor/quazip/quazipnewinfo.h | |||
@@ -0,0 +1,109 @@ | |||
1 | #ifndef QUA_ZIPNEWINFO_H | ||
2 | #define QUA_ZIPNEWINFO_H | ||
3 | |||
4 | /* | ||
5 | -- A kind of "standard" GPL license statement -- | ||
6 | QuaZIP - a Qt/C++ wrapper for the ZIP/UNZIP package | ||
7 | Copyright (C) 2005-2007 Sergey A. Tachenov | ||
8 | |||
9 | This program is free software; you can redistribute it and/or modify it | ||
10 | under the terms of the GNU General Public License as published by the | ||
11 | Free Software Foundation; either version 2 of the License, or (at your | ||
12 | option) any later version. | ||
13 | |||
14 | This program is distributed in the hope that it will be useful, but | ||
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
17 | Public License for more details. | ||
18 | |||
19 | You should have received a copy of the GNU General Public License along | ||
20 | with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | |||
23 | -- A kind of "standard" GPL license statement ends here -- | ||
24 | |||
25 | See COPYING file for GPL. | ||
26 | |||
27 | You are also permitted to use QuaZIP under the terms of LGPL (see | ||
28 | COPYING.LGPL). You are free to choose either license, but please note | ||
29 | that QuaZIP makes use of Qt, which is not licensed under LGPL. So if | ||
30 | you are using Open Source edition of Qt, you therefore MUST use GPL for | ||
31 | your code based on QuaZIP, since it would be also based on Qt in this | ||
32 | case. If you are Qt commercial license owner, then you are free to use | ||
33 | QuaZIP as long as you respect either GPL or LGPL for QuaZIP code. | ||
34 | **/ | ||
35 | |||
36 | #include <QDateTime> | ||
37 | #include <QString> | ||
38 | |||
39 | /// Information about a file to be created. | ||
40 | /** This structure holds information about a file to be created inside | ||
41 | * ZIP archive. At least name should be set to something correct before | ||
42 | * passing this structure to | ||
43 | * QuaZipFile::open(OpenMode,const QuaZipNewInfo&,int,int,bool). | ||
44 | **/ | ||
45 | struct QuaZipNewInfo { | ||
46 | /// File name. | ||
47 | /** This field holds file name inside archive, including path relative | ||
48 | * to archive root. | ||
49 | **/ | ||
50 | QString name; | ||
51 | /// File timestamp. | ||
52 | /** This is the last file modification date and time. Will be stored | ||
53 | * in the archive central directory. It is a good practice to set it | ||
54 | * to the source file timestamp instead of archive creating time. Use | ||
55 | * setFileDateTime() or QuaZipNewInfo(const QString&, const QString&). | ||
56 | **/ | ||
57 | QDateTime dateTime; | ||
58 | /// File internal attributes. | ||
59 | quint16 internalAttr; | ||
60 | /// File external attributes. | ||
61 | quint32 externalAttr; | ||
62 | /// File comment. | ||
63 | /** Will be encoded using QuaZip::getCommentCodec(). | ||
64 | **/ | ||
65 | QString comment; | ||
66 | /// File local extra field. | ||
67 | QByteArray extraLocal; | ||
68 | /// File global extra field. | ||
69 | QByteArray extraGlobal; | ||
70 | /// Uncompressed file size. | ||
71 | /** This is only needed if you are using raw file zipping mode, i. e. | ||
72 | * adding precompressed file in the zip archive. | ||
73 | **/ | ||
74 | ulong uncompressedSize; | ||
75 | /// Constructs QuaZipNewInfo instance. | ||
76 | /** Initializes name with \a name, dateTime with current date and | ||
77 | * time. Attributes are initialized with zeros, comment and extra | ||
78 | * field with null values. | ||
79 | **/ | ||
80 | QuaZipNewInfo(const QString& name); | ||
81 | /// Constructs QuaZipNewInfo instance. | ||
82 | /** Initializes name with \a name and dateTime with timestamp of the | ||
83 | * file named \a file. If the \a file does not exists or its timestamp | ||
84 | * is inaccessible (e. g. you do not have read permission for the | ||
85 | * directory file in), uses current date and time. Attributes are | ||
86 | * initialized with zeros, comment and extra field with null values. | ||
87 | * | ||
88 | * \sa setFileDateTime() | ||
89 | **/ | ||
90 | QuaZipNewInfo(const QString& name, const QString& file); | ||
91 | /// Sets the file timestamp from the existing file. | ||
92 | /** Use this function to set the file timestamp from the existing | ||
93 | * file. Use it like this: | ||
94 | * \code | ||
95 | * QuaZipFile zipFile(&zip); | ||
96 | * QFile file("file-to-add"); | ||
97 | * file.open(QIODevice::ReadOnly); | ||
98 | * QuaZipNewInfo info("file-name-in-archive"); | ||
99 | * info.setFileDateTime("file-to-add"); // take the timestamp from file | ||
100 | * zipFile.open(QIODevice::WriteOnly, info); | ||
101 | * \endcode | ||
102 | * | ||
103 | * This function does not change dateTime if some error occured (e. g. | ||
104 | * file is inaccessible). | ||
105 | **/ | ||
106 | void setFileDateTime(const QString& file); | ||
107 | }; | ||
108 | |||
109 | #endif | ||