~gerboland/qtmir/ual-catch-exception

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/session_interface.h

  • Committer: CI Train Bot
  • Author(s): Daniel d'Andrada
  • Date: 2016-04-13 18:38:49 UTC
  • mfrom: (466.2.16 surfaceListModel)
  • Revision ID: ci-train-bot@canonical.com-20160413183849-qdqd0akyoa4rdl9i
Surface-based window management

- Session is no longer exported to QML. It's now an internal qtmir concept.
Approved by: Gerry Boland

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
namespace qtmir {
41
41
 
42
42
class MirSurfaceInterface;
 
43
class MirSurfaceListModel;
43
44
 
44
45
class SessionInterface : public QObject {
45
46
    Q_OBJECT
46
47
 
47
 
    // FIXME: Remove this once unity8 starts trully supporting multiple surfaces per applicaton.
48
 
    //        Ie, remove this once untiy8 moves from using this property to using the surfaces one.
49
 
    Q_PROPERTY(MirSurfaceInterface* lastSurface READ lastSurface NOTIFY lastSurfaceChanged);
50
 
 
51
 
    Q_PROPERTY(const ObjectListModel<MirSurfaceInterface>* surfaces READ surfaces CONSTANT);
52
48
    Q_PROPERTY(unity::shell::application::ApplicationInfoInterface* application READ application NOTIFY applicationChanged DESIGNABLE false)
53
 
    Q_PROPERTY(SessionInterface* parentSession READ parentSession NOTIFY parentSessionChanged DESIGNABLE false)
54
49
    Q_PROPERTY(SessionModel* childSessions READ childSessions DESIGNABLE false CONSTANT)
55
50
    Q_PROPERTY(bool fullscreen READ fullscreen NOTIFY fullscreenChanged)
56
51
    Q_PROPERTY(bool live READ live NOTIFY liveChanged)
66
61
        Stopped
67
62
    };
68
63
 
69
 
    Q_INVOKABLE virtual void release() = 0;
70
 
 
71
64
    //getters
72
65
    virtual QString name() const = 0;
73
66
    virtual unity::shell::application::ApplicationInfoInterface* application() const = 0;
74
 
    virtual MirSurfaceInterface* lastSurface() const = 0;
75
 
    virtual const ObjectListModel<MirSurfaceInterface>* surfaces() const = 0;
76
 
    virtual SessionInterface* parentSession() const = 0;
 
67
 
 
68
    // List of surfaces in this session. Surfaces that are being forcibly closed are not present in this list
 
69
    virtual MirSurfaceListModel* surfaceList() = 0;
 
70
 
77
71
    virtual SessionModel* childSessions() const = 0;
78
72
    virtual State state() const = 0;
79
73
    virtual bool fullscreen() const = 0;
84
78
    // For MirSurface and MirSurfaceManager use
85
79
 
86
80
    virtual void registerSurface(MirSurfaceInterface* surface) = 0;
87
 
    virtual void removeSurface(MirSurfaceInterface* surface) = 0;
88
81
 
89
82
    // For Application use
90
83
 
93
86
    virtual void resume() = 0;
94
87
    virtual void close() = 0;
95
88
    virtual void stop() = 0;
 
89
    virtual bool hadSurface() const = 0; // whether this session ever had any surface (currently or in the past)
 
90
    virtual bool hasClosingSurfaces() const = 0; // whether it has surfaces being forcibly closed
96
91
 
97
92
    // For SessionManager use
98
93
 
110
105
    virtual void removePromptSession(const std::shared_ptr<mir::scene::PromptSession>& session) = 0;
111
106
 
112
107
Q_SIGNALS:
113
 
    void parentSessionChanged(SessionInterface*);
114
108
    void applicationChanged(unity::shell::application::ApplicationInfoInterface* application);
115
109
    void stateChanged(State state);
116
110
    void fullscreenChanged(bool fullscreen);
117
111
    void liveChanged(bool live);
118
 
    void lastSurfaceChanged(MirSurfaceInterface* surface);
 
112
 
 
113
    // Emitted when any surface in this session emits focusRequested()
 
114
    void focusRequested();
 
115
 
 
116
    // For Application use
 
117
    void hasClosingSurfacesChanged();
119
118
};
120
119
 
121
120
} // namespace qtmir