2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-1999 The LyX Team.
10 * ======================================================*/
21 // necessary for xForms related stuff
22 #include FORMS_H_LOCATION
26 /// User cache class definition
31 UserCache(string const & pszName = string(), uid_t ID = 0,
32 UserCache *pRoot = 0);
36 /// seeks user name from user ID
37 string Find(uid_t ID);
44 UserCache *pNext, *pRoot;
46 /// creates a new user entry
47 UserCache *Add(uid_t ID);
49 extern UserCache lyxUserCache;
52 /// Group cache class definition
57 GroupCache(string const & pszName = string(), gid_t ID = 0,
58 GroupCache *pRoot = 0);
62 /// seeks group name from group ID
63 string Find(gid_t ID);
71 GroupCache *pNext, *pRoot;
73 /// creates a new group entry
74 GroupCache *Add(gid_t ID);
76 extern GroupCache lyxGroupCache;
79 /// LyXDirEntry internal structure definition
83 friend class LyXFileDlg;
87 /// compares two LyXDirEntry objects content (used by qsort)
88 static int ldeCompProc(const LyXDirEntry *r1, const LyXDirEntry *r2);
93 /// FileDlg class definition
101 /// sets file selector user button action
102 void SetButton(int iIndex, string const & pszName = string(),
103 string const & pszPath = string());
104 /// gets last dialog directory
105 string GetDirectory();
106 /// launches dialog and returns selected file
107 string Select(string const & pszTitle = string(),
108 string const & pszPath = string(),
109 string const & pszMask = string(),
110 string const & pszSuggested = string());
111 /// XForms objects callback (static)
112 static void FileDlgCB(FL_OBJECT *, long);
113 /// Callback for double click in list
114 static void DoubleClickCB(FL_OBJECT *, long);
117 static FD_FileDlg *pFileDlgForm;
118 static LyXFileDlg *pCurrentDlg;
128 LyXDirEntry *pCurrentNames;
134 // internal functions
135 /// updates dialog list to match class directory
137 /// sets dialog current directory
138 void SetDirectory(string const & pszPath);
139 /// sets dialog file mask
140 void SetMask(string const & pszNewMask);
141 /// sets dialog information line
142 void SetInfoLine(string const & pszLine);
143 /// handle dialog during file selection
145 /// Handle callback from list
146 void HandleListHit();
147 /// Handle double click from list
148 bool HandleDoubleClick();
149 /// Handle OK button call
151 /// Handle Cancel CB from WM close
152 static int CancelCB(FL_FORM *, void *);
153 /// Simulates a click on OK/Cancel