| 1 |
/* |
| 2 |
* Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd. |
| 3 |
* |
| 4 |
* Author: ZhangYong <[email protected]> |
| 5 |
* |
| 6 |
* Maintainer: ZhangYong <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software: you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, either version 3 of the License, or |
| 11 |
* any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
*/ |
| 21 |
#ifndef TIMELINEVIEW_H |
| 22 |
#define TIMELINEVIEW_H |
| 23 |
|
| 24 |
#include "application.h" |
| 25 |
#include "controller/signalmanager.h" |
| 26 |
#include "dbmanager/dbmanager.h" |
| 27 |
#include "thumbnail/thumbnaillistview.h" |
| 28 |
#include "importview/importview.h" |
| 29 |
#include "searchview/searchview.h" |
| 30 |
#include "widgets/statusbar.h" |
| 31 |
#include "allpicview/allpicview.h" |
| 32 |
|
| 33 |
#include <QWidget> |
| 34 |
#include <QVBoxLayout> |
| 35 |
#include <QScrollArea> |
| 36 |
#include <DListWidget> |
| 37 |
#include <DStackedWidget> |
| 38 |
#include <DCommandLinkButton> |
| 39 |
#include <DApplicationHelper> |
| 40 |
#include <QGraphicsOpacityEffect> |
| 41 |
|
| 42 |
class NoResultWidget; |
| 43 |
class BatchOperateWidget; |
| 44 |
class TimeLineView : public DWidget, public ImageEngineImportObject |
| 45 |
{ |
| 46 |
Q_OBJECT |
| 47 |
|
| 48 |
public: |
| 49 |
TimeLineView(); |
| 50 |
~TimeLineView() override |
| 51 |
{ |
| 52 |
} |
| 53 |
|
| 54 |
bool imageImported(bool success) override; |
| 55 |
|
| 56 |
void updateStackedWidget(); |
| 57 |
void updatePicNum(); |
| 58 |
void updateChoseText(); |
| 59 |
void restorePicNum(); |
| 60 |
void themeChangeSlot(DGuiApplicationHelper::ColorType themeType); |
| 61 |
ThumbnailListView *getThumbnailListView(); |
| 62 |
//tab进入时清除其他所有选中 |
| 63 |
void clearAllSelection(); |
| 64 |
|
| 65 |
public slots: |
| 66 |
void on_AddLabel(QString date, QString num); |
| 67 |
void on_DCommandLinkButton(); |
| 68 |
void clearAndStartLayout(); |
| 69 |
//更新最上当悬浮标题时间与数量 |
| 70 |
void slotTimeLineDataAndNum(QString data, QString num, QString text); |
| 71 |
|
| 72 |
protected: |
| 73 |
void resizeEvent(QResizeEvent *ev) override; |
| 74 |
|
| 75 |
private: |
| 76 |
void initTimeLineViewWidget(); |
| 77 |
void initConnections(); |
| 78 |
void addTimelineLayout(); |
| 79 |
void onKeyDelete(); |
| 80 |
void dragEnterEvent(QDragEnterEvent *e) override; |
| 81 |
void dropEvent(QDropEvent *event) override; |
| 82 |
void dragMoveEvent(QDragMoveEvent *event) override; |
| 83 |
void dragLeaveEvent(QDragLeaveEvent *e) override; |
| 84 |
void mousePressEvent(QMouseEvent *e) override; |
| 85 |
|
| 86 |
public slots: |
| 87 |
//筛选显示,当先列表中内容为无结果 |
| 88 |
void slotNoPicOrNoVideo(bool isNoResult); |
| 89 |
//更新布局(旋转图片时) |
| 90 |
void updataLayout(QStringList updatePathList); |
| 91 |
void onImportViewImportBtnClicked(); |
| 92 |
void onImportFailedToView(); |
| 93 |
void onRepeatImportingTheSamePhotos(QStringList importPaths, QStringList duplicatePaths, const QString &albumName); |
| 94 |
//打开图片 |
| 95 |
void onOpenImage(int row, const QString &path, bool bFullScreen); |
| 96 |
//幻灯片播放 |
| 97 |
void onSlideShow(QString path); |
| 98 |
|
| 99 |
//进入批量状态 |
| 100 |
void slotBatchSelectChanged(bool isBatchSelect); |
| 101 |
//缩略图选中项改变 |
| 102 |
void sltSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); |
| 103 |
private: |
| 104 |
QLayout *m_mainLayout; |
| 105 |
QList<QString> m_timelines; |
| 106 |
//悬浮时间栏控件 |
| 107 |
QWidget *m_dateNumItemWidget = nullptr; |
| 108 |
BatchOperateWidget *m_batchOperateWidget = nullptr; |
| 109 |
DCommandLinkButton *m_suspensionChose = nullptr; |
| 110 |
DLabel *m_dateLabel = nullptr; |
| 111 |
DLabel *m_numLabel = nullptr; |
| 112 |
|
| 113 |
int allnum; |
| 114 |
ThumbnailListView *m_timeLineThumbnailListView = nullptr;//时间线缩略图列表,含时间项 |
| 115 |
QGraphicsOpacityEffect *m_oe; |
| 116 |
QGraphicsOpacityEffect *m_oet; |
| 117 |
QWidget *fatherwidget; |
| 118 |
|
| 119 |
public: |
| 120 |
QStackedWidget *m_pStackedWidget; |
| 121 |
NoResultWidget *m_noResultWidget = nullptr; |
| 122 |
StatusBar *m_pStatusBar; |
| 123 |
SearchView *pSearchView; |
| 124 |
ImportView *pImportView; |
| 125 |
QWidget *pTimeLineViewWidget; |
| 126 |
QWidget *m_pwidget; |
| 127 |
int m_selPicNum; |
| 128 |
DSpinner *m_spinner; |
| 129 |
}; |
| 130 |
|
| 131 |
#endif // TIMELINEVIEW_H |