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

kate

  • kate
  • app
katesessionpanel.h
1/*
2 This file is part of the TDE project
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 version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef __KATE_SESSIONPANEL_H__
20#define __KATE_SESSIONPANEL_H__
21
22/*
23 The kate session panel displays the available sessions (and their documents)
24 in a treeview list and allows for quick switching among them.
25 A toolbar on the top also provides quick access to actions needed
26 to manage sessions.
27*/
28
29#include <tqvbox.h>
30#include <tdetoolbar.h>
31#include <tdelistview.h>
32#include <tqframe.h>
33#include <tqlineedit.h>
34#include <tqcheckbox.h>
35#include <kdialogbase.h>
36
37class KateMainWindow;
38class KateViewManager;
39class KateSessionManager;
40class TDEActionCollection;
41
42
43//BEGIN KateSessionNameChooser
44//FIXME create one single KateSessionNameChooser and reuse it all the time
45//FIXME improve string to distinguish between new session and saving an unnamed session
46class KateSessionNameChooser : public KDialogBase
47{
48 TQ_OBJECT
49
50 public:
51
52 KateSessionNameChooser(TQWidget *parent, bool showSwitchTo);
53 ~KateSessionNameChooser() {}
54
55 TQString getSessionName(); // return the session name typed by the user
56 bool getActivateFlag(); // return whether to switch to the new session or not
57
58 protected slots:
59
60 void slotUser1(); // create new session
61 void slotUser2(); // cancel
62 void slotTextChanged(); // session name has changed
63
64 protected:
65 TQLineEdit *m_sessionNameLE;
66 TQCheckBox *m_activateCB;
67 bool m_showSwitchTo; // if true, display the m_activateCB checkbox
68};
69//BEGIN KateSessionNameChooser
70
71
72//BEGIN KateSessionPanelToolBarParent
73class KateSessionPanelToolBarParent: public TQFrame
74{
75 TQ_OBJECT
76
77 public:
78 KateSessionPanelToolBarParent(TQWidget *parent) : TQFrame(parent), m_tbar(0) {}
79 ~KateSessionPanelToolBarParent() {}
80 void setToolBar(TDEToolBar *tbar);
81
82 protected:
83 virtual void resizeEvent (TQResizeEvent*);
84
85 private:
86 TDEToolBar *m_tbar;
87};
88//END KateSessionPanelToolBarParent
89
90
91//BEGIN KateSessionPanelItem
92class KateSessionPanelItem : public TDEListViewItem
93{
94 public:
95 KateSessionPanelItem(TQListView *listview, const TQString &sessionName, int sessionId)
96 : TDEListViewItem(listview, sessionName), m_sessionId(sessionId) {}
97 KateSessionPanelItem(TQListView *listview, TQListViewItem *after, const TQString &sessionName, int sessionId)
98 : TDEListViewItem(listview, after, sessionName), m_sessionId(sessionId) {}
99
100 int getSessionId() { return m_sessionId; }
101 void setSessionId(int sessionId) { m_sessionId = sessionId; }
102
103 protected:
104 int m_sessionId;
105};
106//END KateSessionPanelItem
107
108
109//BEGIN KateSessionPanel
110class KateSessionPanel : public TQVBox
111{
112 TQ_OBJECT
113
114 friend class KateMainWindow;
115
116 public:
117
118 KateSessionPanel(KateMainWindow *mainWindow=0, KateViewManager *viewManager=0,
119 TQWidget *parent=0, const char *name=0);
120 ~KateSessionPanel() {}
121
122 signals:
126 void selectionChanged();
127
128
129 public slots:
130 void slotNewSession();
131 void slotSaveSession();
132 void slotSaveSessionAs();
133 void slotRenameSession();
134 void slotDeleteSession();
135 void slotReloadSession();
136 void slotActivateSession();
137 void slotSessionToggleReadOnly();
138 void slotSessionMoveUp();
139 void slotSessionMoveDown();
140 void slotItemExecuted(TQListViewItem *item);
141
142 void slotSelectionChanged();
143 void slotSessionActivated(int newSessionId, int oldSessionId);
144 void slotSessionCreated(int sessionId);
145 void slotSessionDeleted(int sessionId);
146 void slotSessionsSwapped(int sessionIdMin, int sessionIdMax);
147 void slotSessionRenamed(int sessionId);
148 void slotLVSessionRenamed(TQListViewItem *item);
149
150 protected:
151 void setup_toolbar();
152
153 /* Checks the session switch option. If the choice is 'ask user',
154 opens a dialog and asks the user what to do.
155 Returns one of the following:
156 - KMessageBox::Cancel : the user wants to abort the current operation
157 - KMessageBox::No : the user wants to discard the session and continue
158 - KMessageBox::Yes : the user wants to save the session and continue
159 If the current session is volatile and the session needs to be saved,
160 it will also ask the user to provide a session name.
161 */
162 int handleSessionSwitch();
163
164 KateSessionManager *m_sessionManager;
165 TDEActionCollection *m_actionCollection;
166 TDEToolBar *m_toolbar;
167 TDEListView *m_listview;
168 int m_columnName;
169 int m_columnPixmap;
170};
171//END KateSessionPanel
172
173
174#endif //__KATE_SESSIONPANEL_H__
KateSessionManager
The Kate session manager.
Definition: katesession.h:177

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.