1 /*
2    Copyright (C) 2002 Kai Sterker <kai.sterker@gmail.com>
3    Part of the Adonthell Project  <http://adonthell.nongnu.org>
4 
5    Dlgedit is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9 
10    Dlgedit is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with Dlgedit.  If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 /**
20  * @file gui_circle.h
21  *
22  * @author Kai Sterker
23  * @brief The Edit Circle dialog
24  */
25 
26 #ifndef GUI_CIRCLE_H
27 #define GUI_CIRCLE_H
28 
29 #include "dlg_types.h"
30 #include "dlg_circle_entry.h"
31 #include "dlg_module_entry.h"
32 #include "gui_edit.h"
33 #include "gui_modal_dialog.h"
34 
35 /**
36  * This is the dialog used to input text, conditions and arbitrary code of
37  * a DlgCircle. It further is used to specify whether the node contains speech
38  * of the Player, the Narrator or of an NPC. In latter case, the text may
39  * be attached to a special NPC, or to the default one. This default one is
40  * always the NPC to whom the dialogue belongs in the game.
41  */
42 class GuiCircle : public GuiModalDialog
43 {
44 public:
45     /**
46      * Open the "Edit Dialogue Node" dialog.
47      * @param parent The parent of the dialog
48      * @param type The type of the circle to display (NPC, PLAYER or NARRATOR)
49      * @param entry The contents of the circle
50      * @param dme The contents of the dialogue
51      */
52     GuiCircle (GtkWindow *parent, node_type *type, DlgCircleEntry *entry, DlgModuleEntry *dme);
53 
54     /**
55      * Apply the values entered in the dialogue to the edited node. This
56      * method should be called when the user hits the OK button.
57      */
58     void applyChanges ();
59 
60 private:
61     const gchar *getOption (GtkComboBox * cbox);
62     void setOption (GtkComboBox *o, const gchar *label);
63 
64     GuiEdit *cond_edit;             // Text entry for conditions
65     GuiEdit *code_edit;             // Text entry for code
66     GtkWidget *loop;                // Checkbox for looping text
67     GtkTextBuffer *text_entry;      // Entry for dialogue text
68     GtkTextBuffer *annotation_entry;// Entry for annotations
69     GtkComboBox *npc_selection;     // The dropdown list with the various NPC's
70     DlgCircleEntry *entry;          // The data to display
71     node_type *type;                // The type of the node
72 };
73 
74 #endif // GUI_CIRCLE_H
75