libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
GtkCRN::Document Class Reference

Displays a crn::Document. More...

#include <GtkCRNDocument.h>

+ Inheritance diagram for GtkCRN::Document:
+ Collaboration diagram for GtkCRN::Document:

Public Member Functions

 Document (bool show_views=true, bool show_tree=true)
 Constructor. More...
 
virtual ~Document () override
 Destructor. More...
 
void set_document (const crn::SDocument &doc)
 Sets the document to display. More...
 
const crn::SDocument & get_document ()
 Gets the displayed document. More...
 
crn::SCDocument get_document () const
 Gets the displayed document. More...
 
std::vector< crn::Stringget_selected_views_ids ()
 Gets the selected views' ids. More...
 
crn::String get_selected_view_id ()
 Gets the displayed views's id. More...
 
void set_selected_view (const crn::String &view_id)
 Sets the one selected view. More...
 
void set_show_thumbnails (bool s)
 Shall the views show a thumbnail. More...
 
void set_show_labels (bool s)
 Shall the views show a label. More...
 
void set_show_indexes (bool s)
 Shall the views show their index. More...
 
void select_even ()
 Selects even views. More...
 
void select_odd ()
 Selects odd views. More...
 
void select_all ()
 Selects all views. More...
 
void deselect_all ()
 Selects all views. More...
 
void invert_selection ()
 Inverts the view selection. More...
 
void delete_selection ()
 Removes all selected views from the document. More...
 
void append_views_dialog ()
 
void append_views (const std::vector< crn::Path > &filenames)
 Appends new views at the end of the document. More...
 
void refresh_views ()
 Redraws the view list. More...
 
void select_first ()
 If selection size is <= 1, then select the first view, else move last_selected to the first selected element. More...
 
void select_previous ()
 If selection size is 0, the select the first element, if selection size is 1, then select the previous view, else move last_selected to the previous selected element. More...
 
void select_next ()
 If selection size is 0, the select the first element, if selection size is 1, then select the next view, else move last_selected to the next selected element. More...
 
void select_last ()
 If selection size is <= 1, then select the last view, else move last_selected to the last selected element. More...
 
void set_default_drop_in (bool b)
 Shall we use the default handler for dropped elements? (true by default). More...
 
sigc::signal< void, int,
crn::StringUTF8
signal_droppedin ()
 Signals when something was dropped from another application. Connect to void on_droppedin(int position, crn::StringUTF8 data). More...
 
sigc::signal< void, const
crn::String, const std::vector
< crn::String > > 
signal_view_selection_changed ()
 Signal when the selection has changed. Connect to void on_view_selection_changed(const crn::String last_selected_view_id, const std::vector<crn::String> selected_views_ids). More...
 
sigc::signal< bool, const
std::vector< crn::String > > 
signal_delete_selection ()
 Signal when the selection is about to be deleted. Connect to bool on_delete_selection(const std::vector<crn::String> selected_views_ids) that will return true to allow the deletion, false to prevent it. More...
 
Glib::RefPtr< Gtk::ActionGroup > & get_views_actions ()
 Gets the action group associated to views management. More...
 
const crn::SBlock & get_selected_block ()
 Gets the displayed block. More...
 
crn::SCBlock get_selected_block () const
 Gets the displayed block. More...
 
void set_show_subblocks (bool s)
 Shows or hides subblocks tree. More...
 
bool get_show_subblocks () const
 Is subblocks tree shown? More...
 
void set_show_subblocks_toolbar (bool s)
 Shows or hides subblocks toolbar. More...
 
bool get_show_subblocks_toolbar () const
 Is subblocks toolbar shown? More...
 
Glib::RefPtr< Gtk::ActionGroup > & get_subblock_actions ()
 Gets the action group associated to subblock management. More...
 
GtkCRN::Imageget_image ()
 Gets the image widget. More...
 
const GtkCRN::Imageget_image () const
 Gets the image widget. More...
 
void reload_image (const crn::String &view_id)
 Refreshes the thumbnail of a view and the Image if needed. More...
 
void thread_safe_reload_image (const crn::String &view_id)
 Refreshes the thumbnail of a view and the Image if needed (thread safe) More...
 
void set_selection_colors (const crn::pixel::RGB8 &col1, const crn::pixel::RGB8 &col2)
 Sets the colors of the user selection on the image. More...
 
void set_subblocks_colors (const crn::pixel::RGB8 &col1, const crn::pixel::RGB8 &col2, const crn::pixel::RGB8 &textcol)
 Sets the colors of the subblocks on the image. More...
 
void set_show_subblock_labels (bool s)
 Shows or hides subblocks labels on the image. More...
 
bool get_show_subblock_labels () const
 Are subblocks labels shown on the image? More...
 
