comparison widgets/InteractiveFileFinder.h @ 529:3228b7913aa4

* Pull out the widgetry part of FileFinder into widgets/InteractiveFileFinder (essentially this is just to avoid a dependency from data/fileio to widgets/ which is problematic for non-gui programs)
author Chris Cannam
date Fri, 27 Mar 2009 16:25:52 +0000
parents
children d0fd7630d32f
comparison
equal deleted inserted replaced
528:44f391ec2172 529:3228b7913aa4
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2007 QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
15
16 #ifndef _INTERACTIVE_FILE_FINDER_H_
17 #define _INTERACTIVE_FILE_FINDER_H_
18
19 #include "data/fileio/FileFinder.h"
20
21 #include <QString>
22 #include <QObject>
23
24 class InteractiveFileFinder : public QObject,
25 public FileFinder
26 {
27 Q_OBJECT
28
29 public:
30 virtual ~InteractiveFileFinder();
31
32 QString getOpenFileName(FileType type, QString fallbackLocation = "");
33 QString getSaveFileName(FileType type, QString fallbackLocation = "");
34 void registerLastOpenedFilePath(FileType type, QString path);
35
36 QString find(FileType type, QString location, QString lastKnownLocation = "");
37
38 static InteractiveFileFinder *getInstance() { return &m_instance; }
39
40 protected:
41 InteractiveFileFinder();
42 static InteractiveFileFinder m_instance;
43
44 QString findRelative(QString location, QString relativeTo);
45 QString locateInteractive(FileType type, QString thing);
46
47 QString m_lastLocatedLocation;
48 };
49
50 #endif
51