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

kate

  • kate
  • app
katefileselector.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4 Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __KATE_FILESELECTOR_H__
22#define __KATE_FILESELECTOR_H__
23
24#include "katemain.h"
25#include "katedocmanager.h"
26#include <kate/document.h>
27
28#include <tqvbox.h>
29#include <tdefile.h>
30#include <kurl.h>
31#include <tdetoolbar.h>
32#include <tqframe.h>
33
34class KateMainWindow;
35class KateViewManager;
36class TDEActionCollection;
37class TDEActionSelector;
38class KFileView;
39
40/*
41 The kate file selector presents a directory view, in which the default action is
42 to open the activated file.
43 Additinally, a toolbar for managing the kdiroperator widget + sync that to
44 the directory of the current file is available, as well as a filter widget
45 allowing to filter the displayed files using a name filter.
46*/
47
48/* I think this fix for not moving toolbars is better */
49class KateFileSelectorToolBar: public TDEToolBar
50{
51 TQ_OBJECT
52public:
53 KateFileSelectorToolBar(TQWidget *parent);
54 virtual ~KateFileSelectorToolBar();
55
56 virtual void setMovingEnabled( bool b );
57};
58
59class KateFileSelectorToolBarParent: public TQFrame
60{
61 TQ_OBJECT
62public:
63 KateFileSelectorToolBarParent(TQWidget *parent);
64 ~KateFileSelectorToolBarParent();
65 void setToolBar(KateFileSelectorToolBar *tb);
66private:
67 KateFileSelectorToolBar *m_tb;
68protected:
69 virtual void resizeEvent ( TQResizeEvent * );
70};
71
72class KateFileSelector : public TQVBox
73{
74 TQ_OBJECT
75
76 friend class KFSConfigPage;
77
78 public:
79 /* When to sync to current document directory */
80 enum AutoSyncEvent { DocumentChanged=1, GotVisible=2 };
81
82 KateFileSelector( KateMainWindow *mainWindow=0, KateViewManager *viewManager=0,
83 TQWidget * parent = 0, const char * name = 0 );
84 ~KateFileSelector();
85
86 void readConfig( TDEConfig *, const TQString & );
87 void writeConfig( TDEConfig *, const TQString & );
88 void setupToolbar( TDEConfig * );
89 void setView( KFile::FileView );
90 KDirOperator *dirOperator(){ return dir; }
91 TDEActionCollection *actionCollection() { return mActionCollection; };
92
93 public slots:
94 void slotFilterChange(const TQString&);
95 void setDir(KURL);
96 void setDir( const TQString& url ) { setDir( KURL( url ) ); };
97 void kateViewChanged();
98 void selectorViewChanged( KFileView * );
99
100 private slots:
101 void cmbPathActivated( const KURL& u );
102 void cmbPathReturnPressed( const TQString& u );
103 void dirUrlEntered( const KURL& u );
104 void dirFinishedLoading();
105 void setActiveDocumentDir();
106 void btnFilterClick();
107
108 protected:
109 void focusInEvent( TQFocusEvent * );
110 void showEvent( TQShowEvent * );
111 bool eventFilter( TQObject *, TQEvent * );
112 void initialDirChangeHack();
113
114 private:
115 class KateFileSelectorToolBar *toolbar;
116 TDEActionCollection *mActionCollection;
117 class KBookmarkHandler *bookmarkHandler;
118 KURLComboBox *cmbPath;
119 KDirOperator * dir;
120 class TDEAction *acSyncDir;
121 KHistoryCombo * filter;
122 class TQToolButton *btnFilter;
123
124 KateMainWindow *mainwin;
125 KateViewManager *viewmanager;
126
127 TQString lastFilter;
128 int autoSyncEvents; // enabled autosync events
129 TQString waitingUrl; // maybe display when we gets visible
130 TQString waitingDir;
131};
132
133/* TODO anders
134 KFSFilterHelper
135 A popup widget presenting a listbox with checkable items
136 representing the mime types available in the current directory, and
137 providing a name filter based on those.
138*/
139
140/*
141 Config page for file selector.
142 Allows for configuring the toolbar, the history length
143 of the path and file filter combos, and how to handle
144 user closed session.
145*/
146class KFSConfigPage : public Kate::ConfigPage {
147 TQ_OBJECT
148 public:
149 KFSConfigPage( TQWidget* parent=0, const char *name=0, KateFileSelector *kfs=0);
150 virtual ~KFSConfigPage() {};
151
152 virtual void apply();
153 virtual void reload();
154
155 private slots:
156 void slotMyChanged();
157
158 private:
159 void init();
160
161 KateFileSelector *fileSelector;
162 TDEActionSelector *acSel;
163 class TQSpinBox *sbPathHistLength, *sbFilterHistLength;
164 class TQCheckBox *cbSyncActive, *cbSyncShow;
165 class TQCheckBox *cbSesLocation, *cbSesFilter;
166
167 bool m_changed;
168};
169
170
171#endif //__KATE_FILESELECTOR_H__

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kate

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