2 ******************************************************************************
4 * @file uavgadgetmanager.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup CorePlugin Core Plugin
11 * @brief The Core GCS plugin
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef UAVGADGETMANAGER_H
30 #define UAVGADGETMANAGER_H
32 #include "../core_global.h"
34 #include <coreplugin/icorelistener.h>
35 #include <coreplugin/imode.h>
54 } // namespace Internal
56 class CORE_EXPORT UAVGadgetManager
: public IMode
{
61 explicit UAVGadgetManager(ICore
*core
, QString name
, QIcon icon
, int priority
, QString uniqueName
, QWidget
*parent
);
62 virtual ~UAVGadgetManager();
77 void setPriority(int priority
)
79 m_priority
= priority
;
81 const char *uniqueModeName() const
83 return m_uniqueModeName
;
85 QList
<int> context() const;
93 void ensureUAVGadgetManagerVisible();
95 IUAVGadget
*currentGadget() const;
97 void saveState(QSettings
&) const;
98 bool restoreState(QSettings
&);
100 void readSettings(QSettings
&settings
);
101 void saveSettings(QSettings
&settings
) const;
105 return m_showToolbars
;
109 void currentGadgetChanged(IUAVGadget
*gadget
);
110 void showUavGadgetMenus(bool show
, bool hasSplitter
);
111 void updateSplitMenus(bool hasSplitter
);
114 void handleContextChange(Core::IContext
*context
);
115 void updateUavGadgetMenus();
116 void modeChanged(Core::IMode
*mode
);
120 void split(Qt::Orientation orientation
);
122 void splitSideBySide();
123 void removeCurrentSplit();
124 void removeAllSplits();
125 void gotoOtherSplit();
126 void showToolbars(bool show
);
129 void setCurrentGadget(IUAVGadget
*gadget
);
130 void addGadgetToContext(IUAVGadget
*gadget
);
131 void removeGadget(IUAVGadget
*gadget
);
132 void closeView(Core::Internal::UAVGadgetView
*view
);
133 void emptyView(Core::Internal::UAVGadgetView
*view
);
134 Core::Internal::SplitterOrView
*currentSplitterOrView() const;
137 Core::Internal::SplitterOrView
*m_splitterOrView
;
138 Core::IUAVGadget
*m_currentGadget
;
144 QString m_uniqueName
;
145 QByteArray m_uniqueNameBA
;
146 const char *m_uniqueModeName
;
149 friend class Core::Internal::SplitterOrView
;
150 friend class Core::Internal::UAVGadgetView
;
154 #endif // UAVGADGETMANAGER_H