[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project

src/klflibentryeditor.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klflibentryeditor.h
00003  *   This file is part of the KLatexFormula Project.
00004  *   Copyright (C) 2010 by Philippe Faist
00005  *   philippe.faist at bluewin.ch
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /* $Id: klflibentryeditor.h 469 2010-09-05 23:12:46Z philippe $ */
00023 
00024 #ifndef KLFLIBENTRYEDITOR_H
00025 #define KLFLIBENTRYEDITOR_H
00026 
00027 #include <QWidget>
00028 #include <QComboBox>
00029 
00030 #include <klflib.h>
00031 
00032 
00033 
00034 namespace Ui { class KLFLibEntryEditor; }
00035 
00036 class KLF_EXPORT KLFLibEntryEditor : public QWidget
00037 {
00038   Q_OBJECT
00039 public:
00040   KLFLibEntryEditor(QWidget *parent = NULL);
00041   virtual ~KLFLibEntryEditor();
00042 
00043   void addCategorySuggestions(const QStringList& categorylist);
00044 
00045   virtual bool eventFilter(QObject *object, QEvent *event);
00046 
00047   inline bool metaInfoModified() const { return pMetaInfoModified; }
00048 
00049 signals:
00050 
00054   void metaInfoChanged(const QMap<int,QVariant>& props);
00055 
00056   void restoreStyle(const KLFStyle& style);
00057 
00058 public slots:
00059 
00060   void displayEntry(const KLFLibEntry& entry);
00061 
00064   void displayEntries(const QList<KLFLibEntry>& entries);
00065 
00071   void setInputEnabled(bool enabled);
00072 
00073   void retranslateUi(bool alsoBaseUi = true);
00074 
00075 protected slots:
00076 
00077   void slotUpdateFromCbx(QComboBox *cbx);
00078 
00079   void on_btnApplyChanges_clicked();
00080   void on_btnRestoreStyle_clicked();
00084   void slotApplyChanges() { slotApplyChanges(true, true); }
00085   void slotApplyChanges(bool category, bool tags);
00086 
00087   void slotModified(bool modif = true);
00088 
00089   void slotCbxSaveCurrentCompletion(QComboBox *cbx);
00090   void slotCbxCleanUpCompletions(QComboBox *cbx);
00091 
00092 private:
00093   Ui::KLFLibEntryEditor *u;
00094 
00095   bool pInputEnabled;
00096 
00097   bool pMetaInfoModified;
00098 
00099   KLFStyle pCurrentStyle;
00100 
00101   //  void updateEditText(QComboBox *editWidget, const QString& newText);
00102   void displayStyle(bool valid, const KLFStyle& style);
00103 };
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 #endif

Generated by doxygen 1.7.3