~gerboland/qtmir/ual-catch-exception

« back to all changes in this revision

Viewing changes to tests/framework/fake_session.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:
1
1
/*
2
 
 * Copyright (C) 2015 Canonical, Ltd.
 
2
 * Copyright (C) 2015-2016 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
15
15
 */
16
16
 
17
17
#include <Unity/Application/session_interface.h>
 
18
#include <Unity/Application/mirsurfacelistmodel.h>
18
19
#include <QDebug>
19
20
 
20
21
#ifndef QTMIR_FAKE_SESSION_H
30
31
    FakeSession();
31
32
    virtual ~FakeSession();
32
33
 
33
 
    // For QML use
34
 
    void release() override;
35
 
 
36
34
    QString name() const override;
37
35
    unity::shell::application::ApplicationInfoInterface* application() const override;
38
 
    MirSurfaceInterface* lastSurface() const override;
39
 
    const ObjectListModel<MirSurfaceInterface>* surfaces() const override;
40
 
    SessionInterface* parentSession() const override;
 
36
    MirSurfaceListModel* surfaceList() override;
41
37
    SessionModel* childSessions() const override;
42
38
    State state() const override;
43
39
    bool fullscreen() const override;
48
44
    // For MirSurfaceItem and MirSurfaceManager use
49
45
 
50
46
    void registerSurface(MirSurfaceInterface*) override;
51
 
    void removeSurface(MirSurfaceInterface*) override;
52
47
 
53
48
    // For Application use
54
49
 
56
51
    void suspend() override;
57
52
    void resume() override;
58
53
    void stop() override;
 
54
    bool hadSurface() const override;
 
55
    bool hasClosingSurfaces() const override;
59
56
 
60
57
    void close() override;
61
58
 
77
74
    // For tests
78
75
 
79
76
    void setState(State state);
 
77
    void setSession(std::shared_ptr<mir::scene::Session> session);
80
78
 
81
79
private:
82
80
    unity::shell::application::ApplicationInfoInterface* m_application;
83
81
    State m_state;
 
82
    std::shared_ptr<mir::scene::Session> m_session;
 
83
    MirSurfaceListModel m_surfaceList;
84
84
};
85
85
 
86
86
} // namespace qtmi