annotate widgets/FileFinder.h @ 378:22b72f0f6a4e

* More work to abstract out interactive components used in the data library, so that it does not need to depend on QtGui.
author Chris Cannam
date Fri, 14 Mar 2008 17:14:21 +0000
parents
children
rev   line source
Chris@378 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@378 2
Chris@378 3 /*
Chris@378 4 Sonic Visualiser
Chris@378 5 An audio file viewer and annotation editor.
Chris@378 6 Centre for Digital Music, Queen Mary, University of London.
Chris@378 7 This file copyright 2007 QMUL.
Chris@378 8
Chris@378 9 This program is free software; you can redistribute it and/or
Chris@378 10 modify it under the terms of the GNU General Public License as
Chris@378 11 published by the Free Software Foundation; either version 2 of the
Chris@378 12 License, or (at your option) any later version. See the file
Chris@378 13 COPYING included with this distribution for more information.
Chris@378 14 */
Chris@378 15
Chris@378 16 #ifndef _FILE_FINDER_H_
Chris@378 17 #define _FILE_FINDER_H_
Chris@378 18
Chris@378 19 #include <QString>
Chris@378 20 #include <QObject>
Chris@378 21
Chris@378 22 class FileFinder : public QObject
Chris@378 23 {
Chris@378 24 Q_OBJECT
Chris@378 25
Chris@378 26 public:
Chris@378 27 virtual ~FileFinder();
Chris@378 28
Chris@378 29 enum FileType {
Chris@378 30 SessionFile,
Chris@378 31 AudioFile,
Chris@378 32 LayerFile,
Chris@378 33 LayerFileNoMidi,
Chris@378 34 SessionOrAudioFile,
Chris@378 35 ImageFile,
Chris@378 36 AnyFile
Chris@378 37 };
Chris@378 38
Chris@378 39 QString getOpenFileName(FileType type, QString fallbackLocation = "");
Chris@378 40 QString getSaveFileName(FileType type, QString fallbackLocation = "");
Chris@378 41 void registerLastOpenedFilePath(FileType type, QString path);
Chris@378 42
Chris@378 43 QString find(FileType type, QString location, QString lastKnownLocation = "");
Chris@378 44
Chris@378 45 static FileFinder *getInstance();
Chris@378 46
Chris@378 47 protected:
Chris@378 48 FileFinder();
Chris@378 49 static FileFinder *m_instance;
Chris@378 50
Chris@378 51 QString findRelative(QString location, QString relativeTo);
Chris@378 52 QString locateInteractive(FileType type, QString thing);
Chris@378 53
Chris@378 54 QString m_lastLocatedLocation;
Chris@378 55 };
Chris@378 56
Chris@378 57 #endif
Chris@378 58