2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
20 #include <sigc++/signal_system.h>
23 #include FORMS_H_LOCATION
26 #ifdef SIGC_CXX_NAMESPACES
28 using SigC::Connection;
31 /// LyXDirEntry internal structure definition
43 /// FileDlg class definition
44 class LyXFileDlg : public 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 *);
70 static FD_FileDlg * pFileDlgForm;
72 static LyXFileDlg * pCurrentDlg;
92 typedef std::vector<LyXDirEntry> DirEntries;
94 DirEntries direntries;
100 /** Redraw the form (on receipt of a Signal indicating, for example,
101 that the xform colors have been re-mapped).
104 /// updates dialog list to match class directory
106 /// sets dialog current directory
107 void SetDirectory(string const & pszPath);
108 /// sets dialog file mask
109 void SetMask(string const & pszNewMask);
110 /// sets dialog information line
111 void SetInfoLine(string const & pszLine);
112 /// handle dialog during file selection
114 /// Handle callback from list
115 void HandleListHit();
116 /// Handle double click from list
117 bool HandleDoubleClick();
118 /// Handle OK button call
120 /// Simulates a click on OK/Cancel
122 /// Redraw connection.