author | eilers <eilers> | 2003-03-06 08:15:23 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-06 08:15:23 (UTC) |
commit | de5ee3b655897d8d6b8b78fee3cb2b63f9a9bf8a (patch) (unidiff) | |
tree | a1be481f2d4281f7221f538f95bfe996ff5e2dfc | |
parent | caecd32d28df2c0de6982bf84c599c5b25880661 (diff) | |
download | opie-de5ee3b655897d8d6b8b78fee3cb2b63f9a9bf8a.zip opie-de5ee3b655897d8d6b8b78fee3cb2b63f9a9bf8a.tar.gz opie-de5ee3b655897d8d6b8b78fee3cb2b63f9a9bf8a.tar.bz2 |
New table appearance by Dan Williams ! It looks like todolist, now ! Thanks
a lot !
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 36 | ||||
-rw-r--r-- | core/pim/addressbook/abtable.h | 1 |
2 files changed, 35 insertions, 2 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 55b1ba1..a829dc2 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp | |||
@@ -493,225 +493,257 @@ void AbTable::fitColumns() | |||
493 | void AbTable::show() | 493 | void AbTable::show() |
494 | { | 494 | { |
495 | //qWarning( "void AbTable::show()" ); | 495 | //qWarning( "void AbTable::show()" ); |
496 | realignTable(); | 496 | realignTable(); |
497 | QTable::show(); | 497 | QTable::show(); |
498 | } | 498 | } |
499 | 499 | ||
500 | void AbTable::setChoiceNames( const QStringList& list) | 500 | void AbTable::setChoiceNames( const QStringList& list) |
501 | { | 501 | { |
502 | choicenames = list; | 502 | choicenames = list; |
503 | if ( choicenames.isEmpty() ) { | 503 | if ( choicenames.isEmpty() ) { |
504 | // hide pick column | 504 | // hide pick column |
505 | setNumCols( 2 ); | 505 | setNumCols( 2 ); |
506 | } else { | 506 | } else { |
507 | // show pick column | 507 | // show pick column |
508 | setNumCols( 3 ); | 508 | setNumCols( 3 ); |
509 | setColumnWidth( 2, fontMetrics().width(tr( "Pick" ))+8 ); | 509 | setColumnWidth( 2, fontMetrics().width(tr( "Pick" ))+8 ); |
510 | horizontalHeader()->setLabel( 2, tr( "Pick" )); | 510 | horizontalHeader()->setLabel( 2, tr( "Pick" )); |
511 | } | 511 | } |
512 | fitColumns(); | 512 | fitColumns(); |
513 | } | 513 | } |
514 | 514 | ||
515 | void AbTable::itemClicked(int,int col) | 515 | void AbTable::itemClicked(int,int col) |
516 | { | 516 | { |
517 | //qWarning( "AbTable::itemClicked(int, col:%d)", col); | 517 | //qWarning( "AbTable::itemClicked(int, col:%d)", col); |
518 | if ( col == 2 ) { | 518 | if ( col == 2 ) { |
519 | return; | 519 | return; |
520 | } else { | 520 | } else { |
521 | // qWarning ("Emitting signalSwitch()"); | 521 | // qWarning ("Emitting signalSwitch()"); |
522 | emit signalSwitch(); | 522 | emit signalSwitch(); |
523 | } | 523 | } |
524 | } | 524 | } |
525 | 525 | ||
526 | QStringList AbTable::choiceNames() const | 526 | QStringList AbTable::choiceNames() const |
527 | { | 527 | { |
528 | return choicenames; | 528 | return choicenames; |
529 | } | 529 | } |
530 | 530 | ||
531 | void AbTable::setChoiceSelection( const QValueList<int>& list ) | 531 | void AbTable::setChoiceSelection( const QValueList<int>& list ) |
532 | { | 532 | { |
533 | intFields = list; | 533 | intFields = list; |
534 | } | 534 | } |
535 | 535 | ||
536 | QStringList AbTable::choiceSelection(int /*index*/) const | 536 | QStringList AbTable::choiceSelection(int /*index*/) const |
537 | { | 537 | { |
538 | QStringList r; | 538 | QStringList r; |
539 | /* ###### | 539 | /* ###### |
540 | 540 | ||
541 | QString selname = choicenames.at(index); | 541 | QString selname = choicenames.at(index); |
542 | for (each row) { | 542 | for (each row) { |
543 | OContact *c = contactForRow(row); | 543 | OContact *c = contactForRow(row); |
544 | if ( text(row,2) == selname ) { | 544 | if ( text(row,2) == selname ) { |
545 | r.append(c->email); | 545 | r.append(c->email); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | 548 | ||
549 | */ | 549 | */ |
550 | return r; | 550 | return r; |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | 554 | ||
555 | 555 | ||
556 | void AbTable::updateVisible() | 556 | void AbTable::updateVisible() |
557 | { | 557 | { |
558 | //qWarning("void AbTable::updateVisible()"); | 558 | //qWarning("void AbTable::updateVisible()"); |
559 | 559 | ||
560 | int visible, | 560 | int visible, |
561 | totalRows, | 561 | totalRows, |
562 | row, | 562 | row, |
563 | selectedRow = 0; | 563 | selectedRow = 0; |
564 | 564 | ||
565 | visible = 0; | 565 | visible = 0; |
566 | 566 | ||
567 | setPaintingEnabled( FALSE ); | 567 | setPaintingEnabled( FALSE ); |
568 | 568 | ||
569 | realignTable(); | 569 | realignTable(); |
570 | 570 | ||
571 | totalRows = numRows(); | 571 | totalRows = numRows(); |
572 | for ( row = 0; row < totalRows; row++ ) { | 572 | for ( row = 0; row < totalRows; row++ ) { |
573 | if ( rowHeight(row) == 0 ) { | 573 | if ( rowHeight(row) == 0 ) { |
574 | showRow( row ); | 574 | showRow( row ); |
575 | adjustRow( row ); | 575 | adjustRow( row ); |
576 | if ( isSelected( row,0 ) || isSelected( row,1 ) ) | 576 | if ( isSelected( row,0 ) || isSelected( row,1 ) ) |
577 | selectedRow = row; | 577 | selectedRow = row; |
578 | } | 578 | } |
579 | visible++; | 579 | visible++; |
580 | } | 580 | } |
581 | 581 | ||
582 | if ( selectedRow ) | 582 | if ( selectedRow ) |
583 | setCurrentCell( selectedRow, 0 ); | 583 | setCurrentCell( selectedRow, 0 ); |
584 | 584 | ||
585 | if ( !visible ) | 585 | if ( !visible ) |
586 | setCurrentCell( -1, 0 ); | 586 | setCurrentCell( -1, 0 ); |
587 | 587 | ||
588 | setPaintingEnabled( TRUE ); | 588 | setPaintingEnabled( TRUE ); |
589 | |||
590 | |||
591 | } | 589 | } |
592 | 590 | ||
593 | 591 | ||
594 | void AbTable::setPaintingEnabled( bool e ) | 592 | void AbTable::setPaintingEnabled( bool e ) |
595 | { | 593 | { |
596 | //qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); | 594 | //qWarning("IN void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); |
597 | 595 | ||
598 | if ( e ) { | 596 | if ( e ) { |
599 | if ( countNested > 0 ) | 597 | if ( countNested > 0 ) |
600 | --countNested; | 598 | --countNested; |
601 | if ( ! countNested ){ | 599 | if ( ! countNested ){ |
602 | setUpdatesEnabled( true ); | 600 | setUpdatesEnabled( true ); |
603 | enablePainting = true; | 601 | enablePainting = true; |
604 | rowHeightChanged( 0 ); | 602 | rowHeightChanged( 0 ); |
605 | viewport()->update(); | 603 | viewport()->update(); |
606 | } | 604 | } |
607 | } else { | 605 | } else { |
608 | ++countNested; | 606 | ++countNested; |
609 | enablePainting = false; | 607 | enablePainting = false; |
610 | setUpdatesEnabled( false ); | 608 | setUpdatesEnabled( false ); |
611 | } | 609 | } |
612 | //qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); | 610 | //qWarning("OUT void AbTable::setPaintingEnabled( %d )->Nested: %d", e, countNested ); |
613 | } | 611 | } |
614 | 612 | ||
615 | void AbTable::viewportPaintEvent( QPaintEvent* e ) { | 613 | void AbTable::viewportPaintEvent( QPaintEvent* e ) { |
616 | //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); | 614 | //qWarning(" void AbTable::viewportPaintEvent( QPaintEvent* e ) -> %d", enablePainting); |
617 | if ( enablePainting ) | 615 | if ( enablePainting ) |
618 | QTable::viewportPaintEvent( e ); | 616 | QTable::viewportPaintEvent( e ); |
619 | } | 617 | } |
620 | 618 | ||
619 | void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) { | ||
620 | const QColorGroup &cg = colorGroup(); | ||
621 | |||
622 | p->save(); | ||
623 | |||
624 | // Paint alternating background bars | ||
625 | if ( (row % 2 ) == 0 ) { | ||
626 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); | ||
627 | p->setPen( QPen( cg.text() ) ); | ||
628 | } | ||
629 | else { | ||
630 | p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Background ) ); | ||
631 | p->setPen( QPen( cg.buttonText() ) ); | ||
632 | } | ||
621 | 633 | ||
634 | QFont f = p->font(); | ||
635 | QFontMetrics fm(f); | ||
636 | |||
637 | int marg = 2; | ||
638 | int x = 0; | ||
639 | int y = ( cr.height() - 14 ) / 2; | ||
640 | |||
641 | QPixmap pic = pixmap( row, col ); | ||
642 | if ( !pic.isNull() ) | ||
643 | { | ||
644 | p->drawPixmap( x + marg, y, pixmap( row, col ) ); | ||
645 | p->drawText( x + marg + pixmap( row, col ).width() + 4,2 + fm.ascent(), text( row, col ) ); | ||
646 | } | ||
647 | else | ||
648 | { | ||
649 | p->drawText( x + marg,2 + fm.ascent(), text( row, col ) ); | ||
650 | } | ||
651 | |||
652 | p->restore(); | ||
653 | } | ||
622 | 654 | ||
623 | void AbTable::rowHeightChanged( int row ) | 655 | void AbTable::rowHeightChanged( int row ) |
624 | { | 656 | { |
625 | if ( enablePainting ) | 657 | if ( enablePainting ) |
626 | QTable::rowHeightChanged( row ); | 658 | QTable::rowHeightChanged( row ); |
627 | } | 659 | } |
628 | ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) | 660 | ContactItem AbTable::findContactContact( const OContact &entry, int /* row */ ) |
629 | { | 661 | { |
630 | 662 | ||
631 | ContactItem item; | 663 | ContactItem item; |
632 | 664 | ||
633 | item.value = ""; | 665 | item.value = ""; |
634 | 666 | ||
635 | for ( QValueList<int>::ConstIterator it = intFields.begin(); | 667 | for ( QValueList<int>::ConstIterator it = intFields.begin(); |
636 | it != intFields.end(); ++it ) { | 668 | it != intFields.end(); ++it ) { |
637 | switch ( *it ) { | 669 | switch ( *it ) { |
638 | default: | 670 | default: |
639 | break; | 671 | break; |
640 | case Qtopia::Title: | 672 | case Qtopia::Title: |
641 | item.value = entry.title(); | 673 | item.value = entry.title(); |
642 | break; | 674 | break; |
643 | case Qtopia::Suffix: | 675 | case Qtopia::Suffix: |
644 | item.value = entry.suffix(); | 676 | item.value = entry.suffix(); |
645 | break; | 677 | break; |
646 | case Qtopia::FileAs: | 678 | case Qtopia::FileAs: |
647 | item.value = entry.fileAs(); | 679 | item.value = entry.fileAs(); |
648 | break; | 680 | break; |
649 | case Qtopia::DefaultEmail: | 681 | case Qtopia::DefaultEmail: |
650 | item.value = entry.defaultEmail(); | 682 | item.value = entry.defaultEmail(); |
651 | if ( !item.value.isEmpty() ) | 683 | if ( !item.value.isEmpty() ) |
652 | item.icon = Resource::loadPixmap( "addressbook/email" ); | 684 | item.icon = Resource::loadPixmap( "addressbook/email" ); |
653 | break; | 685 | break; |
654 | case Qtopia::Emails: | 686 | case Qtopia::Emails: |
655 | item.value = entry.emails(); | 687 | item.value = entry.emails(); |
656 | if ( !item.value.isEmpty() ) | 688 | if ( !item.value.isEmpty() ) |
657 | item.icon = Resource::loadPixmap( "addressbook/email" ); | 689 | item.icon = Resource::loadPixmap( "addressbook/email" ); |
658 | break; | 690 | break; |
659 | case Qtopia::HomeStreet: | 691 | case Qtopia::HomeStreet: |
660 | item.value = entry.homeStreet(); | 692 | item.value = entry.homeStreet(); |
661 | break; | 693 | break; |
662 | case Qtopia::HomeCity: | 694 | case Qtopia::HomeCity: |
663 | item.value = entry.homeCity(); | 695 | item.value = entry.homeCity(); |
664 | break; | 696 | break; |
665 | case Qtopia::HomeState: | 697 | case Qtopia::HomeState: |
666 | item.value = entry.homeState(); | 698 | item.value = entry.homeState(); |
667 | break; | 699 | break; |
668 | case Qtopia::HomeZip: | 700 | case Qtopia::HomeZip: |
669 | item.value = entry.homeZip(); | 701 | item.value = entry.homeZip(); |
670 | break; | 702 | break; |
671 | case Qtopia::HomeCountry: | 703 | case Qtopia::HomeCountry: |
672 | item.value = entry.homeCountry(); | 704 | item.value = entry.homeCountry(); |
673 | break; | 705 | break; |
674 | case Qtopia::HomePhone: | 706 | case Qtopia::HomePhone: |
675 | item.value = entry.homePhone(); | 707 | item.value = entry.homePhone(); |
676 | if ( !item.value.isEmpty() ) | 708 | if ( !item.value.isEmpty() ) |
677 | item.icon = Resource::loadPixmap( "addressbook/phonehome" ); | 709 | item.icon = Resource::loadPixmap( "addressbook/phonehome" ); |
678 | break; | 710 | break; |
679 | case Qtopia::HomeFax: | 711 | case Qtopia::HomeFax: |
680 | item.value = entry.homeFax(); | 712 | item.value = entry.homeFax(); |
681 | if ( !item.value.isEmpty() ) | 713 | if ( !item.value.isEmpty() ) |
682 | item.icon = Resource::loadPixmap( "addressbook/faxhome" ); | 714 | item.icon = Resource::loadPixmap( "addressbook/faxhome" ); |
683 | break; | 715 | break; |
684 | case Qtopia::HomeMobile: | 716 | case Qtopia::HomeMobile: |
685 | item.value = entry.homeMobile(); | 717 | item.value = entry.homeMobile(); |
686 | if ( !item.value.isEmpty() ) | 718 | if ( !item.value.isEmpty() ) |
687 | item.icon = Resource::loadPixmap( "addressbook/mobilehome" ); | 719 | item.icon = Resource::loadPixmap( "addressbook/mobilehome" ); |
688 | break; | 720 | break; |
689 | case Qtopia::HomeWebPage: | 721 | case Qtopia::HomeWebPage: |
690 | item.value = entry.homeWebpage(); | 722 | item.value = entry.homeWebpage(); |
691 | if ( !item.value.isEmpty() ) | 723 | if ( !item.value.isEmpty() ) |
692 | item.icon = Resource::loadPixmap( "addressbook/webpagehome" ); | 724 | item.icon = Resource::loadPixmap( "addressbook/webpagehome" ); |
693 | break; | 725 | break; |
694 | case Qtopia::Company: | 726 | case Qtopia::Company: |
695 | item.value = entry.company(); | 727 | item.value = entry.company(); |
696 | break; | 728 | break; |
697 | case Qtopia::BusinessCity: | 729 | case Qtopia::BusinessCity: |
698 | item.value = entry.businessCity(); | 730 | item.value = entry.businessCity(); |
699 | break; | 731 | break; |
700 | case Qtopia::BusinessStreet: | 732 | case Qtopia::BusinessStreet: |
701 | item.value = entry.businessStreet(); | 733 | item.value = entry.businessStreet(); |
702 | break; | 734 | break; |
703 | case Qtopia::BusinessZip: | 735 | case Qtopia::BusinessZip: |
704 | item.value = entry.businessZip(); | 736 | item.value = entry.businessZip(); |
705 | break; | 737 | break; |
706 | case Qtopia::BusinessCountry: | 738 | case Qtopia::BusinessCountry: |
707 | item.value = entry.businessCountry(); | 739 | item.value = entry.businessCountry(); |
708 | break; | 740 | break; |
709 | case Qtopia::BusinessWebPage: | 741 | case Qtopia::BusinessWebPage: |
710 | item.value = entry.businessWebpage(); | 742 | item.value = entry.businessWebpage(); |
711 | if ( !item.value.isEmpty() ) | 743 | if ( !item.value.isEmpty() ) |
712 | item.icon = Resource::loadPixmap( "addressbook/webpagework" ); | 744 | item.icon = Resource::loadPixmap( "addressbook/webpagework" ); |
713 | break; | 745 | break; |
714 | case Qtopia::JobTitle: | 746 | case Qtopia::JobTitle: |
715 | item.value = entry.jobTitle(); | 747 | item.value = entry.jobTitle(); |
716 | break; | 748 | break; |
717 | case Qtopia::Department: | 749 | case Qtopia::Department: |
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h index 092e86f..4e6b294 100644 --- a/core/pim/addressbook/abtable.h +++ b/core/pim/addressbook/abtable.h | |||
@@ -3,145 +3,146 @@ | |||
3 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) | 3 | ** Copyright (c) 2002 Stefan Eilers (eilers.stefan@epost.de) |
4 | ** | 4 | ** |
5 | ** This file is part of Qt Palmtop Environment. | 5 | ** This file is part of Qt Palmtop Environment. |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #ifndef ABTABLE_H | 22 | #ifndef ABTABLE_H |
23 | #define ABTABLE_H | 23 | #define ABTABLE_H |
24 | 24 | ||
25 | #include <qpe/categories.h> | 25 | #include <qpe/categories.h> |
26 | #include <opie/ocontact.h> | 26 | #include <opie/ocontact.h> |
27 | #include <opie/ocontactaccess.h> | 27 | #include <opie/ocontactaccess.h> |
28 | 28 | ||
29 | #include <qmap.h> | 29 | #include <qmap.h> |
30 | #include <qtable.h> | 30 | #include <qtable.h> |
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qpixmap.h> | 33 | #include <qpixmap.h> |
34 | 34 | ||
35 | class AbTableItem : public QTableItem | 35 | class AbTableItem : public QTableItem |
36 | { | 36 | { |
37 | public: | 37 | public: |
38 | AbTableItem( QTable *t, EditType et, const QString &s, | 38 | AbTableItem( QTable *t, EditType et, const QString &s, |
39 | const QString &secondSortKey); | 39 | const QString &secondSortKey); |
40 | QString entryKey() const; | 40 | QString entryKey() const; |
41 | void setEntryKey( const QString & k ); | 41 | void setEntryKey( const QString & k ); |
42 | virtual int alignment() const; | 42 | virtual int alignment() const; |
43 | virtual QString key() const; | 43 | virtual QString key() const; |
44 | void setItem( const QString &txt, const QString &secondKey ); | 44 | void setItem( const QString &txt, const QString &secondKey ); |
45 | 45 | ||
46 | private: | 46 | private: |
47 | QString sortKey; | 47 | QString sortKey; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | // This is a simple container, storing all contact | 50 | // This is a simple container, storing all contact |
51 | // information | 51 | // information |
52 | class ContactItem | 52 | class ContactItem |
53 | { | 53 | { |
54 | public: | 54 | public: |
55 | QPixmap icon; | 55 | QPixmap icon; |
56 | QString value; | 56 | QString value; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | class AbPickItem : public QTableItem | 59 | class AbPickItem : public QTableItem |
60 | { | 60 | { |
61 | public: | 61 | public: |
62 | AbPickItem( QTable *t ); | 62 | AbPickItem( QTable *t ); |
63 | 63 | ||
64 | QWidget *createEditor() const; | 64 | QWidget *createEditor() const; |
65 | void setContentFromEditor( QWidget *w ); | 65 | void setContentFromEditor( QWidget *w ); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | QGuardedPtr<QComboBox> cb; | 68 | QGuardedPtr<QComboBox> cb; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | class AbTable : public QTable | 71 | class AbTable : public QTable |
72 | { | 72 | { |
73 | Q_OBJECT | 73 | Q_OBJECT |
74 | 74 | ||
75 | public: | 75 | public: |
76 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); | 76 | AbTable( const QValueList<int> ordered, QWidget *parent, const char *name=0 ); |
77 | ~AbTable(); | 77 | ~AbTable(); |
78 | 78 | ||
79 | // Set the contacts shown in the table | 79 | // Set the contacts shown in the table |
80 | void setContacts( const OContactAccess::List& viewList ); | 80 | void setContacts( const OContactAccess::List& viewList ); |
81 | // Selects a contact of a specific UID | 81 | // Selects a contact of a specific UID |
82 | bool selectContact( int UID ); | 82 | bool selectContact( int UID ); |
83 | 83 | ||
84 | // Get the current selected entry | 84 | // Get the current selected entry |
85 | OContact currentEntry(); | 85 | OContact currentEntry(); |
86 | 86 | ||
87 | // Get the UID of the current selected Entry | 87 | // Get the UID of the current selected Entry |
88 | int currentEntry_UID(); | 88 | int currentEntry_UID(); |
89 | 89 | ||
90 | QString findContactName( const OContact &entry ); | 90 | QString findContactName( const OContact &entry ); |
91 | 91 | ||
92 | void init(); | 92 | void init(); |
93 | void clear(); | 93 | void clear(); |
94 | void refresh(); | 94 | void refresh(); |
95 | 95 | ||
96 | void show(); | 96 | void show(); |
97 | void setPaintingEnabled( bool e ); | 97 | void setPaintingEnabled( bool e ); |
98 | void viewportPaintEvent( QPaintEvent* e); | 98 | void viewportPaintEvent( QPaintEvent* e); |
99 | void paintCell(QPainter* p, int row, int col, const QRect&, bool ); | ||
99 | 100 | ||
100 | // addresspicker mode (What's that ? se) | 101 | // addresspicker mode (What's that ? se) |
101 | void setChoiceNames( const QStringList& list); | 102 | void setChoiceNames( const QStringList& list); |
102 | QStringList choiceNames() const; | 103 | QStringList choiceNames() const; |
103 | void setChoiceSelection( const QValueList<int>& list ); | 104 | void setChoiceSelection( const QValueList<int>& list ); |
104 | QStringList choiceSelection(int index) const; | 105 | QStringList choiceSelection(int index) const; |
105 | 106 | ||
106 | signals: | 107 | signals: |
107 | void signalSwitch(); | 108 | void signalSwitch(); |
108 | void signalEditor(); | 109 | void signalEditor(); |
109 | void signalKeyDown(); | 110 | void signalKeyDown(); |
110 | void signalKeyUp(); | 111 | void signalKeyUp(); |
111 | 112 | ||
112 | protected: | 113 | protected: |
113 | virtual void keyPressEvent( QKeyEvent *e ); | 114 | virtual void keyPressEvent( QKeyEvent *e ); |
114 | 115 | ||
115 | // int rowHeight( int ) const; | 116 | // int rowHeight( int ) const; |
116 | // int rowPos( int row ) const; | 117 | // int rowPos( int row ) const; |
117 | // virtual int rowAt( int pos ) const; | 118 | // virtual int rowAt( int pos ) const; |
118 | 119 | ||
119 | 120 | ||
120 | protected slots: | 121 | protected slots: |
121 | void moveTo( char ); | 122 | void moveTo( char ); |
122 | virtual void columnClicked( int col ); | 123 | virtual void columnClicked( int col ); |
123 | void itemClicked(int,int col); | 124 | void itemClicked(int,int col); |
124 | void rowHeightChanged( int row ); | 125 | void rowHeightChanged( int row ); |
125 | 126 | ||
126 | private: | 127 | private: |
127 | void insertIntoTable( const OContact &cnt, int row ); | 128 | void insertIntoTable( const OContact &cnt, int row ); |
128 | ContactItem findContactContact( const OContact &entry, int row ); | 129 | ContactItem findContactContact( const OContact &entry, int row ); |
129 | void fitColumns(); | 130 | void fitColumns(); |
130 | void resizeRows(); | 131 | void resizeRows(); |
131 | void realignTable(); | 132 | void realignTable(); |
132 | void resort(); | 133 | void resort(); |
133 | void updateVisible(); | 134 | void updateVisible(); |
134 | 135 | ||
135 | int lastSortCol; | 136 | int lastSortCol; |
136 | bool asc; | 137 | bool asc; |
137 | QMap<AbTableItem*, OContact> contactList; | 138 | QMap<AbTableItem*, OContact> contactList; |
138 | QValueList<int> intFields; | 139 | QValueList<int> intFields; |
139 | QStringList choicenames; | 140 | QStringList choicenames; |
140 | bool enablePainting; | 141 | bool enablePainting; |
141 | bool columnVisible; | 142 | bool columnVisible; |
142 | int countNested; | 143 | int countNested; |
143 | 144 | ||
144 | OContactAccess::List m_viewList; | 145 | OContactAccess::List m_viewList; |
145 | 146 | ||
146 | }; | 147 | }; |
147 | #endif // ABTABLE_H | 148 | #endif // ABTABLE_H |