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

src/klflibdbengine_p.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klflibdbengine_p.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: klflibdbengine_p.h 453 2010-08-19 00:53:01Z philippe $ */
00023 
00024 
00030 #ifndef KLFLIBDBENGINE_P_H
00031 #define KLFLIBDBENGINE_P_H
00032 
00033 #include <QObject>
00034 
00035 
00037 class KLFLibDBEnginePropertyChangeNotifier : public QObject
00038 {
00039   Q_OBJECT
00040 public:
00041   KLFLibDBEnginePropertyChangeNotifier(const QString& dbname, QObject *parent)
00042     : QObject(parent), pDBName(dbname), pRef(0) { }
00043   virtual ~KLFLibDBEnginePropertyChangeNotifier() { }
00044 
00045   void ref() { ++pRef; }
00047   bool deRef() { return !--pRef; }
00048 
00049   void notifyResourcePropertyChanged(int propId)
00050   {
00051     emit resourcePropertyChanged(propId);
00052   }
00053 
00054   void notifySubResourcePropertyChanged(const QString& subResource, int propId)
00055   {
00056     emit subResourcePropertyChanged(subResource, propId);
00057   }
00058 
00059 signals:
00060   void resourcePropertyChanged(int propId);
00061   void subResourcePropertyChanged(const QString& subResource, int propId);
00062 
00063 private:
00064   QString pDBName;
00065   int pRef;
00066 };
00067 
00068 
00069 
00070 
00071 
00072 #endif

Generated by doxygen 1.7.3