選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

177 行
7.3 KiB

  1. /*
  2. * GTK - The GIMP Toolkit
  3. * Copyright (C) 1999 Red Hat, Inc.
  4. * Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
  5. * Copyright (C) 2003 Matthias Clasen <mclasen@redhat.com>
  6. * Copyright (C) 2005 Carlos Garnacho Parro <carlosg@gnome.org>
  7. *
  8. * All rights reserved.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2 of the License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the
  22. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23. * Boston, MA 02111-1307, USA.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  26. #error "Only <gtk/gtk.h> can be included directly."
  27. #endif
  28. #ifndef __GTK_ASSISTANT_H__
  29. #define __GTK_ASSISTANT_H__
  30. #include <gtk/gtkwindow.h>
  31. G_BEGIN_DECLS
  32. #define GTK_TYPE_ASSISTANT (gtk_assistant_get_type ())
  33. #define GTK_ASSISTANT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_ASSISTANT, GtkAssistant))
  34. #define GTK_ASSISTANT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_ASSISTANT, GtkAssistantClass))
  35. #define GTK_IS_ASSISTANT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_ASSISTANT))
  36. #define GTK_IS_ASSISTANT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_ASSISTANT))
  37. #define GTK_ASSISTANT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_ASSISTANT, GtkAssistantClass))
  38. /**
  39. * GtkAssistantPageType:
  40. * @GTK_ASSISTANT_PAGE_CONTENT: The page has regular contents.
  41. * @GTK_ASSISTANT_PAGE_INTRO: The page contains an introduction to the
  42. * assistant task.
  43. * @GTK_ASSISTANT_PAGE_CONFIRM: The page lets the user confirm or deny the
  44. * changes.
  45. * @GTK_ASSISTANT_PAGE_SUMMARY: The page informs the user of the changes
  46. * done.
  47. * @GTK_ASSISTANT_PAGE_PROGRESS: Used for tasks that take a long time to
  48. * complete, blocks the assistant until the page is marked as complete.
  49. *
  50. * An enum for determining the page role inside the #GtkAssistant. It's
  51. * used to handle buttons sensitivity and visibility.
  52. *
  53. * Note that an assistant needs to end its page flow with a page of type
  54. * %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or
  55. * %GTK_ASSISTANT_PAGE_PROGRESS to be correct.
  56. */
  57. typedef enum
  58. {
  59. GTK_ASSISTANT_PAGE_CONTENT,
  60. GTK_ASSISTANT_PAGE_INTRO,
  61. GTK_ASSISTANT_PAGE_CONFIRM,
  62. GTK_ASSISTANT_PAGE_SUMMARY,
  63. GTK_ASSISTANT_PAGE_PROGRESS
  64. } GtkAssistantPageType;
  65. typedef struct _GtkAssistant GtkAssistant;
  66. typedef struct _GtkAssistantPrivate GtkAssistantPrivate;
  67. typedef struct _GtkAssistantClass GtkAssistantClass;
  68. struct _GtkAssistant
  69. {
  70. GtkWindow parent;
  71. GtkWidget *GSEAL (cancel);
  72. GtkWidget *GSEAL (forward);
  73. GtkWidget *GSEAL (back);
  74. GtkWidget *GSEAL (apply);
  75. GtkWidget *GSEAL (close);
  76. GtkWidget *GSEAL (last);
  77. /*< private >*/
  78. GtkAssistantPrivate *GSEAL (priv);
  79. };
  80. struct _GtkAssistantClass
  81. {
  82. GtkWindowClass parent_class;
  83. void (* prepare) (GtkAssistant *assistant, GtkWidget *page);
  84. void (* apply) (GtkAssistant *assistant);
  85. void (* close) (GtkAssistant *assistant);
  86. void (* cancel) (GtkAssistant *assistant);
  87. /* Padding for future expansion */
  88. void (*_gtk_reserved1) (void);
  89. void (*_gtk_reserved2) (void);
  90. void (*_gtk_reserved3) (void);
  91. void (*_gtk_reserved4) (void);
  92. void (*_gtk_reserved5) (void);
  93. };
  94. /**
  95. * GtkAssistantPageFunc:
  96. * @current_page: The page number used to calculate the next page.
  97. * @data: user data.
  98. *
  99. * A function used by gtk_assistant_set_forward_page_func() to know which
  100. * is the next page given a current one. It's called both for computing the
  101. * next page when the user presses the "forward" button and for handling
  102. * the behavior of the "last" button.
  103. *
  104. * Returns: The next page number.
  105. */
  106. typedef gint (*GtkAssistantPageFunc) (gint current_page, gpointer data);
  107. GType gtk_assistant_get_type (void) G_GNUC_CONST;
  108. GtkWidget *gtk_assistant_new (void);
  109. gint gtk_assistant_get_current_page (GtkAssistant *assistant);
  110. void gtk_assistant_set_current_page (GtkAssistant *assistant,
  111. gint page_num);
  112. gint gtk_assistant_get_n_pages (GtkAssistant *assistant);
  113. GtkWidget *gtk_assistant_get_nth_page (GtkAssistant *assistant,
  114. gint page_num);
  115. gint gtk_assistant_prepend_page (GtkAssistant *assistant,
  116. GtkWidget *page);
  117. gint gtk_assistant_append_page (GtkAssistant *assistant,
  118. GtkWidget *page);
  119. gint gtk_assistant_insert_page (GtkAssistant *assistant,
  120. GtkWidget *page,
  121. gint position);
  122. void gtk_assistant_set_forward_page_func (GtkAssistant *assistant,
  123. GtkAssistantPageFunc page_func,
  124. gpointer data,
  125. GDestroyNotify destroy);
  126. void gtk_assistant_set_page_type (GtkAssistant *assistant,
  127. GtkWidget *page,
  128. GtkAssistantPageType type);
  129. GtkAssistantPageType gtk_assistant_get_page_type (GtkAssistant *assistant,
  130. GtkWidget *page);
  131. void gtk_assistant_set_page_title (GtkAssistant *assistant,
  132. GtkWidget *page,
  133. const gchar *title);
  134. G_CONST_RETURN gchar *gtk_assistant_get_page_title (GtkAssistant *assistant,
  135. GtkWidget *page);
  136. void gtk_assistant_set_page_header_image (GtkAssistant *assistant,
  137. GtkWidget *page,
  138. GdkPixbuf *pixbuf);
  139. GdkPixbuf *gtk_assistant_get_page_header_image (GtkAssistant *assistant,
  140. GtkWidget *page);
  141. void gtk_assistant_set_page_side_image (GtkAssistant *assistant,
  142. GtkWidget *page,
  143. GdkPixbuf *pixbuf);
  144. GdkPixbuf *gtk_assistant_get_page_side_image (GtkAssistant *assistant,
  145. GtkWidget *page);
  146. void gtk_assistant_set_page_complete (GtkAssistant *assistant,
  147. GtkWidget *page,
  148. gboolean complete);
  149. gboolean gtk_assistant_get_page_complete (GtkAssistant *assistant,
  150. GtkWidget *page);
  151. void gtk_assistant_add_action_widget (GtkAssistant *assistant,
  152. GtkWidget *child);
  153. void gtk_assistant_remove_action_widget (GtkAssistant *assistant,
  154. GtkWidget *child);
  155. void gtk_assistant_update_buttons_state (GtkAssistant *assistant);
  156. void gtk_assistant_commit (GtkAssistant *assistant);
  157. G_END_DECLS
  158. #endif /* __GTK_ASSISTANT_H__ */