Ocean
DnD.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_PLATFORM_WXWIDGETS_D_N_D_H
9 #define META_OCEAN_PLATFORM_WXWIDGETS_D_N_D_H
10 
12 
13 #include "ocean/base/Callback.h"
14 
15 #include <wx/dnd.h>
16 
17 namespace Ocean
18 {
19 
20 namespace Platform
21 {
22 
23 namespace WxWidgets
24 {
25 
26 /**
27  * This class implements a drop target.
28  * @ingroup platformwxw
29  */
30 class OCEAN_PLATFORM_WXWIDGETS_EXPORT FileDropTarget : public wxFileDropTarget
31 {
32  public:
33 
34  /**
35  * Definition of a callback function for file drag and drop events.
36  */
38 
39  public:
40 
41  /**
42  * Creates a new drop target object.
43  * @param callback File event callback function
44  */
45  explicit FileDropTarget(const Callback& callback);
46 
47  private:
48 
49  /**
50  * Drag and Drop event function for files.
51  * @param x Horizontal mouse position
52  * @param y Vertical mouse position
53  * @param filenames Names of the file to be dropped
54  * @return True, if the files are accepted
55  */
56  virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
57 
58  private:
59 
60  /// Callback event function.
62 };
63 
64 }
65 
66 }
67 
68 }
69 
70 #endif // META_OCEAN_PLATFORM_WXWIDGETS_D_N_D_H
This class implements a drop target.
Definition: DnD.h:31
Callback targetCallback_
Callback event function.
Definition: DnD.h:61
FileDropTarget(const Callback &callback)
Creates a new drop target object.
virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames)
Drag and Drop event function for files.
Callback< bool, const std::vector< std::string > & > Callback
Definition of a callback function for file drag and drop events.
Definition: DnD.h:37
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15