2 * Copyright 2015-2016 Canonical Ltd.
3 * Copyright 2021 UBports Foundation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19#include <QSqlDatabase>
26#include <unity/shell/application/Mir.h>
30class WindowStateStorage: public QObject
35 WindowStateNormal = 1 << 0,
36 WindowStateMaximized = 1 << 1,
37 WindowStateMinimized = 1 << 2,
38 WindowStateFullscreen = 1 << 3,
39 WindowStateMaximizedLeft = 1 << 4,
40 WindowStateMaximizedRight = 1 << 5,
41 WindowStateMaximizedHorizontally = 1 << 6,
42 WindowStateMaximizedVertically = 1 << 7,
43 WindowStateMaximizedTopLeft = 1 << 8,
44 WindowStateMaximizedTopRight = 1 << 9,
45 WindowStateMaximizedBottomLeft = 1 << 10,
46 WindowStateMaximizedBottomRight = 1 << 11,
47 WindowStateRestored = 1 << 12
50 Q_DECLARE_FLAGS(WindowStates, WindowState)
53 WindowStateStorage(const QString &dbName = QString(), QObject *parent = nullptr);
54 virtual ~WindowStateStorage();
56 Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
58 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue) const;
60 Q_INVOKABLE int getStage(const QString &appId, int defaultValue) const;
62 Q_INVOKABLE Mir::State toMirState(WindowState state) const;
64 const QString getDbName();
67 void saveStage(const QString &appId, int stage);
68 void saveGeometry(const QString &windowId, const QRect &rect);
69 void saveState(const QString &windowId, WindowStateStorage::WindowState state);
73 AsyncQuery *m_asyncQuery;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list