summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrCustomSlideShowDia.h
blob: 203405bd509cf47880625ea39b23f0fe80f69947 (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
113
114
115
116
117
/* This file is part of the KDE project
   Copyright (C) 2004 Laurent Montel <[email protected]>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
*/

#ifndef __CUSTOM_SLIDE_SHOW__
#define __CUSTOM_SLIDE_SHOW__

#include <kdialogbase.h>
#include <qlistbox.h>
#include "global.h"

class QLineEdit;
class QPushButton;
class KPrDocument;
class QToolButton;
class KPrView;
class KPrPage;

class KPrCustomSlideShowDia : public KDialogBase
{
    Q_OBJECT

public:
    KPrCustomSlideShowDia( KPrView* _view, KPrDocument *_doc, const char* name );
    ~KPrCustomSlideShowDia();
public slots:
    virtual void slotOk();
    void slotDoubleClicked(QListBoxItem *);
    void slotTextClicked(QListBoxItem*);
    void slotRemove();
    void slotAdd();
    void slotModify();
    void slotCopy();
    void slotTest();
    void slotPresentationFinished();

protected:
    void hideEvent( QHideEvent* );

    void init();
    void updateButton();
    bool uniqueName( int val, const QString & name ) const;

    QListBox * list;
    QPushButton* m_pRemove;
    QPushButton* m_pAdd;
    QPushButton* m_pModify;
    QPushButton* m_pCopy;
    QPushButton* m_pTest;
    bool m_bChanged;
    KPrDocument *m_doc;
    KPrView *m_view;
    CustomSlideShowMap m_customSlideShowMap;
    QStringList listPageName;
};

class KPrCustomSlideShowItem : public QListBoxText
{
public:
    KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page );
    KPrCustomSlideShowItem( KPrPage * page );
    KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page, QListBoxItem * after );

    KPrPage * getPage() { return m_page; }
private:
    KPrPage * m_page;
};

class KPrDefineCustomSlideShow : public KDialogBase
{
    Q_OBJECT
public:
    KPrDefineCustomSlideShow( QWidget* parent, QStringList &_listNameSlideShow, const QPtrList<KPrPage> &pages, const char *name = 0L);
    KPrDefineCustomSlideShow( QWidget* parent, const QString &_customName, QStringList &_listNameSlideShow, 
                              const QPtrList<KPrPage> &pages, QValueList<KPrPage *> &customPages, const char* name = 0L );

    QString customSlideShowName() const;
    QValueList<KPrPage *> customSlides();

protected slots:
    void slotMoveUpSlide();
    void slotMoveDownSlide();
    void slotMoveRemoveSlide();
    void slotMoveInsertSlide();
    void slideNameChanged( const QString & _name);
    void updateButton();
    virtual void slotOk();

protected:
    void init();
    QStringList listNameCustomSlideShow;
    QListBox *listSlide;
    QListBox *listSlideShow;
    QToolButton *m_insertSlide;
    QToolButton *m_removeSlide;
    QToolButton *m_moveUpSlide;
    QToolButton *m_moveDownSlide;
    QLineEdit *m_name;

};

#endif