~librecad-dev/librecad/librecad

« back to all changes in this revision

Viewing changes to plugins/sample/sample.h

  • Committer: Scott Howard
  • Date: 2014-02-21 19:07:55 UTC
  • Revision ID: showard@debian.org-20140221190755-csjax9wb146hgdq4
first commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************/
 
2
/*  sample.h - plugin example for LibreCAD                                   */
 
3
/*                                                                           */
 
4
/*  Copyright (C) 2011 Rallaz, rallazz@gmail.com                             */
 
5
/*                                                                           */
 
6
/*  This library is free software, licensed under the terms of the GNU       */
 
7
/*  General Public License as published by the Free Software Foundation,     */
 
8
/*  either version 2 of the License, or (at your option) any later version.  */
 
9
/*  You should have received a copy of the GNU General Public License        */
 
10
/*  along with this program.  If not, see <http://www.gnu.org/licenses/>.    */
 
11
/*****************************************************************************/
 
12
 
 
13
#ifndef SAMPLE_H
 
14
#define SAMPLE_H
 
15
 
 
16
#include "qc_plugininterface.h"
 
17
#include <QDialog>
 
18
class QLineEdit;
 
19
 
 
20
class LC_Sample : public QObject, QC_PluginInterface
 
21
{
 
22
    Q_OBJECT
 
23
     Q_INTERFACES(QC_PluginInterface)
 
24
#if QT_VERSION >= 0x050000
 
25
     Q_PLUGIN_METADATA(IID "org.librecad.sample" FILE  "sample.json")
 
26
#endif
 
27
 
 
28
 public:
 
29
    virtual PluginCapabilities getCapabilities() const;
 
30
    virtual QString name() const;
 
31
    virtual void execComm(Document_Interface *doc,
 
32
                                       QWidget *parent, QString cmd);
 
33
};
 
34
 
 
35
class lc_Sampledlg : public QDialog
 
36
{
 
37
    Q_OBJECT
 
38
 
 
39
public:
 
40
    explicit lc_Sampledlg(QWidget *parent = 0);
 
41
    ~lc_Sampledlg();
 
42
 
 
43
public slots:
 
44
//    void processAction(QStringList *commandList);
 
45
    void processAction(Document_Interface *doc);
 
46
    void checkAccept();
 
47
 
 
48
protected:
 
49
    void closeEvent(QCloseEvent *event);
 
50
 
 
51
private:
 
52
    void readSettings();
 
53
    void writeSettings();
 
54
    bool failGUI(QString *msg);
 
55
 
 
56
private:
 
57
    QString errmsg;
 
58
    QLineEdit *startxedit;
 
59
    QLineEdit *startyedit;
 
60
    QLineEdit *endxedit;
 
61
    QLineEdit *endyedit;
 
62
};
 
63
 
 
64
#endif // SAMPLE_H