keximacroproperty.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2006 Sebastian Sauer <mail@dipe.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12 You should have received a copy of the GNU Library General Public License
13 along with this library; see the file COPYING.LIB. If not, write to
14 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
15 Boston, MA 02110-1301, USA.
16*/
17
18#include "keximacroproperty.h"
19
20#include <tqlayout.h>
21#include <tqlineedit.h>
22#include <tqlistbox.h>
23#include <tqpainter.h>
24
25#include <kcombobox.h>
26#include <kpushbutton.h>
27#include <tdelocale.h>
28#include <kiconloader.h>
29#include <kdebug.h>
30
31#include "../lib/variable.h"
32#include "../lib/macroitem.h"
33
34#define KEXIMACRO_PROPERTYEDITORTYPE 5682
35
36/*************************************************************
37 * KexiMacroProperty
38 */
39
44class KexiMacroProperty::Private
45{
46 public:
50 TDESharedPtr<KoMacro::MacroItem> macroitem;
53 TQString name;
54};
55
56KexiMacroProperty::KexiMacroProperty(KoProperty::Property* parent, TDESharedPtr<KoMacro::MacroItem> macroitem, const TQString& name)
57 : KoProperty::CustomProperty(parent)
58 , d( new Private() )
59{
60 d->macroitem = macroitem;
61 d->name = name;
62 init();
63}
64
69
70void KexiMacroProperty::init()
71{
72 Q_ASSERT( d->macroitem != 0 );
73 //kdDebug() << "--------- KexiMacroProperty::set() macroitem=" << d->macroitem->name() << " name=" << d->name << endl;
74
75 TDESharedPtr<KoMacro::Action> action = d->macroitem->action();
76 TDESharedPtr<KoMacro::Variable> actionvariable = action->variable(d->name);
77 if(! actionvariable.data()) {
78 kdDebug() << "KexiMacroProperty::createProperty() Skipped cause there exists no such action=" << d->name << endl;
79 return;
80 }
81
82 TDESharedPtr<KoMacro::Variable> variable = d->macroitem->variable(d->name, true/*checkaction*/);
83 if(! variable.data()) {
84 kdDebug() << "KexiMacroProperty::createProperty() Skipped cause there exists no such variable=" << d->name << endl;
85 return;
86 }
87
88 //TESTCASE!!!!!!!!!!!!!!!!!!!!!!
89 //if(! variable->isEnabled()) tqFatal( TQString("############## VARIABLE=%1").arg(variable->name()).latin1() );
90
91 Q_ASSERT(! d->name.isNull());
92 m_property->setName( d->name.latin1() );
93 m_property->setCaption( actionvariable->text() );
94 m_property->setDescription( action->comment() );
95 m_property->setValue( variable->variant(), true );
96 m_property->setType( KEXIMACRO_PROPERTYEDITORTYPE ); // use our own propertytype
97}
98
99KoProperty::Property* KexiMacroProperty::parentProperty() const
100{
101 return m_property;
102}
103
104void KexiMacroProperty::setValue(const TQVariant &value, bool rememberOldValue)
105{
106 Q_UNUSED(rememberOldValue);
107 kdDebug()<<"KexiMacroProperty::setValue name="<<d->name<<" value="<<value<<" rememberOldValue="<<rememberOldValue<<endl;
108 if(! d->macroitem->setVariant(d->name, value)) { // takes care of the type-conversation
109 kdDebug()<<"KexiMacroProperty::setValue Update failed !!!"<<endl;
110 return;
111 }
112
113 // m_property->setValue() does check if the value changed by using
114 // this-value() and cause we already set it above, m_property->setValue()
115 // will be aborted. Well, we don't touch the properties value and handle
116 // it all via our CustomProperty class anyway. So, just ignore the property.
117 //m_property->setValue(this->value(), rememberOldValue, false/*useCustomProperty*/);
118
119 emit valueChanged();
120}
121
123{
124 TDESharedPtr<KoMacro::Variable> variable = d->macroitem->variable(d->name, true);
125 Q_ASSERT( variable.data() != 0 );
126 return variable.data() ? variable->variant() : TQVariant();
127}
128
130{
131 return true; // we handle getting and setting of values and don't need KoProperty::Property for it.
132}
133
134TDESharedPtr<KoMacro::MacroItem> KexiMacroProperty::macroItem() const
135{
136 return d->macroitem;
137}
138
140{
141 return d->name;
142}
143
144TDESharedPtr<KoMacro::Variable> KexiMacroProperty::variable() const
145{
146 return d->macroitem->variable(d->name, true/*checkaction*/);
147}
148
149KoProperty::Property* KexiMacroProperty::createProperty(TDESharedPtr<KoMacro::MacroItem> macroitem, const TQString& name)
150{
151 KoProperty::Property* property = new KoProperty::Property();
152 KexiMacroProperty* customproperty = new KexiMacroProperty(property, macroitem, name);
153 if(! customproperty->variable().data()) {
154 kdWarning() << "KexiMacroProperty::createProperty() No such variable" << endl;
155 delete customproperty; customproperty = 0;
156 delete property; property = 0;
157 return 0;
158 }
159 property->setCustomProperty(customproperty);
160 return property;
161}
162
163/*************************************************************
164 * KexiMacroPropertyFactory
165 */
166
168 : KoProperty::CustomPropertyFactory(parent)
169{
170}
171
175
176KoProperty::CustomProperty* KexiMacroPropertyFactory::createCustomProperty(KoProperty::Property* parent)
177{
178 kdDebug()<<"KexiMacroPropertyFactory::createCustomProperty parent="<<parent->name()<<endl;
179
180 KoProperty::CustomProperty* customproperty = parent->customProperty();
181 KexiMacroProperty* parentcustomproperty = dynamic_cast<KexiMacroProperty*>(customproperty);
182 if(! parentcustomproperty) {
183 kdWarning() << "KexiMacroPropertyFactory::createCustomProperty() parent=" << parent->name() << " has an invalid customproperty." << endl;
184 return 0;
185 }
186
187 TDESharedPtr<KoMacro::MacroItem> macroitem = parentcustomproperty->macroItem();
188 Q_ASSERT( macroitem.data() != 0 );
189 const TQString name = parentcustomproperty->name();
190 Q_ASSERT(! name.isEmpty());
191
192 KexiMacroProperty* macroproperty = new KexiMacroProperty(parent, macroitem, name);
193 if(! macroproperty->variable().data()) {
194 delete macroproperty; macroproperty = 0;
195 return 0;
196 }
197
198 return macroproperty;
199}
200
201KoProperty::Widget* KexiMacroPropertyFactory::createCustomWidget(KoProperty::Property* property)
202{
203 kdDebug()<<"KexiMacroPropertyFactory::createCustomWidget property="<<property->name()<<endl;
204 return new KexiMacroPropertyWidget(property);
205}
206
208{
209 CustomPropertyFactory* factory = KoProperty::FactoryManager::self()->factoryForEditorType(KEXIMACRO_PROPERTYEDITORTYPE);
210 if(! factory) {
211 factory = new KexiMacroPropertyFactory( KoProperty::FactoryManager::self() );
212 KoProperty::FactoryManager::self()->registerFactoryForEditor(KEXIMACRO_PROPERTYEDITORTYPE, factory);
213 }
214}
215
216/*************************************************************
217 * KexiMacroPropertyWidget
218 */
219
225class ListBoxItem : public TQListBoxText
226{
227 public:
228 ListBoxItem(TQListBox* listbox)
229 : TQListBoxText(listbox), m_enabled(true) {}
230 ListBoxItem(TQListBox* listbox, const TQString& text, TQListBoxItem* after)
231 : TQListBoxText(listbox, text, after), m_enabled(true) {}
232 virtual ~ListBoxItem() {}
233 void setEnabled(bool enabled) { m_enabled = enabled; }
234 virtual int width(const TQListBox* lb) const {
235 Q_ASSERT( dynamic_cast<KComboBox*>( lb->parent() ) );
236 return static_cast<KComboBox*>( lb->parent() )->lineEdit()->width() + 2;
237 }
238 virtual int height(const TQListBox* lb) const {
239 Q_ASSERT( dynamic_cast<KComboBox*>( lb->parent() ) );
240 return m_enabled ? static_cast<KComboBox*>( lb->parent() )->height() + 2 : 0;
241 }
242 private:
243 bool m_enabled;
244};
245
250class EditListBoxItem : public ListBoxItem
251{
252 public:
253
254 EditListBoxItem(TQListBox* listbox, KexiMacroProperty* macroproperty)
255 : ListBoxItem(listbox)
256 , m_macroproperty(macroproperty)
257 , m_prop(0)
258 , m_widget(0)
259 {
260 init();
261 }
262
263 virtual ~EditListBoxItem() {
264 delete m_widget;
265 delete m_prop;
266 }
267
268 virtual TQString text() const {
269 TDESharedPtr<KoMacro::Variable> variable = m_macroproperty->variable();
270 Q_ASSERT( variable.data() );
271 //kdDebug()<<"EditListBoxItem::text() text="<<variable->toString()<<endl;
272 Q_ASSERT( variable->toString() != TQString() );
273 return variable->toString();
274 }
275
276 KoProperty::Widget* widget() const { return m_widget; }
277 TDESharedPtr<KoMacro::MacroItem> macroItem() const { return m_macroproperty->macroItem(); }
278 TDESharedPtr<KoMacro::Variable> variable() const { return m_macroproperty->variable(); }
279 TDESharedPtr<KoMacro::Action> action() const { return m_macroproperty->macroItem()->action(); }
280
281 protected:
282 virtual void paint(TQPainter* p) {
283 if(! m_widget) return;
284 Q_ASSERT( dynamic_cast<KComboBox*>( listBox()->parent() ) );
285 const int w = width(listBox());
286 const int h = height(listBox());
287 m_widget->setFixedSize(w - 2, h - 2);
288 p->drawPixmap(0, 0, TQPixmap::grabWidget(m_widget), 1, 1, w - 1, h - 1);
289 }
290
291 private:
292 void init() {
293 TDESharedPtr<KoMacro::MacroItem> macroitem = m_macroproperty->macroItem();
294 Q_ASSERT( macroitem.data() );
295 TDESharedPtr<KoMacro::Action> action = m_macroproperty->macroItem()->action();
296 if(! action.data()) {
297 kdWarning() << "EditListBoxItem::EditListBoxItem() Skipped cause there exists no action for macroproperty=" << m_macroproperty->name() << endl;
298 return;
299 }
300 KoProperty::Property* parentproperty = m_macroproperty->parentProperty();
301 if(! parentproperty) {
302 kdWarning() << "EditListBoxItem::EditListBoxItem() No parentproperty defined" << endl;
303 return;
304 }
305 TDESharedPtr<KoMacro::Variable> variable = m_macroproperty->variable();
306 if(! variable.data()) {
307 kdWarning() << "EditListBoxItem::EditListBoxItem() No variable defined for property=" << parentproperty->name() << endl;
308 return;
309 }
310
311 TQVariant variant = variable->variant();
312
313 TDESharedPtr<KoMacro::Variable> actionvariable = action->variable(m_macroproperty->name());
314 if(actionvariable.data()) {
315 TQVariant actionvariant = actionvariable->variant();
316 Q_ASSERT( ! actionvariant.isNull() );
317 Q_ASSERT( variant.canCast(actionvariant.type()) );
318 variant.cast( actionvariant.type() ); //preserve type.
319 }
320
321 int type = KoProperty::Auto;
322 switch(variant.type()) {
323 case TQVariant::UInt:
324 case TQVariant::Int: {
325 type = KoProperty::Integer;
326 } break;
327 case TQVariant::CString:
328 case TQVariant::String: {
329 type = KoProperty::String;
330 } break;
331 default: {
332 kdWarning() << "EditListBoxItem::EditListBoxItem() name=" << variable->name() << " type=" << TQVariant::typeToName(variant.type()) << endl;
333 } break;
334 }
335
336 TQString name = variable->name();
337 Q_ASSERT(! name.isNull());
338 //if(name.isNull()) name = "aaaaaaaaaaaaaaaaa";//TESTCASE
339 m_prop = new KoProperty::Property(
340 name.latin1(), // name
341 variant, // value
342 variable->text(), // caption
343 TQString(), // description
344 type, // type
345 0 //parentproperty // parent
346 );
347
348 m_widget = KoProperty::FactoryManager::self()->createWidgetForProperty(m_prop);
349 Q_ASSERT( m_widget != 0 );
350 //m_widget->reparent(listBox()->viewport(), 0, TQPoint(0,0));
351 m_widget->reparent(listBox(), 0, TQPoint(1,1));
352 //layout->addWidget(m_widget, 1);
353 m_widget->setMinimumHeight(5);
354 m_widget->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
355 }
356
357 private:
358 KexiMacroProperty* m_macroproperty;
359 KoProperty::Property* m_prop;
360 KoProperty::Widget* m_widget;
361};
362
367class ListBox : public TQListBox
368{
369 public:
370 ListBox(KComboBox* parent, KexiMacroProperty* macroproperty)
371 : TQListBox(parent)
372 , m_macroproperty(macroproperty)
373 , m_edititem(0)
374 {
375 viewport()->setBackgroundMode(PaletteBackground);
376 setVariableHeight(true);
377 update();
378 }
379
380 virtual ~ListBox() {}
381
382 void update() {
383 m_items.clear();
384 delete m_edititem;
385 m_edititem = 0;
386 clear();
387
388 m_edititem = new EditListBoxItem(this, m_macroproperty);
389 Q_ASSERT( m_edititem->widget() != 0 );
390
391 const TQString name = m_macroproperty->name();
393 {
394 KoMacro::Variable::List actionchildren;
395
396 TDESharedPtr<KoMacro::Variable> itemvar = m_macroproperty->macroItem()->variable(name,false);
397 //kdDebug() << "KexiMacroProperty::ListBox::update() itemvar="<<(itemvar.data() ? "name:"+itemvar->name()+" value:"+itemvar->toString() : "NULL")<<endl;
398 if(itemvar.data())
399 actionchildren = itemvar->children();
400
401 TDESharedPtr<KoMacro::Action> action = m_edititem->action();
402 TDESharedPtr<KoMacro::Variable> actionvar = action.data() ? action->variable(name) : TDESharedPtr<KoMacro::Variable>();
403 //kdDebug() << "KexiMacroProperty::ListBox::update() actionvar="<<(actionvar.data() ? "name:"+actionvar->name()+" value:"+actionvar->toString() : "NULL")<<endl;
404 if(actionvar.data())
405 actionchildren += actionvar->children();
406
407 KoMacro::Variable::List::ConstIterator it(actionchildren.constBegin()), end(actionchildren.constEnd());
408 for(; it != end; ++it) {
409 if(name == (*it)->name()) {
410 KoMacro::Variable::List list = (*it)->children();
411 KoMacro::Variable::List::ConstIterator listit(list.constBegin()), listend(list.constEnd());
412 for(; listit != listend; ++listit)
413 children.append( *listit );
414 }
415 }
416
417 if(children.count() <= 0)
418 children = actionchildren;
419 }
420
421 /*
422 kdDebug() << "KexiMacroProperty::ListBox::update() name="<<name<<" childcount="<<children.count()<<endl;
423 KoMacro::Variable::List::ConstIterator listit(children.constBegin()), listend(children.constEnd());
424 for(; listit != listend; ++listit) {
425 kdDebug()<<" child name="<<(*listit)->name()<<" value="<<(*listit)->toString()<<" childcount="<<(*listit)->children().count()<<endl;
426 }
427 */
428
429 if(children.count() > 0) {
430 KoMacro::Variable::List::Iterator childit(children.begin()), childend(children.end());
431 for(; childit != childend; ++childit) {
432 const TQString n = (*childit)->name();
433 //if(! n.startsWith("@")) continue;
434 const TQVariant v = (*childit)->variant();
435
436 //kdDebug() << " child name=" << n << " value=" << v << endl;
437 switch( v.type() ) {
438 /* case TQVariant::Map: {
439 const TQStringVariantMap map = v.toMap();
440 for(TQStringVariantMap::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it)
441 m_items.append(it.key());
442 } break; */
443 case TQVariant::List: {
444 const TQValueList<TQVariant> list = v.toList();
445 for(TQValueList<TQVariant>::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it) {
446 const TQString s = (*it).toString().stripWhiteSpace();
447 if(! s.isEmpty())
448 m_items.append(s);
449 }
450 } break;
451 case TQVariant::StringList: {
452 const TQStringList list = v.toStringList();
453 for(TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
454 if(! (*it).isEmpty())
455 m_items.append(*it);
456 } break;
457 default: {
458 const TQString s = v.toString().stripWhiteSpace();
459 if(! s.isEmpty())
460 m_items.append(s);
461 } break;
462 }
463 }
464 }
465
466 TQListBoxItem* item = m_edititem;
467 const uint count = m_items.count();
468 for(uint i = 0; i < count; i++)
469 item = new ListBoxItem(this, m_items[i], item);
470 }
471
472 EditListBoxItem* editItem() const { return m_edititem; }
473 TQStringList items() const { return m_items; }
474
475 virtual void hide () {
476 TQListBox::hide();
477 for(uint i = 0; i < count(); i++)
478 static_cast<ListBoxItem*>( item(i) )->setEnabled(false);
479 }
480 virtual void show() {
481 update();
482 adjustSize();
483 TQListBox::show();
484 }
485
486 private:
487 KexiMacroProperty* m_macroproperty;
488 EditListBoxItem* m_edititem;
489 TQStringList m_items;
490};
491
496class KexiMacroPropertyWidget::Private
497{
498 public:
499 KexiMacroProperty* macroproperty;
500 KComboBox* combobox;
501 ListBox* listbox;
502};
503
504KexiMacroPropertyWidget::KexiMacroPropertyWidget(KoProperty::Property* property, TQWidget* parent)
505 : KoProperty::Widget(property, parent)
506 , d( new Private() )
507{
508 kdDebug() << "KexiMacroPropertyWidget::KexiMacroPropertyWidget() Ctor" << endl;
509
510 TQHBoxLayout* layout = new TQHBoxLayout(this, 0, 0);
511
512 d->macroproperty = dynamic_cast<KexiMacroProperty*>( property->customProperty() );
513 if(! d->macroproperty) {
514 kdWarning() << "KexiMacroPropertyWidget::KexiMacroPropertyWidget() Missing macroproperty for property=" << property->name() << endl;
515 return;
516 }
517
518 d->combobox = new KComboBox(this);
519 layout->addWidget(d->combobox);
520 d->listbox = new ListBox(d->combobox, d->macroproperty);
521 d->combobox->setEditable(true);
522 d->combobox->setListBox(d->listbox);
523 d->combobox->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
524 d->combobox->setMinimumHeight(5);
525 d->combobox->setInsertionPolicy(TQComboBox::NoInsertion);
526 d->combobox->setMinimumSize(10, 0); // to allow the combo to be resized to a small size
527 d->combobox->setAutoCompletion(false);
528 d->combobox->setContextMenuEnabled(false);
529
530 TQVariant value = d->macroproperty->value();
531 int index = d->listbox->items().findIndex( value.toString() );
532 if(index >= 0) {
533 d->combobox->setCurrentItem(index + 1);
534 d->listbox->setCurrentItem(index + 1);
535 }
536 else {
537 Q_ASSERT( d->listbox->editItem()->widget() != 0 );
538 d->listbox->editItem()->widget()->setValue( d->macroproperty->value(), true );
539 //d->combobox->setCurrentItem(0);
540 }
541 kdDebug() << ">>> KexiMacroPropertyWidget::KexiMacroPropertyWidget() CurrentItem=" << d->combobox->currentItem() << endl;
542
543 d->combobox->setFocusProxy( d->listbox->editItem()->widget() );
544 setFocusWidget( d->combobox->lineEdit() );
545
546 connect(d->combobox, TQ_SIGNAL(textChanged(const TQString&)),
547 this, TQ_SLOT(slotComboBoxChanged()));
548 connect(d->combobox, TQ_SIGNAL(activated(int)),
549 this, TQ_SLOT(slotComboBoxActivated()));
550 connect(d->listbox->editItem()->widget(), TQ_SIGNAL(valueChanged(Widget*)),
551 this, TQ_SLOT(slotWidgetValueChanged()));
552 connect(d->macroproperty, TQ_SIGNAL(valueChanged()),
553 this, TQ_SLOT(slotPropertyValueChanged()));
554}
555
557{
558 kdDebug() << "KexiMacroPropertyWidget::~KexiMacroPropertyWidget() Dtor" << endl;
559 delete d;
560}
561
563{
564 kdDebug()<<"KexiMacroPropertyWidget::value() value="<<d->macroproperty->value()<<endl;
565 return d->macroproperty->value();
566 /* TQVariant value = d->combobox->currentText();
567 value.cast( d->macroproperty->value().type() );
568 return value; */
569}
570
571void KexiMacroPropertyWidget::setValue(const TQVariant& value, bool emitChange)
572{
573 kdDebug()<<"KexiMacroPropertyWidget::setValue() value="<<value<<" emitChange="<<emitChange<<endl;
574
575 if(! emitChange)
576 d->combobox->blockSignals(true);
577
578 const TQString s = value.toString();
579 d->combobox->setCurrentText( s.isNull() ? "" : s );
580
581 if(emitChange)
582 emit valueChanged(this);
583 else
584 d->combobox->blockSignals(false);
585}
586
588{
589 Q_UNUSED(readOnly);
590 //kdDebug()<<"KexiMacroPropertyWidget::setReadOnlyInternal() readOnly="<<readOnly<<endl;
591}
592
593void KexiMacroPropertyWidget::slotComboBoxChanged()
594{
595 kdDebug()<<"KexiMacroPropertyWidget::slotComboBoxChanged()"<<endl;
596 const TQVariant v = d->combobox->currentText();
597 d->macroproperty->setValue(v, true);
598 //emit valueChanged(this);
599}
600
601void KexiMacroPropertyWidget::slotComboBoxActivated()
602{
603 Q_ASSERT( d->listbox->editItem()->widget() );
604 const int index = d->combobox->currentItem();
605 TQString text = (index == 0)
606 ? d->listbox->editItem()->widget()->value().toString()
607 : d->combobox->text(index);
608 kdDebug()<<"KexiMacroPropertyWidget::slotComboBoxActivated() index="<<index<<" text="<<text<<endl;
609 d->combobox->setCurrentText(text);
610 slotWidgetValueChanged();
611}
612
613void KexiMacroPropertyWidget::slotWidgetValueChanged()
614{
615 d->macroproperty->emitPropertyChanged();
616}
617
618void KexiMacroPropertyWidget::slotPropertyValueChanged()
619{
620 Q_ASSERT( d->listbox->editItem()->widget() );
621 const TQVariant v = d->macroproperty->value();
622 kdDebug()<<"KexiMacroPropertyWidget::slotPropertyValueChanged() value="<<v<<endl;
623 d->listbox->editItem()->widget()->setValue(v, true);
624}
625
626#include "keximacroproperty.moc"
Implementation of a KoProperty::CustomPropertyFactory to handle creation of KexiMacroProperty and Kex...
virtual KoProperty::CustomProperty * createCustomProperty(KoProperty::Property *parent)
virtual KoProperty::Widget * createCustomWidget(KoProperty::Property *property)
KexiMacroPropertyFactory(TQObject *parent)
Constructor.
static void initFactory()
Initializes this factory.
virtual ~KexiMacroPropertyFactory()
Destructor.
Implementation of a KoProperty::Widget used to display and edit a KexiMacroProperty .
KexiMacroPropertyWidget(KoProperty::Property *property, TQWidget *parent=0)
Constructor.
virtual void setReadOnlyInternal(bool readOnly)
Called if the value should be read only.
virtual void setValue(const TQVariant &value, bool emitChange=true)
Set the value value this widget has.
virtual TQVariant value() const
virtual ~KexiMacroPropertyWidget()
Destructor.
Implementation of a KoProperty::CustomProperty to have more control about the handling of our macro-p...
KoProperty::Property * parentProperty() const
TDESharedPtr< KoMacro::MacroItem > macroItem() const
static KoProperty::Property * createProperty(TDESharedPtr< KoMacro::MacroItem > macroitem, const TQString &name)
Factory function to create a new KoProperty::Property instance that will use a KexiMacroProperty as c...
virtual ~KexiMacroProperty()
Destructor.
KexiMacroProperty(KoProperty::Property *parent, TDESharedPtr< KoMacro::MacroItem > macroitem, const TQString &name)
Constructor.
virtual bool handleValue() const
Tells whether CustomProperty should be used to get the property's value.
TDESharedPtr< KoMacro::Variable > variable() const
virtual void setValue(const TQVariant &value, bool rememberOldValue)
This function is called by KoProperty::Property::setValue() when a custom property is set.
void valueChanged()
Emitted if setValue was called and the value changed.
TQString name() const
virtual TQVariant value() const
This function is called by KoProperty::Property::value() when a custom property is set and handleValu...
TQValueList< TDESharedPtr< Variable > > List
Property to get and set a TQVariant as variable.
Definition variable.h:61