]> git.lyx.org Git - features.git/blob - src/frontends/qt4/GuiLyXFiles.h
e4213353b8cb058e7f8e04620a7520e3825904d9
[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 #include <vector>
20
21 class QListWidgetItem;
22
23 namespace lyx {
24
25 class Format;
26
27 namespace frontend {
28
29 class GuiLyXFiles : public GuiDialog, public Ui::LyXFilesUi
30 {
31         Q_OBJECT
32
33 public:
34         GuiLyXFiles(GuiView & lv);
35
36 private Q_SLOTS:
37         void changed_adaptor();
38         void on_fileTypeCO_activated(int);
39         void on_languageCO_activated(int);
40         void on_filesLW_itemDoubleClicked(QTreeWidgetItem *, int);
41         void on_filesLW_itemClicked(QTreeWidgetItem *, int);
42         void on_browsePB_pressed();
43         void slotButtonBox(QAbstractButton *);
44         void filterLabels();
45         void resetFilter();
46
47 private:
48         ///
49         bool isValid();
50         /// Apply from dialog
51         void applyView();
52         /// Update the dialog
53         void updateContents();
54
55         ///
56         bool initialiseParams(std::string const & data);
57         ///
58         void paramsToDialog();
59         ///
60         void clearParams() {}
61         ///
62         void dispatchParams();
63         ///
64         bool isBufferDependent() const { return false; }
65         ///
66         FuncCode getLfun() const;
67         ///
68         QString const getSuffix();
69         ///
70         bool translateName() const;
71         ///
72         QMap<QString, QString> getFiles();
73         /// Get the full file path in the selected localization
74         QString const getRealPath(QString relpath = QString());
75         ///
76         void setLanguage();
77
78 private:
79         /// contains the search box
80         FancyLineEdit * filter_;
81         ///
82         QString type_;
83         ///
84         QString file_;
85         /// All languages (code, guiname)
86         QMap<QString, QString> all_languages_;
87         /// Languages available for files (code. guiname)
88         QMap<QString, QString> available_languages_;
89         ///
90         typedef QMap<QString, QMap<QString, QString>> localizationsMap;
91         ///
92         localizationsMap localizations_;
93         /// Possible GUI language representations
94         std::vector<std::string> guilangs_;
95         /// The real GUI lang as stored in available_languages_
96         QString guilang_;
97         /// The last used language
98         QString savelang_;
99 };
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // GUILYXFILES_H