<?php
/*
 * $RCSfile: GallerySearchInterface_1_0.class,v $
 *
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2005 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */
/**
 * @version $Revision: 1.10 $ $Date: 2005/08/23 03:49:53 $
 * @package Search
 * @author Bharat Mediratta <bharat@menalto.com>
 */

/**
 * This is an interface for the search module.  Modules that wish to work
 * with the Search module must provide a class that implements this interface.
 *
 * @package Search
 * @subpackage Classes
 * @abstract
 */
class GallerySearchInterface_1_0 {

    /**
     * Return the name, description and searchable options of this searchable subsystem
     *
     * @return array array(object GalleryStatus a status code,
     *                     array('name' => '...',
     *                           'description' => '...',
     *                           'options' => array('option_key_1' =>
     *                                                  array('description' => 'Option 1',
     *                                                        'enabled' => 1),
     *                                              'option_key_2' =>
     *                                                  array('description' => 'Option 2',
     *                                                        'enabled' => 0),
     *                                              'option_key_3' =>
     *                                                  array('description' => 'Option 3',
     *                                                        'enabled' => 1))))
     */
    function getSearchModuleInfo() {
	return array(GalleryStatus::error(ERROR_UNIMPLEMENTED, __FILE__, __LINE__),
		     null);
    }

    /**
     * Search the module for the given criteria with the given options
     *
     * @param array array('option_key_1', 'option_key_3')
     * @param string search criteria
     * @param int which hit to start with
     * @param int how many hits to show
     * @return array(object GalleryStatus a status code,
     *               array('start' => 1..#,
     *                     'end' => 1..#,
     *                     'count' => #,
     *                     'results' => array(itemId => id,
     *                                        array(array('key' => 'localized title',
     *                                                    'value' => 'localized text'),
     *                                              array('key' => 'localized title',
     *                                                    'value' => 'localized text'),
     *                                              array('key' => 'localized title',
     *                                                    'value' => 'localized text')))))
     */
    function search($options, $criteria, $offset=0, $count=-1) {
	return array(GalleryStatus::error(ERROR_UNIMPLEMENTED, __FILE__, __LINE__),
		     null);
    }
}
?>
