| 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 IMPORTTIMELINEVIEW_H |
| 22 |
#define IMPORTTIMELINEVIEW_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 "widgets/statusbar.h" |
| 30 |
#include "allpicview/allpicview.h" |
| 31 |
|
| 32 |
#include <QWidget> |
| 33 |
#include <QVBoxLayout> |
| 34 |
#include <QScrollArea> |
| 35 |
#include <QGraphicsOpacityEffect> |
| 36 |
|
| 37 |
#include <DListWidget> |
| 38 |
#include <DCommandLinkButton> |
| 39 |
#include <DApplicationHelper> |
| 40 |
|
| 41 |
class BatchOperateWidget; |
| 42 |
class ImportTimeLineView : public DWidget, public ImageEngineImportObject |
| 43 |
{ |
| 44 |
Q_OBJECT |
| 45 |
public: |
| 46 |
explicit ImportTimeLineView(DWidget *parent); |
| 47 |
~ImportTimeLineView() override |
| 48 |
{ |
| 49 |
void clearAndStop(); |
| 50 |
} |
| 51 |
|
| 52 |
bool imageImported(bool success) override; |
| 53 |
|
| 54 |
int getIBaseHeight(); |
| 55 |
public slots: |
| 56 |
//更新最上当悬浮标题时间与数量 |
| 57 |
void slotTimeLineDataAndNum(QString data, QString num, QString text); |
| 58 |
//打开图片 |
| 59 |
void onOpenImage(int row, const QString &path, bool bFullScreen); |
| 60 |
//幻灯片播放 |
| 61 |
void onSlideShow(QString path); |
| 62 |
|
| 63 |
void clearAndStartLayout(); |
| 64 |
protected: |
| 65 |
void resizeEvent(QResizeEvent *ev) override; |
| 66 |
// void showEvent(QShowEvent *ev) override; |
| 67 |
|
| 68 |
private: |
| 69 |
void initTimeLineViewWidget(); |
| 70 |
void initConnections(); |
| 71 |
|
| 72 |
void dragEnterEvent(QDragEnterEvent *e) override; |
| 73 |
void dropEvent(QDropEvent *event) override; |
| 74 |
void dragMoveEvent(QDragMoveEvent *event) override; |
| 75 |
// void dragLeaveEvent(QDragLeaveEvent *e) override; |
| 76 |
// void keyPressEvent(QKeyEvent *e) override; |
| 77 |
// void keyReleaseEvent(QKeyEvent *e) override; |
| 78 |
void mousePressEvent(QMouseEvent *e) override; |
| 79 |
|
| 80 |
public: |
| 81 |
void addTimelineLayout(); |
| 82 |
void getFatherStatusBar(DSlider *s); |
| 83 |
void themeChangeSlot(DGuiApplicationHelper::ColorType themeType); |
| 84 |
ThumbnailListView *getListView(); |
| 85 |
//tab进入时清除其他所有选中 |
| 86 |
void clearAllSelection(); |
| 87 |
#if 1 |
| 88 |
QStringList selectPaths(); |
| 89 |
#endif |
| 90 |
private slots: |
| 91 |
/** |
| 92 |
* @brief updateSize |
| 93 |
* 调整已导入界面的整体大小 |
| 94 |
*/ |
| 95 |
void updateSize(); |
| 96 |
void onRepeatImportingTheSamePhotos(QStringList importPaths, QStringList duplicatePaths, const QString &albumName); |
| 97 |
void onSuspensionChoseBtnClicked(); |
| 98 |
//进入批量状态 |
| 99 |
void slotBatchSelectChanged(bool isBatchSelect); |
| 100 |
//筛选显示,当先列表中内容为无结果 |
| 101 |
void slotNoPicOrNoVideo(bool isNoResult); |
| 102 |
//响应删除 |
| 103 |
void onDelete(); |
| 104 |
signals: |
| 105 |
void sigUpdatePicNum(); |
| 106 |
//筛选显示图片或者视频,无结果时 |
| 107 |
void sigNoPicOrNoVideo(bool isNoResult);//1050 |
| 108 |
public: |
| 109 |
const static int title_HEIGHT = 60; |
| 110 |
const static int ChoseBtn_HEIGHT = 32; |
| 111 |
private: |
| 112 |
QLayout *m_mainLayout; |
| 113 |
QList<QString> m_timelines; |
| 114 |
DWidget *m_choseBtnItem = nullptr; |
| 115 |
DWidget *m_TitleItem; //title包裹窗口 |
| 116 |
DCommandLinkButton *m_suspensionChoseBtn = nullptr; //悬浮选择按钮 |
| 117 |
DWidget *m_timeLineViewWidget = nullptr; |
| 118 |
BatchOperateWidget *m_batchOperateWidget = nullptr; |
| 119 |
DLabel *m_DateLabel = nullptr; //已导入悬浮日期 |
| 120 |
DLabel *m_NumLabel = nullptr; //已导入悬浮数量 |
| 121 |
DLabel *m_pImportTitle = nullptr; //已导入悬浮标题 |
| 122 |
DSlider *m_DSlider; |
| 123 |
ThumbnailListView *m_importTimeLineListView = nullptr; |
| 124 |
NoResultWidget *m_noResultWidget = nullptr; |
| 125 |
QGraphicsOpacityEffect *m_oe; |
| 126 |
QGraphicsOpacityEffect *m_oet; |
| 127 |
|
| 128 |
bool m_ctrlPress; |
| 129 |
}; |
| 130 |
|
| 131 |
#endif // IMPORTTIMELINEVIEW_H |