Gtk::Box & get_left_panel ()
 Return the VBox on the left of the image. More...
 
Gtk::Box & get_right_panel ()
 

Detailed Description

Displays a crn::Document.

Definition at line 36 of file GtkCRNDocument.h.

Constructor & Destructor Documentation

Document::Document ( bool  show_views = true,
bool  show_tree = true 
)

Constructor.

Constructor

Parameters
[in]show_viewsshall the view list be displayed?
[in]show_treeshall the subblock tree be displayed?

Definition at line 47 of file GtkCRNDocument.cpp.

Document::~Document ( )
overridevirtual

Destructor.

Destructor

Definition at line 231 of file GtkCRNDocument.cpp.

Member Function Documentation

void Document::append_views ( const std::vector< crn::Path > &  filenames)

Appends new views at the end of the document.

Definition at line 584 of file GtkCRNDocument.cpp.

void Document::append_views_dialog ( )

Definition at line 595 of file GtkCRNDocument.cpp.

void Document::delete_selection ( )

Removes all selected views from the document.

Definition at line 552 of file GtkCRNDocument.cpp.

void Document::deselect_all ( )

Selects all views.

Definition at line 652 of file GtkCRNDocument.cpp.

const crn::SDocument& GtkCRN::Document::get_document ( )
inline

Gets the displayed document.

Definition at line 55 of file GtkCRNDocument.h.

crn::SCDocument GtkCRN::Document::get_document ( ) const
inline

Gets the displayed document.

Definition at line 57 of file GtkCRNDocument.h.

GtkCRN::Image& GtkCRN::Document::get_image ( )
inline

Gets the image widget.

Definition at line 208 of file GtkCRNDocument.h.

const GtkCRN::Image& GtkCRN::Document::get_image ( ) const
inline

Gets the image widget.

Definition at line 210 of file GtkCRNDocument.h.

Gtk::Box& GtkCRN::Document::get_left_panel ( )
inline

Return the VBox on the left of the image.

<Return the VBox on the right of the image

Definition at line 230 of file GtkCRNDocument.h.

Gtk::Box& GtkCRN::Document::get_right_panel ( )
inline

Definition at line 232 of file GtkCRNDocument.h.

const crn::SBlock& GtkCRN::Document::get_selected_block ( )
inline

Gets the displayed block.

Definition at line 169 of file GtkCRNDocument.h.

crn::SCBlock GtkCRN::Document::get_selected_block ( ) const
inline

Gets the displayed block.

Definition at line 171 of file GtkCRNDocument.h.

crn::String Document::get_selected_view_id ( )

Gets the displayed views's id.

Definition at line 408 of file GtkCRNDocument.cpp.

std::vector< crn::String > Document::get_selected_views_ids ( )

Gets the selected views' ids.

Definition at line 396 of file GtkCRNDocument.cpp.

bool GtkCRN::Document::get_show_subblock_labels ( ) const
inline

Are subblocks labels shown on the image?

Definition at line 224 of file GtkCRNDocument.h.

bool GtkCRN::Document::get_show_subblocks ( ) const
inline

Is subblocks tree shown?

Definition at line 176 of file GtkCRNDocument.h.

bool GtkCRN::Document::get_show_subblocks_toolbar ( ) const
inline

Is subblocks toolbar shown?

Definition at line 180 of file GtkCRNDocument.h.

Glib::RefPtr<Gtk::ActionGroup>& GtkCRN::Document::get_subblock_actions ( )
inline

Gets the action group associated to subblock management.

Gets the action group associated to subblock management. Valid names are:

  • document-blocks-add
  • document-blocks-remove
  • document-blocks-show
  • document-blocks-configure

Definition at line 201 of file GtkCRNDocument.h.

Glib::RefPtr<Gtk::ActionGroup>& GtkCRN::Document::get_views_actions ( )
inline

Gets the action group associated to views management.

Gets the action group associated to views management. Valid names are:

  • document-views-menu
  • document-views-add
  • document-views-refresh
  • document-views-select-first
  • document-views-select-previous
  • document-views-select-next
  • document-views-select-last
  • document-views-select-all
  • document-views-select-none
  • document-views-select-even
  • document-views-select-odd
  • document-views-invert-selection
  • document-views-remove
  • document-views-export-pdf

Definition at line 162 of file GtkCRNDocument.h.

void Document::invert_selection ( )

Inverts the view selection.

Definition at line 657 of file GtkCRNDocument.cpp.

void Document::refresh_views ( )

Redraws the view list.

Redraws the view list

Definition at line 341 of file GtkCRNDocument.cpp.

void Document::reload_image ( const crn::String view_id)

Refreshes the thumbnail of a view and the Image if needed.

