1 /*****************************************************************************
2  *  $Id: gtkcompletionline.h,v 1.12 2003/11/16 10:43:32 andreas99 Exp $
3  *  Copyright (C) 2000, Mishoo
4  *  Author: Mihai Bazon                  Email: mishoo@fenrir.infoiasi.ro
5  *
6  *   Distributed under the terms of the GNU General Public License. You are
7  *  free to use/modify/distribute this program as long as you comply to the
8  *    terms of the GNU General Public License, version 2 or above, at your
9  *      option, and provided that this copyright notice remains intact.
10  *****************************************************************************/
11 
12 
13 #ifndef __GTKCOMPLETIONLINE_H__
14 #define __GTKCOMPLETIONLINE_H__
15 
16 #include <gtk/gtkentry.h>
17 
18 #include <string>
19 
20 #include "history.h"
21 
22 extern "C++" {
23 
24 #define GTK_COMPLETION_LINE(obj) \
25   GTK_CHECK_CAST(obj, gtk_completion_line_get_type(), GtkCompletionLine)
26 #define GTK_COMPLETION_LINE_CLASS(klass) \
27   GTK_CHECK_CLASS_CAST(klass, gtk_completion_line_get_type(), GtkCompletionLineClass)
28 #define IS_GTK_COMPLETION_LINE(obj) \
29   GTK_CHECK_TYPE(obj, gtk_completion_line_get_type())
30 
31   typedef struct _GtkCompletionLine GtkCompletionLine;
32   typedef struct _GtkCompletionLineClass GtkCompletionLineClass;
33 
34   enum GCL_SEARCH_MODE
35   {
36     GCL_SEARCH_OFF = 0,
37     GCL_SEARCH_REW = 1,
38     GCL_SEARCH_FWD = 2,
39     GCL_SEARCH_BEG = 3
40   };
41 
42   struct _GtkCompletionLine
43   {
44     GtkEntry parent;
45     GtkWidget *win_compl;
46     GtkWidget *list_compl;
47     int list_compl_items_where;
48     int list_compl_nr_rows;
49     int pos_in_text;
50 
51     GList *cmpl;
52     GList *where;
53 
54     HistoryFile *hist;
55     GCL_SEARCH_MODE hist_search_mode;
56     std::string *hist_word;
57 
58     int first_key;
59     int tabtimeout;
60     int show_dot_files;
61   };
62 
63   struct _GtkCompletionLineClass
64   {
65     GtkEntryClass parent_class;
66     /* add your CLASS members here */
67 
68     void (* unique)(GtkCompletionLine *cl);
69     void (* notunique)(GtkCompletionLine *cl);
70     void (* incomplete)(GtkCompletionLine *cl);
71     void (* runwithterm)(GtkCompletionLine *cl);
72     void (* search_mode)(GtkCompletionLine *cl);
73     void (* search_letter)(GtkCompletionLine *cl);
74     void (* search_not_found)(GtkCompletionLine *cl);
75     void (* ext_handler)(GtkCompletionLine *cl);
76     void (* cancel)(GtkCompletionLine *cl);
77   };
78 
79   GtkType gtk_completion_line_get_type(void);
80   GtkWidget *gtk_completion_line_new();
81 
82   void gtk_completion_line_last_history_item(GtkCompletionLine*);
83 }
84 
85 #endif /* __GTKCOMPLETIONLINE_H__ */
86 
87 // Local Variables: ***
88 // mode: c++ ***
89 // c-basic-offset: 2 ***
90 // End: ***
91