summaryrefslogtreecommitdiffstats
path: root/subprojects/libhandy/src/hdy-leaflet.h
blob: 4d9324d70eaed8f89cfe197c2e0f60659e8ce9b2 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * Copyright (C) 2018 Purism SPC
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#pragma once

#if !defined(_HANDY_INSIDE) && !defined(HANDY_COMPILATION)
#error "Only <handy.h> can be included directly."
#endif

#include "hdy-version.h"

#include <gtk/gtk.h>
#include "hdy-enums.h"
#include "hdy-navigation-direction.h"

G_BEGIN_DECLS

#define HDY_TYPE_LEAFLET (hdy_leaflet_get_type())

HDY_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE (HdyLeaflet, hdy_leaflet, HDY, LEAFLET, GtkContainer)

typedef enum {
  HDY_LEAFLET_TRANSITION_TYPE_OVER,
  HDY_LEAFLET_TRANSITION_TYPE_UNDER,
  HDY_LEAFLET_TRANSITION_TYPE_SLIDE,
} HdyLeafletTransitionType;

/**
 * HdyLeafletClass
 * @parent_class: The parent class
 */
struct _HdyLeafletClass
{
  GtkContainerClass parent_class;

  /*< private >*/
  gpointer padding[4];
};

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_leaflet_new (void);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_folded (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_leaflet_get_visible_child (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_visible_child (HdyLeaflet *self,
                                                GtkWidget  *visible_child);
HDY_AVAILABLE_IN_ALL
const gchar     *hdy_leaflet_get_visible_child_name (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_visible_child_name (HdyLeaflet  *self,
                                                     const gchar *name);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_homogeneous (HdyLeaflet     *self,
                                              gboolean        folded,
                                              GtkOrientation  orientation);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_homogeneous (HdyLeaflet     *self,
                                              gboolean        folded,
                                              GtkOrientation  orientation,
                                              gboolean        homogeneous);
HDY_AVAILABLE_IN_ALL
HdyLeafletTransitionType hdy_leaflet_get_transition_type (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_transition_type (HdyLeaflet               *self,
                                                  HdyLeafletTransitionType  transition);

HDY_AVAILABLE_IN_ALL
guint            hdy_leaflet_get_mode_transition_duration (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_mode_transition_duration (HdyLeaflet *self,
                                                           guint       duration);

HDY_AVAILABLE_IN_ALL
guint            hdy_leaflet_get_child_transition_duration (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_child_transition_duration (HdyLeaflet *self,
                                                            guint       duration);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_child_transition_running (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_interpolate_size (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_interpolate_size (HdyLeaflet *self,
                                                   gboolean    interpolate_size);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_can_swipe_back (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_can_swipe_back (HdyLeaflet *self,
                                                 gboolean    can_swipe_back);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_get_can_swipe_forward (HdyLeaflet *self);
HDY_AVAILABLE_IN_ALL
void             hdy_leaflet_set_can_swipe_forward (HdyLeaflet *self,
                                                    gboolean    can_swipe_forward);

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_leaflet_get_adjacent_child (HdyLeaflet             *self,
                                                 HdyNavigationDirection  direction);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_leaflet_navigate (HdyLeaflet             *self,
                                       HdyNavigationDirection  direction);

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_leaflet_get_child_by_name (HdyLeaflet  *self,
                                                const gchar *name);

G_END_DECLS