File indexing completed on 2024-05-12 04:51:08

0001 /*
0002     SPDX-FileCopyrightText: 2003-2008 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-FileCopyrightText: 2009 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
0004     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 
0010 #ifndef _K3B_MOVIX_DOC_H_
0011 #define _K3B_MOVIX_DOC_H_
0012 
0013 #include "k3bdatadoc.h"
0014 
0015 #include <QList>
0016 
0017 #include "k3b_export.h"
0018 
0019 class QUrl;
0020 class QDomElement;
0021 namespace K3b {
0022     class MovixFileItem;
0023     class DataItem;
0024 
0025     class LIBK3B_EXPORT MovixDoc : public DataDoc
0026     {
0027         Q_OBJECT
0028 
0029     public:
0030         explicit MovixDoc( QObject* parent = 0 );
0031         ~MovixDoc() override;
0032 
0033         Type type() const override { return MovixProject; }
0034         QString typeString() const override { return QString::fromLatin1("movix"); }
0035 
0036         bool newDocument() override;
0037 
0038         QList<MovixFileItem*> movixFileItems() const { return m_movixFiles; }
0039 
0040         int indexOf( MovixFileItem* item );
0041 
0042         BurnJob* newBurnJob( JobHandler* hdl, QObject* parent ) override;
0043 
0044         // Movix project options managed by MovixOptionWidget
0045         void setShutdown( bool v ) { m_shutdown = v; }
0046         bool shutdown() const { return m_shutdown; }
0047 
0048         void setReboot( bool v ) { m_reboot = v; }
0049         bool reboot() const { return m_reboot; }
0050 
0051         void setEjectDisk( bool v ) { m_ejectDisk = v; }
0052         bool ejectDisk() const { return m_ejectDisk; }
0053 
0054         void setRandomPlay( bool v ) { m_randomPlay = v; }
0055         bool randomPlay() const { return m_randomPlay; }
0056 
0057         void setSubtitleFontset( const QString& v ) { m_subtitleFontset = v; }
0058         QString subtitleFontset() const { return m_subtitleFontset; }
0059 
0060         void setBootMessageLanguage( const QString& v ) { m_bootMessageLanguage = v; }
0061         QString bootMessageLanguage() const { return m_bootMessageLanguage; }
0062 
0063         void setAudioBackground( const QString& b ) { m_audioBackground = b; }
0064         QString audioBackground() const { return m_audioBackground; }
0065 
0066         void setKeyboardLayout( const QString& l ) { m_keyboardLayout = l; }
0067         QString keyboardLayout() const { return m_keyboardLayout; }
0068 
0069         void setCodecs( const QStringList& c ) { m_codecs = c; }
0070         QStringList codecs() const { return m_codecs; }
0071 
0072         void setDefaultBootLabel( const QString& v ) { m_defaultBootLabel = v; }
0073         QString defaultBootLabel() const { return m_defaultBootLabel; }
0074 
0075         void setAdditionalMPlayerOptions( const QString& v ) { m_additionalMPlayerOptions = v; }
0076         QString additionalMPlayerOptions() const { return m_additionalMPlayerOptions; }
0077 
0078         void setUnwantedMPlayerOptions( const QString& v ) { m_unwantedMPlayerOptions = v; }
0079         QString unwantedMPlayerOptions() const { return m_unwantedMPlayerOptions; }
0080 
0081         void setLoopPlaylist( int v ) { m_loopPlaylist = v; }
0082         int loopPlaylist() const { return m_loopPlaylist; }
0083 
0084         void setNoDma( bool b ) { m_noDma = b; }
0085         bool noDma() const { return m_noDma; }
0086 
0087     Q_SIGNALS:
0088         void itemsAboutToBeInserted( int pos, int count );
0089         void itemsInserted();
0090         void itemsAboutToBeRemoved( int pos, int count );
0091         void itemsRemoved();
0092         void subTitleAboutToBeInserted( K3b::MovixFileItem* parent );
0093         void subTitleInserted();
0094         void subTitleAboutToBeRemoved( K3b::MovixFileItem* parent );
0095         void subTitleRemoved();
0096 
0097     public Q_SLOTS:
0098         void addUrls( const QList<QUrl>& urls ) override;
0099         void addUrlsAt( const QList<QUrl>& urls, int pos );
0100         void addMovixItems( QList<K3b::MovixFileItem*>& items, int pos = -1 );
0101         void removeMovixItem( K3b::MovixFileItem* item);
0102         void moveMovixItem( K3b::MovixFileItem* item, K3b::MovixFileItem* itemAfter );
0103         void addSubTitleItem( K3b::MovixFileItem*, const QUrl& );
0104         void removeSubTitleItem( K3b::MovixFileItem* );
0105 
0106     protected:
0107         /** reimplemented from Doc */
0108         bool loadDocumentData( QDomElement* root ) override;
0109         /** reimplemented from Doc */
0110         bool saveDocumentData( QDomElement* ) override;
0111 
0112     private:
0113         QList<MovixFileItem*> m_movixFiles;
0114 
0115         //Movix project options
0116         bool m_shutdown;
0117         bool m_reboot;
0118         bool m_ejectDisk;
0119         bool m_randomPlay;
0120         QString m_subtitleFontset;
0121         QString m_bootMessageLanguage;
0122         QString m_audioBackground;
0123         QString m_keyboardLayout;
0124         QStringList m_codecs;
0125         QString m_defaultBootLabel;
0126         QString m_additionalMPlayerOptions;
0127         QString m_unwantedMPlayerOptions;
0128         int m_loopPlaylist;
0129         bool m_noDma;
0130     };
0131 }
0132 
0133 #endif