openldev/openldev-widgets/openldev-file-manager.h File Reference

FileManager. More...

#include "openldev-file-tab.h"
#include "../openldev-utils.h"
#include "../openldev-settings/openldev-settings.h"
#include <glib.h>
#include <glib-object.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourcebuffer.h>
#include <gtksourceview/gtksourcelanguagesmanager.h>
#include <vector>

Data Structures

struct  FileManager
 GtkNotebook that holds a FileTab for each open file. More...

Functions

GtkSourceView * file_manager_get_current_view (FileManager *manager)
GtkSourceBuffer * file_manager_get_current_buffer (FileManager *manager)
string file_manager_get_current_filename (FileManager *manager)
string file_manager_get_current_filename_short (FileManager *manager)
int file_manager_get_current_tab (FileManager *manager)
int file_manager_get_insert_offset (FileManager *manager)
int file_manager_get_selection_offset (FileManager *manager)
gboolean file_manager_get_file_open (FileManager *manager)
void file_manager_set_filename (FileManager *manager, const char *file)
void file_manager_set_properties (FileManager *manager, gboolean all_files, EnvironmentSettings *env)
gboolean file_manager_add_tab (FileManager *manager, const char *file, EnvironmentSettings *env)
void file_manager_erase_all_tabs (FileManager *manager)
void file_manager_mark_current_tab_modified (FileManager *manager, gboolean modified, int tab)
void file_manager_scroll_to_mark (FileManager *manager)
void file_manager_modify_fonts (FileManager *manager, PangoFontDescription *fd)
void file_manager_revert_to_saved (FileManager *manager)
PangoTabArray * file_manager_get_tab_array (PangoFontDescription *fd, EnvironmentSettings *env, GtkWidget *widget)


Detailed Description


Function Documentation

gboolean file_manager_add_tab FileManager manager,
const char *  file,
EnvironmentSettings env
 

Open a new file tab for the specified file. Editor settings from the EnvironmentSettings object provided will be used. This function does not actually open the file, but just created a new tab with the proper settings. Use openldev_open_file to open a new file.

Parameters:
manager A FileManager widget object.
file The full path of the file that was opened.
env EnvironmentSettings object to retrieve the settings from.

void file_manager_erase_all_tabs FileManager manager  ) 
 

Close all of the tabs that are currently open. This does not check whether files are modified, so you must do that manually. It is just meant to immediately wipe out all open files.

Parameters:
manager A FileManager widget object.

GtkSourceBuffer* file_manager_get_current_buffer FileManager manager  ) 
 

Get the currently shown GtkSourceBuffer if there is a file open. Otherwise a blank GtkSourceBuffer widget will be returned.

Parameters:
manager A FileManager widget object.
Returns:
The GtkSourceBuffer from the current GtkTextView.

string file_manager_get_current_filename FileManager manager  ) 
 

Get the full file name of the currently selected file if there is a file open.

Parameters:
manager A FileManager widget object.
Returns:
The full file name of the currently selected file.

string file_manager_get_current_filename_short FileManager manager  ) 
 

Get the short file name of the currently selected file if there is a file open.

Parameters:
manager A FileManager widget object.
Returns:
The short file name of the currently selected file.

int file_manager_get_current_tab FileManager manager  ) 
 

Get the position of the currently selected tab.

Parameters:
manager A FileManager widget object.
Returns:
Position of the currently selected tab.

GtkSourceView* file_manager_get_current_view FileManager manager  ) 
 

Get the currently shown GtkTextView if there is a file open. Otherwise a blank GtkTextView widget will be returned.

Parameters:
manager A FileManager widget object.
Returns:
The current GtkSourceView widget.

gboolean file_manager_get_file_open FileManager manager  ) 
 

Check whether there is currently a file open in the FileManager. This should be called before trying to retrieve information about a current file. The FileManager will assume this has already been checked whe you ask for information!

Parameters:
manager A FileManager widget object.
Returns:
TRUE if one or more files are currently open.

int file_manager_get_insert_offset FileManager manager  ) 
 

Get the offset in characters of the "insert" GtkTextIter in the current file.

Parameters:
manager A FileManager widget object.
Returns:
Offset of the "insert" GtkTextIter.

int file_manager_get_selection_offset FileManager manager  ) 
 

Get the offset in characters of the "selection_bound" GtkTextIter in the current file.

Parameters:
manager A FileManager widget object.
Returns:
Offset of the "selection_bound" GtkTextIter.

PangoTabArray* file_manager_get_tab_array PangoFontDescription *  fd,
EnvironmentSettings env,
GtkWidget *  widget
 

Create a new PangoTabArray for the widget. This is used internally and really is not necessary for plugins.

Parameters:
fd PangoFontDescription to use for the calculations.
env EnvironmentSettings structure that provides tab settings.
widget GtkTextView widget that the tab array should be taken from.
Returns:
PangoTabArray calculated from the parameters.

void file_manager_mark_current_tab_modified FileManager manager,
gboolean  modified,
int  tab
 

Mark a specified tab as modified or unmodified. This is done automatically by OpenLDev, so you should have no need to call this function.

Parameters:
manager A FileManager widget object.
modified TRUE if the tab should be marked as modified.
tab Position of the tab to be marked.

void file_manager_modify_fonts FileManager manager,
PangoFontDescription *  fd
 

Change the font of every open tab. This is used when you do not want to update all of the available settings.

Parameters:
manager A FileManager widget object.
fd PangoFontDescription that will be set for each file.

void file_manager_revert_to_saved FileManager manager  ) 
 

Revert to the saved version of the file that is currently in focus. This function assumes that you have already asked the user if they want to do this. You should use openldev_menu_file_revert if you want to ask the user for permission before proceding.

Parameters:
manager A FileManager widget object.

void file_manager_scroll_to_mark FileManager manager  ) 
 

Scroll the the current position of the cursor. This is done to the file that is currently in focus.

Parameters:
manager A FileManager widget object.

void file_manager_set_filename FileManager manager,
const char *  file
 

Set a new file name for the current file. For example, this would be used if you are renaming a certain file.

Parameters:
manager A FileManager widget object.
file New full file name to rename the current file to.

void file_manager_set_properties FileManager manager,
gboolean  all_files,
EnvironmentSettings env
 

Reset the editor properties of one or more open tabs. This includes syntax highlighting, tab size and other settings from EnvironmentSettings.

Parameters:
manager A FileManager widget object.
all_files FALSE if only the current tab should be updated or TRUE to update all open files.
env EnvironmentSettings object to retrieve the settings from.


Generated on Sun May 14 14:57:41 2006 for OpenLDev by  doxygen 1.4.6