~ubuntu-branches/ubuntu/vivid/kate/vivid-updates

« back to all changes in this revision

Viewing changes to addons/kate/katesql/connectionmodel.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-12-04 16:49:41 UTC
  • mfrom: (1.6.6)
  • Revision ID: package-import@ubuntu.com-20141204164941-l3qbvsly83hhlw2v
Tags: 4:14.11.97-0ubuntu1
* New upstream release
* Update build-deps and use pkg-kde v3 for Qt 5 build
* kate-data now kate5-data for co-installability

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
   Copyright (C) 2010  Marco Mentasti  <marcomentasti@gmail.com>
3
 
 
4
 
   This library is free software; you can redistribute it and/or
5
 
   modify it under the terms of the GNU Library General Public
6
 
   License version 2 as published by the Free Software Foundation.
7
 
 
8
 
   This library is distributed in the hope that it will be useful,
9
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
   Library General Public License for more details.
12
 
 
13
 
   You should have received a copy of the GNU Library General Public License
14
 
   along with this library; see the file COPYING.LIB.  If not, write to
15
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
 
   Boston, MA 02110-1301, USA.
17
 
*/
18
 
 
19
 
#ifndef CONNECTIONMODEL_H
20
 
#define CONNECTIONMODEL_H
21
 
 
22
 
#include "connection.h"
23
 
 
24
 
#include <kicon.h>
25
 
 
26
 
#include <QAbstractListModel>
27
 
#include <qstring.h>
28
 
#include <qhash.h>
29
 
 
30
 
class ConnectionModel : public QAbstractListModel
31
 
{
32
 
  Q_OBJECT
33
 
 
34
 
  public:
35
 
    ConnectionModel(QObject *parent = 0);
36
 
    virtual ~ConnectionModel();
37
 
 
38
 
    virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
39
 
    virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
40
 
 
41
 
    virtual int addConnection(Connection conn);
42
 
    virtual void removeConnection(const QString &name);
43
 
 
44
 
    Connection::Status status(const QString &name) const;
45
 
    void setStatus(const QString &name, const Connection::Status status);
46
 
 
47
 
    void setPassword(const QString &name, const QString &password);
48
 
 
49
 
    int indexOf(const QString &name);
50
 
 
51
 
//     virtual bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
52
 
//     virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
53
 
 
54
 
  private:
55
 
    QHash<QString, Connection> m_connections;
56
 
    QHash<Connection::Status, KIcon> m_icons;
57
 
};
58
 
 
59
 
#endif // CONNECTIONMODEL_H