summaryrefslogtreecommitdiffstats
path: root/kmobile/kmobileview.h
blob: 4e18793cc09899aeefb82e65fc77ac4d310cde54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * Copyright (C) 2003 Helge Deller <deller@kde.org>
 */

#ifndef _KMOBILEVIEW_H_
#define _KMOBILEVIEW_H_

#include <qiconview.h>

#include "kmobileiface.h"

#include <kdepimmacros.h>
class KConfig;
class KMobileItem;

/**
 * This is the main view class for kmobile.
 *
 * @short Main view
 * @author Helge Deller <deller@kde.org>
 * @version 0.1
 */
class KDE_EXPORT KMobileView : public QIconView, public kmobileIface
{
    Q_OBJECT
public:
    KMobileView(QWidget *parent, KConfig *_config);
    virtual ~KMobileView();

    bool addNewDevice(KConfig *config, KService::Ptr service);
    bool startKonqueror(const QString &devName);

    /**
     * DCOP implementation
     */
    QStringList deviceNames();

    void removeDevice( QString deviceName );
    void configDevice( QString deviceName );

    bool connectDevice( QString deviceName );
    bool disconnectDevice( QString deviceName );
    bool connected( QString deviceName );

    QString deviceClassName( QString deviceName );
    QString deviceName( QString deviceName );
    QString revision( QString deviceName );
    int classType( QString deviceName );

    int capabilities( QString deviceName );
    QString nameForCap( QString deviceName, int cap );

    QString iconFileName( QString deviceName );

    int     numAddresses( QString deviceName );
    QString readAddress( QString deviceName, int index );
    bool    storeAddress( QString deviceName, int index, QString vcard, bool append );

    int numCalendarEntries( QString deviceName );

    int numNotes( QString deviceName );
    QString readNote( QString deviceName, int index );
    bool storeNote( QString deviceName, int index, QString note );

    /* devices kioslave support: */
    QStringList kio_devices_deviceInfo(QString deviceName);

public:
    void saveAll();
    void restoreAll();

protected:
    KMobileItem * findDevice( const QString &deviceName ) const;

protected slots:
    void slotDoubleClicked( QIconViewItem * item );

signals:
    /**
     * Use this signal to change the content of the statusbar
     */
    void signalChangeStatusbar(const QString& text);

private:
    KConfig *m_config;

};

#endif // _KMOBILEVIEW_H_