summaryrefslogtreecommitdiffstats
path: root/subprojects/libhandy/src/hdy-deck.h
blob: 3c7da1826093615df15889b62d38ae60133333a1 (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
/*
 * 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-navigation-direction.h"

G_BEGIN_DECLS

#define HDY_TYPE_DECK (hdy_deck_get_type())

HDY_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE (HdyDeck, hdy_deck, HDY, DECK, GtkContainer)

typedef enum {
  HDY_DECK_TRANSITION_TYPE_OVER,
  HDY_DECK_TRANSITION_TYPE_UNDER,
  HDY_DECK_TRANSITION_TYPE_SLIDE,
} HdyDeckTransitionType;

/**
 * HdyDeckClass
 * @parent_class: The parent class
 */
struct _HdyDeckClass
{
  GtkContainerClass parent_class;

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

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_deck_new (void);
HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_deck_get_visible_child (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_visible_child (HdyDeck   *self,
                                             GtkWidget *visible_child);
HDY_AVAILABLE_IN_ALL
const gchar     *hdy_deck_get_visible_child_name (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_visible_child_name (HdyDeck     *self,
                                                  const gchar *name);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_get_homogeneous (HdyDeck        *self,
                                           GtkOrientation  orientation);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_homogeneous (HdyDeck        *self,
                                           GtkOrientation  orientation,
                                           gboolean        homogeneous);
HDY_AVAILABLE_IN_ALL
HdyDeckTransitionType hdy_deck_get_transition_type (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_transition_type (HdyDeck               *self,
                                               HdyDeckTransitionType  transition);

HDY_AVAILABLE_IN_ALL
guint            hdy_deck_get_transition_duration (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_transition_duration (HdyDeck *self,
                                                   guint    duration);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_get_transition_running (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_get_interpolate_size (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_interpolate_size (HdyDeck  *self,
                                                gboolean  interpolate_size);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_get_can_swipe_back (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_can_swipe_back (HdyDeck  *self,
                                              gboolean  can_swipe_back);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_get_can_swipe_forward (HdyDeck *self);
HDY_AVAILABLE_IN_ALL
void             hdy_deck_set_can_swipe_forward (HdyDeck  *self,
                                                 gboolean  can_swipe_forward);

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_deck_get_adjacent_child (HdyDeck                *self,
                                              HdyNavigationDirection  direction);
HDY_AVAILABLE_IN_ALL
gboolean         hdy_deck_navigate (HdyDeck                *self,
                                    HdyNavigationDirection  direction);

HDY_AVAILABLE_IN_ALL
GtkWidget       *hdy_deck_get_child_by_name (HdyDeck     *self,
                                             const gchar *name);

G_END_DECLS