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