2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * ================================================= */
12 #pragma implementation
16 #include "ImageLoader.h"
17 #include "frontends/support/LyXImage.h"
19 #include "support/filetools.h"
23 ImageLoader::ImageLoader()
28 ImageLoader::~ImageLoader()
33 bool ImageLoader::isImageFormatOK(string const & /*filename*/) const
38 void ImageLoader::setImage(LyXImage * image)
45 void ImageLoader::freeImage()
51 ImageLoader::FormatList const
52 ImageLoader::loadableFormats() const
58 ImageLoader::loadImage(string const & filename)
60 // Make sure file exists and is readable.
61 if (! IsFileReadable(filename)) {
62 lyxerr << "No XPM file found." << endl;
66 // Verify that the file format is correct.
67 if (! isImageFormatOK(filename)) {
68 lyxerr << "File format incorrect." << endl;
69 return ImageFormatUnknown;
74 return runImageLoader(filename);