Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ABI_GTK_COMMON_H
00022 #define ABI_GTK_COMMON_H
00023
00024 #include <string>
00025 #include <list>
00026 #include <gtk/gtk.h>
00027
00028 std::string tostr( long v );
00029 std::string tostr( GtkTextView* tv );
00030 std::string tostr( GtkEntry* e );
00031 std::string getSelectedText( GtkTreeView* tv, int colnum = 0 );
00032 void selectNext( GtkTreeView* tv );
00033 void selectPrev( GtkTreeView* tv );
00034 void append( GtkComboBox* combo, const std::list< std::string >& data );
00035 std::string tostr( GtkComboBox* combo );
00036
00037
00038 typedef std::list< GtkTreeIter > list_gtktreeiter_t;
00043 list_gtktreeiter_t getIterList( GtkWidget* w_treeview, bool useSelection = false );
00044
00045 void clearSelection( GtkTreeView* tv );
00046 void selectIter( GtkTreeView* tv, GtkTreeIter* iter );
00047 void scrollToIter( GtkTreeView* tv, GtkTreeIter* iter, int colnum = -1, gboolean start_editing = false );
00048
00049
00050
00051 #include "xap_Dlg_FileOpenSaveAs.h"
00052 #include "ie_types.h"
00053
00054 class UT_runDialog_AskForPathname
00055 {
00056 public:
00057
00058 struct Filetype
00059 {
00060 std::string m_desc;
00061 std::string m_ext;
00062 UT_sint32 m_number;
00063 Filetype( std::string desc, std::string ext, UT_sint32 number )
00064 : m_desc(desc), m_ext(ext), m_number(number)
00065 {
00066 }
00067 };
00068 typedef std::list< Filetype > FiletypeList_t;
00069
00070
00071 UT_runDialog_AskForPathname( XAP_Dialog_Id id,
00072 const std::string& suggestedName = "" );
00073
00074 int appendFiletype( const std::string desc,
00075 const std::string ext,
00076 UT_sint32 n = 0 );
00077 void setDefaultFiletype( const std::string desc,
00078 const std::string ext = "" );
00079 bool run( XAP_Frame * pFrame = 0 );
00080
00081 std::string getPath();
00082 IEFileType getType();
00083
00084
00085
00086 private:
00087 std::string m_pathname;
00088 IEFileType m_ieft;
00089 XAP_Dialog_Id m_dialogId;
00090 bool m_saveAs;
00091 std::string m_suggestedName;
00092 FiletypeList_t m_filetypes;
00093 UT_sint32 m_defaultFiletype;
00094
00095 std::string appendDefaultSuffixFunctor( std::string dialogFilename, UT_sint32 n );
00096
00097 };
00098
00099
00100 #endif