OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef VIEWS_WIDGET_DROP_TARGET_WIN_H_ |
| 6 #define VIEWS_WIDGET_DROP_TARGET_WIN_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "ui/base/dragdrop/drop_target.h" |
| 10 #include "views/widget/drop_helper.h" |
| 11 |
| 12 namespace views { |
| 13 |
| 14 class View; |
| 15 namespace internal { |
| 16 class RootView; |
| 17 } |
| 18 |
| 19 // DropTargetWin takes care of managing drag and drop for NativeWidgetWin. It |
| 20 // converts Windows OLE drop messages into Views drop messages. |
| 21 // |
| 22 // DropTargetWin uses DropHelper to manage the appropriate view to target |
| 23 // drop messages at. |
| 24 class DropTargetWin : public ui::DropTarget { |
| 25 public: |
| 26 explicit DropTargetWin(internal::RootView* root_view); |
| 27 virtual ~DropTargetWin(); |
| 28 |
| 29 // If a drag and drop is underway and view is the current drop target, the |
| 30 // drop target is set to null. |
| 31 // This is invoked when a View is removed from the RootView to make sure |
| 32 // we don't target a view that was removed during dnd. |
| 33 void ResetTargetViewIfEquals(View* view); |
| 34 |
| 35 protected: |
| 36 virtual DWORD OnDragOver(IDataObject* data_object, |
| 37 DWORD key_state, |
| 38 POINT cursor_position, |
| 39 DWORD effect); |
| 40 |
| 41 virtual void OnDragLeave(IDataObject* data_object); |
| 42 |
| 43 virtual DWORD OnDrop(IDataObject* data_object, |
| 44 DWORD key_state, |
| 45 POINT cursor_position, |
| 46 DWORD effect); |
| 47 |
| 48 private: |
| 49 views::DropHelper helper_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(DropTargetWin); |
| 52 }; |
| 53 |
| 54 } // namespace views |
| 55 |
| 56 #endif // VIEWS_WIDGET_DROP_TARGET_WIN_H_ |
OLD | NEW |