File indexing completed on 2024-06-16 04:16:23

0001 /*
0002   SPDX-FileCopyrightText: 2020 Saurabh Kumar <saurabhk660@gmail.com>
0003 
0004   SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef STORYBOARD_VIEW_H
0008 #define STORYBOARD_VIEW_H
0009 
0010 #include <QListView>
0011 #include <QScroller>
0012 
0013 #include <kritastoryboarddocker_export.h>
0014 
0015 class QStyleOptionViewItem;
0016 class StoryboardModel;
0017 
0018 /**
0019  * This view draws the children of every index in the first column of 
0020  * the model inside the parent index
0021  *
0022  * */
0023 
0024 class KRITASTORYBOARDDOCKER_EXPORT StoryboardView : public QListView
0025 {
0026     Q_OBJECT
0027 public:
0028     explicit StoryboardView(QWidget *parent = 0);
0029     ~StoryboardView() override;
0030 
0031     void paintEvent(QPaintEvent *event) override;
0032     QRect visualRect(const QModelIndex &index) const override;
0033     QModelIndex indexAt(const QPoint &point) const override;
0034     void setItemOrientation(Qt::Orientation orientation);
0035 
0036     /**
0037      * @brief whether Comments are below or on the right of Thumbnail
0038      * @return The orientation of each Storyboard Item
0039      */
0040     Qt::Orientation itemOrientation();
0041 
0042     /**
0043      * @return True if comments are visible, otherwise False.
0044      */
0045     bool commentIsVisible() const;
0046 
0047     /**
0048      * @return True if thumbnails are visible, otherwise False.
0049      */
0050     bool thumbnailIsVisible() const;
0051 
0052     /**
0053      * @brief Sets the visibility of comments
0054      * @param value The new visibility value
0055      */
0056     void setCommentVisibility(bool value);
0057 
0058     /**
0059      * @brief Sets the visibility of thumbnails
0060      * @param value The new visibility value
0061      */
0062     void setThumbnailVisibility(bool value);
0063 
0064     /**
0065      * @brief changes the @c currentIndex and @c selectedIndex to frame
0066      * @param frame The new current frame
0067      */
0068     void setCurrentItem(int frame);
0069 
0070 
0071     void mouseReleaseEvent(QMouseEvent *event) override;
0072 
0073     QSize sizeHint() const override;
0074 
0075 private Q_SLOTS:
0076     void slotContextMenuRequested(const QPoint &);
0077 
0078     void slotItemClicked(const QModelIndex &clicked);
0079 
0080 private:
0081     Qt::Orientation m_itemOrientation;
0082     bool m_commentIsVisible;
0083     bool m_thumbnailIsVisible;
0084 };
0085 
0086 #endif