1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef UBFEATURESACTIONBAR_H
#define UBFEATURESACTIONBAR_H
#include <QWidget>
#include <QToolButton>
#include <QDropEvent>
#include "UBLibActionBar.h"
#include "board/UBFeaturesController.h"
enum UBFeaturesActionBarState
{
IN_ROOT,
IN_FOLDER,
IN_PROPERTIES,
IN_FAVORITE,
IN_TRASH
};
class UBFeaturesActionBar : public QWidget
{
Q_OBJECT
public:
UBFeaturesActionBar(UBFeaturesController *controller, QWidget* parent=0, const char* name="UBFeaturesActionBar");
~UBFeaturesActionBar();
void setCurrentState( UBFeaturesActionBarState state );
signals:
void searchElement(const QString &text);
void newFolderToCreate();
void deleteElements( const QMimeData &data );
void addToFavorite( const QMimeData &data );
void removeFromFavorite( const QMimeData &data );
void addElementsToFavorite();
void removeElementsFromFavorite();
void deleteSelectedElements();
private slots:
void onSearchTextChanged(QString txt);
void onActionNewFolder();
void onActionFavorite();
void onActionRemoveFavorite();
void onActionTrash();
protected:
//void dragMoveEvent(QDragMoveEvent *event);
void dragEnterEvent( QDragEnterEvent *event );
void dropEvent( QDropEvent *event );
private:
void setButtons();
UBFeaturesController *featuresController;
UBFeaturesActionBarState currentState;
eButtonSet mCrntButtonSet;
eButtonSet mPreviousButtonSet;
QButtonGroup* mButtonGroup;
QLineEdit* mSearchBar;
QHBoxLayout* mLayout;
QAction* mpFavoriteAction;
QAction* mpSocialAction;
QAction* mpDeleteAction;
QAction* mpSearchAction;
QAction* mpCloseAction;
QAction* mpRemoveFavorite;
QAction* mpNewFolderAction;
UBActionButton* mpFavoriteBtn;
UBActionButton* mpSocialBtn;
UBActionButton* mpDeleteBtn;
//UBActionButton* mpSearchBtn;
UBActionButton* mpCloseBtn;
UBActionButton* mpRemoveFavoriteBtn;
UBActionButton* mpNewFolderBtn;
};
#endif