14#ifndef KIS_RESOURCE_ITEM_CHOOSER
15#define KIS_RESOURCE_ITEM_CHOOSER
27class QAbstractProxyModel;
28class QAbstractItemDelegate;
31class QSortFilterProxyModel;
35#include "kritaresourcewidgets_export.h"
58 explicit KisResourceItemChooser(
const QString &resourceType,
bool usePreview =
false, QWidget *parent = 0);
63 void setResponsiveness(
bool isResponsive);
71 void showTaggingBar(
bool show);
83 void showStorageBtn(
bool visible);
86 void setRowHeight(
int rowHeight);
89 void setColumnWidth(
int columnWidth);
92 void setItemDelegate(QAbstractItemDelegate *delegate);
104 void setCurrentResource(QString resourceName);
111 void setCurrentItem(
int row);
115 void showImportExportBtns(
bool show);
118 void setPreviewOrientation(Qt::Orientation orientation);
121 void setPreviewTiled(
bool tiled);
124 void setGrayscalePreview(
bool grayscale);
127 QSize viewSize()
const;
134 void setSynced(
bool sync);
137 bool eventFilter(QObject *
object, QEvent *event)
override;
151 void slotButtonClicked(
int button);
156 void scrollBackwards();
157 void scrollForwards();
158 void activate(
const QModelIndex &index);
159 void clicked(
const QModelIndex &index);
160 void contextMenuRequested(
const QPoint &pos);
161 void baseLengthChanged(
int length);
162 void afterFilterChanged();
163 void slotSaveSplitterState();
166 void showEvent(QShowEvent *event)
override;
167 void resizeEvent(QResizeEvent *event)
override;
170 void updateButtonState();
171 void updatePreview(
const QModelIndex &idx);
173 void hideEverything();
174 void applyVerticalLayout();
175 void changeLayoutBasedOnSize();
179 KoResourceSP resourceFromModelIndex(
const QModelIndex &index)
const;
qreal length(const QPointF &vec)
void slotScrollerStateChanged(QScroller::State state)
void listViewModeChanged(ListViewMode newViewMode)
Emitted when the view mode for the internal KisResourceItemListView changes.
KoResourceSP currentResource(bool includeHidden=false) const
Gets the currently selected resource.
KisPopupButton * viewModeButton() const
void resourceSelected(KoResourceSP resource)
Emitted when a resource was selected.
void showViewModeBtn(bool visible)
void resourceClicked(KoResourceSP resource)
The KisTagFilterResourceProxyModel class filters the resources by tag or resource name.
QString button(const QWheelEvent &ev)