2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-06-12 18:01:43 +02:00
|
|
|
#include <coreplugin/sidebar.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QFutureInterface>
|
|
|
|
|
#include <QFutureWatcher>
|
|
|
|
|
#include <QWidget>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-07-17 16:37:01 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QHelpSearchEngine;
|
2018-04-18 10:25:29 +02:00
|
|
|
class QHelpSearchQueryWidget;
|
2012-07-17 16:37:01 +02:00
|
|
|
class QHelpSearchResultWidget;
|
|
|
|
|
class QUrl;
|
|
|
|
|
QT_END_NAMESPACE
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2018-04-18 10:25:29 +02:00
|
|
|
namespace Utils { class ProgressIndicator; }
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Help {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-06-12 18:01:43 +02:00
|
|
|
class SearchSideBarItem : public Core::SideBarItem
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
SearchSideBarItem();
|
|
|
|
|
|
2018-05-07 15:08:20 +02:00
|
|
|
QList<QToolButton *> createToolBarWidgets() override;
|
2014-06-12 18:01:43 +02:00
|
|
|
|
|
|
|
|
signals:
|
2014-10-31 14:20:03 +01:00
|
|
|
void linkActivated(const QUrl &url, const QStringList &searchTerms, bool newPage);
|
2014-06-12 18:01:43 +02:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class SearchWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-03-23 18:11:43 +01:00
|
|
|
SearchWidget();
|
2018-05-07 15:08:20 +02:00
|
|
|
~SearchWidget() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
void zoomIn();
|
|
|
|
|
void zoomOut();
|
|
|
|
|
void resetZoom();
|
|
|
|
|
|
2014-10-22 15:53:20 +02:00
|
|
|
void reindexDocumentation();
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
signals:
|
2014-10-31 14:20:03 +01:00
|
|
|
void linkActivated(const QUrl &link, const QStringList &searchTerms, bool newPage);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-03-23 18:11:43 +01:00
|
|
|
protected:
|
2018-05-07 15:08:20 +02:00
|
|
|
void showEvent(QShowEvent *event) override;
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2016-06-28 23:07:19 +03:00
|
|
|
private:
|
2008-12-02 12:01:29 +01:00
|
|
|
void search() const;
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void searchingStarted();
|
|
|
|
|
void searchingFinished(int hits);
|
|
|
|
|
|
2010-03-23 18:11:43 +01:00
|
|
|
void indexingStarted();
|
|
|
|
|
void indexingFinished();
|
|
|
|
|
|
2018-05-07 15:08:20 +02:00
|
|
|
bool eventFilter(QObject* o, QEvent *e) override;
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *contextMenuEvent) override;
|
2014-10-31 14:20:03 +01:00
|
|
|
QStringList currentSearchTerms() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2018-04-19 10:47:13 +02:00
|
|
|
int zoomCount = 0;
|
2010-03-23 18:11:43 +01:00
|
|
|
|
|
|
|
|
QFutureWatcher<void> m_watcher;
|
2018-04-19 10:47:13 +02:00
|
|
|
QFutureInterface<void> *m_progress = nullptr;
|
2010-03-23 18:11:43 +01:00
|
|
|
|
2018-04-19 10:47:13 +02:00
|
|
|
QHelpSearchEngine *searchEngine = nullptr;
|
|
|
|
|
QHelpSearchResultWidget *resultWidget = nullptr;
|
|
|
|
|
QHelpSearchQueryWidget *m_queryWidget = nullptr;
|
|
|
|
|
QWidget *m_indexingDocumentationLabel = nullptr;
|
|
|
|
|
Utils::ProgressIndicator *m_indexingIndicator = nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Help
|