plugin_doc_search.h

Go to the documentation of this file.
00001 /*
00002  * File Name: plugin_doc_search.h
00003  */
00004 
00005 /*
00006  * This file is part of uds-plugin-common.
00007  *
00008  * uds-plugin-common is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * uds-plugin-common is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
00025  */
00026 
00027 #ifndef PLUGIN_DOC_SEARCHER_H_
00028 #define PLUGIN_DOC_SEARCHER_H_
00029 
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 #include "plugin_type.h"
00036 #include "plugin_unknown.h"
00037 
00038 /**
00039  * @brief Universal Document Shell Document Search interafce. 
00040  * Through IPluginDocumentSearch, caller is able to do text search through 
00041  * in document. 
00042  */
00043 typedef struct 
00044 {
00045     /** 
00046      * @brief Create the search criteria object for next search.
00047      * @param thiz IPluginUnknown pointer of IPluginDocSearcher object.
00048      * @return Returns IPluginUnknown pointer of a search criteria object
00049      * if it can successfully create the object; otherwise returns NULL.
00050      */
00051     IPluginUnknown * (* create_search_criteria)( IPluginUnknown  *thiz );
00052 
00053     /**
00054      * @brief Send a request to search next/prev string according to the 
00055      * search criteria.
00056      * @param thiz IPluginUnknown pointer of document object.
00057      * @param criteria The IPluginUnknown pointer of document search criteria
00058      * object created by the document object.
00059      * @param from_anchor The start position anchor. The plugin searches from
00060      * this position if it's initialized by caller before the function is 
00061      * invoked. If this value is empty, plugin would search from the beginning
00062      * of the document. When this function returns successfully, the position
00063      * of cursor will be adjusted to the start anchor of first matched text.
00064      * @return The search status of executing this request.
00065      */
00066     PluginStatus (* request_search_next)( IPluginUnknown      *thiz,
00067                                           IPluginUnknown      *criteria,
00068                                           const UDSString     *from_anchor,
00069                                           const unsigned int  search_id );
00070 
00071     /**
00072      * @brief Send a request of searching the objective string in the whole
00073      * document. The plugin will return list of all matched anchors.
00074      * @param thiz IPluginUnknown pointer of document object.
00075      * @param criteria The IPluginUnknown pointer of Plugin document search
00076      * criteria object.
00077      * @return The search status of executing this request
00078      */
00079     PluginStatus (* request_search_all)( IPluginUnknown         *thiz,
00080                                          IPluginUnknown         *criteria,
00081                                          const unsigned int     search_id);
00082 
00083     /**
00084      * @brief Abort search request that is identified by search_id.
00085      * @param thiz IPluginUnknown pointer of document object.
00086      * @param search_id The search task id that has been sent.
00087      * @return This function returns PLUGIN_OK if plugin can abort the 
00088      * search task. It returns other values if something wrong with plugin.
00089      * The possible reason can be invalid search id.
00090      */
00091     PluginStatus (* abort_search)( IPluginUnknown               *thiz,
00092                                    const unsigned int           search_id);
00093 
00094 } IPluginDocSearch;
00095 
00096 #ifdef __cplusplus
00097 }
00098 #endif 
00099 
00100 #endif
00101 
Generated by  doxygen 1.6.2-20100208