contactengine/detailsgv.h
author wesleyt@symbian.org
Thu, 09 Sep 2010 11:30:41 -0700
changeset 45 b23ec2b62c45
parent 34 93c5a58496b6
permissions -rwxr-xr-x
resizing layouts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
#ifndef DETAILSGV_H
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
#define DETAILSGV_H
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
#include <QHash>
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
#include <QObject>
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
#include <QGraphicsView>
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
#include <QGraphicsProxyWidget>
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
#include <QPushButton>
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
/*
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
 * This class is a mock up of how the Graphics View architecture might be
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
 * used to present the details of a contact. It encapsulates all information
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
 * about Graphics View except the UI Design defines and asks the view itself to the
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
 * QStackedView.
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
 *
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
 * It has no knowledge of the QMainWindow. Widgets in this calls can emit a signal to
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
 * communicate with the QMainWindow.
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
 */
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
class DetailsGV : public QObject
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
{
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
    Q_OBJECT
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
public:
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
    explicit DetailsGV(QObject *parent, QGraphicsView *gv);
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
signals:
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
    void closeMe();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
    void backToList();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
public slots:
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
private:
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
    // We can use normal widgets in a Graphics View. This one creates some push buttons.
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
    void createWidgets();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
    // If you use normal widgets, you'll need to use a proxy to communite between them and the graphics view.
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
    void createProxyWidgets();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
    void createLayout();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
    // customize the view
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
    void customizeView();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
    void createConnections();
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
private:
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
    QGraphicsScene *scene;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    44
    QGraphicsView *view;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    45
    QPushButton *callMe;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
    QPushButton *textMe;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
    QPushButton *back;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
    QPushButton *exitApp;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    50
    QHash<QString, QGraphicsProxyWidget*> proxyForName;
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    51
};
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    52
93c5a58496b6 add graphics view which presents contacts details
John Kern <johnk@symbian.org>
parents:
diff changeset
    53
#endif // DETAILSGV_H