kexi

kexipartmanager.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
3 Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KEXIPARTMANAGER_H
22#define KEXIPARTMANAGER_H
23
24#include <tqobject.h>
25#include <tqdict.h>
26#include <tqasciidict.h>
27#include <tqintdict.h>
28#include <tqvaluelist.h>
29#include <tqptrlist.h>
30
31#include <kservice.h>
32
33#include <kexidb/object.h>
34
35//#include "kexipartdatasource.h"
36
37namespace KexiDB
38{
39 class Connection;
40}
41
42namespace KexiPart
43{
44 class Info;
45 class Part;
46 class StaticPart;
47
48 struct Missing
49 {
50 TQString name;
51 TQCString mime;
52 TQString url;
53 };
54
55 typedef TQAsciiDict<Info> PartInfoDict;
56 typedef TQDictIterator<Info> PartInfoDictIterator;
57 typedef TQValueList<Missing> MissingList;
58 typedef TQPtrList<Info> PartInfoList;
59 typedef TQPtrListIterator<Info> PartInfoListIterator;
60 typedef TQIntDict<Part> PartDict;
61// typedef TQPtrList<DataSource> DataSourceList;
62
68class KEXICORE_EXPORT Manager : public TQObject, public KexiDB::Object
69{
70 TQ_OBJECT
71
72
73 public:
77 Manager(TQObject *parent = 0);
78 ~Manager();
79
83 void lookup();
84
89 Part *partForMimeType(const TQString& mimeTypt);
90
95 Part *part(Info *);
96
100 Info *infoForMimeType(const TQString& mimeType);
101
108 bool checkProject(KexiDB::Connection *conn);
109
113 MissingList missingParts() const { return m_missing; }
114
115
119 PartInfoList *partInfoList() { return &m_partlist; }
120
121 signals:
122 void partLoaded(KexiPart::Part*);
123
124 protected:
126 void insertStaticPart(KexiPart::StaticPart* part);
127
128 private:
129 PartDict m_parts;
130 PartInfoList m_partlist;
131 PartInfoDict m_partsByMime;
132 MissingList m_missing;
133 int m_nextTempProjectPartID;
134 bool m_lookupDone : 1;
135
136 friend class StaticPart;
137};
138
139}
140
141#endif
142
Provides database connection, allowing queries and data modification.
Definition connection.h:62
Information about a Kexi Part (plugin).
KexiPart's manager: looks up and instantiates them.
PartInfoList * partInfoList()
MissingList missingParts() const
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
Static Kexi Part (plugin).
High-level database connectivity library with database backend drivers.