Add TAL-Reverb-II plugin to test
[juce-lv2.git] / juce / source / src / gui / components / filebrowser / juce_FileSearchPathListComponent.h
blobba15fb747088d357c71f77da628ab277452135fe
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_FILESEARCHPATHLISTCOMPONENT_JUCEHEADER__
27 #define __JUCE_FILESEARCHPATHLISTCOMPONENT_JUCEHEADER__
29 #include "../controls/juce_ListBox.h"
30 #include "../buttons/juce_DrawableButton.h"
31 #include "../buttons/juce_TextButton.h"
32 #include "../mouse/juce_FileDragAndDropTarget.h"
33 #include "../../../io/files/juce_FileSearchPath.h"
36 //==============================================================================
37 /**
38 Shows a set of file paths in a list, allowing them to be added, removed or
39 re-ordered.
41 @see FileSearchPath
43 class JUCE_API FileSearchPathListComponent : public Component,
44 public SettableTooltipClient,
45 public FileDragAndDropTarget,
46 private ButtonListener, // (can't use Button::Listener due to idiotic VC2005 bug)
47 private ListBoxModel
49 public:
50 //==============================================================================
51 /** Creates an empty FileSearchPathListComponent. */
52 FileSearchPathListComponent();
54 /** Destructor. */
55 ~FileSearchPathListComponent();
57 //==============================================================================
58 /** Returns the path as it is currently shown. */
59 const FileSearchPath& getPath() const noexcept { return path; }
61 /** Changes the current path. */
62 void setPath (const FileSearchPath& newPath);
64 /** Sets a file or directory to be the default starting point for the browser to show.
66 This is only used if the current file hasn't been set.
68 void setDefaultBrowseTarget (const File& newDefaultDirectory);
70 /** A set of colour IDs to use to change the colour of various aspects of the label.
72 These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
73 methods.
75 @see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
77 enum ColourIds
79 backgroundColourId = 0x1004100, /**< The background colour to fill the component with.
80 Make this transparent if you don't want the background to be filled. */
83 //==============================================================================
84 /** @internal */
85 int getNumRows();
86 /** @internal */
87 void paintListBoxItem (int rowNumber, Graphics& g, int width, int height, bool rowIsSelected);
88 /** @internal */
89 void deleteKeyPressed (int lastRowSelected);
90 /** @internal */
91 void returnKeyPressed (int lastRowSelected);
92 /** @internal */
93 void listBoxItemDoubleClicked (int row, const MouseEvent&);
94 /** @internal */
95 void selectedRowsChanged (int lastRowSelected);
96 /** @internal */
97 void resized();
98 /** @internal */
99 void paint (Graphics& g);
100 /** @internal */
101 bool isInterestedInFileDrag (const StringArray& files);
102 /** @internal */
103 void filesDropped (const StringArray& files, int, int);
104 /** @internal */
105 void buttonClicked (Button* button);
108 private:
109 //==============================================================================
110 FileSearchPath path;
111 File defaultBrowseTarget;
113 ListBox listBox;
114 TextButton addButton, removeButton, changeButton;
115 DrawableButton upButton, downButton;
117 void changed();
118 void updateButtons();
120 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileSearchPathListComponent);
124 #endif // __JUCE_FILESEARCHPATHLISTCOMPONENT_JUCEHEADER__