/***************************** LICENSE START ***********************************

 Copyright 2012 ECMWF and INPE. This software is distributed under the terms
 of the Apache License version 2.0. In applying this license, ECMWF does not
 waive the privileges and immunities granted to it by virtue of its status as
 an Intergovernmental Organization or submit itself to any jurisdiction.

 ***************************** LICENSE END *************************************/

#ifndef VIEWER_SRC_ABSTRACTTEXTEDITSEARCHINTERFACE_HPP_
#define VIEWER_SRC_ABSTRACTTEXTEDITSEARCHINTERFACE_HPP_

#include "StringMatchMode.h"
#include "MvQProperty.h"

#include <QColor>
#include <QTextDocument>
#include <QTextCursor>

class AbstractTextEditSearchInterface
{
public:
    AbstractTextEditSearchInterface();
    virtual ~AbstractTextEditSearchInterface() {}

    virtual bool findString(QString str, bool highlightAll, QTextDocument::FindFlags findFlags,
                            QTextCursor::MoveOperation move, int iteration, StringMatchMode::Mode matchMode) = 0;
    virtual void automaticSearchForKeywords(bool)                                                            = 0;
    virtual void refreshSearch()                                                                             = 0;
    virtual void clearHighlights()                                                                           = 0;
    virtual void disableHighlights()                                                                         = 0;
    virtual void enableHighlights()                                                                          = 0;
    virtual bool highlightsNeedSearch()                                                                      = 0;
    virtual void gotoLastLine()                                                                              = 0;

protected:
    static QColor highlightColour_;
    MvQProperty* vpPerformAutomaticSearch_;
    MvQProperty* vpAutomaticSearchMode_;
    MvQProperty* vpAutomaticSearchText_;
    MvQProperty* vpAutomaticSearchFrom_;
    MvQProperty* vpAutomaticSearchCase_;
};


#endif /* VIEWER_SRC_ABSTRACTTEXTEDITSEARCHINTERFACE_HPP_ */
