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

Side by Side Diff: chrome/views/tree_view.h

Issue 28175: Adds ability for tree model to reorder its children. I'm going to use... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/views/tree_model.h ('k') | chrome/views/tree_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_TREE_VIEW_H__ 5 #ifndef CHROME_VIEWS_TREE_VIEW_H__
6 #define CHROME_VIEWS_TREE_VIEW_H__ 6 #define CHROME_VIEWS_TREE_VIEW_H__
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // TreeModelObserver methods. Don't call these directly, instead your model 98 // TreeModelObserver methods. Don't call these directly, instead your model
99 // should notify the observer TreeView adds to it. 99 // should notify the observer TreeView adds to it.
100 virtual void TreeNodesAdded(TreeModel* model, 100 virtual void TreeNodesAdded(TreeModel* model,
101 TreeModelNode* parent, 101 TreeModelNode* parent,
102 int start, 102 int start,
103 int count); 103 int count);
104 virtual void TreeNodesRemoved(TreeModel* model, 104 virtual void TreeNodesRemoved(TreeModel* model,
105 TreeModelNode* parent, 105 TreeModelNode* parent,
106 int start, 106 int start,
107 int count); 107 int count);
108 virtual void TreeNodeChildrenReordered(TreeModel* model,
109 TreeModelNode* parent);
108 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node); 110 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node);
109 111
110 // Sets the controller, which may be null. TreeView does not take ownership 112 // Sets the controller, which may be null. TreeView does not take ownership
111 // of the controller. 113 // of the controller.
112 void SetController(TreeViewController* controller) { 114 void SetController(TreeViewController* controller) {
113 controller_ = controller; 115 controller_ = controller;
114 } 116 }
115 117
116 // Sets whether enter is processed when not editing. If true, enter will 118 // Sets whether enter is processed when not editing. If true, enter will
117 // expand/collapse the node. If false, enter is passed to the focus manager 119 // expand/collapse the node. If false, enter is passed to the focus manager
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 DCHECK(id_to_details_map_.find(id) != id_to_details_map_.end()); 229 DCHECK(id_to_details_map_.find(id) != id_to_details_map_.end());
228 return id_to_details_map_[id]; 230 return id_to_details_map_[id];
229 } 231 }
230 232
231 // Returns the NodeDetails by HTREEITEM. 233 // Returns the NodeDetails by HTREEITEM.
232 NodeDetails* GetNodeDetailsByTreeItem(HTREEITEM tree_item); 234 NodeDetails* GetNodeDetailsByTreeItem(HTREEITEM tree_item);
233 235
234 // Creates the image list to use for the tree. 236 // Creates the image list to use for the tree.
235 HIMAGELIST CreateImageList(); 237 HIMAGELIST CreateImageList();
236 238
239 // Returns the HTREEITEM for |node|. This is intended to be called when a
240 // model mutation event occur with |node| as the parent. This returns null
241 // if the user has never expanded |node| or all of its parents.
242 HTREEITEM GetTreeItemForNodeDuringMutation(TreeModelNode* node);
243
237 // The window function installed on the treeview. 244 // The window function installed on the treeview.
238 static LRESULT CALLBACK TreeWndProc(HWND window, 245 static LRESULT CALLBACK TreeWndProc(HWND window,
239 UINT message, 246 UINT message,
240 WPARAM w_param, 247 WPARAM w_param,
241 LPARAM l_param); 248 LPARAM l_param);
242 249
243 // Handle to the tree window. 250 // Handle to the tree window.
244 HWND tree_view_; 251 HWND tree_view_;
245 252
246 // The model, may be null. 253 // The model, may be null.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 bool has_custom_icons_; 296 bool has_custom_icons_;
290 297
291 HIMAGELIST image_list_; 298 HIMAGELIST image_list_;
292 299
293 DISALLOW_COPY_AND_ASSIGN(TreeView); 300 DISALLOW_COPY_AND_ASSIGN(TreeView);
294 }; 301 };
295 302
296 } // namespace views 303 } // namespace views
297 304
298 #endif // CHROME_VIEWS_TREE_VIEW_H__ 305 #endif // CHROME_VIEWS_TREE_VIEW_H__
OLDNEW
« no previous file with comments | « chrome/views/tree_model.h ('k') | chrome/views/tree_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698