]> git.lyx.org Git - features.git/blob - src/frontends/qt4/GuiLyXFiles.h
6a25697748679c82d6501a6bb5e7825486601a3e
[features.git] / src / frontends / qt4 / GuiLyXFiles.h
1 // -*- C++ -*-
2 /**
3  * \file GuiLyXFiles.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Spitzmüller
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUILYXFILES_H
13 #define GUILYXFILES_H
14
15 #include "GuiDialog.h"
16 #include "FancyLineEdit.h"
17 #include "ui_LyXFilesUi.h"
18
19 class QListWidgetItem;
20
21 namespace lyx {
22
23 class Format;
24
25 namespace frontend {
26
27 class GuiLyXFiles : public GuiDialog, public Ui::LyXFilesUi
28 {
29         Q_OBJECT
30
31 public:
32         GuiLyXFiles(GuiView & lv);
33
34 private Q_SLOTS:
35         void changed_adaptor();
36         void on_fileTypeCO_activated(int);
37         void on_languageCO_activated(int);
38         void on_filesLW_itemDoubleClicked(QTreeWidgetItem *, int);
39         void on_filesLW_itemClicked(QTreeWidgetItem *, int);
40         void on_browsePB_pressed();
41         void slotButtonBox(QAbstractButton *);
42         void filterLabels();
43         void resetFilter();
44
45 private:
46         ///
47         bool isValid();
48         /// Apply from dialog
49         void applyView();
50         /// Update the dialog
51         void updateContents();
52
53         ///
54         bool initialiseParams(std::string const & data);
55         ///
56         void paramsToDialog();
57         ///
58         void clearParams() {}
59         ///
60         void dispatchParams();
61         ///
62         bool isBufferDependent() const { return false; }
63         ///
64         FuncCode getLfun() const;
65         ///
66         QString const getSuffix();
67         ///
68         bool translateName() const;
69         ///
70         void getFiles(QMap<QString, QString> &, QString const);
71         /// Get the full file path in the selected localization
72         QString const getRealPath();
73
74 private:
75         /// contains the search box
76         FancyLineEdit * filter_;
77         ///
78         QString type_;
79         ///
80         QString file_;
81         /// All languages (code, guiname)
82         QMap<QString, QString> all_languages_;
83         /// Languages available for files (code. guiname)
84         QMap<QString, QString> available_languages_;
85         ///
86         typedef QMap<QString, QMap<QString, QString>> localizationsMap;
87         ///
88         localizationsMap localizations_;
89         /// Possible GUI language representations
90         std::vector<std::string> guilangs_;
91         /// The real GUI lang as stored in available_languages_
92         QString guilang_;
93         /// The last used language
94         QString savelang_;
95 };
96
97 } // namespace frontend
98 } // namespace lyx
99
100 #endif // GUILYXFILES_H