UBFeaturesActionBar.h 1.88 KB
Newer Older
1 2 3 4 5
#ifndef UBFEATURESACTIONBAR_H
#define UBFEATURESACTIONBAR_H

#include <QWidget>
#include <QToolButton>
6
#include <QDropEvent>
7
#include "UBLibActionBar.h"
8 9 10 11 12 13 14
#include "board/UBFeaturesController.h"

enum UBFeaturesActionBarState
{
	IN_ROOT,
	IN_FOLDER,
	IN_PROPERTIES,
Anna Udovichenko's avatar
Anna Udovichenko committed
15 16
	IN_FAVORITE,
	IN_TRASH
17
};
18 19 20 21 22

class UBFeaturesActionBar : public QWidget
{
	Q_OBJECT
public:
23
	UBFeaturesActionBar(UBFeaturesController *controller, QWidget* parent=0, const char* name="UBFeaturesActionBar");
24
    ~UBFeaturesActionBar();
25 26 27
	
	void setCurrentState( UBFeaturesActionBarState state );
signals:
28
	void searchElement(const QString &text);
29
	void newFolderToCreate();
30
	void deleteElements( const QMimeData &data );
31
	void addToFavorite( const QMimeData &data );
32
	void removeFromFavorite( const QMimeData &data );
33
    void addElementsToFavorite();
34
    void removeElementsFromFavorite();
35
    void deleteSelectedElements();
36 37 38
private slots:
	void onSearchTextChanged(QString txt);
	void onActionNewFolder();
39
    void onActionFavorite();
40
    void onActionRemoveFavorite();
41
    void onActionTrash();
42 43 44 45
protected:
	//void dragMoveEvent(QDragMoveEvent *event);
	void dragEnterEvent( QDragEnterEvent *event );
	void dropEvent( QDropEvent *event );
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
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;

72 73 74 75
};


#endif