Definition at line 1044 of file GtkCRNDocument.cpp.

void Document::select_all ( )

Selects all views.

Definition at line 647 of file GtkCRNDocument.cpp.

void Document::select_even ( )

Selects even views.

Definition at line 637 of file GtkCRNDocument.cpp.

void Document::select_first ( )

If selection size is <= 1, then select the first view, else move last_selected to the first selected element.

Definition at line 662 of file GtkCRNDocument.cpp.

void Document::select_last ( )

If selection size is <= 1, then select the last view, else move last_selected to the last selected element.

Definition at line 677 of file GtkCRNDocument.cpp.

void Document::select_next ( )

If selection size is 0, the select the first element, if selection size is 1, then select the next view, else move last_selected to the next selected element.

Definition at line 672 of file GtkCRNDocument.cpp.

void Document::select_odd ( )

Selects odd views.

Definition at line 642 of file GtkCRNDocument.cpp.

void Document::select_previous ( )

If selection size is 0, the select the first element, if selection size is 1, then select the previous view, else move last_selected to the previous selected element.

Definition at line 667 of file GtkCRNDocument.cpp.

void GtkCRN::Document::set_default_drop_in ( bool  b)
inline

Shall we use the default handler for dropped elements? (true by default).

Shall we use the default handler for dropped elements? (true by default). The default handler tries to insert files in the document. Set to false and connect a slot to signal_droppedin() if you want to handle dropped elements by yourself.

Parameters
[in]btrue to use the default handler, false to disable the default handler

Definition at line 113 of file GtkCRNDocument.h.

void Document::set_document ( const crn::SDocument &  doc)

Sets the document to display.

Sets the document to display

Parameters
[in]docthe document to display

Definition at line 247 of file GtkCRNDocument.cpp.

void Document::set_selected_view ( const crn::String view_id)

Sets the one selected view.

Sets the one selected view

Exceptions
crn::ExceptionNotFoundid not found
Glib::OptionErrorview not shown in the list (the crn::Document object is not consistent with the GtkCRN::Document object!)

Definition at line 422 of file GtkCRNDocument.cpp.

void Document::set_selection_colors ( const crn::pixel::RGB8 col1,
const crn::pixel::RGB8 col2 
)

Sets the colors of the user selection on the image.

Definition at line 1114 of file GtkCRNDocument.cpp.

void Document::set_show_indexes ( bool  s)

Shall the views show their index.

Definition at line 532 of file GtkCRNDocument.cpp.

void Document::set_show_labels ( bool  s)

Shall the views show a label.

Definition at line 523 of file GtkCRNDocument.cpp.

void Document::set_show_subblock_labels ( bool  s)

Shows or hides subblocks labels on the image.

Definition at line 1132 of file GtkCRNDocument.cpp.

void GtkCRN::Document::set_show_subblocks ( bool  s)
inline

Shows or hides subblocks tree.

Definition at line 174 of file GtkCRNDocument.h.

void GtkCRN::Document::set_show_subblocks_toolbar ( bool  s)
inline

Shows or hides subblocks toolbar.

Definition at line 178 of file GtkCRNDocument.h.

void Document::set_show_thumbnails ( bool  s)

Shall the views show a thumbnail.

Definition at line 514 of file GtkCRNDocument.cpp.

void Document::set_subblocks_colors ( const crn::pixel::RGB8 col1,
const crn::pixel::RGB8 col2,
const crn::pixel::RGB8 textcol 
)

Sets the colors of the subblocks on the image.

Definition at line 1122 of file GtkCRNDocument.cpp.

sigc::signal<bool, const std::vector<crn::String> > GtkCRN::Document::signal_delete_selection ( )
inline

Signal when the selection is about to be deleted. Connect to bool on_delete_selection(const std::vector<crn::String> selected_views_ids) that will return true to allow the deletion, false to prevent it.

Definition at line 121 of file GtkCRNDocument.h.

sigc::signal<void, int, crn::StringUTF8> GtkCRN::Document::signal_droppedin ( )
inline

Signals when something was dropped from another application. Connect to void on_droppedin(int position, crn::StringUTF8 data).

Definition at line 115 of file GtkCRNDocument.h.

sigc::signal<void, const crn::String, const std::vector<crn::String> > GtkCRN::Document::signal_view_selection_changed ( )
inline

Signal when the selection has changed. Connect to void on_view_selection_changed(const crn::String last_selected_view_id, const std::vector<crn::String> selected_views_ids).

Definition at line 118 of file GtkCRNDocument.h.

void Document::thread_safe_reload_image ( const crn::String view_id)

Refreshes the thumbnail of a view and the Image if needed (thread safe)

Definition at line 1070 of file GtkCRNDocument.cpp.


The documentation for this class was generated from the following files: