File: dialogresourceconverter.h

package info (click to toggle)
bibledit-gtk 4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 31,668 kB
  • ctags: 11,053
  • sloc: xml: 289,607; sql: 160,978; cpp: 86,450; sh: 3,316; makefile: 609; ansic: 398; perl: 143; python: 36
file content (171 lines) | stat: -rw-r--r-- 6,054 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*
** Copyright (©) 2003-2012 Teus Benschop.
**  
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**  
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**  
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
**  
*/


#ifndef INCLUDED_DIALOGRESOURCECONVERTER_H
#define INCLUDED_DIALOGRESOURCECONVERTER_H


#include <gtk/gtk.h>
#include "ustring.h"
#include "types.h"
#include "shortcuts.h"


class ResourceConverterDialog
{
public:
  ResourceConverterDialog (const ustring& working_directory);
  ~ResourceConverterDialog ();
  int run ();
  ResourceConversionType resource_conversion_type;
  ustring chapter_pattern_prefix;
  unsigned int chapter_pattern_index;
  ustring chapter_pattern_suffix;
  ustring verse_pattern_prefix;
  unsigned int verse_pattern_index;
  ustring verse_pattern_suffix;
private:

  // Dialog.
  GtkWidget *resourceconverterdialog;
  GtkWidget *dialog_vbox1;
  GtkWidget *label1;
  GtkWidget *table1;
  void build_table_and_type (Shortcuts& shortcuts);
  unsigned int table_attachment_offset;

  // Entry.
  void build_entry (GtkWidget *& image_ok, GtkWidget *& label_ok, GtkWidget *& label, const gchar * label_text, GtkWidget *& entry, const ustring& entry_text, GCallback handler);
  //static void on_entry_changed (GtkEditable *editable, gpointer user_data);
  //void on_entry ();

  // Button.
  void build_button (GtkWidget *& image_ok, GtkWidget *& label_ok, GtkWidget *& label_short, GtkWidget *& button, const gchar * button_text, Shortcuts& shortcuts, GCallback handler, GtkWidget *& label_long);

  // Checkbutton and button.
  void build_checkbutton_button (GtkWidget *& image_ok, GtkWidget *& label_ok, 
                                 GtkWidget *& checkbutton, const gchar * checkbutton_text, GCallback checkbutton_handler, 
                                 GtkWidget *& button, const gchar * button_text, GCallback button_handler, 
                                 Shortcuts& shortcuts, 
                                 GtkWidget *& label);
  
  // Textview.
  void build_textview (GtkWidget *& image_ok, GtkWidget *& label_ok, GtkWidget *& label,
                       GtkWidget *& textview, gchar * text, GCallback handler);
  
  // Entry, combo, entry.
  void build_entry_combo_entry (GtkWidget *& image_ok, GtkWidget *& label_ok,
                                GtkWidget *& label,
                                GtkWidget *& label_entry_1, GtkWidget *& entry_1,
                                GtkWidget *& label_combo, GtkWidget *& combo,
                                GtkWidget *& label_entry_2, GtkWidget *& entry_2,
                                GCallback entry_handler, Shortcuts& shortcuts);

  // Dialog action.
  GtkWidget *dialog_action_area1;
  GtkWidget *helpbutton;
  GtkWidget *cancelbutton;
  GtkWidget *okbutton;

  // Working directory and data.
  ustring workingdirectory;
  ustring filename;
  vector <ustring> lines;
  
  // Resource conversion type.
  GtkWidget *image_type_ok;
  GtkWidget *label_type_ok;
  GtkWidget *label_type_short;
  GtkWidget *button_type;
  GtkWidget *label_type_long;
  static void on_type_button_clicked (GtkButton *button, gpointer user_data);
  void on_type_button (bool no_ask);
  bool type_gui ();
  
  // Open file.
  GtkWidget *image_open_file_ok;
  GtkWidget *label_open_file_ok;
  GtkWidget *label_open_file_short;
  GtkWidget *button_open_file;
  GtkWidget *label_open_file_long;
  static void on_open_file_button_clicked (GtkButton *button, gpointer user_data);
  void on_open_file_button ();
  bool open_file_gui ();

  // View file.
  GtkWidget *image_view_file_ok;
  GtkWidget *label_view_file_ok;
  GtkWidget *label_view_file_short;
  GtkWidget *button_view_file_html;
  GtkWidget *label_view_file_long;
  static void on_view_file_button_clicked (GtkButton *button, gpointer user_data);
  void on_view_file_button ();
  bool view_file_gui ();

  // Chapter detection pattern.
  GtkWidget *image_chapter_pattern_ok;
  GtkWidget *label_chapter_pattern_ok;
  GtkWidget *label_chapter_pattern;
  GtkWidget *label_chapter_pattern_1;
  GtkWidget *entry_chapter_pattern_1;
  GtkWidget *label_chapter_pattern_combo;
  GtkWidget *combo_chapter_pattern;
  GtkWidget *label_chapter_pattern_2;
  GtkWidget *entry_chapter_pattern_2;
  static void on_chapter_pattern_entry_changed (GtkEditable *editable, gpointer user_data);
  void on_chapter_pattern_entry ();
  bool chapter_pattern_gui ();

  // Verse detection pattern.
  GtkWidget *image_verse_pattern_ok;
  GtkWidget *label_verse_pattern_ok;
  GtkWidget *label_verse_pattern;
  GtkWidget *label_verse_pattern_1;
  GtkWidget *entry_verse_pattern_1;
  GtkWidget *label_verse_pattern_combo;
  GtkWidget *combo_verse_pattern;
  GtkWidget *label_verse_pattern_2;
  GtkWidget *entry_verse_pattern_2;
  static void on_verse_pattern_entry_changed (GtkEditable *editable, gpointer user_data);
  void on_verse_pattern_entry ();
  bool verse_pattern_gui ();

  // Write anchors.
  GtkWidget *image_write_anchors_ok;
  GtkWidget *label_write_anchors_ok;
  GtkWidget *label_write_anchors_short;
  GtkWidget *button_write_anchors;
  GtkWidget *label_write_anchors_long;
  static void on_write_anchors_button_clicked (GtkButton *button, gpointer user_data);
  void on_write_anchors_button ();
  bool write_anchors_gui ();
  bool anchors_written;

  // General gui.
  void gui ();
  void build_gui (Shortcuts& shortcuts);
  
  // Ok button.
  static void on_okbutton_clicked (GtkButton *button, gpointer user_data);
  void on_okbutton ();
};


#endif