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
;
89 /// compares two LyXDirEntry objects content (used by qsort)
90 static int ldeCompProc(const LyXDirEntry
*r1
, const LyXDirEntry
*r2
);
94 /// FileDlg class definition
102 /// sets file selector user button action
103 void SetButton(int iIndex
, string
const & pszName
= string(),
104 string
const & pszPath
= string());
105 /// gets last dialog directory
106 string
GetDirectory();
107 /// launches dialog and returns selected file
108 string
Select(string
const & pszTitle
= string(),
109 string
const & pszPath
= string(),
110 string
const & pszMask
= string(),
111 string
const & pszSuggested
= string());
112 /// XForms objects callback (static)
113 static void FileDlgCB(FL_OBJECT
*, long);
114 /// Callback for double click in list
115 static void DoubleClickCB(FL_OBJECT
*, long);
116 /// Handle Cancel CB from WM close
117 static int CancelCB(FL_FORM
*, void *);
120 static FD_FileDlg
*pFileDlgForm
;
121 static LyXFileDlg
*pCurrentDlg
;
131 LyXDirEntry
*pCurrentNames
;
137 // internal functions
138 /// updates dialog list to match class directory
140 /// sets dialog current directory
141 void SetDirectory(string
const & pszPath
);
142 /// sets dialog file mask
143 void SetMask(string
const & pszNewMask
);
144 /// sets dialog information line
145 void SetInfoLine(string
const & pszLine
);
146 /// handle dialog during file selection
148 /// Handle callback from list
149 void HandleListHit();
150 /// Handle double click from list
151 bool HandleDoubleClick();
152 /// Handle OK button call
154 /// Simulates a click on OK/Cancel