QCodeEdit 2.2
lib/snippets/qsnippetedit.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
00004 **
00005 ** This file is part of the Edyuk project <http://edyuk.org>
00006 ** 
00007 ** This file may be used under the terms of the GNU General Public License
00008 ** version 3 as published by the Free Software Foundation and appearing in the
00009 ** file GPL.txt included in the packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ****************************************************************************/
00015 
00016 #ifndef _QSNIPPET_EDIT_H_
00017 #define _QSNIPPET_EDIT_H_
00018 
00019 #include "qce-config.h"
00020 
00026 #include <QWidget>
00027 #include "ui_snippetedit.h"
00028 
00029 class QSnippet;
00030 class QSnippetManager;
00031 
00032 class QCE_EXPORT QSnippetEdit : public QWidget, private Ui::SnippetEdit
00033 {
00034     Q_OBJECT
00035     
00036     public:
00037         QSnippetEdit(QWidget *p = 0);
00038         QSnippetEdit(QSnippetManager *mgr, QWidget *p = 0);
00039         
00040         QSnippetManager* snippetManager() const;
00041         
00042     public slots:
00043         void setSnippetManager(QSnippetManager *mgr);
00044         
00045         bool maybeSave();
00046         
00047         void retranslate();
00048         
00049     private slots:
00050         void on_lwSnippets_currentRowChanged(int idx);
00051         
00052         void on_leSnippetName_editingFinished();
00053         void on_leSnippetScope_editingFinished();
00054         
00055         void on_tbCreateSnippet_clicked();
00056         void on_tbDeleteSnippet_clicked();
00057         void on_bMoreSnippets_clicked();
00058         
00059         void snippetRemoved(int i);
00060         void snippetAdded(QSnippet *s);
00061         
00062     private:
00063         int m_editedSnippet;
00064         QSnippetManager *m_manager;
00065 };
00066 
00067 #endif