svgui  1.9
InteractiveFileFinder.h
Go to the documentation of this file.
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 <QApplication>
22 #include <QString>
23 #include <QObject>
24 
25 class InteractiveFileFinder : public QObject,
26  public FileFinder
27 {
28  Q_OBJECT
29 
30 public:
31  virtual ~InteractiveFileFinder();
32 
35  void setApplicationSessionExtension(QString extension);
36 
38  return m_sessionExtension;
39  }
40 
41  QString getOpenFileName(FileType type, QString fallbackLocation = "");
42  QString getSaveFileName(FileType type, QString fallbackLocation = "");
43  void registerLastOpenedFilePath(FileType type, QString path);
44 
45  QString find(FileType type, QString location, QString lastKnownLocation = "");
46 
47  static void setParentWidget(QWidget *);
48 
50 
51 protected:
54 
55  QString findRelative(QString location, QString relativeTo);
56  QString locateInteractive(FileType type, QString thing);
57 
60 
61  QWidget *m_parent;
62 };
63 
64 #endif
65 
static void setParentWidget(QWidget *)
QString find(FileType type, QString location, QString lastKnownLocation="")
QString getOpenFileName(FileType type, QString fallbackLocation="")
QString locateInteractive(FileType type, QString thing)
void setApplicationSessionExtension(QString extension)
Specify the extension for this application's session files (without the dot)
void registerLastOpenedFilePath(FileType type, QString path)
QString getApplicationSessionExtension() const
QString getSaveFileName(FileType type, QString fallbackLocation="")
QString findRelative(QString location, QString relativeTo)
static InteractiveFileFinder m_instance
static InteractiveFileFinder * getInstance()