C# Class Tomboy.ExportAllApplicationAddin

An abstract class which handles all the details of "export all", to be subclassed with a method that defines what to do with a single note.
Inheritance: Tomboy.ApplicationAddin
Mostrar archivo Open project: GNOME/tomboy

Protected Properties

Property Type Description
export_file_suffix string
export_type_pretty_name string

Public Methods

Method Description
ExportNotesInList ( List note_list, string output_folder ) : void

Exports the specified list of notes to *** files in the given folder, excludes template notes.

ExportSingleNote ( Note note, string output_folder ) : void

Exports a single Note to the chosen format and saves it in the specified folder. To be implemented in a subclass where the subclass implementation takes care of conversion and saving. The folder which the note is to be saved to. For an all notes export the top level folder is chosen by the user and sublevel folders are automatically created for each notebook and passed to this method.

Initialize ( ) : void

Called when Tomboy has started up and is nearly 100% initialized.

ListUnfiledNotes ( ) : List

Finds all notes without a notebook tag and returns them in a list.

ResolveRelativePath ( Note note_from, string title_to ) : string

Determines the relative path between two exported files, can optionally be used by the subclass.

SanitizeNoteTitle ( string note_title ) : string

Removes elements from the note title that might be problematic in a file name.

Shutdown ( ) : void

Called just before Tomboy shuts down for good.

Protected Methods

Method Description
ExportAllButtonClicked ( object sender, EventArgs args ) : void
ExportAllNotesViaGUI ( ) : void

Called when the user chooses "Export All" from the menu, allows user to select destination via GUI.

ExportNotebookButtonClicked ( object sender, EventArgs args ) : void

Called when the user chooses "Export Notebook" (Even when "All Notes or "Unfiled Notes" are selected.)

ParseArgs ( object sender, EventArgs e ) : void

An event handler that parses add-in commandline args looking for commands relating to this class and executes them.

SetNames ( ) : void

Must be overridden in order to set names for internal menu use and file naming (export_file_suffix) and what the user sees (export_type_pretty_name).

Private Methods

Method Description
ExportAllNotes ( string output_folder ) : void

Exports all notes to a given folder.

SanitizePath ( string path ) : string

Makes sure a path doesn't have any illegal characters.

ShowErrorDialog ( string output_folder, ExportMultipleDialog dialog, string error_message ) : void

Shows an error dialog if things go wrong.

ShowSuccessDialog ( string output_folder ) : void

Shows a success dialog when export is complete

Method Details

ExportAllButtonClicked() protected method

protected ExportAllButtonClicked ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
return void

ExportAllNotesViaGUI() protected method

Called when the user chooses "Export All" from the menu, allows user to select destination via GUI.
protected ExportAllNotesViaGUI ( ) : void
return void

ExportNotebookButtonClicked() protected method

Called when the user chooses "Export Notebook" (Even when "All Notes or "Unfiled Notes" are selected.)
protected ExportNotebookButtonClicked ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
return void

ExportNotesInList() public method

Exports the specified list of notes to *** files in the given folder, excludes template notes.
public ExportNotesInList ( List note_list, string output_folder ) : void
note_list List
output_folder string
return void

ExportSingleNote() public abstract method

Exports a single Note to the chosen format and saves it in the specified folder. To be implemented in a subclass where the subclass implementation takes care of conversion and saving. The folder which the note is to be saved to. For an all notes export the top level folder is chosen by the user and sublevel folders are automatically created for each notebook and passed to this method.
public abstract ExportSingleNote ( Note note, string output_folder ) : void
note Note
output_folder string
return void

Initialize() public method

Called when Tomboy has started up and is nearly 100% initialized.
public Initialize ( ) : void
return void

ListUnfiledNotes() public method

Finds all notes without a notebook tag and returns them in a list.
public ListUnfiledNotes ( ) : List
return List

ParseArgs() protected method

An event handler that parses add-in commandline args looking for commands relating to this class and executes them.
protected ParseArgs ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

ResolveRelativePath() public method

Determines the relative path between two exported files, can optionally be used by the subclass.
public ResolveRelativePath ( Note note_from, string title_to ) : string
note_from Note
title_to string /// The title of the note we're finding the relative path to. ///
return string

SanitizeNoteTitle() public static method

Removes elements from the note title that might be problematic in a file name.
public static SanitizeNoteTitle ( string note_title ) : string
note_title string
return string

SetNames() protected abstract method

Must be overridden in order to set names for internal menu use and file naming (export_file_suffix) and what the user sees (export_type_pretty_name).
protected abstract SetNames ( ) : void
return void

Shutdown() public method

Called just before Tomboy shuts down for good.
public Shutdown ( ) : void
return void

Property Details

export_file_suffix protected_oe property

The filename suffix of the export type, e.g. "html" or "txt". Don't put a punctuation mark in front!
protected string export_file_suffix
return string

export_type_pretty_name protected_oe property

The full name to be used in the menu. Can include spaces, should use Catalog.GetString.
protected string export_type_pretty_name
return string