summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/session.h
blob: 04bf257fa4d288564e270f45f78186e6e3149f38 (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
#ifndef OPIE_SESSION_H
#define OPIE_SESSION_H

#include <qwidgetstack.h>

class IOLayer;
class EmulationLayer;
class WidgetLayer;
/**
 * This is a Session. A session contains
 * a QWidget pointer and a IOLayer
 * Imagine a session like a collection of what
 * is needed to show your widget in a tab ;)
 */
class Session {
public:
    /**
     * c'tor with widget and layer
     * ownership get's transfered
     */
    Session();
    Session( const QString&, QWidgetStack* widget, IOLayer* );
    ~Session();

    /**
     * return the name of the session
     */
    QString name()const;

    /**
     * return the widgetstack
     * this is used to be semi modal
     * for FileTransfer
     *
     * semi modal == SessionModal
     */
    QWidgetStack* widgetStack();

    /**
     * return the layer
     */
    IOLayer* layer();

//    EmulationLayer* emulationLayer();
    WidgetLayer* emulationWidget();

    /*
     * connects the data flow from
     * the IOLayer to the EmulationLayer
     */
    void connect();

    /*
     * disconnect the dataflow
     * this will be done for ft
     */
    void disconnect();

    void setWidgetStack( QWidgetStack* widget );
//    void setEmulationLayer( EmulationLayer* lay );
//    void setEmulationWidget( WidgetLayer* lay );
    void setIOLayer( IOLayer*  );
    void setName( const QString& );

private:
    QString m_name;
    QWidgetStack* m_widget;
    IOLayer* m_layer;
//    EmulationLayer* m_emLay;
//    WidgetLayer* m_widLay;

};

#endif