TDME2 1.9.121
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
FileDialogScreenController Class Referencefinal

File dialog screen controller. More...

#include <tdme/tools/editor/controllers/FileDialogScreenController.h>

Inheritance diagram for FileDialogScreenController:
Inheritance graph
Collaboration diagram for FileDialogScreenController:
Collaboration graph

Public Member Functions

 FileDialogScreenController ()
 Public constructor. More...
 
virtual ~FileDialogScreenController ()
 Destructor. More...
 
GUIScreenNodegetScreenNode () override
 
const string & getDefaultCWD ()
 
void setDefaultCWD (const string &defaultCwd)
 Set default current working directory. More...
 
const string & getPathName ()
 
const string getFileName ()
 
void show (const string &cwd, const string &captionText, const vector< string > &extensions, const string &fileName, bool enableFilter, Action *applyAction, Action *cancelAction=nullptr, const string &settingsFileName=".filedialog.properties", const string &settingsPathName=string())
 Shows the file dialog pop up. More...
 
void close ()
 Abort the file dialog pop up. More...
 
void initialize () override
 Init. More...
 
void dispose () override
 Dispose. More...
 
void onValueChanged (GUIElementNode *node) override
 On value changed. More...
 
void onActionPerformed (GUIActionListenerType type, GUIElementNode *node) override
 
void onFocus (GUIElementNode *node) override
 On focus. More...
 
void onUnfocus (GUIElementNode *node) override
 On unfocus. More...
 
void loadSettings ()
 Load settings. More...
 
void saveSettings ()
 Save settings. More...
 
- Public Member Functions inherited from ScreenController
virtual ~ScreenController ()
 Destructor. More...
 
virtual GUIScreenNodegetScreenNode ()=0
 
virtual void initialize ()=0
 Init. More...
 
virtual void dispose ()=0
 Dispose. More...
 
- Public Member Functions inherited from GUIActionListener
virtual ~GUIActionListener ()
 Destructor. More...
 
virtual void onActionPerformed (GUIActionListenerType type, GUIElementNode *node)=0
 On action performed. More...
 
- Public Member Functions inherited from GUIChangeListener
virtual ~GUIChangeListener ()
 Destructor. More...
 
virtual void onValueChanged (GUIElementNode *node)=0
 On value changed. More...
 
- Public Member Functions inherited from GUIFocusListener
virtual ~GUIFocusListener ()
 Destructor. More...
 
virtual void onFocus (GUIElementNode *node)=0
 On focus. More...
 
virtual void onUnfocus (GUIElementNode *node)=0
 On unfocus. More...
 

Static Public Member Functions

static const string getFileImageName (const string &fileName)
 Get file image name. More...
 

Private Member Functions

bool setupFiles ()
 Set up files. More...
 
void setupFiles (const vector< string > &fileNameList, const string &selectedFileName=string())
 Set up files. More...
 
void setupFavorites ()
 Set up favorites. More...
 
void setupRecents ()
 Set up recent. More...
 
void setupDrives ()
 Set up drives. More...
 
const string getExtensionHash ()
 

Private Attributes

GUIScreenNodescreenNode { nullptr }
 
string cwd
 
vector< string > extensions
 
string captionText
 
GUIElementNodetabsHeaderNode { nullptr }
 
GUIElementNodepathNode { nullptr }
 
GUIElementNodefileNameNode { nullptr }
 
GUIElementNodefilesNode { nullptr }
 
GUIElementNoderecentsNode { nullptr }
 
GUIElementNodefavoritesNode { nullptr }
 
GUIElementNodedrivesNode { nullptr }
 
GUIElementNodetypeDropDownNode { nullptr }
 
ActionapplyAction { nullptr }
 
ActioncancelAction { nullptr }
 
vector< string > fileList
 
bool enableFilter
 
bool filtered
 
vector< string > favorites
 
vector< string > recents
 
string defaultCwd
 
