openshot-audio  0.1.2
juce_FileChooser.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_FILECHOOSER_H_INCLUDED
26 #define JUCE_FILECHOOSER_H_INCLUDED
27 
28 
29 //==============================================================================
56 {
57 public:
58  //==============================================================================
78  FileChooser (const String& dialogBoxTitle,
79  const File& initialFileOrDirectory = File::nonexistent,
80  const String& filePatternsAllowed = String::empty,
81  bool useOSNativeDialogBox = true);
82 
84  ~FileChooser();
85 
86  //==============================================================================
100  bool browseForFileToOpen (FilePreviewComponent* previewComponent = nullptr);
101 
107  bool browseForMultipleFilesToOpen (FilePreviewComponent* previewComponent = nullptr);
108 
122  bool browseForFileToSave (bool warnAboutOverwritingExistingFiles);
123 
134  bool browseForDirectory();
135 
141  bool browseForMultipleFilesOrDirectories (FilePreviewComponent* previewComponent = nullptr);
142 
143  //==============================================================================
152  bool showDialog (int flags, FilePreviewComponent* previewComponent);
153 
154  //==============================================================================
168  File getResult() const;
169 
178  const Array<File>& getResults() const noexcept { return results; }
179 
180 private:
181  //==============================================================================
182  String title, filters;
183  const File startingFile;
184  Array<File> results;
185  const bool useNativeDialogBox;
186 
187  static void showPlatformDialog (Array<File>& results, const String& title, const File& file,
188  const String& filters, bool selectsDirectories, bool selectsFiles,
189  bool isSave, bool warnAboutOverwritingExistingFiles, bool selectMultipleFiles,
190  FilePreviewComponent* previewComponent);
191  static bool isPlatformDialogAvailable();
192 
194 };
195 
196 
197 #endif // JUCE_FILECHOOSER_H_INCLUDED
static const String empty
Definition: juce_String.h:152
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_FileChooser.h:55
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
there are legal restrictions on arithmetic coding Invalid progressive parameters caller expects u Cannot quantize more than d color components Adobe APP14 flags
Definition: juce_JPEGLoader.cpp:127
static const File nonexistent
Definition: juce_File.h:99
Definition: juce_FilePreviewComponent.h:41
const Array< File > & getResults() const noexcept
Definition: juce_FileChooser.h:178
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_File.h:45