1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
//////////////////////////////////////////////////////////////////////////////
//
// CDARCHIVING.H
//
// Copyright (C) 2003-2004 Gilles Caulier <caulier dot gilles at gmail dot com>
// Copyright (C) 2003-2004 by Gregory Kokanosky <gregory dot kokanosky at free.fr>
// for images navigation mode.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef CDARCHIVING_H
#define CDARCHIVING_H
// C Ansi includes.
extern "C"
{
#include <unistd.h>
}
// Qt includes
#include <qcolor.h>
#include <qdatetime.h>
#include <qdir.h>
#include <qobject.h>
#include <qstring.h>
#include <qstringlist.h>
// KDE includes
#include <kaction.h>
#include <kurl.h>
// KIPI includes
#include <libkipi/imagecollection.h>
#include <libkipi/interface.h>
class KProcess;
namespace KIPICDArchivingPlugin
{
class CDArchivingDialog;
const int NAV_THUMB_MAX_SIZE = 64;
// First field is the URL, represented with KURL::prettyURL. We can't use KURL
// directly because operator<(KURL,KURL) is not defined in KDE 3.1
class CDArchiving : public QObject
{
Q_OBJECT
public:
CDArchiving( KIPI::Interface* interface, QObject *parent=0,
KAction *action_cdarchiving=0 );
~CDArchiving();
bool prepare(void);
bool showDialog();
void invokeK3b();
void removeTmpFiles(void);
void run(void);
void stop(void);
public slots:
void slotK3bDone(KProcess*);
void slotK3bStartBurningProcess(void);
private:
CDArchivingDialog *m_configDlg;
KAction *m_actionCDArchiving;
KIPI::Interface *m_interface;
KProcess *m_Proc;
KURL m_albumUrl; // Current album Url use in the thread.
KURL::List m_albumUrlList; // Urls of Albums list from setup dialog.
QColor m_backgroundColor;
QColor m_bordersImagesColor;
QColor m_foregroundColor;
QObject *m_parent;
QString m_AlbumCollection;
QString m_AlbumComments;
QString m_AlbumDate;
QString m_AlbumTitle;
QString m_HTMLInterfaceAutoRunFolder;
QString m_HTMLInterfaceAutoRunInf;
QString m_HTMLInterfaceFolder;
QString m_HTMLInterfaceIndex;
QString m_K3bBinPathName;
QString m_K3bParameters;
QString m_StreamMainPageAlbumPreview;
QString m_applicationID;
QString m_bordersImagesSize;
QString m_fontName;
QString m_fontSize;
QString m_hostName;
QString m_hostURL;
QString m_imageFormat;
QString m_imagesFileFilter;
QString m_mainTitle;
QString m_mediaFormat;
QString m_preparer;
QString m_publisher;
QString m_systemID;
QString m_tmpFolder;
QString m_volumeID;
QString m_volumeSetID;
QStringList m_collection_name_list;
QValueList<KIPI::ImageCollection> m_albumsList;
bool m_cancelled;
bool m_copyFiles;
bool m_useAutoRunWin32;
bool m_useCheckCD;
bool m_useHTMLInterface;
bool m_useOnTheFly;
bool m_useStartBurningProcess;
int m_albumListSize;
int m_imagesPerRow;
int m_imgHeight;
int m_imgWidth;
int m_targetImgHeight;
int m_targetImgWidth;
int m_thumbnailsSize;
pid_t m_k3bPid;
private:
bool buildHTMLInterface (void);
bool createDirectory(QDir thumb_dir, QString imgGalleryDir, QString dirName);
void createHead(QTextStream& stream);
void createCSSSection(QTextStream& stream);
void createBody(QTextStream& stream,
const KIPI::ImageCollection& album,
const KURL& targetURL,
const QString& imageFormat);
int createThumb( const QString& imgName, const QString& sourceDirName, const QString& uniqueFileName,
const QString& imgGalleryDir, const QString& imageFormat);
int ResizeImage( const QString Path, const QString Directory, const QString ImageFormat,
const QString ImageNameFormat, int *Width, int *Height, int SizeFactor,
bool ColorDepthChange, int ColorDepthValue, bool CompressionSet, int ImageCompression);
bool createHtml( const KIPI::ImageCollection& album,
const KURL& targetURL,
const QString& imageFormat );
bool createPage(const QString& imgGalleryDir,
const KURL& imgURL,
const QString& uniqueImgName,
const KURL& prevImgURL,
const QString& prevUniqueImgName,
const KURL& nextImgURL,
const QString& nextUniqueImgName,
const QString& comment);
void createBodyMainPage(QTextStream& stream, KURL& url);
static QString extension(const QString& imageFormat);
bool BuildK3bXMLprojectfile (QString HTMLinterfaceFolder, QString IndexHtm,
QString AutoRunInf, QString AutorunFolder);
bool AddFolderTreeToK3bXMLProjectFile (QString dirname, QTextStream* stream);
bool addCollectionToK3bXMLProjectFile(const KIPI::ImageCollection& collection, QTextStream* stream);
bool CreateAutoRunInfFile(void);
bool DeleteDir(QString dirname);
bool deldir(QString dirname);
QString EscapeSgmlText(const QTextCodec* codec, const QString& strIn,
const bool quot = false, const bool apos = false );
void writeSettings(void);
void readSettings(void);
QString webifyFileName(QString fileName);
QString makeFileNameUnique(QStringList& list, QString fileName);
};
} // NameSpace KIPICDArchivingPlugin
#endif // CDARCHIVING_H
|