1 /*****************************************************************************
2 * ToolbarEdit.hpp : ToolbarEdit dialogs
3 ****************************************************************************
4 * Copyright (C) 2007 the VideoLAN team
7 * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _TOOLBAREDIT_DIALOG_H_
25 #define _TOOLBAREDIT_DIALOG_H_
27 #include "util/qvlcframe.hpp"
28 #include "components/controller.hpp"
30 #include <QRubberBand>
31 #include <QListWidget>
34 class ToolbarEditDialog;
35 class DroppingController;
38 class WidgetListing : public QListWidget
42 WidgetListing( intf_thread_t *, QWidget *_parent = 0 );
44 virtual void startDrag( Qt::DropActions /*supportedActions*/ );
46 ToolbarEditDialog *parent;
49 class ToolbarEditDialog : public QVLCFrame
53 static ToolbarEditDialog * getInstance( intf_thread_t *p_intf )
56 instance = new ToolbarEditDialog( p_intf );
59 virtual ~ToolbarEditDialog();
60 int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
61 bigBox->isChecked() * WIDGET_BIG +
62 shinyBox->isChecked() * WIDGET_SHINY; }
64 ToolbarEditDialog( intf_thread_t * );
65 static ToolbarEditDialog *instance;
67 QCheckBox *flatBox, *bigBox, *shinyBox;
69 WidgetListing *widgetListing;
70 DroppingController *controller1, *controller2, *controllerA;
71 DroppingController *controllerFSC, *controller;
78 class DroppingController: public AbstractController
82 DroppingController( intf_thread_t *, QString line, QWidget *parent = 0 );
84 virtual ~DroppingController();
87 virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
88 buttonType_e i_type, int i_option );
89 virtual void dragEnterEvent ( QDragEnterEvent * event );
90 virtual void dragMoveEvent(QDragMoveEvent *event);
91 virtual void dropEvent ( QDropEvent * event );
92 virtual void dragLeaveEvent ( QDragLeaveEvent * event );
94 virtual void doAction( int );
96 bool eventFilter( QObject *, QEvent * );
103 QRubberBand *rubberband;
104 QList <doubleInt *> widgetList;
106 int getParentPosInLayout( QPoint point);