KoInsertLink.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Montel Laurent <lmontel@mandrakesoft.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 as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __KoInsertLink__
21#define __KoInsertLink__
22
23#include <kdialogbase.h>
24#include <koffice_export.h>
25class TQLineEdit;
26class KURLRequester;
27
28namespace KOfficePrivate {
32class internetLinkPage : public TQWidget
33{
34 TQ_OBJECT
35
36public:
37 internetLinkPage( TQWidget *parent = 0, char *name = 0 );
38 TQString linkName()const;
39 TQString hrefName();
40 void setLinkName(const TQString & _name);
41 void setHrefName(const TQString &_name);
42private:
43 TQString createInternetLink();
44 TQLineEdit* m_linkName, *m_hrefName;
45private slots:
46 void textChanged ( const TQString & );
47signals:
48 void textChanged();
49};
50
54class bookmarkLinkPage : public TQWidget
55{
56 TQ_OBJECT
57
58public:
59 bookmarkLinkPage( TQWidget *parent = 0, char *name = 0 );
60 TQString linkName()const;
61 TQString hrefName();
62 void setLinkName(const TQString & _name);
63 void setHrefName(const TQString &_name);
64 void setBookmarkList(const TQStringList &bkmlist);
65private:
66 TQString createBookmarkLink();
67 TQLineEdit* m_linkName;
68 TQComboBox *m_hrefName;
69private slots:
70 void textChanged ( const TQString & );
71signals:
72 void textChanged();
73};
74
78class mailLinkPage : public TQWidget
79{
80 TQ_OBJECT
81
82public:
83 mailLinkPage( TQWidget *parent = 0, char *name = 0 );
84 TQString linkName()const;
85 TQString hrefName();
86 void setLinkName(const TQString & _name);
87 void setHrefName(const TQString &_name);
88
89private slots:
90 void textChanged ( const TQString & );
91private:
92 TQString createMailLink();
93 TQLineEdit* m_linkName, *m_hrefName;
94signals:
95 void textChanged();
96};
97
101class fileLinkPage : public TQWidget
102{
103 TQ_OBJECT
104
105public:
106 fileLinkPage( TQWidget *parent = 0, char *name = 0 );
107 TQString linkName()const;
108 TQString hrefName();
109 void setLinkName(const TQString & _name);
110 void setHrefName(const TQString &_name);
111
112private slots:
113 void textChanged ( const TQString & );
114 void slotSelectRecentFile( const TQString & );
115private:
116 TQString createFileLink();
117 TQLineEdit* m_linkName;
118 KURLRequester* m_hrefName;
119signals:
120 void textChanged();
121};
122}
123
127class KOFFICEUI_EXPORT KoInsertLinkDia : public KDialogBase
128{
129 TQ_OBJECT
130
131public:
132 KoInsertLinkDia( TQWidget *parent, const char *name = 0,bool displayBookmarkLink=true );
133 static bool createLinkDia(TQString & linkName, TQString & hrefName, const TQStringList& bkmlist, bool displayBookmarkLink = true,
134 TQWidget* parent = 0, const char* name = 0);
135
136 //internal
137 TQString linkName() const;
138 TQString hrefName() const;
139 void setHrefLinkName(const TQString &_href, const TQString &_link, const TQStringList & bkmlist);
140protected slots:
141 virtual void slotOk();
142 void slotTextChanged ( );
143 void tabChanged(TQWidget *);
144
145private:
146 KOfficePrivate::fileLinkPage *fileLink;
147 KOfficePrivate::mailLinkPage *mailLink;
148 KOfficePrivate::internetLinkPage *internetLink;
149 KOfficePrivate::bookmarkLinkPage *bookmarkLink;
150 TQString currentText;
151};
152
153#endif
virtual void slotOk()
Dialog to insert links to various sources (file, Internet, mail and bookmarks).