ListFileSystem.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <ewol/widget/List.hpp>
9 #include <etk/os/FSNode.hpp>
11 #include <esignal/Signal.hpp>
12 
13 namespace ewol {
14  namespace widget {
15  class ListFileSystem;
16  using ListFileSystemShared = ememory::SharedPtr<ewol::widget::ListFileSystem>;
17  using ListFileSystemWeak = ememory::WeakPtr<ewol::widget::ListFileSystem>;
22  public: // signals
23  esignal::Signal<std::string> signalFileSelect;
24  esignal::Signal<std::string> signalFileValidate;
25  esignal::Signal<std::string> signalFolderSelect;
26  esignal::Signal<std::string> signalFolderValidate;
27  public: // properties
34  protected:
36  public:
37  DECLARE_WIDGET_FACTORY(ListFileSystem, "ListFileSystem");
38  virtual ~ListFileSystem();
39  protected:
41  int32_t m_colorIdText;
45  protected:
46  etk::Color<> getBasicBG() override;
47  uint32_t getNuberOfColomn() override;
48  bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) override;
49  uint32_t getNuberOfRaw() override;
50  bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) override;
51  bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) override;
52  protected:
53  // TODO: use shred_ptr
54  std::vector<etk::FSNode *> m_list;
55 
58  void clearList();
62  virtual void regenerateView();
63  protected:
64  int32_t m_selectedLine;
65  public:
70  virtual void setSelect(const std::string& _data);
75  std::string getSelect() const ;
76  protected:
77  virtual void onChangePropertyPath();
78  virtual void onChangePropertyFile();
79  virtual void onChangePropertyShowFile();
80  virtual void onChangePropertyShowFolder();
81  virtual void onChangePropertyShowHidden();
82  virtual void onChangePropertyFilter();
83  };
84  };
85 };
86 
87 
std::string getSelect() const
Get the current selected file/folder/... in the list.
Definition: List.hpp:22
int32_t m_colorIdText
Color of the text.
Definition: ListFileSystem.hpp:41
std::vector< etk::FSNode * > m_list
List of all element in the path. (they are filtered)
Definition: ListFileSystem.hpp:54
eproperty::Value< std::string > propertyFilter
Regular expression to filter the view (for temporary file:".*(~|.bck|.pyc)\e")
Definition: ListFileSystem.hpp:33
int32_t m_colorIdBackground1
Color of the Background.
Definition: ListFileSystem.hpp:42
int32_t m_colorIdBackgroundSelected
Color of line selected.
Definition: ListFileSystem.hpp:44
eproperty::Value< std::string > propertyFile
current selected file
Definition: ListFileSystem.hpp:29
virtual void setSelect(const std::string &_data)
Select a specific file in the path.
esignal::Signal< std::string > signalFileSelect
"file-select" Generated when a file is selected.
Definition: ListFileSystem.hpp:23
int32_t m_selectedLine
Current Line ID that is selected.
Definition: ListFileSystem.hpp:64
Generic display folder class. This widget display the content of a single folder : ...
Definition: ListFileSystem.hpp:21
Definition: Area.hpp:16
void clearList()
Clean the list of element.
esignal::Signal< std::string > signalFileValidate
"file-validate" Generate when the user validate (return) or double click on the element ...
Definition: ListFileSystem.hpp:24
eproperty::Value< bool > propertyShowFile
Show files elements.
Definition: ListFileSystem.hpp:30
eproperty::Value< bool > propertyShowHidden
Display hidden elements.
Definition: ListFileSystem.hpp:32
ememory::SharedPtr< ewol::resource::ColorFile > m_colorProperty
theme color property.
Definition: ListFileSystem.hpp:40
eproperty::Value< bool > propertyShowFolder
Display the folders elements.
Definition: ListFileSystem.hpp:31
int32_t m_colorIdBackground2
Color of the Background 2.
Definition: ListFileSystem.hpp:43
eproperty::Value< std::string > propertyPath
Current folder that display point on.
Definition: ListFileSystem.hpp:28
virtual void regenerateView()
Regenerate the content of the view. this is actually not automation on the system update...