~ubuntu-branches/ubuntu/quantal/marble/quantal

« back to all changes in this revision

Viewing changes to src/lib/FileViewModel.h

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-11 15:43:02 UTC
  • Revision ID: james.westby@ubuntu.com-20110711154302-lq69ftcx125g1jx5
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// This file is part of the Marble Virtual Globe.
 
3
//
 
4
// This program is free software licensed under the GNU LGPL. You can
 
5
// find a copy of this license in LICENSE.txt in the top directory of
 
6
// the source code.
 
7
//
 
8
// Copyright 2007      Murad Tagirov <tmurad@gmail.com>
 
9
// Copyright 2009      Patrick Spendrin <ps_ml@gmx.de>
 
10
//
 
11
 
 
12
#ifndef MARBLE_FILEVIEWMODEL_H
 
13
#define MARBLE_FILEVIEWMODEL_H
 
14
 
 
15
#include <QtCore/QAbstractListModel>
 
16
#include <QtCore/QVariant>
 
17
 
 
18
#include "marble_export.h"
 
19
 
 
20
class QItemSelectionModel;
 
21
 
 
22
namespace Marble
 
23
{
 
24
 
 
25
class FileManager;
 
26
 
 
27
class MARBLE_EXPORT FileViewModel : public QAbstractListModel
 
28
{
 
29
    Q_OBJECT
 
30
 
 
31
  public:
 
32
    explicit FileViewModel( QObject* parent = 0 );
 
33
    ~FileViewModel();
 
34
 
 
35
    virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;
 
36
    virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
 
37
    virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
 
38
    virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
 
39
 
 
40
    void setFileManager( FileManager * fileManager );
 
41
    QItemSelectionModel * selectionModel();
 
42
 
 
43
  public slots:
 
44
    void saveFile();
 
45
    void closeFile();
 
46
    void append( int item );
 
47
    void remove( int item );
 
48
 
 
49
  private:
 
50
    Q_DISABLE_COPY( FileViewModel )
 
51
    QItemSelectionModel *m_selectionModel;
 
52
    FileManager *m_manager;
 
53
    
 
54
};
 
55
 
 
56
}
 
57
 
 
58
#endif