(root)/
glib-2.79.0/
gio/
glistmodel.h
       1  /*
       2   * Copyright 2015 Lars Uebernickel
       3   * Copyright 2015 Ryan Lortie
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   *
       7   * This library is free software; you can redistribute it and/or
       8   * modify it under the terms of the GNU Lesser General Public
       9   * License as published by the Free Software Foundation; either
      10   * version 2.1 of the License, or (at your option) any later version.
      11   *
      12   * This library is distributed in the hope that it will be useful,
      13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15   * Lesser General Public License for more details.
      16   *
      17   * You should have received a copy of the GNU Lesser General
      18   * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
      19   *
      20   * Authors:
      21   *     Lars Uebernickel <lars@uebernic.de>
      22   *     Ryan Lortie <desrt@desrt.ca>
      23   */
      24  
      25  #ifndef __G_LIST_MODEL_H__
      26  #define __G_LIST_MODEL_H__
      27  
      28  #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
      29  #error "Only <gio/gio.h> can be included directly."
      30  #endif
      31  
      32  #include <gio/giotypes.h>
      33  
      34  G_BEGIN_DECLS
      35  
      36  #define G_TYPE_LIST_MODEL g_list_model_get_type ()
      37  GIO_AVAILABLE_IN_2_44
      38  G_DECLARE_INTERFACE(GListModel, g_list_model, G, LIST_MODEL, GObject)
      39  
      40  struct _GListModelInterface
      41  {
      42    GTypeInterface g_iface;
      43  
      44    GType     (* get_item_type)   (GListModel *list);
      45  
      46    guint     (* get_n_items)     (GListModel *list);
      47  
      48    gpointer  (* get_item)        (GListModel *list,
      49                                   guint       position);
      50  };
      51  
      52  GIO_AVAILABLE_IN_2_44
      53  GType                   g_list_model_get_item_type                      (GListModel *list);
      54  
      55  GIO_AVAILABLE_IN_2_44
      56  guint                   g_list_model_get_n_items                        (GListModel *list);
      57  
      58  GIO_AVAILABLE_IN_2_44
      59  gpointer                g_list_model_get_item                           (GListModel *list,
      60                                                                           guint       position);
      61  
      62  GIO_AVAILABLE_IN_2_44
      63  GObject *               g_list_model_get_object                         (GListModel *list,
      64                                                                           guint       position);
      65  
      66  GIO_AVAILABLE_IN_2_44
      67  void                    g_list_model_items_changed                      (GListModel *list,
      68                                                                           guint       position,
      69                                                                           guint       removed,
      70                                                                           guint       added);
      71  
      72  G_END_DECLS
      73  
      74  #endif /* __G_LIST_MODEL_H__ */