/*
-----------------------------------------------------------------------------
This source file is part of OpenSpace3D
For the latest info, see http://www.openspace3d.com

Copyright (c) 2011 I-maginer

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt
-----------------------------------------------------------------------------
*/

#ifndef _SCOL_EMBEDDED_WEB_NAVIGATOR_FIND_
#define _SCOL_EMBEDDED_WEB_NAVIGATOR_FIND_

#include "embeddedWebNavigatorPrerequisites.h"

/** \defgroup grpWebNavigatorFind Web navigator find reflexives functions
 *  Callbacks related to browser find results
 *  @{
 */
/** @} */

/** \ingroup grpWebNavigatorFind
 * \brief WebNavigatorCbOnFindResult : Called to report find results returned by CefBrowser::Find().
 * |identifer| is the identifier passed to 'Find' function, |count| is the number of matches currently identified,
 * |selectionRect| is the location of where the match was found (in window coordinates), |activeMatchOrdinal| 
 * is the current position in the search results, and |finalUpdate| is true if this is the last find notification.
 *
 * <b>Prototype:</b> TODO OBJWEBNAVIGATORSCOL
 * \param OBJWEBNAVIGATORSCOL : The object on which we want to catch the event
 * \param fun [OBJWEBNAVIGATORSCOL u0 I I [I I I I] I I] u1 : Scol function to call
 * \param u0 : Optionnal user parameter
 * \param I : the identifier passed to 'Find' function
 * \param I : the number of matches currently identified
 * \param [I I I I] : the location of where the match was found
 * \param I : the current position in the search results
 * \param I : '1' if this is the last find notification, '0' if there's more responses after this position.
 *
 * \return OBJWEBNAVIGATORSCOL : Web navigator object if success
 */
int WebNavigatorCbOnFindResult(mmachine m);

/**
 * Execute the WEB_NAVIGATOR_FIND_ON_RESULT_CB reflexive function
 * \param m : Current machine
 * \param hwnd : Main scol window
 * \param msg : Window message
 * \param wParam : WebNavigator pointer
 * \param lParam : data pointer
 * \param ret : user parameter
 */
int FireWebNavigatorReflexiveOnFindResult(mmachine m, ScolWindowHandle hwnd, unsigned int msg, UINT wParam, LONG lParam, int* ret);

// Everything inside _cond and _endcond is ignored by doxygen
//! \cond

/**
 * \brief Load the WebNavigatorFind package in Scol virtual machine
 * \param mmachine : the scol machine
 */
int LoadWebNavigatorFind(mmachine m);

//! \endcond

#endif
