Changeset View
Changeset View
Standalone View
Standalone View
kexi/core/KexiView.h
Show All 29 Lines | |||||
30 | 30 | | |||
31 | namespace KoProperty | 31 | namespace KoProperty | ||
32 | { | 32 | { | ||
33 | class Set; | 33 | class Set; | ||
34 | } | 34 | } | ||
35 | 35 | | |||
36 | namespace KexiDB | 36 | namespace KexiDB | ||
37 | { | 37 | { | ||
38 | class Cursor; | ||||
38 | class SchemaData; | 39 | class SchemaData; | ||
39 | } | 40 | } | ||
40 | 41 | | |||
41 | //! Base class for single view embeddable in KexiWindow. | 42 | //! Base class for single view embeddable in KexiWindow. | ||
42 | /*! This class automatically works as a proxy for shared (application-wide) actions. | 43 | /*! This class automatically works as a proxy for shared (application-wide) actions. | ||
43 | KexiView has 'dirty' flag to indicate that view's data has changed. | 44 | KexiView has 'dirty' flag to indicate that view's data has changed. | ||
44 | This flag's state is reused by KexiWindow object that contain the view. | 45 | This flag's state is reused by KexiWindow object that contain the view. | ||
45 | KexiView objects can be also nested, using addChildView(): any actions and 'dirty' flag | 46 | KexiView objects can be also nested, using addChildView(): any actions and 'dirty' flag | ||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 62 | public: | |||
143 | void setDefaultIconName(const QString& iconName); | 144 | void setDefaultIconName(const QString& iconName); | ||
144 | 145 | | |||
145 | /*! For KexiQueryView */ | 146 | /*! For KexiQueryView */ | ||
146 | virtual QList<QVariant> currentParameters() const; | 147 | virtual QList<QVariant> currentParameters() const; | ||
147 | 148 | | |||
148 | Q_DECLARE_FLAGS(StoreNewDataOptions, StoreNewDataOption) | 149 | Q_DECLARE_FLAGS(StoreNewDataOptions, StoreNewDataOption) | ||
149 | 150 | | |||
150 | public Q_SLOTS: | 151 | public Q_SLOTS: | ||
152 | /*! Sets data. Only works for db-aware view. */ | ||||
153 | bool setData(KexiDB::Cursor *cursor); | ||||
154 | | ||||
151 | virtual void setFocus(); | 155 | virtual void setFocus(); | ||
152 | 156 | | |||
153 | /*! Call this in your view's implementation whenever current property set | 157 | /*! Call this in your view's implementation whenever current property set | ||
154 | (returned by propertySet()) is switched to other, | 158 | (returned by propertySet()) is switched to other, | ||
155 | so property editor contents need to be completely replaced. */ | 159 | so property editor contents need to be completely replaced. */ | ||
156 | virtual void propertySetSwitched(); | 160 | virtual void propertySetSwitched(); | ||
157 | 161 | | |||
158 | /*! Saves settings for the view. Default implementation does nothing and returns true. | 162 | /*! Saves settings for the view. Default implementation does nothing and returns true. | ||
Show All 12 Lines | |||||
171 | 175 | | |||
172 | Q_SIGNALS: | 176 | Q_SIGNALS: | ||
173 | //! emitted when the view is about to close | 177 | //! emitted when the view is about to close | ||
174 | void closing(bool *cancel); | 178 | void closing(bool *cancel); | ||
175 | 179 | | |||
176 | void focus(bool in); | 180 | void focus(bool in); | ||
177 | 181 | | |||
178 | protected: | 182 | protected: | ||
183 | /*! Sets data to the widget. Default implementation just calls KexiDB::Cursor::open(). | ||||
184 | Used internally by setData(KexiDB::Cursor*). | ||||
185 | @return true on success. */ | ||||
186 | virtual bool setWidgetData(KexiDB::Cursor *cursor); | ||||
187 | | ||||
179 | virtual bool eventFilter(QObject *o, QEvent *e); | 188 | virtual bool eventFilter(QObject *o, QEvent *e); | ||
180 | 189 | | |||
181 | /*! called by KexiWindow::switchToViewMode() right before window is switched to new mode | 190 | /*! called by KexiWindow::switchToViewMode() right before window is switched to new mode | ||
182 | By default does nothing. Reimplement this if you need to do something | 191 | By default does nothing. Reimplement this if you need to do something | ||
183 | before switching to this view. | 192 | before switching to this view. | ||
184 | \return true if you accept or false if a error occupied and view shouldn't change | 193 | \return true if you accept or false if a error occupied and view shouldn't change | ||
185 | If there is no error but switching should be just cancelled | 194 | If there is no error but switching should be just cancelled | ||
186 | (probably after showing some info messages), you need to return cancelled. | 195 | (probably after showing some info messages), you need to return cancelled. | ||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |