text::PluginDocImpl Class Reference

Implement all necessary interfaces for document object. If the interface is not supported, the impl can remove them from parent class list. More...

#include <document_impl.h>

Inheritance diagram for text::PluginDocImpl:
Inheritance graph
[legend]
Collaboration diagram for text::PluginDocImpl:
Collaboration graph
[legend]

Public Member Functions

 PluginDocImpl ()
 ~PluginDocImpl ()
TextModelget_model ()
void on_search_done (const std::vector< Range > &result, const SearchContext *sc)
 Handle search done event.

Data Fields

Signal< PluginDocImpl * > release_signal
 The release signal.

Detailed Description

Implement all necessary interfaces for document object. If the interface is not supported, the impl can remove them from parent class list.

Definition at line 70 of file plaintext/plugin_impl/document_impl.h.


Constructor & Destructor Documentation

text::PluginDocImpl::PluginDocImpl (  ) 

Definition at line 38 of file plaintext/plugin_impl/document_impl.cpp.

References IPluginDocSearch::abort_search, IPluginEventBroadcaster::add_event_receiver, utils::ObjectTable< T >::add_interface(), utils::Signal< A1, A2, A3, A4, A5 >::add_slot(), IPluginDocument::close, IPluginDocNavigator::compare_anchor_location, IPluginDocSearch::create_search_criteria, IPluginDocument::create_view, IPluginDocAttributes::get_attribute, IPluginDocNavigator::get_file_name_from_anchor, IPluginDocNavigator::get_file_position_from_anchor, IPluginDocNavigator::get_initial_anchor, IPluginDocNavigator::get_object_from_anchor, IPluginDocHyperlink::get_target_from_hyperlink, IPluginDocNavigator::get_text_from_range, IPluginDocNavigator::get_type_of_object, IPluginDocNavigator::get_words_from_range, IPluginDocNavigator::is_anchor_in_current_document, IPluginDocDictionary::is_dictionary, IPluginDocHyperlink::is_hyperlink, IPluginDocument::is_open, on_search_done(), IPluginDocument::open, _IPluginUnknown::query_interface, _IPluginUnknown::release, IPluginEventBroadcaster::remove_event_receiver, IPluginDocMarker::request_marker_trees, IPluginDocSearch::request_search_all, IPluginDocSearch::request_search_next, text::TextModel::search_done_signal, and IPluginDocAttributes::set_attribute.

00042 : controller(0)
00043 {
00044     // IPluginUnknown
00045     query_interface = query_interface_impl;
00046     release         = release_impl;
00047 
00048     // IPluginDocument
00049     open        = open_impl;
00050     is_open     = is_open_impl;
00051     close       = close_impl;
00052     create_view = create_view_impl;
00053 
00054     // IPluginDocNavigator
00055     get_initial_anchor      = get_initial_anchor_impl;
00056     get_object_from_anchor  = get_object_from_anchor_impl;
00057     get_type_of_object      = get_type_of_object_impl;
00058     get_words_from_range    = get_words_from_range_impl;
00059     get_text_from_range     = get_text_from_range_impl;
00060     is_anchor_in_current_document = is_anchor_in_current_document_impl;
00061     get_file_name_from_anchor = get_file_name_from_anchor_impl;
00062     get_file_position_from_anchor = get_file_position_from_anchor_impl;
00063     compare_anchor_location = compare_anchor_location_impl;
00064 
00065     // IPluginDocAttributes
00066     get_attribute = get_attribute_impl;
00067     set_attribute = set_attribute_impl;
00068 
00069     // IPluginEventBroadcaster
00070     add_event_receiver      = add_event_receiver_impl;
00071     remove_event_receiver   = remove_event_receiver_impl;
00072 
00073     // IPluginDocHyperlink
00074     is_hyperlink                = is_hyperlink_impl;
00075     get_target_from_hyperlink   = get_target_from_hyperlink_impl;
00076 
00077     // IPluginDocDictionary
00078     is_dictionary = is_dictionary_impl;
00079 
00080     // IPluginDocMarker
00081     // get_supported_marker_types  = get_supported_marker_types_impl;
00082     request_marker_trees    = request_marker_trees_impl;
00083 
00084     // IPluginDocSearch
00085     create_search_criteria  = create_search_criteria_impl;
00086     request_search_next     = request_search_next_impl;
00087     request_search_all      = request_search_all_impl;
00088     abort_search            = abort_search_impl;
00089 
00090     // Initialize interface and object table.
00091     g_instances_table.add_interface<IPluginUnknown>(this);
00092     g_instances_table.add_interface<IPluginDocument>(this);
00093     g_instances_table.add_interface<IPluginDocNavigator>(this);
00094     g_instances_table.add_interface<IPluginDocAttributes>(this);
00095     g_instances_table.add_interface<IPluginEventBroadcaster>(this);
00096     g_instances_table.add_interface<IPluginDocHyperlink>(this);
00097     g_instances_table.add_interface<IPluginDocDictionary>(this);
00098     g_instances_table.add_interface<IPluginDocSearch>(this);
00099 
00100     document.search_done_signal.add_slot(this,
00101         &PluginDocImpl::on_search_done);
00102 

Here is the call graph for this function:

text::PluginDocImpl::~PluginDocImpl (  ) 

Definition at line 110 of file plaintext/plugin_impl/document_impl.cpp.

00114 {


Member Function Documentation

TextModel& text::PluginDocImpl::get_model (  )  [inline]

Definition at line 85 of file plaintext/plugin_impl/document_impl.h.

00085 { return document; }

void text::PluginDocImpl::on_search_done ( const std::vector< Range > &  result,
const SearchContext sc 
)

Handle search done event.

Definition at line 534 of file plaintext/plugin_impl/document_impl.cpp.

Referenced by PluginDocImpl().

00539 {
00540     PluginCollectionImpl *coll_p = new PluginCollectionImpl();
00541     coll_p->create<RangeImpl *>();
00542     std::vector<RangeImpl *>& data = coll_p->take_data_ref<RangeImpl *>();
00543     
00544     for (unsigned int i=0; i<result.size(); i++)
00545     {
00546         data.push_back(new RangeImpl(result[i]));
00547     }
00548 
00549     PluginEventAttrs attrs;
00550     attrs.search_end.search_id = sc->search_id;

Here is the caller graph for this function:


Field Documentation

The release signal.

Definition at line 89 of file plaintext/plugin_impl/document_impl.h.


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208