plugin.h

Go to the documentation of this file.
00001 /*  cssed (c) Iago Rubio 2003, 2005 - A tiny CSS editor.
00002  *
00003  *  This program is free software; you can redistribute it and/or modify
00004  *  it under the terms of the GNU General Public License as published by
00005  *  the Free Software Foundation; either version 2 of the License, or
00006  *  (at your option) any later version.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU Library General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016  * 
00017  *  - SPECIAL EXCEPTION -
00018  * 
00019  *  Linking cssed statically or dynamically with other modules is making a
00020  *  combined work based on cssed.  Thus, the terms and conditions of the GNU
00021  *  General Public License cover the whole combination.
00022  * 
00023  *  As a special exception, the copyright holders of cssed give you
00024  *  permission to link cssed with independent modules that communicate with
00025  *  cssed solely through this file's plugable interface, regardless of the
00026  *  license terms of these independent modules, and to copy and distribute the
00027  *  resulting combined work under terms of your choice, provided that
00028  *  every copy of the combined work is accompanied by a complete copy of
00029  *  the source code of cssed (the version of cssed used to produce the
00030  *  combined work), being distributed under the terms of the GNU General
00031  *  Public License plus this exception.  An independent module is a module
00032  *  which is not derived from or based on cssed.
00033  * 
00034  *  Note that people who make modified versions of cssed are NOT obligated
00035  *  to grant this special exception for their modified versions; it is
00036  *  their choice whether to do so.  The GNU General Public License gives
00037  *  permission to release a modified version without this exception; this
00038  *  exception also makes it possible to release a modified version which
00039  *  carries forward this exception.
00040  */
00041  
00050 typedef struct _CssedPluginPriv CssedPluginPriv;
00051 
00055 typedef struct _CssedPlugin CssedPlugin;
00056 
00065 gint
00066 cssed_plugin_get_position_at_line ( CssedPlugin* plugin, gint line );
00067 
00078 struct _CssedPlugin
00079 {
00081         gchar *name;            
00083         gchar *description;                                             
00085         gboolean (*load_plugin) (CssedPlugin*); 
00087         void (*clean_plugin) (CssedPlugin*);    
00089         gpointer user_data;     
00091         CssedPluginPriv* priv;
00092 };
00093 
00094 
00100 void 
00101 cssed_plugin_unload_callback( GtkWidget* widget, gpointer plugin );
00102 
00109 gboolean
00110 cssed_add_menu_item_to_plugins_menu( CssedPlugin* plugin, GtkWidget* menu_item);
00111 
00120 gboolean
00121 cssed_plugin_add_widget_to_toolbar( CssedPlugin* plugin, 
00122                                                          GtkWidget* widget,
00123                                                          const char *tooltip_text,
00124                                                          const char *tooltip_private_text );
00132 gboolean
00133 cssed_plugin_add_page_with_widget_to_footer( CssedPlugin* plugin,
00134                                                                                         GtkWidget* widget,
00135                                                                                         gchar* label_text );
00141 gboolean
00142 cssed_plugin_remove_page_with_widget_in_footer( CssedPlugin* plugin,
00143                                                                                         GtkWidget* widget );
00144 
00152 gboolean
00153 cssed_plugin_add_page_with_widget_to_sidebar( CssedPlugin* plugin,
00154                                                                                         GtkWidget* widget,
00155                                                                                         gchar* label_text );
00156 
00162 gboolean
00163 cssed_plugin_remove_page_with_widget_in_sidebar( CssedPlugin* plugin,
00164                                                                                         GtkWidget* widget );
00165 
00171 gboolean
00172 cssed_plugin_select_page_with_widget_in_sidebar( CssedPlugin* plugin,
00173                                                                                         GtkWidget* widget );
00174 
00180 gboolean
00181 cssed_plugin_select_page_with_widget_in_footer( CssedPlugin* plugin,
00182                                                                                         GtkWidget* widget );
00183 
00192 void
00193 cssed_plugin_error_message ( gchar* title, gchar* message, ...);
00194 
00205 gboolean
00206 cssed_plugin_confirm_dialog ( gchar* title, gchar* message, ... );
00207 
00213 void
00214 cssed_plugin_open_file( CssedPlugin* plugin, gchar* filename );
00215 
00220 void
00221 cssed_plugin_open_file_with_fileselector( CssedPlugin* plugin );
00222 
00229 void 
00230 cssed_plugin_add_text_to_document( CssedPlugin* plugin, gchar* text );
00231 
00238 gchar*
00239 cssed_plugin_get_text( CssedPlugin* plugin );
00240 
00249 void
00250 cssed_plugin_select_text_range( CssedPlugin* plugin, gint start, gint end );
00251 
00258 gchar*
00259 cssed_plugin_get_selected_text(  CssedPlugin* plugin  );
00260 
00265 void
00266 cssed_plugin_clear_selected_text( CssedPlugin* plugin );
00267 
00272 void
00273 cssed_plugin_undo_document_action ( CssedPlugin* plugin );
00274 
00279 void
00280 cssed_plugin_redo_document_action ( CssedPlugin* plugin );
00281 
00288 gboolean
00289 cssed_plugin_document_can_redo ( CssedPlugin* plugin );
00290 
00297 gboolean
00298 cssed_plugin_document_can_undo ( CssedPlugin* plugin );
00299 
00307 void
00308 cssed_plugin_search_prev( CssedPlugin* plugin, gchar* text_to_search );
00309 
00316 void
00317 cssed_plugin_search_next( CssedPlugin* plugin, gchar* text_to_search );
00318 
00320 
00325 void
00326 cssed_plugin_bookmark_next ( CssedPlugin* plugin );
00327 
00333 void
00334 cssed_plugin_bookmark_prev ( CssedPlugin* plugin );
00335 
00336 
00345  void
00346 cssed_plugin_set_bookmark_at_line  ( CssedPlugin* plugin, gboolean set, gint line );
00347 
00356 gboolean
00357 cssed_plugin_is_bookmark_set_at_line ( CssedPlugin* plugin, gint line );
00358 
00359 // for marker 1 arrow (validator arrow)
00365 gboolean
00366 cssed_plugin_marker_next ( CssedPlugin* plugin );
00372 gboolean
00373 cssed_plugin_marker_prev ( CssedPlugin* plugin );
00374 
00381 void
00382 cssed_plugin_set_marker_at_line  ( CssedPlugin* plugin, gboolean set, gint line );
00383 
00390 gboolean
00391 cssed_plugin_is_marker_set_at_line ( CssedPlugin* plugin, gint line );
00392 
00400 void
00401 cssed_plugin_output_write ( CssedPlugin* plugin, gchar *markup, ... );
00402 
00407 void
00408 cssed_plugin_output_clear ( CssedPlugin* plugin );
00409 
00416 gint
00417 cssed_plugin_get_line_from_position ( CssedPlugin* plugin, gint pos );
00418 
00425 gint
00426 cssed_plugin_get_position_from_line ( CssedPlugin* plugin, gint line );
00427 
00433 gint
00434 cssed_plugin_get_current_position ( CssedPlugin* plugin );
00435 
00441 void
00442 cssed_plugin_set_current_position ( CssedPlugin* plugin, gint pos );
00443 
00449 void
00450 cssed_plugin_set_current_line ( CssedPlugin* plugin , gint line );
00451 
00457 gint
00458 cssed_plugin_get_current_line ( CssedPlugin* plugin );
00459 
00467 gint
00468 cssed_plugin_get_line_end_from_position ( CssedPlugin* plugin, gint pos);
00469 
00470 
00477 void
00478 cssed_plugin_cut ( CssedPlugin* plugin );
00479 
00486 void
00487 cssed_plugin_copy ( CssedPlugin* plugin );
00488 
00495 void
00496 cssed_plugin_paste ( CssedPlugin* plugin );
00497 
00504 gint
00505 cssed_plugin_get_selection_end ( CssedPlugin* plugin );
00506 
00513 gint
00514 cssed_plugin_get_selection_start ( CssedPlugin* plugin );
00515 
00522 void
00523 cssed_plugin_set_selection_start ( CssedPlugin* plugin, gint start);
00524 
00532 void
00533 cssed_plugin_set_selection_end ( CssedPlugin* plugin, gint end );
00534 
00542 void
00543 cssed_plugin_set_selection_range ( CssedPlugin* plugin, gint start, gint end );
00544 
00550 void
00551 cssed_plugin_replace_sel  ( CssedPlugin* plugin, gchar *text );
00552 
00557 void
00558 cssed_plugin_clear_sel ( CssedPlugin* plugin );
00559 
00565 gint
00566 cssed_plugin_get_length ( CssedPlugin* plugin );
00567 
00574 void
00575 cssed_plugin_show_user_list ( CssedPlugin* plugin, gchar* list );
00576 
00585 void
00586 cssed_plugin_show_autocompletion_list (CssedPlugin* plugin, gint len, gchar* list);
00587 
00593 void 
00594 cssed_plugin_autocompletion_cancel (CssedPlugin* plugin);
00595 
00601 gboolean
00602 cssed_plugin_is_autocompletion_active (CssedPlugin* plugin);
00603 
00610 void 
00611 cssed_plugin_autocompletion_select (CssedPlugin* plugin, gchar* select);
00612 
00619 void
00620 cssed_plugin_show_calltip ( CssedPlugin* plugin, gint start, gchar* definition );
00621 
00626 void
00627 cssed_plugin_cancel_calltip ( CssedPlugin* plugin );
00628 
00633 gboolean
00634 cssed_plugin_calltipactive ( CssedPlugin* plugin );
00635 
00640 gint
00641 cssed_plugin_calltiposstart ( CssedPlugin* plugin );
00642 
00643 //
00644 void
00645 cssed_plugin_document_grab_focus ( CssedPlugin* plugin );
00646 // line related
00647 gchar*
00648 cssed_plugin_get_text_line (CssedPlugin* plugin, gint line);
00649 gint
00650 cssed_plugin_get_line_length (CssedPlugin* plugin, gint line);
00651 gint
00652 cssed_plugin_get_line_count (CssedPlugin* plugin);
00653 // folding
00654 void
00655 cssed_plugin_toggle_fold_at_line (CssedPlugin* plugin, gint line);
00656 gboolean
00657 cssed_plugin_get_line_is_visible (CssedPlugin* plugin, gint line);
00658 void
00659 cssed_plugin_ensure_line_is_visible (CssedPlugin* plugin, gint line);
00660 gint
00661 cssed_plugin_get_fold_level (CssedPlugin* plugin, gint line);
00662 gint
00663 cssed_plugin_get_fold_depth (CssedPlugin* plugin, gint line);
00664 void
00665 cssed_plugin_set_folding_margin_visible (CssedPlugin* plugin, gboolean set);
00666 gboolean
00667 cssed_plugin_get_folding_margin_visible (CssedPlugin* plugin);
00668 gboolean
00669 cssed_plugin_get_folding_enabled (CssedPlugin* plugin);
00670 void
00671 cssed_plugin_fold_all (CssedPlugin* plugin);
00672 void
00673 cssed_plugin_unfold_all (CssedPlugin* plugin);
00674 // validator arrow marker
00675 void
00676 cssed_plugin_set_arrow_marker_at_line (CssedPlugin* plugin, gint line);
00677 void
00678 cssed_plugin_clear_arrow_marker (CssedPlugin* plugin);
00679 // zooming
00680 void
00681 cssed_plugin_zoom_in (CssedPlugin* plugin);
00682 void
00683 cssed_plugin_zoom_out (CssedPlugin* plugin);
00684 void
00685 cssed_plugin_zoom_off (CssedPlugin* plugin);
00686 //
00687 gboolean
00688 cssed_plugin_get_modified (CssedPlugin* plugin);
00689 gboolean
00690 cssed_plugin_is_file_opened (CssedPlugin* plugin, gchar* filename);
00691 gboolean
00692 cssed_plugin_save_document (CssedPlugin* plugin);
00693 gboolean
00694 cssed_plugin_save_document_as (CssedPlugin* plugin, gchar* filename);
00695 gint
00696 cssed_plugin_get_document_index (CssedPlugin* plugin);
00697 void
00698 cssed_plugin_set_document_by_index (CssedPlugin* plugin, gint index);
00699 gint
00700 cssed_plugin_get_num_docs (CssedPlugin* plugin);
00701 gboolean
00702 cssed_plugin_new_document (CssedPlugin* plugin);
00703 gchar*
00704 cssed_plugin_document_get_filename (CssedPlugin* plugin);
00705 gint
00706 cssed_plugin_get_style_at (CssedPlugin* plugin, gint pos);
00707 gchar*
00708 cssed_plugin_prompt_for_file_to_open (CssedPlugin* plugin, gchar* dialog_title, gchar* basedir);
00709 gchar*
00710 cssed_plugin_prompt_for_file_to_save (CssedPlugin* plugin, gchar* dialog_title, gchar* basedir);
00711 gchar*
00712 cssed_plugin_prompt_for_directory_to_open (CssedPlugin* plugin, gchar* dialog_title, gchar* basedir);
00713 gchar*
00714 cssed_plugin_prompt_for_directory_to_create (CssedPlugin* plugin, gchar* dialog_title, gchar* basedir);
00716 
00723 void 
00724 cssed_plugin_css_dialog_insert (CssedPlugin* plugin, gchar* key, gpointer klass);
00725         
00732 void 
00733 cssed_plugin_css_dialog_remove_by_keyword( CssedPlugin* plugin, gchar* key );
00734 
00742 gpointer 
00743 cssed_plugin_css_dialog_lookup_by_keyword( CssedPlugin* plugin, gchar* key );
00744 
00751 gboolean 
00752 cssed_plugin_css_dialog_keyword_in_use( CssedPlugin* plugin, gchar* key );
00753 
00761 gpointer
00762 cssed_plugin_get_window( CssedPlugin* plugin );
00763 
00764 /* ******************************************************************* */
00765 gint
00766 cssed_plugin_get_filetype_id (CssedPlugin* plugin);
00767 void
00768 cssed_plugin_set_filetype_by_id (CssedPlugin* plugin, gint id);
00769 
00770 gint
00771 cssed_plugin_get_eol_mode (CssedPlugin* plugin);
00772 void
00773 cssed_plugin_set_eol_mode (CssedPlugin* plugin, gint eol_mode);
00774 void 
00775 cssed_plugin_convert_eols (CssedPlugin* plugin, gint eolmode);
00776 
00777 gint
00778 cssed_plugin_get_codepage (CssedPlugin* plugin);
00779 void
00780 cssed_plugin_set_codepage (CssedPlugin* plugin, gint codepage);
00781 
00782 
00783 /* ******************************************************************* */
00784 gboolean
00785 cssed_plugin_get_line_endings_visible (CssedPlugin* plugin);
00786 void
00787 cssed_plugin_set_line_endings_visible (CssedPlugin* plugin, gboolean visible);
00788 gboolean
00789 cssed_plugin_get_lines_wrapped (CssedPlugin* plugin);
00790 void
00791 cssed_plugin_set_lines_wrapped (CssedPlugin* plugin, gboolean wrapped);
00792 gboolean
00793 cssed_plugin_get_white_spaces_visible (CssedPlugin* plugin);
00794 void
00795 cssed_plugin_set_white_spaces_visible (CssedPlugin* plugin, gboolean visible);
00796 
00797 
00798 GtkWidget* 
00799 cssed_plugin_get_pop_menu (CssedPlugin* plugin);
00800 
00810 gpointer 
00811 cssed_plugin_send_scintilla_message (CssedPlugin* plugin, guint iMessage, gulong wParam, glong lParam);

Back to Index

This documentation is © Iago Rubio Sanfiz, 2004