Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: ui/views/selection_controller_delegate.h

Issue 2413223003: Views:: Make Labels support text selection. (Closed)
Patch Set: -- Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_ 5 #ifndef UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_
6 #define UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_ 6 #define UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_
7 7
8 #include "ui/views/views_export.h" 8 #include "ui/views/views_export.h"
9 9
10 namespace ui { 10 namespace ui {
11 class MouseEvent; 11 class MouseEvent;
12 } 12 }
13 13
14 namespace views { 14 namespace views {
15 15
16 // An interface implemented/managed by a view which uses the 16 // An interface implemented/managed by a view which uses the
17 // SelectionController. 17 // SelectionController.
18 class VIEWS_EXPORT SelectionControllerDelegate { 18 class VIEWS_EXPORT SelectionControllerDelegate {
19 public: 19 public:
20 // Returns the associated RenderText instance to be used for selection. 20 // Returns the associated RenderText instance to be used for selection.
21 virtual gfx::RenderText* GetRenderTextForSelectionController() = 0; 21 virtual gfx::RenderText* GetRenderTextForSelectionController() = 0;
22 22
23 // Methods related to properties of the associated view. 23 // Methods related to properties of the associated view.
24 24
25 // Returns true if the associated text view is read only. 25 // Returns true if the associated text view is read only.
26 virtual bool IsReadOnly() const = 0; 26 virtual bool IsReadOnly() const = 0;
27 // Returns whether the associated view supports drag-and-drop.
28 virtual bool SupportsDrag() const = 0;
27 // Returns whether there is a drag operation originating from the associated 29 // Returns whether there is a drag operation originating from the associated
28 // view. 30 // view.
29 virtual bool HasTextBeingDragged() const = 0; 31 virtual bool HasTextBeingDragged() const = 0;
30 // Sets whether text is being dragged from the associated view. 32 // Sets whether text is being dragged from the associated view. Called only if
33 // the delegate supports drag.
31 virtual void SetTextBeingDragged(bool value) = 0; 34 virtual void SetTextBeingDragged(bool value) = 0;
32 // Returns the height of the associated view. 35 // Returns the height of the associated view.
33 virtual int GetViewHeight() const = 0; 36 virtual int GetViewHeight() const = 0;
34 // Returns the width of the associated view. 37 // Returns the width of the associated view.
35 virtual int GetViewWidth() const = 0; 38 virtual int GetViewWidth() const = 0;
36 // Returns the drag selection timer delay. This is the duration after which a 39 // Returns the drag selection timer delay. This is the duration after which a
37 // drag selection is updated when the event location is outside the text 40 // drag selection is updated when the event location is outside the text
38 // bounds. 41 // bounds.
39 virtual int GetDragSelectionDelay() const = 0; 42 virtual int GetDragSelectionDelay() const = 0;
40 43
(...skipping 17 matching lines...) Expand all
58 // the render text instance, it may be called outside of a pointer action. 61 // the render text instance, it may be called outside of a pointer action.
59 virtual void UpdateSelectionClipboard() = 0; 62 virtual void UpdateSelectionClipboard() = 0;
60 63
61 protected: 64 protected:
62 virtual ~SelectionControllerDelegate() {} 65 virtual ~SelectionControllerDelegate() {}
63 }; 66 };
64 67
65 } // namespace views 68 } // namespace views
66 69
67 #endif // UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_ 70 #endif // UI_VIEWS_SELECTION_CONTROLLER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698