toolbar.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 );
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