unordered_map< string, string > defaultCwdByExtensions
 
string settingsPathName
 
string settingsFileName
 

Detailed Description

File dialog screen controller.

Author
Andreas Drewke
Version
$Id$

Definition at line 36 of file FileDialogScreenController.h.

Constructor & Destructor Documentation

◆ FileDialogScreenController()

Public constructor.

Definition at line 53 of file FileDialogScreenController.cpp.

◆ ~FileDialogScreenController()

Destructor.

Definition at line 61 of file FileDialogScreenController.cpp.

Member Function Documentation

◆ close()

void close ( )

Abort the file dialog pop up.

Definition at line 339 of file FileDialogScreenController.cpp.

◆ dispose()

void dispose ( )
overridevirtual

Dispose.

Implements ScreenController.

Definition at line 107 of file FileDialogScreenController.cpp.

◆ getDefaultCWD()

const string & getDefaultCWD ( )
inline
Returns
default current working directory

Definition at line 125 of file FileDialogScreenController.h.

◆ getExtensionHash()

const string getExtensionHash ( )
inlineprivate
Returns
extension hash

Definition at line 101 of file FileDialogScreenController.h.

◆ getFileImageName()

const string getFileImageName ( const string &  fileName)
static

Get file image name.

Parameters
fileNamefile name
Returns
file image name

Definition at line 572 of file FileDialogScreenController.cpp.

◆ getFileName()

const string getFileName ( )
Returns
file name

Definition at line 76 of file FileDialogScreenController.cpp.

◆ getPathName()

const string & getPathName ( )
Returns
path name

Definition at line 71 of file FileDialogScreenController.cpp.

◆ getScreenNode()

GUIScreenNode * getScreenNode ( )
overridevirtual
Returns
screen node

Implements ScreenController.

Definition at line 66 of file FileDialogScreenController.cpp.

◆ initialize()

void initialize ( )
overridevirtual

Init.

Implements ScreenController.

Definition at line 85 of file FileDialogScreenController.cpp.

◆ loadSettings()

void loadSettings ( )

Load settings.

Definition at line 505 of file FileDialogScreenController.cpp.

◆ onActionPerformed()

void onActionPerformed ( GUIActionListenerType  type,
GUIElementNode node 
)
override

Definition at line 413 of file FileDialogScreenController.cpp.

◆ onFocus()

void onFocus ( GUIElementNode node)
overridevirtual

On focus.

Parameters
nodenode

Implements GUIFocusListener.

Definition at line 496 of file FileDialogScreenController.cpp.

◆ onUnfocus()

void onUnfocus ( GUIElementNode node)
overridevirtual

On unfocus.

Parameters
nodenode

Implements GUIFocusListener.

Definition at line 502 of file FileDialogScreenController.cpp.

◆ onValueChanged()

void onValueChanged ( GUIElementNode node)
overridevirtual

On value changed.

Parameters
nodenode

Implements GUIChangeListener.

Definition at line 348 of file FileDialogScreenController.cpp.

◆ saveSettings()

void saveSettings ( )

Save settings.

Definition at line 544 of file FileDialogScreenController.cpp.

◆ setDefaultCWD()

void setDefaultCWD ( const string &  defaultCwd)

Set default current working directory.

Parameters
defaultCWDdefault current working directory

Definition at line 81 of file FileDialogScreenController.cpp.

◆ setupDrives()

void setupDrives ( )
private

Set up drives.

Definition at line 252 of file FileDialogScreenController.cpp.

◆ setupFavorites()

void setupFavorites ( )
private

Set up favorites.

Definition at line 200 of file FileDialogScreenController.cpp.

◆ setupFiles() [1/2]

bool setupFiles ( )
private

Set up files.

Returns
success

Public constructor

Parameters
fileDialogScreenControllerfile dialog screen controller

Definition at line 112 of file FileDialogScreenController.cpp.

◆ setupFiles() [2/2]

