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