2 * \file FormFiledialog.h
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
10 #ifndef FORMFILEDIALOG_H
11 #define FORMFILEDIALOG_H
20 #include <sigc++/signal_system.h>
23 #include FORMS_H_LOCATION
24 #include "form_filedialog.h"
26 #include "frontends/FileDialog.h"
28 #ifdef SIGC_CXX_NAMESPACES
30 using SigC::Connection;
33 /// DirEntry internal structure definition
44 extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data);
45 extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data);
46 extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev);
48 class FileDialog::Private : public Object
56 /// sets file selector user button action
57 void SetButton(int iIndex, string const & pszName = string(),
58 string const & pszPath = string());
59 /// gets last dialog directory
60 string const GetDirectory() const;
61 /// launches dialog and returns selected file
62 string const Select(string const & pszTitle = string(),
63 string const & pszPath = string(),
64 string const & pszMask = string(),
65 string const & pszSuggested = string());
66 /// XForms objects callback (static)
67 static void FileDlgCB(FL_OBJECT *, long);
68 /// Callback for double click in list
69 static void DoubleClickCB(FL_OBJECT *, long);
70 /// Handle Cancel CB from WM close
71 static int CancelCB(FL_FORM *, void *);
75 static FD_form_filedialog * pFileDlgForm;
77 static FileDialog::Private * pCurrentDlg;
97 typedef std::vector<DirEntry> DirEntries;
99 DirEntries direntries;
106 FD_form_filedialog * build_filedialog();
108 /** Redraw the form (on receipt of a Signal indicating, for example,
109 that the xform colors have been re-mapped).
112 /// updates dialog list to match class directory
114 /// sets dialog current directory
115 void SetDirectory(string const & pszPath);
116 /// sets dialog file mask
117 void SetMask(string const & pszNewMask);
118 /// sets dialog information line
119 void SetInfoLine(string const & pszLine);
120 /// handle dialog during file selection
122 /// Handle callback from list
123 void HandleListHit();
124 /// Handle double click from list
125 bool HandleDoubleClick();
126 /// Handle OK button call
128 /// Simulates a click on OK/Cancel
130 /// Redraw connection.
134 #endif // FORMFILEDIALOG_H