* doc/visual_index.xml Fix reference to HildonLoginDialog in documentation
[hildon] / src / hildon-pannable-area.h
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2008 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Karl Lattimer <karl.lattimer@nokia.com>
7  *
8  * This widget is based on MokoFingerScroll from libmokoui
9  * OpenMoko Application Framework UI Library
10  * Authored by Chris Lord <chris@openedhand.com>
11  * Copyright (C) 2006-2007 OpenMoko Inc.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser Public License as published by
15  * the Free Software Foundation; version 2 of the license.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU Lesser Public License for more details.
21  *
22  */
23
24 #ifndef _HILDON_PANNABLE_AREA
25 #define _HILDON_PANNABLE_AREA
26
27 #include <glib-object.h>
28 #include <gtk/gtk.h>
29
30 G_BEGIN_DECLS
31
32 #define HILDON_TYPE_PANNABLE_AREA hildon_pannable_area_get_type()
33 #define HILDON_PANNABLE_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
34         HILDON_TYPE_PANNABLE_AREA, HildonPannableArea))
35 #define HILDON_PANNABLE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
36         HILDON_TYPE_PANNABLE_AREA, HildonPannableAreaClass))
37 #define HILDON_IS_PANNABLE_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
38         HILDON_TYPE_PANNABLE_AREA))
39 #define HILDON_IS_PANNABLE_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
40         HILDON_TYPE_PANNABLE_AREA))
41 #define HILDON_PANNABLE_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
42         HILDON_TYPE_PANNABLE_AREA, HildonPannableAreaClass))
43
44 GType hildon_pannable_area_mode_get_type (void) G_GNUC_CONST;
45 #define HILDON_TYPE_PANNABLE_AREA_MODE (hildon_pannable_area_mode_get_type())
46
47 GType hildon_pannable_area_indicator_mode_get_type (void)  G_GNUC_CONST;
48 #define HILDON_TYPE_PANNABLE_AREA_INDICATOR_MODE \
49         (hildon_pannable_area_indicator_mode_get_type())
50
51 /**
52  * HildonPannableArea:
53  *
54  * HildonPannableArea has no publicly accessible fields
55  */
56 typedef struct _HildonPannableArea HildonPannableArea;
57 typedef struct _HildonPannableAreaClass HildonPannableAreaClass;
58
59 struct _HildonPannableArea {
60   GtkEventBox parent;
61 };
62
63 struct _HildonPannableAreaClass {
64   GtkEventBoxClass parent_class;
65 };
66
67 /**
68  * HildonPannableAreaMode:
69  * @HILDON_PANNABLE_AREA_MODE_PUSH: Areaing follows pointer
70  * @HILDON_PANNABLE_AREA_MODE_ACCEL: Areaing uses physics to "spin" the widget
71  * @HILDON_PANNABLE_AREA_MODE_AUTO: Automatically chooses between push and accel
72  * modes, depending on input.
73  *
74  * Used to change the behaviour of the pannable areaing
75  */
76 typedef enum {
77         HILDON_PANNABLE_AREA_MODE_PUSH,
78         HILDON_PANNABLE_AREA_MODE_ACCEL,
79         HILDON_PANNABLE_AREA_MODE_AUTO
80 } HildonPannableAreaMode;
81
82 typedef enum {
83         HILDON_PANNABLE_AREA_INDICATOR_MODE_AUTO,
84         HILDON_PANNABLE_AREA_INDICATOR_MODE_SHOW,
85         HILDON_PANNABLE_AREA_INDICATOR_MODE_HIDE
86 } HildonPannableAreaIndicatorMode;
87
88 GType hildon_pannable_area_get_type (void);
89
90 GtkWidget* hildon_pannable_area_new (void);
91 GtkWidget* hildon_pannable_area_new_full (gint mode, gboolean enabled,
92                                         gdouble vel_min, gdouble vel_max,
93                                         gdouble decel, guint sps);
94 void hildon_pannable_area_add_with_viewport (HildonPannableArea *area,
95                                            GtkWidget *child);
96
97 G_END_DECLS
98
99 #endif /* _HILDON_PANNABLE_AREA */
100