]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xforms_helpers.h
fix crash with "save as"
[lyx.git] / src / frontends / xforms / xforms_helpers.h
index 7e0acc9ed09359831249ce742048452149520e7b..cccfeb6f86255b66aad98f7688741a0025e606a0 100644 (file)
@@ -1,10 +1,12 @@
 // -*- C++ -*-
 /**
  * \file xforms_helpers.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming 
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #ifndef XFORMSHELPERS_H
@@ -14,7 +16,7 @@
 #pragma interface
 #endif
 
-#include FORMS_H_LOCATION
+#include "forms_fwd.h"
 
 #include "Color.h"
 #include "LString.h"
@@ -30,40 +32,23 @@ string const choice_Length_All =
 string const choice_Length_WithUnit =
     "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu";     // all with a Unit
 
-/// Extract shortcut from <ident>|<shortcut> string
-char const * flyx_shortcut_extract(char const * sc);
-/// Shortcut for flyx_shortcut_extract
-#define scex flyx_shortcut_extract
-
-/// Extract shortcut from <ident>|<shortcut> string
-char const * flyx_ident_extract(char const * sc);
-/// Shortcut for flyx_ident_extract
-#define idex flyx_ident_extract
+/// return the (in)active state of the object
+bool isActive(FL_OBJECT * ob);
 
 /// Set an FL_OBJECT to activated or deactivated
 void setEnabled(FL_OBJECT *, bool enable);
 
 /// Take a string and add breaks so that it fits into a desired label width, w
 string formatted(string const &label, int w,
-                int = FL_NORMAL_SIZE, int = FL_NORMAL_STYLE);
-
-/// Given an fl_choice, create a vector of its entries
-std::vector<string> const getVectorFromChoice(FL_OBJECT *);
+                int = 12 /*FL_NORMAL_SIZE*/, int = 0 /*FL_NORMAL_STYLE*/);
 
-/// Given an fl_browser, create a vector of its entries
-std::vector<string> const getVectorFromBrowser(FL_OBJECT *);
+/// Given an fl_choice or an fl_browser, create a vector of its entries
+std::vector<string> const getVector(FL_OBJECT *);
 
-/// Given an fl_input, return its contents.
-string const getStringFromInput(FL_OBJECT * ob);
-
-/** Given an fl_browser, return the contents of line
-    (xforms numbering convention; starts at 1).
-*/
-string const getStringFromBrowser(FL_OBJECT * ob, int line);
-/** Given an fl_browser, return the contents of the currently
-    highlighted line.
-*/
-string const getSelectedStringFromBrowser(FL_OBJECT * ob);
+/** Given an fl_input, an fl_choice or an fl_browser, return an entry
+    \c num is the position for the string, where 0 means "current item"
+ */
+string const getString(FL_OBJECT * ob, int num = 0);
 
 /// Given input and choice widgets, create a string such as "1cm"
 string getLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice);