kate
katesessionpanel.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __KATE_SESSIONPANEL_H__
00020 #define __KATE_SESSIONPANEL_H__
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <tqvbox.h>
00030 #include <tdetoolbar.h>
00031 #include <tdelistview.h>
00032 #include <tqframe.h>
00033 #include <tqlineedit.h>
00034 #include <tqcheckbox.h>
00035 #include <kdialogbase.h>
00036
00037 class KateMainWindow;
00038 class KateViewManager;
00039 class KateSessionManager;
00040 class TDEActionCollection;
00041
00042
00043
00044
00045
00046 class KateSessionNameChooser : public KDialogBase
00047 {
00048 Q_OBJECT
00049
00050 public:
00051
00052 KateSessionNameChooser(TQWidget *parent, bool showSwitchTo);
00053 ~KateSessionNameChooser() {}
00054
00055 TQString getSessionName();
00056 bool getActivateFlag();
00057
00058 protected slots:
00059
00060 void slotUser1();
00061 void slotUser2();
00062 void slotTextChanged();
00063
00064 protected:
00065 TQLineEdit *m_sessionNameLE;
00066 TQCheckBox *m_activateCB;
00067 bool m_showSwitchTo;
00068 };
00069
00070
00071
00072
00073 class KateSessionPanelToolBarParent: public TQFrame
00074 {
00075 Q_OBJECT
00076
00077 public:
00078 KateSessionPanelToolBarParent(TQWidget *parent) : TQFrame(parent), m_tbar(0) {}
00079 ~KateSessionPanelToolBarParent() {}
00080 void setToolBar(TDEToolBar *tbar);
00081
00082 protected:
00083 virtual void resizeEvent (TQResizeEvent*);
00084
00085 private:
00086 TDEToolBar *m_tbar;
00087 };
00088
00089
00090
00091
00092 class KateSessionPanelItem : public TDEListViewItem
00093 {
00094 public:
00095 KateSessionPanelItem(TQListView *listview, const TQString &sessionName, int sessionId)
00096 : TDEListViewItem(listview, sessionName), m_sessionId(sessionId) {}
00097 KateSessionPanelItem(TQListView *listview, TQListViewItem *after, const TQString &sessionName, int sessionId)
00098 : TDEListViewItem(listview, after, sessionName), m_sessionId(sessionId) {}
00099
00100 int getSessionId() { return m_sessionId; }
00101 void setSessionId(int sessionId) { m_sessionId = sessionId; }
00102
00103 protected:
00104 int m_sessionId;
00105 };
00106
00107
00108
00109
00110 class KateSessionPanel : public TQVBox
00111 {
00112 Q_OBJECT
00113
00114 friend class KateMainWindow;
00115
00116 public:
00117
00118 KateSessionPanel(KateMainWindow *mainWindow=0, KateViewManager *viewManager=0,
00119 TQWidget *parent=0, const char *name=0);
00120 ~KateSessionPanel() {}
00121
00122 signals:
00126 void selectionChanged();
00127
00128
00129 public slots:
00130 void slotNewSession();
00131 void slotSaveSession();
00132 void slotSaveSessionAs();
00133 void slotRenameSession();
00134 void slotDeleteSession();
00135 void slotReloadSession();
00136 void slotActivateSession();
00137 void slotSessionToggleReadOnly();
00138 void slotSessionMoveUp();
00139 void slotSessionMoveDown();
00140 void slotItemExecuted(TQListViewItem *item);
00141
00142 void slotSelectionChanged();
00143 void slotSessionActivated(int newSessionId, int oldSessionId);
00144 void slotSessionCreated(int sessionId);
00145 void slotSessionDeleted(int sessionId);
00146 void slotSessionsSwapped(int sessionIdMin, int sessionIdMax);
00147 void slotSessionRenamed(int sessionId);
00148 void slotLVSessionRenamed(TQListViewItem *item);
00149
00150 protected:
00151 void setup_toolbar();
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 int handleSessionSwitch();
00163
00164 KateSessionManager *m_sessionManager;
00165 TDEActionCollection *m_actionCollection;
00166 TDEToolBar *m_toolbar;
00167 TDEListView *m_listview;
00168 int m_columnName;
00169 int m_columnPixmap;
00170 };
00171
00172
00173
00174 #endif //__KATE_SESSIONPANEL_H__