File indexing completed on 2024-05-12 16:34:42

0001 /* This file is part of the Calligra project
0002  * Copyright (C) 2010-2014 Yue Liu <yue.liu@mail.com>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef KOSTENCILBOXDOCKER_H
0021 #define KOSTENCILBOXDOCKER_H
0022 
0023 #include <QDockWidget>
0024 #include <QListView>
0025 #include <QMap>
0026 #include <QIcon>
0027 #include <QThread>
0028 
0029 class CollectionItemModel;
0030 class CollectionTreeWidget;
0031 
0032 class KLineEdit;
0033 
0034 class QToolButton;
0035 class QMenu;
0036 class QVBoxLayout;
0037 class QHBoxLayout;
0038 class QSortFilterProxyModel;
0039 
0040 class StencilBoxDockerLoader;
0041 
0042 class StencilBoxDocker : public QDockWidget
0043 {
0044     Q_OBJECT
0045     public:
0046         explicit StencilBoxDocker(QWidget* parent = 0);
0047         ~StencilBoxDocker() override;
0048 
0049     protected:
0050         void removeCollection(const QString& family);
0051 
0052     protected Q_SLOTS:
0053         /// Called when the docker changes area
0054         void locationChanged(Qt::DockWidgetArea area);
0055 
0056     private:
0057         QMap<QString, CollectionItemModel*> m_modelMap;
0058         //QMap<QString, QSortFilterProxyModel*> m_proxyMap;
0059 
0060         CollectionTreeWidget *m_treeWidget;
0061         QMenu* m_menu;
0062         QToolButton* m_button;
0063         KLineEdit* m_filterLineEdit;
0064         QVBoxLayout* m_layout;
0065         QHBoxLayout* m_panelLayout;
0066 
0067         QThread loaderThread;
0068         StencilBoxDockerLoader *m_loader;
0069 
0070     private Q_SLOTS:
0071         void reapplyFilter();
0072 #ifdef GHNS
0073         void getHotNewStuff();
0074 #endif
0075         void manageStencilsFolder();
0076         //void regenerateProxyMap();
0077         void collectionsLoaded();
0078         void threadStarted();
0079 
0080     Q_SIGNALS:
0081         void startLoading();
0082 };
0083 
0084 #endif //KOSHAPECOLLECTIONDOCKER_H