void setupFiles ( const vector< string > &  fileNameList,
const string &  selectedFileName = string() 
)
private

Set up files.

Parameters
fileNameListfile name list
selectedFileNameselected file name

Definition at line 167 of file FileDialogScreenController.cpp.

◆ setupRecents()

void setupRecents ( )
private

Set up recent.

Definition at line 226 of file FileDialogScreenController.cpp.

◆ show()

void show ( const string &  cwd,
const string &  captionText,
const vector< string > &  extensions,
const string &  fileName,
bool  enableFilter,
Action applyAction,
Action cancelAction = nullptr,
const string &  settingsFileName = ".filedialog.properties",
const string &  settingsPathName = string() 
)

Shows the file dialog pop up.

Parameters
cwdcurrent working directory
captionTextcaption text
extensionsextensions
fileNamefile name
enableFilterenable filter
applyActionapply action
cancelActioncancel action
settingsFileNamesettings file name
settingsPathNamesettings path name
Exceptions
IOException

Definition at line 292 of file FileDialogScreenController.cpp.

Member Data Documentation

◆ applyAction

Action* applyAction { nullptr }
private

Definition at line 56 of file FileDialogScreenController.h.

◆ cancelAction

Action* cancelAction { nullptr }
private

Definition at line 57 of file FileDialogScreenController.h.

◆ captionText

string captionText
private

Definition at line 47 of file FileDialogScreenController.h.

◆ cwd

string cwd
private

Definition at line 45 of file FileDialogScreenController.h.

◆ defaultCwd

string defaultCwd
private

Definition at line 63 of file FileDialogScreenController.h.

◆ defaultCwdByExtensions

unordered_map<string, string> defaultCwdByExtensions
private

Definition at line 64 of file FileDialogScreenController.h.

◆ drivesNode

GUIElementNode* drivesNode { nullptr }
private

Definition at line 54 of file FileDialogScreenController.h.

◆ enableFilter

bool enableFilter
private

Definition at line 59 of file FileDialogScreenController.h.

◆ extensions

vector<string> extensions
private

Definition at line 46 of file FileDialogScreenController.h.

◆ favorites

vector<string> favorites
private

Definition at line 61 of file FileDialogScreenController.h.

◆ favoritesNode

GUIElementNode* favoritesNode { nullptr }
private

Definition at line 53 of file FileDialogScreenController.h.

◆ fileList

vector<string> fileList
private

Definition at line 58 of file FileDialogScreenController.h.

◆ fileNameNode

GUIElementNode* fileNameNode { nullptr }
private

Definition at line 50 of file FileDialogScreenController.h.

◆ filesNode

GUIElementNode* filesNode { nullptr }
private

Definition at line 51 of file FileDialogScreenController.h.

◆ filtered

bool filtered
private

Definition at line 60 of file FileDialogScreenController.h.

◆ pathNode

GUIElementNode* pathNode { nullptr }
private

Definition at line 49 of file FileDialogScreenController.h.

◆ recents

vector<string> recents
private

Definition at line 62 of file FileDialogScreenController.h.

◆ recentsNode

GUIElementNode* recentsNode { nullptr }
private

Definition at line 52 of file FileDialogScreenController.h.

◆ screenNode

GUIScreenNode* screenNode { nullptr }
private

Definition at line 44 of file FileDialogScreenController.h.

◆ settingsFileName

string settingsFileName
private

Definition at line 66 of file FileDialogScreenController.h.

◆ settingsPathName

string settingsPathName
private

Definition at line 65 of file FileDialogScreenController.h.

◆ tabsHeaderNode

GUIElementNode* tabsHeaderNode { nullptr }
private

Definition at line 48 of file FileDialogScreenController.h.

◆ typeDropDownNode

GUIElementNode* typeDropDownNode { nullptr }
private

Definition at line 55 of file FileDialogScreenController.h.


The documentation for this class was generated from the following files: