1 /*
2     *
3     * This file is a part of Libcprime.
4     * Library for saving activites and bookmarks, share file and more.
5 	* Copyright 2019 CuboCore Group
6     *
7 
8     *
9     * This program is free software; you can redistribute it and/or modify
10     * it under the terms of the GNU General Public License as published by
11     * the Free Software Foundation; either version 3 of the License, or
12     * (at your option) any later version.
13     *
14 
15     *
16     * This program is distributed in the hope that it will be useful,
17     * but WITHOUT ANY WARRANTY; without even the implied warranty of
18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     * GNU General Public License for more details.
20     *
21 
22     *
23     * You should have received a copy of the GNU General Public License
24     * along with this program; if not, vsit http://www.gnu.org/licenses/.
25     *
26 */
27 
28 #pragma once
29 
30 #include <QDialog>
31 
32 #include "pinmanage.h"
33 #include "libcprime_global.h"
34 
35 
36 namespace Ui {
37     class PinIT;
38 }
39 
40 class LIBCPRIMESHARED_EXPORT PinIT : public QDialog
41 {
42     Q_OBJECT
43 
44 public:
45     /**
46      * @brief Call add pinit dialog from any apps by giving the path to pin it.
47      * @brief If a stringlist is sent, only first file will be pinned.
48      * @param files : Path which needs to be pinned.
49      */
50     explicit PinIT(const QStringList &files = QStringList(), QWidget *parent = nullptr);
51     ~PinIT();
52 
53 
54 private slots:
55     void on_done_clicked();
56     void pinName_Changed();
57     void item_Changed();
58     void on_pinName_textChanged(const QString &arg1);
59     void on_pinSection_currentIndexChanged(const QString &arg1);
60 
61 	void on_deleteSection_clicked();
62 
63 	void on_addSection_clicked();
64 
65 private:
66     Ui::PinIT *ui;
67     PinManage pin;
68 
69     QStringList mFiles;
70 
71     void checkPath();
72     void setPinPath(const QString &path);
73     void setPinName(const QString &bName);
74 
75     QString getPinName();
76     QString getSectionName();
77 };
78