Subversion Repositories Scribus

Rev

Rev 3686 | Rev 3693 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3487 craig 1
#include "loadsaveplugin.h"
2
 
3686 craig 3
QValueList<LoadSavePlugin::FormatSupport> LoadSavePlugin::formats;
4
 
3487 craig 5
LoadSavePlugin::LoadSavePlugin()
6
        : ScActionPlugin()
7
{
8
}
9
 
10
LoadSavePlugin::~LoadSavePlugin()
11
{
12
}
3686 craig 13
 
14
bool LoadSavePlugin::saveFile(const QString & /* fileName */,
15
                                                          const LoadSavePlugin::FormatSupport & /* fmt */)
16
{
17
        return false;
18
}
19
 
20
bool LoadSavePlugin::loadFile(const QString & /* fileName */,
21
                                                          const LoadSavePlugin::FormatSupport & /* fmt */)
22
{
23
        return false;
24
}
25
 
26
const QValueList<LoadSavePlugin::FormatSupport> & LoadSavePlugin::supportedFormats()
27
{
28
        return formats;
29
}
30
 
31
void LoadSavePlugin::registerFormat(const LoadSavePlugin::FormatSupport & fmt)
32
{
3688 craig 33
        return; // FIXME - temporarily disabled
3686 craig 34
        // Must be no existing format of that name owned by this plugin
35
        Q_ASSERT(findFormat(fmt.internalName, this) == formats.end());
36
        formats.append(fmt);
37
}
38
 
39
void LoadSavePlugin::unregisterFormat(const QCString & name)
40
{
3688 craig 41
        return; // FIXME - temporarily disabled
3686 craig 42
        QValueList<LoadSavePlugin::FormatSupport>::iterator it(findFormat(name, this));
43
        Q_ASSERT(it != formats.end());
44
        formats.remove(it);
45
}
46
 
47
void LoadSavePlugin::unregisterAll()
48
{
3688 craig 49
        return; // FIXME - temporarily disabled
3686 craig 50
        QValueList<LoadSavePlugin::FormatSupport>::iterator it(formats.begin());
51
        QValueList<LoadSavePlugin::FormatSupport>::iterator itEnd(formats.end());
52
        for ( ; it != itEnd; ++it )
53
        {
54
                if ((*it).plug == this)
55
                        formats.remove(it);
56
        }
57
}
58
 
59
QValueList<LoadSavePlugin::FormatSupport>::iterator
60
LoadSavePlugin::findFormat(const QCString & name,
61
                                                   LoadSavePlugin* plug,
62
                                                   QValueList<LoadSavePlugin::FormatSupport>::iterator it)
63
{
64
        QValueList<LoadSavePlugin::FormatSupport>::iterator itEnd(formats.end());
65
        for ( ; it != itEnd ; ++it )
66
        {
67
                if ( ((*it).internalName == name) && ((plug == 0) || (plug == (*it).plug)) )
68
                        return it;
69
        }
70
        return itEnd;
71
}