[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klffactory.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klffactory.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klffactory.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFFACTORY_H
25 #define KLFFACTORY_H
26 
27 #include <QString>
28 #include <QList>
29 
30 #include <klfdefs.h>
31 
32 
33 class KLFFactoryManager;
34 
36 
40 class KLF_EXPORT KLFFactoryBase
41 {
42 public:
43  KLFFactoryBase(KLFFactoryManager *factoryManager);
44  virtual ~KLFFactoryBase();
45 
47  virtual QStringList supportedTypes() const = 0;
48 
49 private:
50  KLFFactoryManager *pFactoryManager;
51 };
52 
53 
55 
90 class KLF_EXPORT KLFFactoryManager
91 {
92 public:
96  virtual ~KLFFactoryManager();
97 
100  KLFFactoryBase * findFactoryFor(const QString& objType);
101 
104  QStringList allSupportedTypes();
106  inline QList<KLFFactoryBase*> registeredFactories() { return pRegisteredFactories; }
107 
108 private:
110  QList<KLFFactoryBase*> pRegisteredFactories;
111 
113  void registerFactory(KLFFactoryBase *factory);
115  void unRegisterFactory(KLFFactoryBase *factory);
116 
117  friend class KLFFactoryBase;
118 };
119 
120 
121 
122 
123 #endif
QList< KLFFactoryBase * > registeredFactories()
Definition: klffactory.h:106
Base class for factories.
Definition: klffactory.h:40
A base abstract factory manager class.
Definition: klffactory.h:90

Generated by doxygen 1.8.5