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
42 // void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data);
43 // void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data);
44 // int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev);
48 class FileDialog::Private : public SigC::Object {
55 /// sets file selector user button action
56 void SetButton(int iIndex, string const & pszName = string(),
57 string const & pszPath = string());
58 /// gets last dialog directory
59 string const GetDirectory() const;
60 /// launches dialog and returns selected file
61 string const Select(string const & pszTitle = string(),
62 string const & pszPath = string(),
63 string const & pszMask = string(),
64 string const & pszSuggested = string());
65 /// XForms objects callback (static)
66 static void FileDlgCB(FL_OBJECT *, long);
67 /// Callback for double click in list
68 static void DoubleClickCB(FL_OBJECT *, long);
69 /// Handle Cancel CB from WM close
70 static int CancelCB(FL_FORM *, void *);
74 static FD_form_filedialog * pFileDlgForm;
76 static FileDialog::Private * pCurrentDlg;
96 typedef std::vector<DirEntry> DirEntries;
98 DirEntries direntries;
105 FD_form_filedialog * build_filedialog();
107 /** Redraw the form (on receipt of a Signal indicating, for example,
108 that the xform colors have been re-mapped).
111 /// updates dialog list to match class directory
113 /// sets dialog current directory
114 void SetDirectory(string const & pszPath);
115 /// sets dialog file mask
116 void SetMask(string const & pszNewMask);
117 /// sets dialog information line
118 void SetInfoLine(string const & pszLine);
119 /// handle dialog during file selection
121 /// Handle callback from list
122 void HandleListHit();
123 /// Handle double click from list
124 bool HandleDoubleClick();
125 /// Handle OK button call
127 /// Simulates a click on OK/Cancel
129 /// Redraw connection.
133 #endif // FORMFILEDIALOG_H