home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoInsertLink.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  3.9 KB  |  149 lines

  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>
  25. class QLineEdit;
  26. class KURLRequester;
  27.  
  28. namespace KOfficePrivate {
  29. /**
  30.  * @internal
  31.  */
  32. class internetLinkPage : public QWidget
  33. {
  34.     Q_OBJECT
  35. public:
  36.     internetLinkPage( QWidget *parent = 0, char *name = 0 );
  37.     QString linkName()const;
  38.     QString hrefName();
  39.     void setLinkName(const QString & _name);
  40.     void setHrefName(const QString &_name);
  41. private:
  42.     QString createInternetLink();
  43.     QLineEdit* m_linkName, *m_hrefName;
  44. private slots:
  45.     void textChanged ( const QString & );
  46. signals:
  47.     void textChanged();
  48. };
  49.  
  50. /**
  51.  * @internal
  52.  */
  53. class bookmarkLinkPage : public QWidget
  54. {
  55.     Q_OBJECT
  56. public:
  57.     bookmarkLinkPage( QWidget *parent = 0, char *name = 0 );
  58.     QString linkName()const;
  59.     QString hrefName();
  60.     void setLinkName(const QString & _name);
  61.     void setHrefName(const QString &_name);
  62.     void setBookmarkList(const QStringList &bkmlist);
  63. private:
  64.     QString createBookmarkLink();
  65.     QLineEdit* m_linkName;
  66.     QComboBox *m_hrefName;
  67. private slots:
  68.     void textChanged ( const QString & );
  69. signals:
  70.     void textChanged();
  71. };
  72.  
  73. /**
  74.  * @internal
  75.  */
  76. class mailLinkPage : public QWidget
  77. {
  78.     Q_OBJECT
  79. public:
  80.     mailLinkPage( QWidget *parent = 0, char *name = 0 );
  81.     QString linkName()const;
  82.     QString hrefName();
  83.     void setLinkName(const QString & _name);
  84.     void setHrefName(const QString &_name);
  85.  
  86. private slots:
  87.     void textChanged ( const QString & );
  88. private:
  89.     QString createMailLink();
  90.     QLineEdit* m_linkName, *m_hrefName;
  91. signals:
  92.     void textChanged();
  93. };
  94.  
  95. /**
  96.  * @internal
  97.  */
  98. class fileLinkPage : public QWidget
  99. {
  100.     Q_OBJECT
  101. public:
  102.     fileLinkPage( QWidget *parent = 0, char *name = 0 );
  103.     QString linkName()const;
  104.     QString hrefName();
  105.     void setLinkName(const QString & _name);
  106.     void setHrefName(const QString &_name);
  107.  
  108. private slots:
  109.     void textChanged ( const QString & );
  110.     void slotSelectRecentFile( const QString & );
  111. private:
  112.     QString createFileLink();
  113.     QLineEdit* m_linkName;
  114.     KURLRequester* m_hrefName;
  115. signals:
  116.     void textChanged();
  117. };
  118. }
  119.  
  120. /**
  121.  * Dialog to insert links to various sources (file, Internet, mail and bookmarks).
  122.  */
  123. class KOFFICEUI_EXPORT KoInsertLinkDia : public KDialogBase
  124. {
  125.     Q_OBJECT
  126. public:
  127.     KoInsertLinkDia( QWidget *parent, const char *name = 0,bool displayBookmarkLink=true );
  128.     static bool createLinkDia(QString & linkName, QString & hrefName, const QStringList& bkmlist, bool displayBookmarkLink = true,
  129.                               QWidget* parent = 0, const char* name = 0);
  130.  
  131.     //internal
  132.     QString linkName() const;
  133.     QString hrefName() const;
  134.     void setHrefLinkName(const QString &_href, const QString &_link, const QStringList & bkmlist);
  135. protected slots:
  136.     virtual void slotOk();
  137.     void slotTextChanged (  );
  138.     void tabChanged(QWidget *);
  139.  
  140. private:
  141.     KOfficePrivate::fileLinkPage *fileLink;
  142.     KOfficePrivate::mailLinkPage *mailLink;
  143.     KOfficePrivate::internetLinkPage *internetLink;
  144.     KOfficePrivate::bookmarkLinkPage *bookmarkLink;
  145.     QString currentText;
  146. };
  147.  
  148. #endif
  149.