2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 1995 1996 Matthias Ettrich
10 *======================================================*/
21 // necessary for xForms related stuff
22 #include FORMS_H_LOCATION
26 /// User cache class definition
31 UserCache(LString const & pszName = LString(), uid_t ID = 0,
32 UserCache *pRoot = NULL);
36 /// seeks user name from user ID
37 LString 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(LString const & pszName = LString(), gid_t ID = 0,
58 GroupCache *pRoot = NULL);
62 /// seeks group name from group ID
63 LString 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, LString const & pszName = LString(),
103 LString const & pszPath = LString());
104 /// gets last dialog directory
105 LString GetDirectory();
106 /// launches dialog and returns selected file
107 LString Select(LString const & pszTitle = LString(),
108 LString const & pszPath = LString(),
109 LString const & pszMask = LString(),
110 LString const & pszSuggested = LString());
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;
119 LString pszUserPath1;
120 LString pszUserPath2;
121 LString pszDirectory;
128 LyXDirEntry *pCurrentNames;
134 // internal functions
135 /// updates dialog list to match class directory
137 /// sets dialog current directory
138 void SetDirectory(LString const & pszPath);
139 /// sets dialog file mask
140 void SetMask(LString const & pszNewMask);
141 /// sets dialog information line
142 void SetInfoLine(LString 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