summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_tree_util.h
blob: abd9ee65ac76845309fd1b2cee4eb394dabee9be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_GTK_TREE_UTIL_H_
#define CHROME_COMMON_GTK_TREE_UTIL_H_

#include <gtk/gtk.h>

#include "base/basictypes.h"

class GtkTreeUtil {
 public:
  // Get the row number corresponding to |path|.
  static gint GetRowNumForPath(GtkTreePath* path);

  // Get the row number corresponding to |iter|.
  static gint GetRowNumForIter(GtkTreeModel* model, GtkTreeIter* iter);

  // Get the row number in the child tree model corresponding to |sort_path| in
  // the parent tree model.
  static gint GetTreeSortChildRowNumForPath(GtkTreeModel* sort_model,
                                            GtkTreePath* sort_path);

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(GtkTreeUtil);
};

#endif  // CHROME_COMMON_GTK_TREE_UTIL_H_