kexi
KexiProject Class Reference
#include <kexiproject.h>
Inheritance diagram for KexiProject:

Detailed Description
A project's main controller.It also contains connection data, current file state, etc.
Definition at line 67 of file kexiproject.h.
Signals | |
void | error (const QString &title, KexiDB::Object *obj) |
void | error (const QString &msg, const QString &desc) |
void | newItemStored (KexiPart::Item &item) |
void | itemRemoved (const KexiPart::Item &item) |
void | itemRenamed (const KexiPart::Item &item, const QCString &oldName) |
Public Member Functions | |
KexiProject (KexiProjectData *pdata, KexiDB::MessageHandler *handler=0) | |
KexiProject (KexiProjectData *pdata, KexiDB::MessageHandler *handler, KexiDB::Connection *conn) | |
~KexiProject () | |
int | versionMajor () const |
int | versionMinor () const |
tristate | open () |
tristate | open (bool &incompatibleWithKexi) |
tristate | create (bool forceOverwrite=false) |
bool | error () const |
bool | isConnected () |
KexiPart::ItemDict * | items (KexiPart::Info *i) |
KexiPart::ItemDict * | itemsForMimeType (const QCString &mimeType) |
void | getSortedItems (KexiPart::ItemList &list, KexiPart::Info *i) |
void | getSortedItemsForMimeType (KexiPart::ItemList &list, const QCString &mimeType) |
KexiPart::Item * | itemForMimeType (const QCString &mimeType, const QString &name) |
KexiPart::Item * | item (KexiPart::Info *i, const QString &name) |
KexiPart::Item * | item (int identifier) |
KexiDB::Connection * | dbConnection () const |
KexiProjectData * | data () const |
KexiDialogBase * | openObject (KexiMainWindow *wnd, KexiPart::Item &item, int viewMode=Kexi::DataViewMode, QMap< QString, QString > *staticObjectArgs=0) |
KexiDialogBase * | openObject (KexiMainWindow *wnd, const QCString &mimeType, const QString &name, int viewMode=Kexi::DataViewMode) |
bool | removeObject (KexiMainWindow *wnd, KexiPart::Item &item) |
bool | renameObject (KexiMainWindow *wnd, KexiPart::Item &item, const QString &newName) |
KexiPart::Item * | createPartItem (KexiPart::Info *info, const QString &suggestedCaption=QString::null) |
KexiPart::Item * | createPartItem (KexiPart::Part *part, const QString &suggestedCaption=QString::null) |
void | addStoredItem (KexiPart::Info *info, KexiPart::Item *item) |
void | deleteUnstoredItem (KexiPart::Item *item) |
KexiDB::Parser * | sqlParser () |
bool | final () const |
void | setFinal (bool set) |
Static Public Member Functions | |
static KexiProject * | createBlankProject (bool &cancelled, KexiProjectData *data, KexiDB::MessageHandler *handler=0) |
static tristate | dropProject (KexiProjectData *data, KexiDB::MessageHandler *handler, bool dontAsk=false) |
Protected Member Functions | |
bool | createConnection () |
void | closeConnection () |
bool | initProject () |
tristate | openInternal (bool *incompatibleWithKexi) |
bool | createInternalStructures (bool insideTransaction) |
KexiPart::Part * | findPartFor (KexiPart::Item &item) |
bool | checkWritable () |
Protected Attributes | |
Private * | d |
Friends | |
class | KexiMainWindowImpl |
Constructor & Destructor Documentation
|
Constructor 1. Creates a new object using pdata. pdata which will be then owned by KexiProject object. handler can be provided to receive error messages during entire KexiProject object's lifetime. Definition at line 115 of file kexiproject.cpp. |
|
Constructor 2. Like above but sets predefined connections conn. The connection should be created using the same connection data as pdata->connectionData(). The connection will become owned by created KexiProject object, so do not destroy it. Definition at line 124 of file kexiproject.cpp. |
Member Function Documentation
|
Adds item item after it is succesfully stored as an instance of part pointed by info. Also clears 'neverSaved' flag if item. Used by KexiDialogBase::storeNewData(). Definition at line 579 of file kexiproject.cpp. |
|
New object of mimetype mime and name has been created. Checks whether the project's connection is read-only. If so, error message is set and false is returned. Definition at line 708 of file kexiproject.cpp. |
|
Creates new, empty project using project data. If forceOverwrite is true, existing database project is silently overwritten. Connection is created (accessible then with KexiProject::dbConnection()). Since KexiProject inherits KexiDB::Object, it is possible to get error message and other informations on error.
Definition at line 230 of file kexiproject.cpp. |
|
Shows dialog for creating new blank project, ans creates one. Dialog is not shown if option for automatic creation is checked or Kexi::startupHandler().projectData() was provided from command line. cancelled is set to true if creation has been cancelled (e.g. user answered no when asked for database overwriting, etc.
Definition at line 896 of file kexiproject.cpp. |
|
used to emit objectCreated() signal Creates connection using project data.
Definition at line 420 of file kexiproject.cpp. |
|
Kexi itself can define a number of internal database objects (mostly data structures), usually tables for it's own purposes. Even while at KexiDB library level, such "system" tables, like "kexi__objects", "kexi__objectdata" are created automatically on database project creation, this is not enough: there are objects needed specifically for Kexi but not for other applications utilizing KexiDB library. Example table created here for now is "kexi__blobs". This method is called on create() and open(): creates necessary objects if they are not yet existing. This especially allows to create to create these objects (on open) within a project made with previous Kexi version not supporting all currently defined structurtes. We're trying to be here as much backward compatible as possible. For this purpose, here's the complete list of currently created objects:
Definition at line 304 of file kexiproject.cpp. |
|
Added for convenience.
Definition at line 870 of file kexiproject.cpp. |
|
Creates part item for given part info. Newly item will not be saved to the backend but stored in memory only (owned by project), and marked as "neverSaved" (see KexiPart::Item::neverSaved()). The item will have assigned a new unique caption like e.g. "Table15", and unique name like "table15", but no specific identifier (because id will be assigned on creation at the backend side). If suggestedCaption is not empty, it will be set as a caption (with number suffix, to avoid duplicated, e.g. "employees7" for "employees" sugested name). Name will be then built based on this caption using KexiUtils::string2Identifier(). This method is used before creating new object.
Definition at line 805 of file kexiproject.cpp. |
|
Definition at line 146 of file kexiproject.cpp. |
|
removes item from internal dictionaries. The item is destroyed after successful removal. Used to delete an unstored part item previusly created with createPartItem(). Definition at line 875 of file kexiproject.cpp. |
|
Drops project described by data.
Definition at line 931 of file kexiproject.cpp. |
|
signal emitted on error (not KexiDB-related)
|
|
signal emitted on error
|
|
Reimplemented from KexiDB::Object. Definition at line 125 of file kexiproject.h. |
|
Definition at line 156 of file kexiproject.cpp. |
|
Definition at line 672 of file kexiproject.cpp. |
|
Puts a list of items of a type i in this project into list. You can then sort this list using ItemList::sort(). Definition at line 561 of file kexiproject.cpp. |
|
Puts a sorted list of items of a type mimeType in this project into list. You can then sort this list using ItemList::sort(). Definition at line 572 of file kexiproject.cpp. |
|
Definition at line 498 of file kexiproject.cpp. |
|
Definition at line 620 of file kexiproject.cpp. |
|
Definition at line 606 of file kexiproject.cpp. |
|
Definition at line 592 of file kexiproject.cpp. |
|
instance pointed by item is removed
|
|
instance pointed by item is renamed
|
|
Definition at line 507 of file kexiproject.cpp. |
|
Definition at line 554 of file kexiproject.cpp. |
|
New item has been stored.
|
|
Like open().
Definition at line 177 of file kexiproject.cpp. |
|
Opens existing project using project data.
Definition at line 183 of file kexiproject.cpp. |
|
Used in open() and open(bool&).
Definition at line 189 of file kexiproject.cpp. |
|
For convenience.
Definition at line 701 of file kexiproject.cpp. |
|
Opens object pointed by item in a view viewMode. staticObjectArgs can be passed for static object (only works when part for this item is of type KexiPart::StaticPart) Definition at line 682 of file kexiproject.cpp. |
|
Remove a part instance pointed by item.
Definition at line 716 of file kexiproject.cpp. |
|
Renames a part instance pointed by item to a new name newName.
Definition at line 755 of file kexiproject.cpp. |
|
Definition at line 166 of file kexiproject.cpp. |
|
Definition at line 171 of file kexiproject.cpp. |
Member Data Documentation
|
for future extensions
Reimplemented from KexiDB::Object. Definition at line 328 of file kexiproject.h. |
The documentation for this class was generated from the following files: