/usr/include/k3bdoc.h is in libk3b-dev 17.12.3-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 221 222 223 224 225 226 227 228 229 230 231 232 | /*
*
* Copyright (C) 2003-2009 Sebastian Trueg <trueg@k3b.org>
*
* This file is part of the K3b project.
* Copyright (C) 1998-2009 Sebastian Trueg <trueg@k3b.org>
*
* 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.
* See the file "COPYING" for the exact licensing terms.
*/
#ifndef K3BDOC_H
#define K3BDOC_H
#include "config-k3b.h"
#include "k3bglobals.h"
#include "k3b_export.h"
#include <KIOCore/KIO/Global>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QUrl>
class QDomElement;
namespace K3b {
class BurnJob;
class JobHandler;
class Msf;
namespace Device {
class Device;
}
/**
* Doc is the base document class.
* It handles some general settings.
*/
class LIBK3B_EXPORT Doc : public QObject
{
Q_OBJECT
public:
Doc( QObject* = 0 );
virtual ~Doc();
enum Type {
AudioProject = 0x1,
DataProject = 0x2,
MixedProject = 0x4,
VcdProject = 0x8,
MovixProject = 0x10,
VideoDvdProject = 0x20
};
virtual Type type() const = 0;
/**
* \return A string representation of the document type.
*/
virtual QString typeString() const = 0;
/**
* \return A name for the project which might for example be used as a suggestion for a file name
* when saving. The default implementation extracts a name from the URL.
*/
virtual QString name() const;
/**
* The media types that are supported by this project type.
* The default implementation returns all writable media types.
* This should NOT take into accout settings like the writing mode
* or anything that can be changed in the burn dialog.
*/
virtual Device::MediaTypes supportedMediaTypes() const;
/**
* returns the view widget set with setView() or null if none has been set.
*/
QWidget* view() const { return m_view; }
/**
* Just for convenience to make an easy mapping from doc to GUI possible.
*/
void setView( QWidget* v ) { m_view = v; }
/**
* sets the modified flag for the document after a modifying action on the view connected to the document.
*/
virtual void setModified( bool m = true );
/**
* returns if the document is modified or not. Use this to determine
* if your document needs saving by the user on closing.
*/
virtual bool isModified() const { return m_modified; }
/**
* Subclasses should call this when reimplementing.
* Sets some defaults.
* FIXME: this method is completely useless. Just do it all in the constructor
*/
virtual bool newDocument();
/**
* Clear project, i.e. remove all data that has ben added
*/
virtual void clear() = 0;
/**
* Load a project from an xml stream.
*
* This is used to load/save k3b projects.
*/
virtual bool loadDocumentData( QDomElement* root ) = 0;
/**
* Save a project to an xml stream.
*
* This is used to load/save k3b projects.
*/
virtual bool saveDocumentData( QDomElement* docElem ) = 0;
/** returns the QUrl of the document */
const QUrl& URL() const;
/** sets the URL of the document */
virtual void setURL( const QUrl& url );
WritingMode writingMode() const { return m_writingMode; }
bool dummy() const { return m_dummy; }
bool onTheFly() const { return m_onTheFly; }
bool removeImages() const { return m_removeImages; }
bool onlyCreateImages() const { return m_onlyCreateImages; }
int copies() const { return m_copies; }
int speed() const { return m_speed; }
Device::Device* burner() const { return m_burner; }
/**
* \return the size that will actually be burnt to the medium.
* This only differs from size() for multisession projects.
*/
virtual KIO::filesize_t burningSize() const;
virtual KIO::filesize_t size() const = 0;
virtual Msf length() const = 0;
// FIXME: rename this to something like imagePath
const QString& tempDir() const { return m_tempDir; }
virtual int numOfTracks() const { return 1; }
/**
* Create a new BurnJob to burn this project. It is not mandatory to use this
* method. You may also just create the BurnJob you need manually. It is just
* easier this way since you don't need to distinguish between the different
* project types.
*/
virtual BurnJob* newBurnJob( JobHandler*, QObject* parent = 0 ) = 0;
WritingApp writingApp() const { return m_writingApp; }
void setWritingApp( WritingApp a ) { m_writingApp = a; }
/**
* @return true if the document has successfully been saved to a file
*/
bool isSaved() const { return m_saved; }
/**
* Used for session management. Use with care.
*/
void setSaved( bool s ) { m_saved = s; }
Q_SIGNALS:
void changed();
void changed( K3b::Doc* );
public Q_SLOTS:
void setDummy( bool d );
void setWritingMode( WritingMode m ) { m_writingMode = m; }
void setOnTheFly( bool b ) { m_onTheFly = b; }
void setSpeed( int speed );
void setBurner( Device::Device* dev );
void setTempDir( const QString& dir ) { m_tempDir = dir; }
void setRemoveImages( bool b ) { m_removeImages = b; }
void setOnlyCreateImages( bool b ) { m_onlyCreateImages = b; }
void setCopies( int c ) { m_copies = c; }
/**
* the default implementation just calls addUrls with
* list containing the url
*/
virtual void addUrl( const QUrl& url );
virtual void addUrls( const QList<QUrl>& urls ) = 0;
protected:
bool saveGeneralDocumentData( QDomElement* );
bool readGeneralDocumentData( const QDomElement& );
private Q_SLOTS:
void slotChanged();
private:
/** the modified flag of the current document */
bool m_modified;
QUrl doc_url;
QWidget* m_view;
QString m_tempDir;
Device::Device* m_burner;
bool m_dummy;
bool m_onTheFly;
bool m_removeImages;
bool m_onlyCreateImages;
int m_speed;
/** see k3bglobals.h */
WritingApp m_writingApp;
WritingMode m_writingMode;
int m_copies;
bool m_saved;
};
}
#endif // K3BDOC_H
|