ACF $AcfVersion:0$
CSimpleFilePathParamGuiComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
9#include <GeneratedFiles/ifilegui/ui_CSimpleFilePathParamGuiComp.h>
10
11
12namespace ifilegui
13{
14
15
17 Ui::CSimpleFilePathParamGuiComp,
18 ifile::IFileNameParam>
19{
20 Q_OBJECT
21
22public:
24 Ui::CSimpleFilePathParamGuiComp,
26
27 I_BEGIN_COMPONENT(CSimpleFilePathParamGuiComp);
28 I_ASSIGN(m_pathLabelAttrPtr, "PathLabel", "Label for the file editor", false, "Directory");
29 I_ASSIGN(m_startHintAttrPtr, "StartHint", "Start hint for the editor", false, "<Enter path>");
30 I_ASSIGN(m_fileTypeInfoPtr, "FileTypeInfo", "Allows to retrieve optional file type information for file selection dialog", false, "FileTypeInfo");
31 I_ASSIGN(m_readOnlyAttrPtr, "ReadOnly", "True if read only", true, false);
32 I_ASSIGN(m_filesComboAttrPtr, "FilesComboBox", "Show combobox with files", true, true);
33 I_ASSIGN(m_labelWidthAttrPtr, "LabelWidth", "Fixed label width (in pixels)", false, 100);
34 I_ASSIGN(m_defaultDirPtr, "DefaultPath", "Default path to search", false, "C:/");
35 I_ASSIGN(m_showBrowseButtonAttrPtr, "ShowBrowseButton", "If enabled, the browse button will be shown", true, true);
36 I_ASSIGN(m_filePathValidationExpressionAttrPtr, "ValidationExpression", "Regular expression used for path validation", false, "^[/,\\\\,\\w,\\s-]+");
37 I_ASSIGN(m_useSaveDialogAttrPtr, "UseSaveDialog", "Use save dialog instead of open one", true, false);
38 I_ASSIGN(m_updateOnEveryChangeAttrPtr, "UpdateOnEveryTextChange", "If set the model will be updated after every text change, else only if Enter pressed or focus lost", true, false);
39 I_END_COMPONENT;
40
41protected:
42 // reimplemented (iqtgui::TGuiObserverWrap)
43 virtual void OnGuiModelAttached() override;
44 virtual void UpdateModel() const override;
45 virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
46
47 // reimplemented (iqtgui::CGuiComponentBase)
48 virtual void OnGuiCreated() override;
49 virtual void OnGuiRetranslate() override;
50 virtual void OnGuiDesignChanged() override;
51
52protected Q_SLOTS:
54 void on_PathEdit_textChanged(const QString& text);
56
57private:
58 void SetPathToEditor(const QString& path) const;
59 void OnPathEdited(const QString& path);
60 QString GetPathFromEditor() const;
61 bool IsLabelNeeded() const;
62
63private:
64 I_TEXTATTR(m_pathLabelAttrPtr);
65 I_TEXTATTR(m_startHintAttrPtr);
66 I_ATTR(bool, m_readOnlyAttrPtr);
67 I_ATTR(bool, m_filesComboAttrPtr);
68 I_ATTR(int, m_labelWidthAttrPtr);
69 I_ATTR(bool, m_showBrowseButtonAttrPtr);
70 I_ATTR(bool, m_useSaveDialogAttrPtr);
71 I_ATTR(QString, m_filePathValidationExpressionAttrPtr);
72 I_ATTR(bool, m_updateOnEveryChangeAttrPtr);
73 I_REF(ifile::IFileTypeInfo, m_fileTypeInfoPtr);
74 I_REF(ifile::IFileNameParam, m_defaultDirPtr);
75};
76
77
78} // namespace ifilegui
79
80
81
82
Common interface for any file system item name (e.g directory, file or URL path)
Provide loading and saving of objects.
virtual void OnGuiCreated() override
virtual void OnGuiDesignChanged() override
virtual void UpdateModel() const override
iqtgui::TDesignerGuiObserverCompBase< Ui::CSimpleFilePathParamGuiComp, ifile::IFileNameParam > BaseClass
void on_PathEdit_textChanged(const QString &text)
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
virtual void OnGuiModelAttached() override
virtual void OnGuiRetranslate() override
Base class for all Qt GUI components.
Set of change flags (its IDs).
Definition IChangeable.h:36
#define I_TEXTATTR(member)
Declare translatable text attribute member.
GUI specific interfaces and components for file system access and representation.