3 * \file FormFiledialog.h
4 * Copyright 2001 the LyX Team
5 * Read the file COPYING
11 #ifndef FORMFILEDIALOG_H
12 #define FORMFILEDIALOG_H
15 #include <sigc++/signal_system.h>
24 #include FORMS_H_LOCATION
25 #include "form_filedialog.h"
27 #include "frontends/FileDialog.h"
29 /// DirEntry internal structure definition
40 extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data);
41 extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data);
42 extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev);
44 class FileDialog::Private : public SigC::Object
52 /// sets file selector user button action
53 void SetButton(int iIndex, string const & pszName = string(),
54 string const & pszPath = string());
55 /// gets last dialog directory
56 string const GetDirectory() const;
57 /// launches dialog and returns selected file
58 string const Select(string const & pszTitle = string(),
59 string const & pszPath = string(),
60 string const & pszMask = string(),
61 string const & pszSuggested = string());
62 /// XForms objects callback (static)
63 static void FileDlgCB(FL_OBJECT *, long);
64 /// Callback for double click in list
65 static void DoubleClickCB(FL_OBJECT *, long);
66 /// Handle Cancel CB from WM close
67 static int CancelCB(FL_FORM *, void *);
71 static FD_form_filedialog * pFileDlgForm;
73 static FileDialog::Private * pCurrentDlg;
93 typedef std::vector<DirEntry> DirEntries;
95 DirEntries direntries;
102 FD_form_filedialog * build_filedialog();
104 /** Redraw the form (on receipt of a Signal indicating, for example,
105 that the xform colors have been re-mapped).
108 /// updates dialog list to match class directory
110 /// sets dialog current directory
111 void SetDirectory(string const & pszPath);
112 /// sets dialog file mask
113 void SetMask(string const & pszNewMask);
114 /// sets dialog information line
115 void SetInfoLine(string const & pszLine);
116 /// handle dialog during file selection
118 /// Handle callback from list
119 void HandleListHit();
120 /// Handle double click from list
121 bool HandleDoubleClick();
122 /// Handle OK button call
124 /// Simulates a click on OK/Cancel
126 /// Redraw connection.
130 #endif // FORMFILEDIALOG_H