summaryrefslogtreecommitdiffstats
path: root/kipi-plugins/sendimages/sendimagesdialog.h
blob: 46cb12b0d3b219f23c4910eaae513ec63d882d05 (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/* ============================================================
 *
 * This file is a part of kipi-plugins project
 * http://www.kipi-plugins.org
 *
 * Date        : 2003-10-01
 * Description : a kipi plugin to e-mailing images
 *
 * Copyright (C) 2003-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * 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 SENDIMAGESDIALOG_H
#define SENDIMAGESDIALOG_H

// TQt includes.

#include <tqstring.h>
#include <tqguardedptr.h>

// KDE includes.

#include <kdialogbase.h>
#include <klistbox.h>
#include <tdeio/previewjob.h>
#include <kurl.h>

// LibKipi includes.

#include <libkipi/interface.h>
#include <libkipi/imagecollection.h>
#include <libkipi/imageinfo.h>

// Local includes.

#include "kpaboutdata.h"

class TQComboBox;
class TQGroupBox;
class TQLabel;
class TQCheckBox;
class TQFrame;
class TQPushButton;
class TQFileInfo;

class KFileItem;
class KIntNumInput;
class KListBox;
class KSqueezedTextLabel;
class KURLRequester;

namespace KIPISendimagesPlugin
{

class ListImageItems : public KListBox
{
    Q_OBJECT
  

public:

    ListImageItems(TQWidget *parent=0, const char *name=0);

signals:

    void addedDropItems(TQStringList filesPath);

protected:

    void dragEnterEvent(TQDragEnterEvent *e);
    void dropEvent(TQDropEvent *e);
};


class SendImagesDialog : public KDialogBase
{
    Q_OBJECT
  

public:
   
   SendImagesDialog(TQWidget *parent, KIPI::Interface* interface, 
                    const KIPI::ImageCollection& images );
   ~SendImagesDialog();

   KIntNumInput   *m_imageCompression;
   KIntNumInput   *m_attachmentlimit;

   TQComboBox      *m_imagesFormat;
   TQComboBox      *m_imagesResize;
   TQComboBox      *m_mailAgentName;

   TQCheckBox      *m_addComments;
   TQCheckBox      *m_comment2ImageName;
   TQCheckBox      *m_changeImagesProp;
             
   KURLRequester  *m_ThunderbirdBinPath;
      
   KURL::List      m_images2send;
   
public slots:
   
   void slotAddDropItems(TQStringList filesPath);

signals:
   
   void signalAccepted(void);   

private slots:
   
   void slotHelp();
   void slotOk();
   void slotImageSelected( TQListBoxItem * item );
   void slotGotPreview(const KFileItem* , const TQPixmap &pixmap);
   void slotFailedPreview(const KFileItem*);
   void slotImagesFilesButtonAdd(void);
   void slotImagesFilesButtonRem(void);
   void slotThunderbirdBinPathChanged(const TQString&);
   void slotMailAgentChanged(int);

private:
   
   void setupImagesList(void);
   void setupEmailOptions(void);
   void setImagesList(const KURL::List& images);
   void writeSettings(void);
   void readSettings(void);
   void setNbItems(void);

private:

   bool                      m_cancelled;
   
   TQLabel                   *m_labelImageFormat;
   TQLabel                   *m_labelImageSize;
   TQLabel                   *m_mailAgentLabel;
   TQLabel                   *m_labelThunderbirdBinPath;
      
   TQPushButton              *m_addImageButton;
   TQPushButton              *m_remImagesButton;
   TQPushButton              *m_helpButton;
     
   TQProgressDialog          *m_progressDlg;

   TQGroupBox                *m_groupBoxImageList;

   TQLabel                   *m_imageLabel;

   TQFrame                   *page_setupImagesList;
   TQFrame                   *page_setupEmailOptions;
   TQFrame                   *page_about;

   KSqueezedTextLabel       *m_ImageComments;
   KSqueezedTextLabel       *m_ImageAlbum;
   
   KIPI::Interface          *m_interface;
   TDEIO::PreviewJob          *m_thumbJob;

   KIPIPlugins::KPAboutData *m_about;
   ListImageItems           *m_ImagesFilesListBox;
};

}  // NameSpace KIPISendimagesPlugin

#endif  // SENDIMAGESDIALOG_H