openshot-audio  0.1.4
juce_RecentlyOpenedFilesList.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_RECENTLYOPENEDFILESLIST_H_INCLUDED
26 #define JUCE_RECENTLYOPENEDFILESLIST_H_INCLUDED
27 
28 
29 //==============================================================================
40 {
41 public:
42  //==============================================================================
46 
49 
50  //==============================================================================
58  void setMaxNumberOfItems (int newMaxNumber);
59 
63  int getMaxNumberOfItems() const noexcept { return maxNumberOfItems; }
64 
69  int getNumFiles() const;
70 
75  File getFile (int index) const;
76 
79  const StringArray& getAllFilenames() const noexcept { return files; }
80 
82  void clear();
83 
92  void addFile (const File& file);
93 
95  void removeFile (const File& file);
96 
102  void removeNonExistentFiles();
103 
108  static void registerRecentFileNatively (const File& file);
109 
110  //==============================================================================
128  int createPopupMenuItems (PopupMenu& menuToAddItemsTo,
129  int baseItemId,
130  bool showFullPaths,
131  bool dontAddNonExistentFiles,
132  const File** filesToAvoid = nullptr);
133 
134  //==============================================================================
143  String toString() const;
144 
152  void restoreFromString (const String& stringifiedVersion);
153 
154 
155 private:
156  //==============================================================================
157  StringArray files;
158  int maxNumberOfItems;
159 
161 };
162 
163 
164 #endif // JUCE_RECENTLYOPENEDFILESLIST_H_INCLUDED
Definition: juce_RecentlyOpenedFilesList.h:39
Definition: juce_PopupMenu.h:77
#define noexcept
Definition: juce_CompilerSupport.h:141
const StringArray & getAllFilenames() const noexcept
Definition: juce_RecentlyOpenedFilesList.h:79
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_StringArray.h:39
int getMaxNumberOfItems() const noexcept
Definition: juce_RecentlyOpenedFilesList.h:63
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
Definition: juce_File.h:45