1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2010 Denis Mingulov.
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef CLASSVIEWNAVIGATIONWIDGET_H
35 #define CLASSVIEWNAVIGATIONWIDGET_H
37 #include <QtGui/QWidget>
38 #include <QtGui/QToolButton>
39 #include <QtGui/QStandardItem>
40 #include <QtCore/QScopedPointer>
41 #include <QtCore/QSharedPointer>
42 #include <QtCore/QList>
44 QT_FORWARD_DECLARE_CLASS(QModelIndex)
50 \class NavigationWidget
51 \brief A widget for the class view tree
54 class NavigationWidget : public QWidget
57 Q_DISABLE_COPY(NavigationWidget)
60 explicit NavigationWidget(QWidget *parent = 0);
64 \brief Create QToolbuttons for Navigation Pane Widget
65 \return List with created QToolButtons
66 \sa NavigationWidgetFactory::createWidget
68 QList<QToolButton *> createToolButtons();
71 \brief Get flat mode state
72 \return Flat mode state
74 bool flatMode() const;
77 \brief Set flat mode state
78 \param flatMode Flat mode state
80 void setFlatMode(bool flatMode);
84 \brief Widget visibility is changed
85 \param visibility true is plugin becames visible, false otherwise
87 void visibilityChanged(bool visibility);
90 \brief Signal to request to go to location
91 \param name File which has to be open
94 \sa Manager::gotoLocation
96 void requestGotoLocation(const QString &name, int line, int column);
99 \brief Signal to request to go to any of location in the list
100 \param locations Symbol locations
101 \sa Manager::gotoLocations
103 void requestGotoLocations(const QList<QVariant> &locations);
106 \brief Signal that the widget wants to receive the latest tree info
107 \sa Manager::onRequestTreeDataUpdate
109 void requestTreeDataUpdate();
113 \brief Item is activated in the tree view
114 \param index Item index
116 void onItemActivated(const QModelIndex &index);
119 \brief Receive a new data for the tree
120 \param Result - root item
122 void onDataUpdate(QSharedPointer<QStandardItem> result);
125 \brief Full projects' mode button has been toggled
126 \param state Full projects' mode
128 void onFullProjectsModeToggled(bool state);
132 \brief Fetch data for expanded items - to be sure that content will exist
136 void fetchExpandedItems(QStandardItem *item, const QStandardItem *target) const;
138 //! implements QWidget::hideEvent
139 void hideEvent(QHideEvent *event);
141 //! implements QWidget::showEvent
142 void showEvent(QShowEvent *event);
145 //! Private class data pointer
146 QScopedPointer<struct NavigationWidgetPrivate> d_ptr;
149 } // namespace Internal
150 } // namespace ClassView
152 #endif // CLASSVIEWNAVIGATIONWIDGET_H