Add remaining files
[juce-lv2.git] / juce / source / src / gui / components / filebrowser / juce_DirectoryContentsDisplayComponent.cpp
blob44680a7e575e5fb7d827fd57ed2c6126f902ddbd
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 #include "../../../core/juce_StandardHeader.h"
28 BEGIN_JUCE_NAMESPACE
30 #include "juce_DirectoryContentsDisplayComponent.h"
33 //==============================================================================
34 DirectoryContentsDisplayComponent::DirectoryContentsDisplayComponent (DirectoryContentsList& listToShow)
35 : fileList (listToShow)
39 DirectoryContentsDisplayComponent::~DirectoryContentsDisplayComponent()
43 //==============================================================================
44 FileBrowserListener::~FileBrowserListener()
48 void DirectoryContentsDisplayComponent::addListener (FileBrowserListener* const listener)
50 listeners.add (listener);
53 void DirectoryContentsDisplayComponent::removeListener (FileBrowserListener* const listener)
55 listeners.remove (listener);
58 void DirectoryContentsDisplayComponent::sendSelectionChangeMessage()
60 Component::BailOutChecker checker (dynamic_cast <Component*> (this));
61 listeners.callChecked (checker, &FileBrowserListener::selectionChanged);
64 void DirectoryContentsDisplayComponent::sendMouseClickMessage (const File& file, const MouseEvent& e)
66 if (fileList.getDirectory().exists())
68 Component::BailOutChecker checker (dynamic_cast <Component*> (this));
69 listeners.callChecked (checker, &FileBrowserListener::fileClicked, file, e);
73 void DirectoryContentsDisplayComponent::sendDoubleClickMessage (const File& file)
75 if (fileList.getDirectory().exists())
77 Component::BailOutChecker checker (dynamic_cast <Component*> (this));
78 listeners.callChecked (checker, &FileBrowserListener::fileDoubleClicked, file);
83 END_JUCE_NAMESPACE