• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
knewmenu.h
1/* This file is part of the KDE project
2 Copyright (C) 1998-2000 David Faure <faure@kde.org>
3 2003 Sven Leiber <s.leiber@web.de>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
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 __knewmenu_h
21#define __knewmenu_h
22
23#include <tqintdict.h>
24#include <tqstringlist.h>
25
26#include <tdeaction.h>
27#include <kdialogbase.h>
28#include <kurl.h>
29#include <libkonq_export.h>
30
31namespace TDEIO { class Job; }
32
33class KDirWatch;
34class KLineEdit;
35class KURLRequester;
36class TQPopupMenu;
37
52class LIBKONQ_EXPORT KNewMenu : public TDEActionMenu
53{
54 TQ_OBJECT
55public:
56
60 KNewMenu( TDEActionCollection * _collec, const char *name=0L );
61 KNewMenu( TDEActionCollection * _collec, TQWidget *parentWidget, const char *name=0L );
62 virtual ~KNewMenu();
63
68 void setPopupFiles(KURL::List & _files) {
69 popupFiles = _files;
70 }
71 void setPopupFiles(const KURL & _file) {
72 popupFiles.clear();
73 popupFiles.append( _file );
74 }
75
76public slots:
81 void slotCheckUpToDate( );
82
83protected slots:
87 void slotNewDir();
88
92 void slotNewFile();
93
97 void slotFillTemplates();
98
99 void slotResult( TDEIO::Job * );
100 // Special case (filename conflict when creating a link=url file)
101 void slotRenamed( TDEIO::Job *, const KURL&, const KURL& );
102
103private:
104
108 void fillMenu();
109
114 void parseFiles();
115
119 void makeMenus();
120
128 enum { LINKTOTEMPLATE = 1, TEMPLATE, SEPARATOR };
129
130 struct Entry {
131 TQString text;
132 TQString filePath; // empty for SEPARATOR
133 TQString templatePath; // same as filePath for TEMPLATE
134 TQString icon;
135 int entryType;
136 TQString comment;
137 };
138 // NOTE: only filePath is known before we call parseFiles
139
144 static TQValueList<Entry> * s_templatesList;
145
146 class KNewMenuPrivate;
147 KNewMenuPrivate* d;
148
154 static int s_templatesVersion;
155
160 static bool s_filesParsed;
161
162 int menuItemsVersion;
163
168 KURL::List popupFiles;
169
173 bool m_isURLDesktopFile;
174 TQString m_linkURL; // the url to put in the file
175
176 static KDirWatch * s_pDirWatch;
177};
178
185class KURLDesktopFileDlg : public KDialogBase
186{
187 TQ_OBJECT
188public:
189 KURLDesktopFileDlg( const TQString& textFileName, const TQString& textUrl );
190 KURLDesktopFileDlg( const TQString& textFileName, const TQString& textUrl, TQWidget *parent );
191 virtual ~KURLDesktopFileDlg() {}
192
196 TQString fileName() const;
200 TQString url() const;
201
202protected slots:
203 void slotClear();
204 void slotNameTextChanged( const TQString& );
205 void slotURLTextChanged( const TQString& );
206private:
207 void initDialog( const TQString& textFileName, const TQString& defaultName, const TQString& textUrl, const TQString& defaultUrl );
208
212 KLineEdit *m_leFileName;
216 KURLRequester *m_urlRequester;
217
221 bool m_fileNameEdited;
222};
223
224#endif
KNewMenu
The 'New' submenu, both for the File menu and the RMB popup menu.
Definition: knewmenu.h:53
KNewMenu::setPopupFiles
void setPopupFiles(KURL::List &_files)
Set the files the popup is shown for Call this before showing up the menu.
Definition: knewmenu.h:68

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.4
This website is maintained by Timothy Pearson.