~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to discover/BackendsSingleton.h

Tags: upstream-1.3.65
ImportĀ upstreamĀ versionĀ 1.3.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2012 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library/Lesser General Public License
 
6
 *   version 2, or (at your option) any later version, as published by the
 
7
 *   Free Software Foundation
 
8
 *
 
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 General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library/Lesser General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef BACKENDSSINGLETON_H
 
21
#define BACKENDSSINGLETON_H
 
22
#include <LibQApt/Globals>
 
23
 
 
24
class MuonInstallerMainWindow;
 
25
namespace QApt { class Backend; }
 
26
class ApplicationBackend;
 
27
class ApplicationModel;
 
28
 
 
29
class BackendsSingleton : public QObject
 
30
{
 
31
Q_OBJECT
 
32
public:
 
33
    BackendsSingleton();
 
34
    
 
35
    static BackendsSingleton* self();
 
36
    
 
37
    void initialize(QApt::Backend* b, MuonInstallerMainWindow* main);
 
38
    
 
39
    ApplicationModel* appsModel();
 
40
    QApt::Backend* backend();
 
41
    ApplicationBackend* applicationBackend();
 
42
    MuonInstallerMainWindow* mainWindow() const;
 
43
 
 
44
signals:
 
45
    void initialized();
 
46
    
 
47
private:
 
48
    static BackendsSingleton* m_self;
 
49
    ApplicationModel* m_appsModel;
 
50
    QApt::Backend* m_backend;
 
51
    QApt::CacheState m_originalState;
 
52
    ApplicationBackend* m_applicationBackend;
 
53
    MuonInstallerMainWindow* m_mainWindow;
 
54
};
 
55
 
 
56
#endif // BACKENDSSINGLETON_H