OSDN Git Service

581ac3ad580b2f346a7e101f5a349c418c8c01e3
[qt-creator-jp/qt-creator-jp.git] / src / plugins / classview / classviewnavigationwidgetfactory.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2010 Denis Mingulov.
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
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
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
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.
24 **
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.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef CLASSVIEWNAVIGATIONWIDGETFACTORY_H
35 #define CLASSVIEWNAVIGATIONWIDGETFACTORY_H
36
37 #include <coreplugin/inavigationwidgetfactory.h>
38
39 #include <QtCore/QScopedPointer>
40
41 namespace ClassView {
42 namespace Internal {
43
44 /*!
45    \class NavigationWidgetFactory
46    \brief INavigationWidgetFactory implementation for Class View
47
48    INavigationWidgetFactory implementation for Class View. Singleton instance.
49    Supports \a setState publc slot to add/remove factory to \a ExtensionSystem::PluginManager.
50    Also supports some additional signals, \a widgetIsCreated and \a stateChanged.
51  */
52
53 class NavigationWidgetFactory : public Core::INavigationWidgetFactory
54 {
55     Q_OBJECT
56     Q_DISABLE_COPY(NavigationWidgetFactory)
57
58 public:
59     //! destructor
60     virtual ~NavigationWidgetFactory();
61
62     //! get an instance
63     static NavigationWidgetFactory *instance();
64
65     // Core::INavigationWidgetFactory
66     //! \implements Core::INavigationWidgetFactory::displayName
67     QString displayName() const;
68
69     //! \implements Core::INavigationWidgetFactory::priority
70     int priority() const;
71
72     //! \implements Core::INavigationWidgetFactory::id
73     QString id() const;
74
75     //! \implements Core::INavigationWidgetFactory::activationSequence
76     QKeySequence activationSequence() const;
77
78     //! \implements Core::INavigationWidgetFactory::createWidget
79     Core::NavigationView createWidget();
80
81     //! \implements Core::INavigationWidgetFactory::saveSettings
82     void saveSettings(int position, QWidget *widget);
83
84     //! \implements Core::INavigationWidgetFactory::restoreSettings
85     void restoreSettings(int position, QWidget *widget);
86
87     // own functionality
88
89 signals:
90     /*!
91        \brief Signal which informs that the widget factory creates a widget.
92      */
93     void widgetIsCreated();
94
95 private:
96     //! Constructor
97     NavigationWidgetFactory();
98
99     /*!
100        \brief Get a settings prefix for the specified position
101        \param position Position
102        \return Settings prefix
103      */
104     QString settingsPrefix(int position) const;
105
106 private:
107     //! private class data pointer
108     QScopedPointer<struct NavigationWidgetFactoryPrivate> d_ptr;
109 };
110
111 } // namespace Internal
112 } // namespace ClassView
113
114 #endif // CLASSVIEWNAVIGATIONWIDGETFACTORY_H