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;
39 class WidgetListing : public QListWidget
43 WidgetListing( intf_thread_t *, QWidget *_parent = 0 );
45 virtual void startDrag( Qt::DropActions /*supportedActions*/ );
47 ToolbarEditDialog *parent;
50 class ToolbarEditDialog : public QVLCFrame
54 static ToolbarEditDialog * getInstance( intf_thread_t *p_intf )
57 instance = new ToolbarEditDialog( p_intf );
60 static void killInstance()
61 { if( instance ) delete instance; instance = NULL;}
62 virtual ~ToolbarEditDialog();
63 int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
64 bigBox->isChecked() * WIDGET_BIG +
65 !shinyBox->isChecked() * WIDGET_SHINY; }
67 ToolbarEditDialog( intf_thread_t * );
68 static ToolbarEditDialog *instance;
70 QCheckBox *flatBox, *bigBox, *shinyBox;
71 QComboBox *positionCombo, *profileCombo;
73 WidgetListing *widgetListing;
74 DroppingController *controller1, *controller2, *controllerA;
75 DroppingController *controllerFSC, *controller;
80 void changeProfile( int );
85 class DroppingController: public AbstractController
89 DroppingController( intf_thread_t *, QString line, QWidget *parent = 0 );
91 virtual ~DroppingController();
93 void resetLine( QString );
95 virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
96 buttonType_e i_type, int i_option );
97 virtual void dragEnterEvent ( QDragEnterEvent * event );
98 virtual void dragMoveEvent(QDragMoveEvent *event);
99 virtual void dropEvent ( QDropEvent * event );
100 virtual void dragLeaveEvent ( QDragLeaveEvent * event );
102 virtual void doAction( int );
104 bool eventFilter( QObject *, QEvent * );
111 QRubberBand *rubberband;
112 QList <doubleInt *> widgetList;
114 int getParentPosInLayout( QPoint point);