openshot-audio  0.1.6
juce_DragAndDropContainer.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_DRAGANDDROPCONTAINER_H_INCLUDED
26 #define JUCE_DRAGANDDROPCONTAINER_H_INCLUDED
27 
28 
29 //==============================================================================
49 {
50 public:
51  //==============================================================================
57 
59  virtual ~DragAndDropContainer();
60 
61  //==============================================================================
87  void startDragging (const var& sourceDescription,
88  Component* sourceComponent,
89  Image dragImage = Image::null,
90  bool allowDraggingToOtherJuceWindows = false,
91  const Point<int>* imageOffsetFromMouse = nullptr);
92 
94  bool isDragAndDropActive() const;
95 
103  var getCurrentDragDescription() const;
104 
106  void setCurrentDragImage (const Image& newImage);
107 
118  static DragAndDropContainer* findParentDragContainerFor (Component* childComponent);
119 
120 
121  //==============================================================================
137  static bool performExternalDragDropOfFiles (const StringArray& files, bool canMoveFiles);
138 
152  static bool performExternalDragDropOfText (const String& text);
153 
154 protected:
168  virtual bool shouldDropFilesWhenDraggedExternally (const DragAndDropTarget::SourceDetails& sourceDetails,
169  StringArray& files, bool& canMoveFiles);
170 
172  virtual void dragOperationStarted();
173 
175  virtual void dragOperationEnded();
176 
177 private:
178  //==============================================================================
180  friend class DragImageComponent;
182  ScopedPointer<DragImageComponent> dragImageComponent;
183 
184  JUCE_DEPRECATED (virtual bool shouldDropFilesWhenDraggedExternally (const String&, Component*, StringArray&, bool&)) { return false; }
185 
187 };
188 
189 
190 #endif // JUCE_DRAGANDDROPCONTAINER_H_INCLUDED
Definition: juce_Variant.h:46
Definition: juce_DragAndDropTarget.h:53
Definition: juce_DragAndDropContainer.cpp:30
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Component.h:33
Definition: juce_ScopedPointer.h:70
#define JUCE_DEPRECATED(functionDef)
Definition: juce_PlatformDefs.h:319
Definition: juce_StringArray.h:39
Definition: juce_ContainerDeletePolicy.h:44
Definition: juce_DragAndDropContainer.h:48
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_Image.h:54
static const Image null
Definition: juce_Image.h:152