kexi

kexidialogbase.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
3 Copyright (C) 2003-2004 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#include "kexidialogbase.h"
22
23#include "keximainwindow.h"
24#include "kexiviewbase.h"
25#include "kexicontexthelp_p.h"
26#include "kexipart.h"
27#include "kexistaticpart.h"
28#include "kexipartitem.h"
29#include "kexipartinfo.h"
30#include "kexiproject.h"
31
32#include <kexidb/connection.h>
33#include <kexidb/utils.h>
34#include <kexiutils/utils.h>
35
36#include <tqwidgetstack.h>
37#include <tqobjectlist.h>
38#include <tqtimer.h>
39
40#include <kdebug.h>
41#include <tdeapplication.h>
42#include <kiconloader.h>
43
44KexiDialogBase::KexiDialogBase(KexiMainWindow *parent, const TQString &caption)
45 : KMdiChildView(caption, parent, "KexiDialogBase")
46 , KexiActionProxy(this, parent)
47 , m_isRegistered(false)
48 , m_origCaption(caption)
49 , m_schemaData(0)
50 , m_destroying(false)
51 , m_disableDirtyChanged(false)
52// , m_neverSaved(false)
53{
54 m_supportedViewModes = 0; //will be set by KexiPart
55 m_openedViewModes = 0;
56 m_currentViewMode = Kexi::NoViewMode; //no view available yet
57 m_parentWindow = parent;
58 m_creatingViewsMode = -1;
59
60 TQVBoxLayout *lyr = new TQVBoxLayout(this);
61 m_stack = new TQWidgetStack(this, "stack");
62 lyr->addWidget(m_stack);
63
64#ifdef KEXI_NO_CTXT_HELP
65 m_contextHelpInfo=new KexiContextHelpInfo();
66#endif
67// m_instance=parent->instance();
68 m_id = -1;
69 m_item = 0;
70
71 hide(); //will be shown later
72}
73
74KexiDialogBase::~KexiDialogBase()
75{
76 m_destroying = true;
77}
78
79KexiViewBase *KexiDialogBase::selectedView() const
80{
81 if (m_destroying)
82 return 0;
83// return static_cast<KexiViewBase*>(m_stack->visibleWidget());
84 return static_cast<KexiViewBase*>( m_stack->widget(m_currentViewMode) );
85}
86
87KexiViewBase *KexiDialogBase::viewForMode(int mode) const
88{
89 return static_cast<KexiViewBase*>( m_stack->widget(mode) );
90}
91
92void KexiDialogBase::addView(KexiViewBase *view)
93{
94 addView(view,0);
95}
96
97void KexiDialogBase::addView(KexiViewBase *view, int mode)
98{
99 m_stack->addWidget(view, mode);
100// addActionProxyChild( view );
101
102 //set focus proxy inside this view
103 TQWidget *ch = static_cast<TQWidget*>(view->child( 0, "TQWidget", false ));
104 if (ch)
105 view->setFocusProxy(ch);
106
107 m_openedViewModes |= mode;
108}
109
110void KexiDialogBase::removeView(int mode)
111{
112 KexiViewBase *view = viewForMode(mode);
113 if (view)
114 m_stack->removeWidget(view);
115
116 m_openedViewModes |= mode;
117 m_openedViewModes ^= mode;
118}
119
121{
122 KexiViewBase *v = selectedView();
123 if (!v)
124 return KMdiChildView::minimumSizeHint();
125 return v->minimumSizeHint() + TQSize(0, mdiParent() ? mdiParent()->captionHeight() : 0);
126}
127
129{
130 KexiViewBase *v = selectedView();
131 if (!v)
132 return KMdiChildView::sizeHint();
133 return v->preferredSizeHint( v->sizeHint() );
134}
135
136/*
137TDEInstance *KexiDialogBase::instance() {
138 return m_instance;
139}*/
140
141void KexiDialogBase::registerDialog() {
142 if (m_isRegistered)
143 return;
144 m_parentWindow->registerChild(this);
145 m_isRegistered=true;
146 if ( m_parentWindow->mdiMode() == KMdi::ToplevelMode ) {
147 m_parentWindow->addWindow( (KMdiChildView *)this, KMdi::Detach );
148 m_parentWindow->detachWindow((KMdiChildView *)this, true);
149 }
150 else
151 m_parentWindow->addWindow((KMdiChildView *)this);
152//later show();
153// m_parentWindow->activeWindowChanged(this);
154}
155
156bool KexiDialogBase::isRegistered(){
157 return m_isRegistered;
158}
159
161 if (!guiClient())
162 return;
163
164}
165
166void KexiDialogBase::detachFromGUIClient() {
167 if (!guiClient())
168 return;
169 //TODO
170}
171
173{
174 return (partItem() && partItem()->identifier()>0) ? partItem()->identifier() : m_id;
175}
176
177void KexiDialogBase::setContextHelp(const TQString& caption, const TQString& text, const TQString& iconName) {
178#ifdef KEXI_NO_CTXT_HELP
179 m_contextHelpInfo->caption=caption;
180 m_contextHelpInfo->text=text;
181 m_contextHelpInfo->text=iconName;
182 updateContextHelp();
183#endif
184}
185
186void KexiDialogBase::closeEvent( TQCloseEvent * e )
187{
188 m_parentWindow->acceptPropertySetEditing();
189
190 //let any view send "closing" signal
191 TQObjectList *list = m_stack->queryList( "KexiViewBase", 0, false, false);
192 KexiViewBase *view;
193 TQObjectListIt it( *list );
194 for ( ;(view = static_cast<KexiViewBase*>(it.current()) ) != 0; ++it ) {
195 bool cancel = false;
196 emit view->closing(cancel);
197 if (cancel) {
198 e->ignore();
199 return;
200 }
201 }
202 delete list;
203 emit closing();
204 KMdiChildView::closeEvent(e);
205}
206
207#if 0
208//js removed
209bool KexiDialogBase::tryClose(bool dontSaveChanges)
210{
211 if (!dontSaveChanges && dirty()) {
212/*TODO if (KMessageBox::questionYesNo(this, "<b>"+i18n("Do you want save:")
213 +"<p>"+typeName+" \""+ item->name() + "\"?</b>",
214 0, KStdGuiItem::yes(), KStdGuiItem::no(), ???????)==KMessageBox::No)
215 return false;*/
216 //js TODO: save data using saveChanges()
217 }
218 close(true);
219 return true;
220}
221#endif
222
224{
225 //look for "dirty" flag
226 int m = m_openedViewModes, mode = 1;
227 while (m>0) {
228 if (m & 1) {
229 if (static_cast<KexiViewBase*>(m_stack->widget(mode))->dirty())
230 return true;
231 }
232 m >>= 1;
233 mode <<= 1;
234 }
235 return false;
236/* KexiViewBase *v = m_newlySelectedView ? m_newlySelectedView : selectedView();
237 return v ? v->dirty() : false;*/
238}
239
241{
242 m_disableDirtyChanged = true;
243 int m = m_openedViewModes, mode = 1;
244 while (m>0) {
245 if (m & 1) {
246 static_cast<KexiViewBase*>(m_stack->widget(mode))->setDirty(dirty);
247 }
248 m >>= 1;
249 mode <<= 1;
250 }
251 m_disableDirtyChanged = false;
252 dirtyChanged(m_viewThatRecentlySetDirtyFlag); //update
253}
254
256{
257 if (!m_part || !m_part->info()) {
258 KexiViewBase *v = selectedView();
259 if (v) {//m_stack->visibleWidget() && m_stack->visibleWidget()->inherits("KexiViewBase")) {
260 return v->m_defaultIconName;
261 }
262 return TQString();
263 }
264 return m_part->info()->itemIcon();
265}
266
267KexiPart::GUIClient* KexiDialogBase::guiClient() const
268{
269 if (!m_part || m_currentViewMode<1)
270 return 0;
271 return m_part->instanceGuiClient(m_currentViewMode);
272}
273
274KexiPart::GUIClient* KexiDialogBase::commonGUIClient() const
275{
276 if (!m_part)
277 return 0;
278 return m_part->instanceGuiClient(0);
279}
280
281bool KexiDialogBase::isDesignModePreloadedForTextModeHackUsed(int newViewMode) const
282{
283 return newViewMode==Kexi::TextViewMode
284 && !viewForMode(Kexi::DesignViewMode)
285 && supportsViewMode(Kexi::DesignViewMode);
286}
287
288tristate KexiDialogBase::switchToViewMode( int newViewMode, TQMap<TQString,TQString>* staticObjectArgs,
289 bool& proposeOpeningInTextViewModeBecauseOfProblems)
290{
291 m_parentWindow->acceptPropertySetEditing();
292
293 const bool designModePreloadedForTextModeHack = isDesignModePreloadedForTextModeHackUsed(newViewMode);
294 tristate res = true;
295 if (designModePreloadedForTextModeHack) {
296 /* A HACK: open design BEFORE text mode: otherwise Query schema becames crazy */
297 bool _proposeOpeningInTextViewModeBecauseOfProblems = false; // used because even if opening the view failed,
298 // text view can be opened
299 res = switchToViewMode( Kexi::DesignViewMode, staticObjectArgs, _proposeOpeningInTextViewModeBecauseOfProblems);
300 if ((!res && !_proposeOpeningInTextViewModeBecauseOfProblems) || ~res)
301 return res;
302 }
303
304 kdDebug() << "KexiDialogBase::switchToViewMode()" << endl;
305 bool dontStore = false;
306 KexiViewBase *view = selectedView();
307
308 if (m_currentViewMode == newViewMode)
309 return true;
310 if (!supportsViewMode(newViewMode))
311 return false;
312
313 if (view) {
314 res = true;
315 if (!designModePreloadedForTextModeHack) {
316 res = view->beforeSwitchTo(newViewMode, dontStore);
317 }
318 if (~res || !res)
319 return res;
320 if (!dontStore && view->dirty()) {
321 res = m_parentWindow->saveObject(this, i18n("Design has been changed. "
322 "You must save it before switching to other view."));
323 if (~res || !res)
324 return res;
325// KMessageBox::questionYesNo(0, i18n("Design has been changed. You must save it before switching to other view."))
326// ==KMessageBox::No
327 }
328 }
329
330 //get view for viewMode
331 KexiViewBase *newView
332 = (m_stack->widget(newViewMode) && m_stack->widget(newViewMode)->inherits("KexiViewBase"))
333 ? static_cast<KexiViewBase*>(m_stack->widget(newViewMode)) : 0;
334 if (!newView) {
336 //ask the part to create view for the new mode
337 m_creatingViewsMode = newViewMode;
338 KexiPart::StaticPart *staticPart = dynamic_cast<KexiPart::StaticPart*>((KexiPart::Part*)m_part);
339 if (staticPart)
340 newView = staticPart->createView(m_stack, this, *m_item, newViewMode, staticObjectArgs);
341 else
342 newView = m_part->createView(m_stack, this, *m_item, newViewMode, staticObjectArgs);
344 if (!newView) {
345 //js TODO error?
346 kdDebug() << "Switching to mode " << newViewMode << " failed. Previous mode "
347 << m_currentViewMode << " restored." << endl;
348 return false;
349 }
350 m_creatingViewsMode = -1;
351 addView(newView, newViewMode);
352 }
353 const int prevViewMode = m_currentViewMode;
354 res = true;
355 if (designModePreloadedForTextModeHack) {
356 m_currentViewMode = Kexi::NoViewMode; //SAFE?
357 }
358 res = newView->beforeSwitchTo(newViewMode, dontStore);
359 proposeOpeningInTextViewModeBecauseOfProblems = tempData()->proposeOpeningInTextViewModeBecauseOfProblems;
360 if (!res) {
361 removeView(newViewMode);
362 delete newView;
363 kdDebug() << "Switching to mode " << newViewMode << " failed. Previous mode "
364 << m_currentViewMode << " restored." << endl;
365 return false;
366 }
367 m_currentViewMode = newViewMode;
368 m_newlySelectedView = newView;
369 if (prevViewMode==Kexi::NoViewMode)
370 m_newlySelectedView->setDirty(false);
371
372 res = newView->afterSwitchFrom(
373 designModePreloadedForTextModeHack ? Kexi::NoViewMode : prevViewMode);
374 proposeOpeningInTextViewModeBecauseOfProblems = tempData()->proposeOpeningInTextViewModeBecauseOfProblems;
375 if (!res) {
376 removeView(newViewMode);
377 delete newView;
378 kdDebug() << "Switching to mode " << newViewMode << " failed. Previous mode "
379 << prevViewMode << " restored." << endl;
380 const Kexi::ObjectStatus status(*this);
381 setStatus(mainWin()->project()->dbConnection(),
382 i18n("Switching to other view failed (%1).").arg(Kexi::nameForViewMode(newViewMode)),"");
383 append( status );
384 m_currentViewMode = prevViewMode;
385 return false;
386 }
387 m_newlySelectedView = 0;
388 if (~res) {
389 m_currentViewMode = prevViewMode;
390 return cancelled;
391 }
392 if (view)
393 takeActionProxyChild( view ); //take current proxy child
394 addActionProxyChild( newView ); //new proxy child
395 m_stack->raiseWidget( newView );
396 newView->propertySetSwitched();
397 m_parentWindow->invalidateSharedActions( newView );
398 TQTimer::singleShot(10, newView, TQ_SLOT(setFocus())); //newView->setFocus(); //js ok?
399// setFocus();
400 return true;
401}
402
404{
405 bool dummy;
406 return switchToViewMode( newViewMode, 0, dummy );
407}
408
409void KexiDialogBase::setFocus()
410{
411 if (m_stack->visibleWidget()) {
412 if (m_stack->visibleWidget()->inherits("KexiViewBase"))
413 static_cast<KexiViewBase*>( m_stack->visibleWidget() )->setFocus();
414 else
415 m_stack->visibleWidget()->setFocus();
416 }
417 else {
418 KMdiChildView::setFocus();
419 }
420 activate();
421}
422
423KoProperty::Set*
425{
426 KexiViewBase *v = selectedView();
427 if (!v)
428 return 0;
429 return v->propertySet();
430}
431
432bool KexiDialogBase::eventFilter(TQObject *obj, TQEvent *e)
433{
434 if (KMdiChildView::eventFilter(obj, e))
435 return true;
436/* if (e->type()==TQEvent::FocusIn) {
437 TQWidget *w = m_parentWindow->activeWindow();
438 w=0;
439 }*/
440 if ((e->type()==TQEvent::FocusIn && m_parentWindow->activeWindow()==this)
441 || e->type()==TQEvent::MouseButtonPress) {
442 if (m_stack->visibleWidget() && KexiUtils::hasParent(m_stack->visibleWidget(), obj)) {
443 //pass the activation
444 activate();
445 }
446 }
447 return false;
448}
449
450void KexiDialogBase::dirtyChanged(KexiViewBase* view)
451{
452 if (m_disableDirtyChanged)
453 return;
454 m_viewThatRecentlySetDirtyFlag = dirty() ? view : 0;
455/* if (!dirty()) {
456 if (caption()!=m_origCaption)
457 KMdiChildView::setCaption(m_origCaption);
458 }
459 else {
460 if (caption()!=(m_origCaption+"*"))
461 KMdiChildView::setCaption(m_origCaption+"*");
462 }*/
463 updateCaption();
464 emit dirtyChanged(this);
465}
466
467/*TQString KexiDialogBase::caption() const
468{
469 return m_origCaption;
470 if (dirty())
471 return KMdiChildView::caption()+;
472
473 return KMdiChildView::caption();
474}*/
475
476void KexiDialogBase::updateCaption()
477{
478 if (!m_item || !m_part || !m_origCaption.isEmpty())
479 return;
480// m_origCaption = c;
481 TQString capt = m_item->name();
482 TQString fullCapt = capt;
483 if (m_part)
484 fullCapt += (" : " + m_part->instanceCaption());
485 if (dirty()) {
486 KMdiChildView::setCaption(fullCapt+"*");
487 KMdiChildView::setTabCaption(capt+"*");
488 }
489 else {
490 KMdiChildView::setCaption(fullCapt);
491 KMdiChildView::setTabCaption(capt);
492 }
493}
494
496{
497 return m_item ? m_item->neverSaved() : true;
498}
499
501{
502 if (!neverSaved())
503 return false;
504 KexiViewBase *v = selectedView();
505 if (m_schemaData)
506 return false; //schema must not exist
507 if (!v)
508 return false;
509 //create schema object and assign information
510 KexiDB::SchemaData sdata(m_part->info()->projectPartID());
511 sdata.setName( m_item->name() );
512 sdata.setCaption( m_item->caption() );
513 sdata.setDescription( m_item->description() );
514
515 bool cancel = false;
516 m_schemaData = v->storeNewData(sdata, cancel);
517 if (cancel)
518 return cancelled;
519 if (!m_schemaData) {
520 setStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's definition failed."),"");
521 return false;
522 }
523
524 if (!part()->info()->isIdStoredInPartDatabase()) {
525 //this part's ID is not stored within kexi__parts:
526 KexiDB::TableSchema *ts = m_parentWindow->project()->dbConnection()->tableSchema("kexi__parts");
527 kdDebug() << "KexiDialogBase::storeNewData(): schema: " << ts << endl;
528 if (!ts)
529 return false;
530
531 //temp. hack: avoid problems with autonumber
532 // see http://bugs.kde.org/show_bug.cgi?id=89381
533 int p_id = part()->info()->projectPartID();
534
535 if (p_id<0) {
536 // Find first available custom part ID by taking the greatest
537 // existing custom ID (if it exists) and adding 1.
538 p_id = (int)KexiPart::UserObjectType;
539 tristate success = m_parentWindow->project()->dbConnection()->querySingleNumber(
540 "SELECT max(p_id) FROM kexi__parts", p_id);
541 if (!success) {
542 // Couldn't read part id's from the kexi__parts table
543 return false;
544 } else {
545 // Got a maximum part ID, or there were no parts
546 p_id = p_id + 1;
547 p_id = TQMAX(p_id, (int)KexiPart::UserObjectType);
548 }
549 }
550
551 KexiDB::FieldList *fl = ts->subList("p_id", "p_name", "p_mime", "p_url");
552 kexidbg << "KexiDialogBase::storeNewData(): fieldlist: "
553 << (fl ? fl->debugString() : TQString()) << endl;
554 if (!fl)
555 return false;
556
557 kexidbg << part()->info()->ptr()->untranslatedGenericName() << endl;
558// TQStringList sl = part()->info()->ptr()->propertyNames();
559// for (TQStringList::ConstIterator it=sl.constBegin();it!=sl.constEnd();++it)
560// kexidbg << *it << " " << part()->info()->ptr()->property(*it).toString() << endl;
561 if (!m_parentWindow->project()->dbConnection()->insertRecord(
562 *fl,
563 TQVariant(p_id),
564 TQVariant(part()->info()->ptr()->untranslatedGenericName()),
565 TQVariant(part()->info()->mimeType()), TQVariant("http://www.koffice.org/kexi/" /*always ok?*/)))
566 return false;
567
568 kdDebug() << "KexiDialogBase::storeNewData(): insert success!" << endl;
569 part()->info()->setProjectPartID( p_id );
570 //(int) project()->dbConnection()->lastInsertedAutoIncValue("p_id", "kexi__parts"));
571 kdDebug() << "KexiDialogBase::storeNewData(): new id is: "
572 << part()->info()->projectPartID() << endl;
573
574 part()->info()->setIdStoredInPartDatabase(true);
575 }
576
577 /* Sets 'dirty' flag on every dialog's view. */
578 setDirty(false);
579// v->setDirty(false);
580 //new schema data has now ID updated to a unique value
581 //-assign that to item's identifier
582 m_item->setIdentifier( m_schemaData->id() );
583 m_parentWindow->project()->addStoredItem( part()->info(), m_item );
584
585 return true;
586}
587
589{
590 if (neverSaved())
591 return false;
592 KexiViewBase *v = selectedView();
593 if (!v)
594 return false;
595
596#define storeData_ERR \
597 setStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's data failed."),"");
598
599 //save changes using transaction
600 KexiDB::Transaction transaction = m_parentWindow->project()->dbConnection()->beginTransaction();
601 if (transaction.isNull()) {
602 storeData_ERR;
603 return false;
604 }
605 KexiDB::TransactionGuard tg(transaction);
606
607 const tristate res = v->storeData(dontAsk);
608 if (~res) //trans. will be cancelled
609 return res;
610 if (!res) {
611 storeData_ERR;
612 return res;
613 }
614 if (!tg.commit()) {
615 storeData_ERR;
616 return false;
617 }
618 /* Sets 'dirty' flag on every dialog's view. */
619 setDirty(false);
620// v->setDirty(false);
621 return true;
622}
623
625{
626 KexiViewBase *v = selectedView();
627 //kdDebug() << "focusWidget(): " << focusWidget()->name() << endl;
628 if (KexiUtils::hasParent( v, KMdiChildView::focusedChildWidget()))//focusWidget()))
629 KMdiChildView::activate();
630 else {//ah, focused widget is not in this view, move focus:
631 if (v)
632 v->setFocus();
633 }
634 if (v)
635 v->updateActions(true);
636//js: not neeed?? m_parentWindow->invalidateSharedActions(this);
637}
638
640{
641 KexiViewBase *v = selectedView();
642 if (v)
643 v->updateActions(false);
644}
645
647{
648 KexiViewBase *v = selectedView();
649 if (v)
651}
652
654{
655 KexiViewBase *v = selectedView();
656 if (v)
658}
659
660#include "kexidialogbase.moc"
661
An interface that acts as proxy for shared actions within the application.
void addActionProxyChild(KexiActionProxy *child)
FieldList * subList(const TQString &n1, const TQString &n2=TQString(), const TQString &n3=TQString(), const TQString &n4=TQString(), const TQString &n5=TQString(), const TQString &n6=TQString(), const TQString &n7=TQString(), const TQString &n8=TQString(), const TQString &n9=TQString(), const TQString &n10=TQString(), const TQString &n11=TQString(), const TQString &n12=TQString(), const TQString &n13=TQString(), const TQString &n14=TQString(), const TQString &n15=TQString(), const TQString &n16=TQString(), const TQString &n17=TQString(), const TQString &n18=TQString())
virtual TQString debugString()
Helper class for using inside methods for given connection.
This class encapsulates transaction handle.
Definition transaction.h:60
tristate storeNewData()
KexiDialogTempData * tempData() const
bool neverSaved() const
KexiPart::GUIClient * commonGUIClient() const
virtual void attachToGUIClient()
void sendDetachedStateToCurrentView()
KoProperty::Set * propertySet()
KexiPart::GUIClient * guiClient() const
virtual TQSize sizeHint() const
void setDirty(bool dirty)
bool supportsViewMode(int mode) const
void sendAttachedStateToCurrentView()
virtual TQSize minimumSizeHint() const
KexiViewBase * viewForMode(int mode) const
KexiPart::Part * part() const
virtual TQString itemIcon()
tristate storeData(bool dontAsk=false)
KexiPart::Item * partItem() const
void closing()
emitted when the window is about to close
virtual bool eventFilter(TQObject *obj, TQEvent *e)
KexiViewBase * selectedView() const
void dirtyChanged(KexiDialogBase *)
tristate switchToViewMode(int newViewMode)
bool dirty() const
void addView(KexiViewBase *view)
Adds view for the dialog. It will be the only view (of unspecified mode) for the dialog.
bool proposeOpeningInTextViewModeBecauseOfProblems
Kexi's main window interface This interface is implemented by KexiMainWindowImpl class.
virtual void registerChild(KexiDialogBase *dlg)=0
int projectPartID() const
KService::Ptr ptr() const
void setProjectPartID(int id)
Sets the project-part-id.
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
Static Kexi Part (plugin).
virtual KexiViewBase * createView(TQWidget *parent, KexiDialogBase *dialog, KexiPart::Item &item, int viewMode, TQMap< TQString, TQString > *args)=0
Base class for single view embeddable of in KexiDialogBase.
virtual tristate beforeSwitchTo(int mode, bool &dontStore)
virtual void parentDialogDetached()
virtual tristate afterSwitchFrom(int mode)
virtual bool dirty() const
virtual KexiDB::SchemaData * storeNewData(const KexiDB::SchemaData &sdata, bool &cancel)
virtual tristate storeData(bool dontAsk=false)
virtual void propertySetSwitched()
void setDirty(bool set)
virtual KoProperty::Set * propertySet()
virtual void parentDialogAttached()
void closing(bool &cancel)
emitted when the view is about to close
virtual TQSize preferredSizeHint(const TQSize &otherSize)
virtual void updateActions(bool activated)
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
bool hasParent(TQObject *par, TQObject *o)
KEXIUTILS_EXPORT void setWaitCursor(bool noDelay=false)
KEXIUTILS_EXPORT void removeWaitCursor()
KEXICORE_EXPORT TQString nameForViewMode(int m)
i18n'ed name of view mode m
Definition kexi.cpp:157
@ TextViewMode
Also known as SQL View Mode.
Definition kexi.h:48
@ NoViewMode
Definition kexi.h:44