2008-07-30 Alberto Garcia <agarcia@igalia.com>
[hildon] / src / hildon-toggle-button.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 program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser Public License as published by
10  * the Free Software Foundation; version 2 of the license.
11  *
12  * This program 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
15  * GNU Lesser Public License for more details.
16  *
17  */
18
19 #ifndef                                         __HILDON_TOGGLE_BUTTON_H__
20 #define                                         __HILDON_TOGGLE_BUTTON_H__
21
22 #include                                        <gtk/gtk.h>
23
24 G_BEGIN_DECLS
25
26 #define                                         HILDON_TYPE_TOGGLE_BUTTON \
27                                                 (hildon_toggle_button_get_type())
28
29 #define                                         HILDON_TOGGLE_BUTTON(obj) \
30                                                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
31                                                 HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButton))
32
33 #define                                         HILDON_TOGGLE_BUTTON_CLASS(klass) \
34                                                 (G_TYPE_CHECK_CLASS_CAST ((klass), \
35                                                 HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButtonClass))
36
37 #define                                         HILDON_IS_TOGGLE_BUTTON(obj) \
38                                                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_TOGGLE_BUTTON))
39
40 #define                                         HILDON_IS_TOGGLE_BUTTON_CLASS(klass) \
41                                                 (G_TYPE_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_TOGGLE_BUTTON))
42
43 #define                                         HILDON_TOGGLE_BUTTON_GET_CLASS(obj) \
44                                                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
45                                                 HILDON_TYPE_TOGGLE_BUTTON, HildonToggleButtonClass))
46
47 typedef struct                                  _HildonToggleButton HildonToggleButton;
48
49 typedef struct                                  _HildonToggleButtonClass HildonToggleButtonClass;
50
51 struct                                          _HildonToggleButtonClass
52 {
53     GtkToggleButtonClass parent_class;
54 };
55
56 struct                                          _HildonToggleButton
57 {
58     GtkToggleButton parent;
59 };
60
61 typedef enum {
62    HILDON_TOGGLE_BUTTON_AUTO_WIDTH              = 0,      /* leave width unset */
63    HILDON_TOGGLE_BUTTON_HALFSCREEN_WIDTH        = 1,      /* set to 50% screen width */
64    HILDON_TOGGLE_BUTTON_FULLSCREEN_WIDTH        = 2,      /* set to 100% screen width */
65    HILDON_TOGGLE_BUTTON_AUTO_HEIGHT             = 0 << 2, /* leave height unset */
66    HILDON_TOGGLE_BUTTON_FINGER_HEIGHT           = 1 << 2, /* set to finger height */
67    HILDON_TOGGLE_BUTTON_THUMB_HEIGHT            = 2 << 2, /* set to thumb height */
68 }                                               HildonToggleButtonFlags;
69
70 GType
71 hildon_toggle_button_get_type                   (void) G_GNUC_CONST;
72
73 GtkWidget *
74 hildon_toggle_button_new                        (HildonToggleButtonFlags flags);
75
76 GtkWidget *
77 hildon_toggle_button_new_with_label             (HildonToggleButtonFlags  flags,
78                                                  const char              *label);
79
80 G_END_DECLS
81
82 #endif /* __HILDON_TOGGLE_BUTTON_H__ */