AssistantHelpManagerImpl.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/help/AssistantHelpManagerImpl.h
22 
23  \brief An implementation of HelpManager that uses QAssistant to show help files.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_HELP_INTERNAL_ASSISTANTHELPMANAGERIMPL_H
27 #define __TERRALIB_QT_WIDGETS_HELP_INTERNAL_ASSISTANTHELPMANAGERIMPL_H
28 
29 //TerraLib
30 #include "HelpManagerImpl.h"
31 
32 // Boost
33 #include <boost/noncopyable.hpp>
34 
35 // Qt
36 #include <QtCore/QObject>
37 #include <QtCore/QStringList>
38 
39 // Forward declarations
40 class QProcess;
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace widgets
47  {
48  /*!
49  \class AssistantHelpManagerImpl
50 
51  \brief A help manager that uses the QAssistant to manage help files.
52  */
53  class TEQTWIDGETSEXPORT AssistantHelpManagerImpl : public QObject, public HelpManagerImpl, public boost::noncopyable
54  {
55  Q_OBJECT
56 
57  public:
58 
59  /*!
60  \brief Constructor.
61  \param collectionFile Name of the Qt collection file to be used.
62  \param parent Used by QObject constructor.
63  */
64  AssistantHelpManagerImpl(const QString& collectionFile, QObject* parent = 0);
65 
66  /*! \brief Destructor. */
68 
69  /*!
70  \brief It starts the Qt assistant help process pointing out to the given collection file.
71 
72  \return True if start assistant with no problems, false otherwise.
73  */
74  bool startAssistant();
75 
76  public slots:
77 
78  void showHelp(const QString& htmRef, const QString& nSpace="");
79 
80  void appendDoc(const QString& docRef);
81 
82  protected:
83 
84  QProcess* m_proc; //!< Qt process, used to init QAssistant.
85  QStringList m_regDocs; //!< Registered documents.
86  QString m_collectionFile; //!< Collection name.
87  };
88 
89  } // end namespace widgets
90  } // end namespace qt
91 } // end namespace te
92 
93 #endif //__TERRALIB_QT_WIDGETS_HELP_INTERNAL_ASSISTANTHELPMANAGERIMPL_H
94 
URI C++ Library.
QProcess * m_proc
Qt process, used to init QAssistant.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
QStringList m_regDocs
Registered documents.
An interface for a help manager implementation.
An interface for help managers implementations.
A help manager that uses the QAssistant to manage help files.