]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/helper_funcs.h
to much stuff for my liking...
[lyx.git] / src / frontends / controllers / helper_funcs.h
index d2af6683b4c0bb300537a70809ff4ef9548b9f16..3631b692b059b09905e9e274f926a04e66d47706 100644 (file)
@@ -42,8 +42,22 @@ class LyXView;
 string const browseFile(LyXView *lv, string const & filename,
                        string const & title,
                        string const & pattern, 
-                       std::pair<string,string> const & dir1,
-                       std::pair<string,string> const & dir2);
+                       std::pair<string,string> const & dir1 = std::make_pair(string(), string()),
+                       std::pair<string,string> const & dir2 = std::make_pair(string(), string()));
+
+
+/* Wrapper around browseFile which tries to provide a filename
+   relative to relpath.  If the relative path is of the form "foo.txt"
+   or "bar/foo.txt", then it is returned as relative. OTOH, if it is
+   of the form "../baz/foo.txt", an absolute path is returned. This is
+   intended to be useful for insets which encapsulate files/
+*/
+string const browseRelFile(LyXView *lv, string const & filename,
+                          string const & refpath,
+                          string const & title,
+                          string const & pattern, 
+                          std::pair<string,string> const & dir1 = std::make_pair(string(), string()),
+                          std::pair<string,string> const & dir2 = std::make_pair(string(), string()));
 
 
 /// Returns a vector of units that can be used to create a valid LaTeX length.