]> git.lyx.org Git - lyx.git/blob - src/filedlg.h
make doc++ able to generate the source documentation for lyx
[lyx.git] / src / filedlg.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef FILEDLG_H
13 #define FILEDLG_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include <vector>
20
21 #include "LString.h"
22 #include FORMS_H_LOCATION
23 #include "form1.h"
24
25 /// LyXDirEntry internal structure definition
26 class LyXDirEntry {
27 public:
28         ///
29         string pszName;
30         ///
31         string pszDisplayed;
32         ///
33         string pszLsEntry;
34 };
35
36
37 /// FileDlg class definition
38 class LyXFileDlg 
39 {
40 public:
41         ///
42         LyXFileDlg();
43
44         /// sets file selector user button action
45         void SetButton(int iIndex, string const & pszName = string(), 
46                        string const & pszPath = string());
47         /// gets last dialog directory
48         string GetDirectory() const;
49         /// launches dialog and returns selected file
50         string Select(string const & pszTitle = string(),
51                        string const & pszPath = string(),
52                        string const & pszMask = string(), 
53                        string const & pszSuggested = string());
54         /// XForms objects callback (static)
55         static void FileDlgCB(FL_OBJECT *, long);
56         /// Callback for double click in list
57         static void DoubleClickCB(FL_OBJECT *, long);
58         /// Handle Cancel CB from WM close
59         static int CancelCB(FL_FORM *, void *);
60 private:
61         /// data
62         static FD_FileDlg * pFileDlgForm;
63         ///
64         static LyXFileDlg * pCurrentDlg;
65         ///
66         string pszUserPath1;
67         ///
68         string pszUserPath2;
69         ///
70         string pszDirectory;
71         ///
72         string pszMask;
73         ///
74         string pszFileName;
75         ///
76         int iDepth;
77         ///
78         int iLastSel;
79         ///
80         long lLastTime;
81         ///
82         string pszInfoLine;
83         ///
84         typedef std::vector<LyXDirEntry> DirEntries;
85         ///
86         DirEntries direntries;
87         ///
88         bool force_cancel;
89         ///
90         bool force_ok;
91
92         /// updates dialog list to match class directory
93         void Reread();
94         /// sets dialog current directory
95         void SetDirectory(string const & pszPath);
96         /// sets dialog file mask
97         void SetMask(string const & pszNewMask);
98         /// sets dialog information line
99         void SetInfoLine(string const & pszLine);
100         /// handle dialog during file selection
101         bool RunDialog();
102         /// Handle callback from list
103         void HandleListHit();
104         /// Handle double click from list
105         bool HandleDoubleClick();
106         /// Handle OK button call
107         bool HandleOK();
108         /// Simulates a click on OK/Cancel
109         void Force(bool);
110 };
111
112 #endif