blob: c9a8dd1f30b6c595d2132f176b9f02a9e8deec86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
/* ============================================================
* File : galleries.h
* Author: Colin Guthrie <kde@colin.guthr.ie>
* Date : 2006-09-04
* Copyright 2006 by Colin Guthrie <kde@colin.guthr.ie>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
* either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================ */
#ifndef GALLERIES_H
#define GALLERIES_H
#include <qptrlist.h>
#include <qlistview.h>
namespace KWallet
{
class Wallet;
}
namespace KIPIGalleryExportPlugin
{
class Gallery
{
public:
Gallery(const QString& name = i18n("New Gallery"),
const QString& url = QString("http://www.newgallery.com/"),
const QString& username = QString(),
const QString& password = QString(),
const unsigned int version = 2,
const unsigned int galleryId = 0);
~Gallery();
QString name() const;
QString url() const;
QString username() const;
QString password() const;
unsigned int version() const;
unsigned int galleryId() const;
void setName(QString name);
void setUrl(QString url);
void setUsername(QString username);
void setPassword(QString password);
void setVersion(unsigned int version);
void setGalleryId(unsigned int galleryId);
QListViewItem* asQListViewItem(QListView* pParent);
private:
QString mName;
QString mUrl;
QString mUsername;
QString mPassword;
unsigned int mVersion;
unsigned int mGalleryId;
};
/* Simple Stub Class to allow easy access to Galleries from GUI elements */
class GalleryQListViewItem : public QListViewItem
{
public:
GalleryQListViewItem(Gallery* pGallery, QListView* pParent);
Gallery* GetGallery();
void Refresh();
private:
Gallery* mpGallery;
};
typedef QPtrList<Gallery> GalleryPtrList;
/* Container class for all Galleries */
class Galleries
{
public:
Galleries();
~Galleries();
void Add(Gallery* pGallery);
void Remove(Gallery* pGallery);
void Save();
QListView* asQListView(QWidget* pParent);
private:
void Load();
KWallet::Wallet* mpWallet;
GalleryPtrList mGalleries;
unsigned int mMaxGalleryId;
};
}
#endif /* GALLERIES_H */
|