Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FbExportDlg.h « dialogs « MyRuLib « sources - github.com/lintest/myrulib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f620bd15af97cf1b3bb6cb9ba59256cf43e59135 (plain)
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
#ifndef __FBEXPORTDLG_H__
#define __FBEXPORTDLG_H__

#include <wx/wx.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/dialog.h>
#include "models/FbBookList.h"
#include "controls/FbTreeView.h"
#include "FbConst.h"
#include "FbDatabase.h"
#include "FbWindow.h"
#include "controls/FbChoiceCtrl.h"
#include "controls/FbComboBox.h"

class FbBookPanel;

class FbConvertArray;

class FbExportTreeModel;

///////////////////////////////////////////////////////////////////////////////
/// Class FbExportDlg
///////////////////////////////////////////////////////////////////////////////
class FbExportDlg : public FbDialog
{
	public:
		FbExportDlg(wxWindow* parent, const wxString & selections, int iAuthor);
		~FbExportDlg();
		static bool Execute(wxWindow* parent, FbBookPanel * books, int iAuthor = 0);
	private:
		FbModel * CreateModel();
		void FullBySequences(wxTreeItemId root, const wxString &selections, bool bUseLetter);
		void FullNoSequences(wxTreeItemId root, const wxString &selections, bool bUseLetter);
		wxTreeItemId AppendFolder(const wxTreeItemId &parent, const wxString & name);
		void ChangeFilesExt(const wxTreeItemId &parent);
		void FillFilelist(const wxTreeItemId &parent, FbConvertArray &filelist, const wxString &dir = wxEmptyString);
		void ChangeFormat(FbExportTreeModel * model);
		bool ExportBooks();
		void LoadFormats();
		wxString GetExt(int format);
	private:
		wxString m_selections;
		wxArrayString m_filenames;
		int m_author;
		FbCommonDatabase m_database;
	private:
		enum
		{
			ID_DIR_TXT = 1000,
			ID_STRUCT,
			ID_BOOKS,
			ID_FORMAT,
			ID_AUTHOR,
			ID_DIR,
			ID_FILE,
		};
		FbCustomCombo * m_folder;
		wxComboBox * m_struct;
		FbTreeViewCtrl * m_books;
		FbChoiceInt * m_format;
		wxCheckBox * m_checkAuthor;
		wxCheckBox * m_transDir;
		wxCheckBox * m_transFile;
	private:
        void OnSelectDir( wxCommandEvent& event );
		void OnBookCollapsing( wxTreeEvent & event );
		void OnChangeFormat( wxCommandEvent& event );
		void OnCheckAuthor( wxCommandEvent& event );
		DECLARE_EVENT_TABLE()
};

#endif // __FBEXPORTDLG_H__