kexi
kexiquerydesignerguieditor.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEXIQUERYDESIGNERGUIEDITOR_H
00022 #define KEXIQUERYDESIGNERGUIEDITOR_H
00023
00024 #include <qguardedptr.h>
00025 #include <qsplitter.h>
00026
00027 #include <kexiviewbase.h>
00028 #include "kexiquerypart.h"
00029
00030 class KexiMainWindow;
00031 class KexiTableViewData;
00032 class KexiDataTable;
00033 class KexiTableItem;
00034 class KexiRelationWidget;
00035 class KexiSectionHeader;
00036 class KexiDataAwarePropertySet;
00037 class KexiRelationViewTableContainer;
00038 class KexiRelationViewConnection;
00039
00040 namespace KexiPart
00041 {
00042 class Item;
00043 }
00044
00045 namespace KoProperty {
00046 class Property;
00047 class Set;
00048 }
00049
00050 namespace KexiDB
00051 {
00052 class Connection;
00053 class QuerySchema;
00054 class TableSchema;
00055 class ResultInfo;
00056 }
00057
00059 class KexiQueryDesignerGuiEditor : public KexiViewBase
00060 {
00061 Q_OBJECT
00062
00063 public:
00064 KexiQueryDesignerGuiEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0);
00065 virtual ~KexiQueryDesignerGuiEditor();
00066
00067
00068
00069 KexiRelationWidget *relationView() const;
00070
00071 virtual QSize sizeHint() const;
00072
00073 public slots:
00074 virtual void setFocus();
00075
00076 protected:
00077 void initTableColumns();
00078 void initTableRows();
00079
00080
00081 virtual tristate beforeSwitchTo(int mode, bool &dontStore);
00082 virtual tristate afterSwitchFrom(int mode);
00083
00084 virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
00085 virtual tristate storeData(bool dontAsk = false);
00086
00089 void updateColumnsData();
00090
00093 virtual KoProperty::Set *propertySet();
00094
00095 KoProperty::Set* createPropertySet( int row,
00096 const QString& tableName, const QString& fieldName, bool newOne = false );
00097
00102 bool buildSchema(QString *errMsg = 0);
00103
00104 KexiQueryPart::TempData * tempData() const;
00105
00109 KexiTableItem* createNewRow(const QString& tableName, const QString& fieldName,
00110 bool visible) const;
00111
00112 KexiDB::BaseExpr* parseExpressionString(const QString& fullString, int& token,
00113 bool allowRelationalOperator);
00114
00115 QCString generateUniqueAlias() const;
00116 void updatePropertiesVisibility(KoProperty::Set& buf);
00117
00118 protected slots:
00119 void slotDragOverTableRow(KexiTableItem *item, int row, QDragMoveEvent* e);
00120 void slotDroppedAtRow(KexiTableItem *item, int row,
00121 QDropEvent *ev, KexiTableItem*& newItem);
00123 void slotNewItemAppendedForAfterDeletingInSpreadSheetMode();
00124 void slotTableAdded(KexiDB::TableSchema &t);
00125 void slotTableHidden(KexiDB::TableSchema &t);
00126
00128 void slotBeforeCellChanged(KexiTableItem *item, int colnum,
00129 QVariant& newValue, KexiDB::ResultInfo* result);
00130
00131 void slotRowInserted(KexiTableItem* item, uint row, bool repaint);
00132 void slotTablePositionChanged(KexiRelationViewTableContainer*);
00133 void slotAboutConnectionRemove(KexiRelationViewConnection*);
00134 void slotTableFieldDoubleClicked( KexiDB::TableSchema* table, const QString& fieldName );
00135
00137 bool loadLayout();
00138
00140 bool storeLayout();
00141
00142 void showTablesForQuery(KexiDB::QuerySchema *query);
00144 void showFieldsOrRelationsForQueryInternal(
00145 KexiDB::QuerySchema *query, bool showFields, bool showRelations, KexiDB::ResultInfo& result);
00147 void showFieldsAndRelationsForQuery(KexiDB::QuerySchema *query, KexiDB::ResultInfo& result);
00149 void showFieldsForQuery(KexiDB::QuerySchema *query, KexiDB::ResultInfo& result);
00151 void showRelationsForQuery(KexiDB::QuerySchema *query, KexiDB::ResultInfo& result);
00152
00153 void addConnection(KexiDB::Field *masterField, KexiDB::Field *detailsField);
00154
00155 void slotPropertyChanged(KoProperty::Set& list, KoProperty::Property& property);
00156
00157
00158 void slotNewItemStored(KexiPart::Item&);
00159 void slotItemRemoved(const KexiPart::Item& item);
00160 void slotItemRenamed(const KexiPart::Item& item, const QCString& oldName);
00161
00162 private:
00163 class Private;
00164 Private *d;
00165
00166 friend class KexiQueryView;
00167 };
00168
00169 #endif
00170
|