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
30 /// LyXDirEntry internal structure definition
42 /// FileDlg class definition
43 class LyXFileDlg : public Object
51 /// sets file selector user button action
52 void SetButton(int iIndex, string const & pszName = string(),
53 string const & pszPath = string());
54 /// gets last dialog directory
55 string const GetDirectory() const;
56 /// launches dialog and returns selected file
57 string const Select(string const & pszTitle = string(),
58 string const & pszPath = string(),
59 string const & pszMask = string(),
60 string const & pszSuggested = string());
61 /// XForms objects callback (static)
62 static void FileDlgCB(FL_OBJECT *, long);
63 /// Callback for double click in list
64 static void DoubleClickCB(FL_OBJECT *, long);
65 /// Handle Cancel CB from WM close
66 static int CancelCB(FL_FORM *, void *);
69 static FD_FileDlg * pFileDlgForm;
71 static LyXFileDlg * pCurrentDlg;
91 typedef std::vector<LyXDirEntry> DirEntries;
93 DirEntries direntries;
99 /** Redraw the form (on receipt of a Signal indicating, for example,
100 that the xform colors have been re-mapped).
103 /// updates dialog list to match class directory
105 /// sets dialog current directory
106 void SetDirectory(string const & pszPath);
107 /// sets dialog file mask
108 void SetMask(string const & pszNewMask);
109 /// sets dialog information line
110 void SetInfoLine(string const & pszLine);
111 /// handle dialog during file selection
113 /// Handle callback from list
114 void HandleListHit();
115 /// Handle double click from list
116 bool HandleDoubleClick();
117 /// Handle OK button call
119 /// Simulates a click on OK/Cancel
121 /// Redraw connection.