openshot-audio  0.1.6
juce_FileSearchPathListComponent.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_FILESEARCHPATHLISTCOMPONENT_H_INCLUDED
26 #define JUCE_FILESEARCHPATHLISTCOMPONENT_H_INCLUDED
27 
28 
29 //==============================================================================
37  public SettableTooltipClient,
38  public FileDragAndDropTarget,
39  private ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug)
40  private ListBoxModel
41 {
42 public:
43  //==============================================================================
46 
49 
50  //==============================================================================
52  const FileSearchPath& getPath() const noexcept { return path; }
53 
55  void setPath (const FileSearchPath& newPath);
56 
61  void setDefaultBrowseTarget (const File& newDefaultDirectory);
62 
70  enum ColourIds
71  {
72  backgroundColourId = 0x1004100,
74  };
75 
76  //==============================================================================
78  int getNumRows() override;
80  void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected) override;
82  void deleteKeyPressed (int lastRowSelected) override;
84  void returnKeyPressed (int lastRowSelected) override;
86  void listBoxItemDoubleClicked (int row, const MouseEvent&) override;
88  void selectedRowsChanged (int lastRowSelected) override;
90  void resized() override;
92  void paint (Graphics&) override;
94  bool isInterestedInFileDrag (const StringArray&) override;
96  void filesDropped (const StringArray& files, int, int) override;
98  void buttonClicked (Button*) override;
99 
100 private:
101  //==============================================================================
102  FileSearchPath path;
103  File defaultBrowseTarget;
104 
105  ListBox listBox;
106  TextButton addButton, removeButton, changeButton;
107  DrawableButton upButton, downButton;
108 
109  void changed();
110  void updateButtons();
111 
113 };
114 
115 
116 #endif // JUCE_FILESEARCHPATHLISTCOMPONENT_H_INCLUDED
ColourIds
Definition: juce_FileSearchPathListComponent.h:70
Definition: juce_ListBox.h:177
#define noexcept
Definition: juce_CompilerSupport.h:141
virtual bool isInterestedInFileDrag(const StringArray &files)=0
virtual void buttonClicked(Button *)=0
Definition: juce_FileDragAndDropTarget.h:33
virtual void returnKeyPressed(int lastRowSelected)
Definition: juce_ListBox.cpp:964
virtual void listBoxItemDoubleClicked(int row, const MouseEvent &)
Definition: juce_ListBox.cpp:960
Definition: juce_Button.h:39
Definition: juce_TextButton.h:36
Definition: juce_DrawableButton.h:38
const FileSearchPath & getPath() const noexcept
Definition: juce_FileSearchPathListComponent.h:52
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
virtual void resized()
Definition: juce_Component.cpp:2272
Definition: juce_TooltipClient.h:63
virtual int getNumRows()=0
Definition: juce_FileSearchPath.h:39
Definition: juce_Component.h:33
Definition: juce_Button.h:162
Definition: juce_FileSearchPathListComponent.h:36
virtual void paintListBoxItem(int rowNumber, Graphics &g, int width, int height, bool rowIsSelected)=0
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
virtual void selectedRowsChanged(int lastRowSelected)
Definition: juce_ListBox.cpp:962
Definition: juce_StringArray.h:39
virtual void filesDropped(const StringArray &files, int x, int y)=0
void paint(Graphics &) override
Definition: juce_Button.cpp:424
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42
virtual void deleteKeyPressed(int lastRowSelected)
Definition: juce_ListBox.cpp:963
Definition: juce_File.h:45
Definition: juce_MouseEvent.h:36
Definition: juce_ListBox.h:35