tools/designer/src/components/widgetbox/widgetbox.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the Qt Designer of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef WIDGETBOX_H
00025 #define WIDGETBOX_H
00026 
00027 #include <QtXml/QDomDocument>
00028 
00029 #include <QtDesigner/QtDesigner>
00030 
00031 #include "widgetbox_global.h"
00032 
00033 class QDesignerFormEditorInterface;
00034 class QDesignerFormWindowInterface;
00035 class QStackedLayout;
00036 class QDomElement;
00037 class QEvent;
00038 class QMenu;
00039 class QAction;
00040 class QActionGroup;
00041 class DomWidget;
00042 
00043 namespace qdesigner_internal {
00044 
00045 class WidgetBoxTreeView;
00046 class WidgetCollectionModel;
00047 class Scratchpad;
00048 
00049 class QT_WIDGETBOX_EXPORT WidgetBox : public QDesignerWidgetBoxInterface
00050 {
00051     Q_OBJECT
00052 public:
00053     WidgetBox(QDesignerFormEditorInterface *core, QWidget *parent = 0, Qt::WindowFlags flags = 0);
00054     virtual ~WidgetBox();
00055 
00056     QDesignerFormEditorInterface *core() const;
00057 
00058     virtual int categoryCount() const;
00059     virtual Category category(int cat_idx) const;
00060     virtual void addCategory(const Category &cat);
00061     virtual void removeCategory(int cat_idx);
00062 
00063     virtual int widgetCount(int cat_idx) const;
00064     virtual Widget widget(int cat_idx, int wgt_idx) const;
00065     virtual void addWidget(int cat_idx, const Widget &wgt);
00066     virtual void removeWidget(int cat_idx, int wgt_idx);
00067 
00068     void dropWidgets(const QList<QDesignerDnDItemInterface*> &item_list, const QPoint &global_mouse_pos);
00069 
00070     virtual void setFileName(const QString &file_name);
00071     virtual QString fileName() const;
00072     virtual bool load();
00073     virtual bool save();
00074 
00075 private slots:
00076     void handleMousePress(const QString &xml, const QPoint &global_mouse_pos);
00077 
00078 private:
00079     QDesignerFormEditorInterface *m_core;
00080     WidgetBoxTreeView *m_view;
00081 };
00082 
00083 }  // namespace qdesigner_internal
00084 
00085 #endif // WIDGETBOX_H

Generated on Thu Mar 15 12:01:15 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1