~ubuntu-branches/ubuntu/saucy/kopete/saucy-proposed

« back to all changes in this revision

Viewing changes to kopete/contactlist/kopeteaddrbookexport.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-21 02:22:39 UTC
  • Revision ID: package-import@ubuntu.com-20130621022239-63l3zc8p0nf26pt6
Tags: upstream-4.10.80
ImportĀ upstreamĀ versionĀ 4.10.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    kopeteaddrbookexport.h - Kopete Online Status
 
3
 
 
4
    Logic for exporting data acquired from messaging systems to the 
 
5
    KDE address book
 
6
 
 
7
    Copyright (c) 2004 by Will Stephenson <wstephenson@kde.org>
 
8
 
 
9
    Kopete    (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
 
10
 
 
11
    *************************************************************************
 
12
    *                                                                       *
 
13
    * This program is free software; you can redistribute it and/or modify  *
 
14
    * it under the terms of the GNU General Public License as published by  *
 
15
    * the Free Software Foundation; either version 2 of the License, or     *
 
16
    * (at your option) any later version.                                   *
 
17
    *                                                                       *
 
18
    *************************************************************************
 
19
*/
 
20
 
 
21
#ifndef KOPETEADDRBOOKEXPORT_H
 
22
#define KOPETEADDRBOOKEXPORT_H
 
23
 
 
24
#include <kabc/stdaddressbook.h>
 
25
#include <kabc/addressee.h>
 
26
 
 
27
#include "kopeteproperty.h"
 
28
#include "ui_kopeteaddrbookexportui.h"
 
29
//Added by qt3to4:
 
30
#include <QPixmap>
 
31
 
 
32
class KDialog;
 
33
class K3ListBox;
 
34
 
 
35
namespace Kopete
 
36
{
 
37
class Contact;
 
38
class MetaContact;
 
39
}
 
40
 
 
41
class KopeteAddressBookExport : public QObject, private Ui::AddressBookExportUI
 
42
{
 
43
Q_OBJECT
 
44
 
 
45
public:
 
46
        KopeteAddressBookExport( QWidget *parent, Kopete::MetaContact *mc );
 
47
        ~KopeteAddressBookExport();
 
48
        
 
49
        /** 
 
50
         * Display the dialog
 
51
         * @return a QDialog return code
 
52
         */
 
53
        int showDialog();
 
54
        /**
 
55
         * Export the data to KABC if changed, omitting any duplicates
 
56
         */
 
57
        void exportData();
 
58
        
 
59
protected:
 
60
        /**
 
61
         * Initialise the GUI labels with labels from KABC
 
62
         */
 
63
        void initLabels();
 
64
        /**
 
65
         * Populate the GUI with data from KABC
 
66
         */
 
67
        void fetchKABCData();
 
68
        /**
 
69
         * Populate a listbox with a given type of phone number
 
70
         */
 
71
        void fetchPhoneNumbers( K3ListBox * listBox, KABC::PhoneNumber::Type type, uint& counter );
 
72
        /**
 
73
         * Populate the GUI with data from IM systems
 
74
         */
 
75
        void fetchIMData();
 
76
        /**
 
77
         * Populate a combobox with a contact's IM data
 
78
         */
 
79
        void populateIM( const Kopete::Contact *contact, const QPixmap &icon, 
 
80
                        QComboBox *combo, const Kopete::PropertyTmpl &property );
 
81
        /**
 
82
         * Populate a listbox with a contact's IM data
 
83
         */
 
84
        void populateIM( const Kopete::Contact *contact, const QPixmap &icon, 
 
85
                        K3ListBox *combo, const Kopete::PropertyTmpl &property );
 
86
        
 
87
        /** Check the selected item is not the first (existing KABC) item, or the same as it */
 
88
        bool newValue( QComboBox *combo );
 
89
        QStringList newValues( K3ListBox *listBox, uint counter );
 
90
        
 
91
        // the GUI
 
92
        QWidget *mParent;
 
93
        KDialog * mDialog;
 
94
        QPixmap mAddrBookIcon;
 
95
        AddressBookExportUI *mUI;
 
96
        Kopete::MetaContact *mMetaContact;
 
97
        KABC::AddressBook *mAddressBook;
 
98
        KABC::Addressee mAddressee;
 
99
        
 
100
        // counters tracking the number of KABC values where multiple values are possible in a single key
 
101
        uint numEmails, numHomePhones, numWorkPhones, numMobilePhones;
 
102
 
 
103
};
 
104
 
 
105
#endif