|
|
@ -12,6 +12,8 @@ |
|
|
|
#include <QUrl> |
|
|
|
#include <QUrl> |
|
|
|
#include <QByteArray> |
|
|
|
#include <QByteArray> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#include "UBDockPaletteWidget.h"
|
|
|
|
|
|
|
|
|
|
|
|
enum UBFeatureElementType |
|
|
|
enum UBFeatureElementType |
|
|
|
{ |
|
|
|
{ |
|
|
|
FEATURE_CATEGORY, |
|
|
|
FEATURE_CATEGORY, |
|
|
@ -30,25 +32,30 @@ class UBFeature |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeature() {;} |
|
|
|
UBFeature() {;} |
|
|
|
//UBFeature(const UBFeature &f);
|
|
|
|
//UBFeature(const UBFeature &f);
|
|
|
|
UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QString &realPath, UBFeatureElementType type = FEATURE_CATEGORY); |
|
|
|
UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QUrl &realPath, UBFeatureElementType type = FEATURE_CATEGORY); |
|
|
|
virtual ~UBFeature() {;} |
|
|
|
virtual ~UBFeature() {;} |
|
|
|
QString getName() const { return mName; } |
|
|
|
QString getName() const { return mName; } |
|
|
|
QPixmap getThumbnail() const {return mThumbnail;} |
|
|
|
QPixmap getThumbnail() const {return mThumbnail;} |
|
|
|
QString getUrl() const { return virtualPath; } |
|
|
|
QString getVirtualPath() const { return virtualPath; } |
|
|
|
//QString getPath() const { return mPath; };
|
|
|
|
//QString getPath() const { return mPath; };
|
|
|
|
QString getFullPath() const { return mPath; } |
|
|
|
QUrl getFullPath() const { return mPath; } |
|
|
|
QString getVirtualPath() const { return virtualPath + "/" + mName; } |
|
|
|
QString getFullVirtualPath() const { return virtualPath + "/" + mName; } |
|
|
|
|
|
|
|
QString getUrl() const; |
|
|
|
UBFeatureElementType getType() const { return elementType; } |
|
|
|
UBFeatureElementType getType() const { return elementType; } |
|
|
|
|
|
|
|
|
|
|
|
bool isFolder() const; |
|
|
|
bool isFolder() const; |
|
|
|
bool isDeletable() const; |
|
|
|
bool isDeletable() const; |
|
|
|
bool operator ==( const UBFeature &f )const; |
|
|
|
bool operator ==( const UBFeature &f )const; |
|
|
|
bool operator !=( const UBFeature &f )const; |
|
|
|
bool operator !=( const UBFeature &f )const; |
|
|
|
|
|
|
|
const QMap<QString,QString> & getMetadata() const { return metadata; } |
|
|
|
|
|
|
|
void setMetadata( const QMap<QString,QString> &data ) { metadata = data; } |
|
|
|
private: |
|
|
|
private: |
|
|
|
QString virtualPath; |
|
|
|
QString virtualPath; |
|
|
|
QPixmap mThumbnail; |
|
|
|
QPixmap mThumbnail; |
|
|
|
QString mName; |
|
|
|
QString mName; |
|
|
|
QString mPath; |
|
|
|
QUrl mPath; |
|
|
|
UBFeatureElementType elementType; |
|
|
|
UBFeatureElementType elementType; |
|
|
|
|
|
|
|
QMap<QString,QString> metadata; |
|
|
|
}; |
|
|
|
}; |
|
|
|
Q_DECLARE_METATYPE( UBFeature ) |
|
|
|
Q_DECLARE_METATYPE( UBFeature ) |
|
|
|
|
|
|
|
|
|
|
@ -65,9 +72,13 @@ class UBFeaturesController : public QObject |
|
|
|
const QString& getRootPath()const { return rootPath; } |
|
|
|
const QString& getRootPath()const { return rootPath; } |
|
|
|
|
|
|
|
|
|
|
|
void addItemToPage( const UBFeature &item ); |
|
|
|
void addItemToPage( const UBFeature &item ); |
|
|
|
|
|
|
|
void addItemAsBackground( const UBFeature &item ); |
|
|
|
const UBFeature& getCurrentElement()const { return currentElement; } |
|
|
|
const UBFeature& getCurrentElement()const { return currentElement; } |
|
|
|
void setCurrentElement( const UBFeature &elem ) { currentElement = elem; } |
|
|
|
void setCurrentElement( const UBFeature &elem ) { currentElement = elem; } |
|
|
|
const UBFeature & getTrashElement () const { return trashElement; } |
|
|
|
const UBFeature & getTrashElement () const { return trashElement; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBFeature addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData ); |
|
|
|
|
|
|
|
|
|
|
|
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
void deleteItem( const QUrl &url ); |
|
|
|
void deleteItem( const QUrl &url ); |
|
|
@ -75,13 +86,14 @@ class UBFeaturesController : public QObject |
|
|
|
UBFeature newFolder( const QString &name ); |
|
|
|
UBFeature newFolder( const QString &name ); |
|
|
|
UBFeature addToFavorite( const QUrl &path ); |
|
|
|
UBFeature addToFavorite( const QUrl &path ); |
|
|
|
void removeFromFavorite( const QUrl &path ); |
|
|
|
void removeFromFavorite( const QUrl &path ); |
|
|
|
|
|
|
|
UBFeature importImage( const QImage &image, const UBFeature &destination ); |
|
|
|
|
|
|
|
|
|
|
|
static QString fileNameFromUrl( const QUrl &url ); |
|
|
|
static QString fileNameFromUrl( const QUrl &url ); |
|
|
|
static QPixmap thumbnailForFile( const QString &path ); |
|
|
|
static QPixmap thumbnailForFile( const QString &path ); |
|
|
|
static bool isDeletable( const QUrl &url ); |
|
|
|
static bool isDeletable( const QUrl &url ); |
|
|
|
private: |
|
|
|
private: |
|
|
|
void initDirectoryTree(); |
|
|
|
void initDirectoryTree(); |
|
|
|
void fileSystemScan(const QString &currPath, const QString & currVirtualPath); |
|
|
|
void fileSystemScan(const QUrl &currPath, const QString & currVirtualPath); |
|
|
|
static QPixmap createThumbnail(const QString &path); |
|
|
|
static QPixmap createThumbnail(const QString &path); |
|
|
|
//void addImageToCurrentPage( const QString &path );
|
|
|
|
//void addImageToCurrentPage( const QString &path );
|
|
|
|
void loadFavoriteList(); |
|
|
|
void loadFavoriteList(); |
|
|
@ -93,22 +105,22 @@ class UBFeaturesController : public QObject |
|
|
|
QList <UBFeature> *featuresList; |
|
|
|
QList <UBFeature> *featuresList; |
|
|
|
UBFeature *rootElement; |
|
|
|
UBFeature *rootElement; |
|
|
|
|
|
|
|
|
|
|
|
QString mUserAudioDirectoryPath; |
|
|
|
QUrl mUserAudioDirectoryPath; |
|
|
|
QString mUserVideoDirectoryPath; |
|
|
|
QUrl mUserVideoDirectoryPath; |
|
|
|
QString mUserPicturesDirectoryPath; |
|
|
|
QUrl mUserPicturesDirectoryPath; |
|
|
|
QString mUserInteractiveDirectoryPath; |
|
|
|
QUrl mUserInteractiveDirectoryPath; |
|
|
|
QString mUserAnimationDirectoryPath; |
|
|
|
QUrl mUserAnimationDirectoryPath; |
|
|
|
|
|
|
|
|
|
|
|
QString libraryPath; |
|
|
|
QString libraryPath; |
|
|
|
QString mLibAudioDirectoryPath; |
|
|
|
QUrl mLibAudioDirectoryPath; |
|
|
|
QString mLibVideoDirectoryPath; |
|
|
|
QUrl mLibVideoDirectoryPath; |
|
|
|
QString mLibPicturesDirectoryPath; |
|
|
|
QUrl mLibPicturesDirectoryPath; |
|
|
|
QString mLibInteractiveDirectoryPath; |
|
|
|
QUrl mLibInteractiveDirectoryPath; |
|
|
|
QString mLibAnimationDirectoryPath; |
|
|
|
QUrl mLibAnimationDirectoryPath; |
|
|
|
QString mLibApplicationsDirectoryPath; |
|
|
|
QUrl mLibApplicationsDirectoryPath; |
|
|
|
QString mLibShapesDirectoryPath; |
|
|
|
QUrl mLibShapesDirectoryPath; |
|
|
|
QString trashDirectoryPath; |
|
|
|
QUrl trashDirectoryPath; |
|
|
|
QString mLibSearchDirectoryPath; |
|
|
|
QUrl mLibSearchDirectoryPath; |
|
|
|
|
|
|
|
|
|
|
|
QString rootPath; |
|
|
|
QString rootPath; |
|
|
|
QString audiosPath; |
|
|
|
QString audiosPath; |
|
|
@ -131,9 +143,9 @@ class UBFeaturesController : public QObject |
|
|
|
UBFeature interactElement; |
|
|
|
UBFeature interactElement; |
|
|
|
UBFeature flashElement; |
|
|
|
UBFeature flashElement; |
|
|
|
UBFeature shapesElement; |
|
|
|
UBFeature shapesElement; |
|
|
|
UBFeature searchElement; |
|
|
|
UBFeature webSearchElement; |
|
|
|
|
|
|
|
|
|
|
|
QSet <QString> *favoriteSet; |
|
|
|
QSet <QUrl> *favoriteSet; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|