toolbar.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * ToolbarEdit.hpp : ToolbarEdit dialogs
00003  ****************************************************************************
00004  * Copyright (C) 2008-2009 the VideoLAN team
00005  * $Id: 6a436d806c2d60c9f39f38a21bdfef2110f835cf $
00006  *
00007  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef QVLC_TOOLBAREDIT_DIALOG_H_
00025 #define QVLC_TOOLBAREDIT_DIALOG_H_ 1
00026 
00027 #include "util/qvlcframe.hpp"
00028 #include "components/controller.hpp"
00029 
00030 #include <QRubberBand>
00031 #include <QListWidget>
00032 #include <QCheckBox>
00033 
00034 #define PROFILE_NAME_1 "Modern Style"
00035 #define VALUE_1 "0|64;39;64;38;65;|0-2;64;3;1;4;64;7;10;9;64-4;20;19;64-4;37;65;35-4;|12;11;13;14;|5-1;33;6-1;|0-2;64;3;1;4;64;37;64;38;64;8;65;35-4;34;"
00036 #define PROFILE_NAME_2 "Classic Style"
00037 #define VALUE_2 "1|64;39-1;64;38;|2-1;32-4;0-5;1-5;32-5;3-5;5-5;6-5;4-5;32-5;10-1;64-1;35-1;65;|12-1;11-1;13-1;14-1;|33;37-4;|0-5;1-5;32-1;1-5;5-1;6-1;4-5;32-1;12-5;11-1;65;34-4;35-1;"
00038 #define PROFILE_NAME_3 "Minimalist Style"
00039 #define VALUE_3 "0|64;65;|0-7;64;3-1;1-5;4-1;64;12-5;64-5;37-5;38-5;64-4;10-1;65;36-4;|11-5;13-5;14-5;|5-1;33;6-1;|0-5;64;3-5;1-5;4-5;64;12-5;65;34-4;35-1;"
00040 #define PROFILE_NAME_4 "One-Liner Style"
00041 #define VALUE_4 "0|64;38;65;|0-4;64;3;1;4;64;7;10;9;64-4;39;64-4;37;65;36-4;|12;11;14;13;|5-1;33;6-1;|0-2;64;3;1;4;64;37;64;38;64;8;65;35-4;34;"
00042 #define PROFILE_NAME_5 "Simplest Style"
00043 #define VALUE_5 "0||36-4;65-4;0-7;4-5;1-5;65-4;7-5;|12-4;11;13;||36-4;65-4;0-5;4-5;1-5;65;8-5;"
00044 
00045 class ToolbarEditDialog;
00046 class DroppingController;
00047 class QCheckBox;
00048 class QComboBox;
00049 
00050 class WidgetListing : public QListWidget
00051 {
00052     Q_OBJECT
00053 public:
00054     WidgetListing( intf_thread_t *, QWidget *_parent = 0 );
00055 protected:
00056     virtual void startDrag( Qt::DropActions /*supportedActions*/ );
00057 private:
00058     ToolbarEditDialog *parent;
00059 };
00060 
00061 class ToolbarEditDialog : public QVLCDialog
00062 {
00063     Q_OBJECT
00064 public:
00065     ToolbarEditDialog( QWidget *, intf_thread_t * );
00066     int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
00067                         bigBox->isChecked() * WIDGET_BIG +
00068                         !shinyBox->isChecked() * WIDGET_SHINY; }
00069     virtual ~ToolbarEditDialog();
00070 private:
00071 
00072     QCheckBox *flatBox, *bigBox, *shinyBox;
00073     QComboBox *positionCombo, *profileCombo;
00074 
00075     WidgetListing *widgetListing;
00076     DroppingController *controller1, *controller2, *controllerA;
00077     DroppingController *controllerFSC, *controller;
00078 
00079 private slots:
00080     void newProfile();
00081     void deleteProfile();
00082     void changeProfile( int );
00083     void cancel();
00084     void close();
00085 };
00086 
00087 class DroppingController: public AbstractController
00088 {
00089     Q_OBJECT
00090 public:
00091     DroppingController( intf_thread_t *, const QString& line, QWidget *parent = 0 );
00092     QString getValue();
00093     virtual ~DroppingController();
00094 
00095     void resetLine( const QString& );
00096 protected:
00097     virtual void createAndAddWidget( QBoxLayout *controlLayout, int i_index,
00098             buttonType_e i_type, int i_option );
00099     virtual void dragEnterEvent ( QDragEnterEvent * event );
00100     virtual void dragMoveEvent(QDragMoveEvent *event);
00101     virtual void dropEvent ( QDropEvent * event );
00102     virtual void dragLeaveEvent ( QDragLeaveEvent * event );
00103 
00104     virtual void doAction( int );
00105 
00106     bool eventFilter( QObject *, QEvent * );
00107 private:
00108     struct doubleInt
00109     {
00110         int i_type;
00111         int i_option;
00112     };
00113     QRubberBand *rubberband;
00114     QList <doubleInt *> widgetList;
00115 
00116     int getParentPosInLayout( QPoint point);
00117 
00118     bool b_draging;
00119 
00120 };
00121 
00122 #endif
00123 

Generated on Tue May 25 08:04:57 2010 for VLC by  doxygen 1.5.6