• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Generic Shell
 

KDevelop Generic Shell

  • src
partcontroller.h
1 #ifndef __PARTCONTROLLER_H__
2 #define __PARTCONTROLLER_H__
3 
4 #include "kdevpartcontroller.h"
5 
6 #include <tqwidget.h>
7 #include <tqdatetime.h>
8 #include <tqptrlist.h>
9 #include <kurl.h>
10 #include <tqmap.h>
11 #include <tqguardedptr.h>
12 #include <tqpair.h>
13 
14 namespace KParts
15 {
16  class Part;
17  class Factory;
18  class PartManager;
19  class ReadOnlyPart;
20  class ReadWritePart;
21 }
22 
23 namespace KTextEditor
24 {
25  class Document;
26  class Editor;
27 }
28 
29 namespace Kate { class Document; }
30 
31 class TQTabWidget;
32 class TQPopupMenu;
33 class TDEAction;
34 class TDEToolBarPopupAction;
35 class TDERecentFilesAction;
36 class HTMLDocumentationPart;
37 class HistoryEntry;
38 class KDirWatch;
39 
43 class PartController : public KDevPartController
44 {
45  Q_OBJECT
46 
47 
48 public:
49 
50  PartController(TQWidget *toplevel);
51  static void createInstance(TQWidget *parent);
52  static PartController *getInstance();
53 
55 
56  void setEncoding(const TQString &encoding);
57  void editDocument(const KURL &inputUrl, int lineNum=-1, int col=-1);
58  void splitCurrentDocument(const KURL &inputUrl, int lineNum=-1, int col=-1);
59  void scrollToLineColumn(const KURL &url, int lineNum=-1, int col=-1, bool storeHistory = false );
60  void editDocumentInternal(const KURL &inputUrl, int lineNum=-1, int col=-1,
61  bool activate = true, bool addToCurrentBuffer = false );
62  void integrateTextEditorPart(KTextEditor::Document* doc);
63 
64  void showDocument(const KURL &url, bool newWin = false);
65  void showPart( KParts::Part* part, const TQString& name, const TQString& shortDescription );
66 
67  KParts::ReadOnlyPart *partForURL(const KURL &url);
68  KParts::ReadOnlyPart *qtDesignerPart();
69  KParts::Part * partForWidget( const TQWidget * widget );
70 
71  void activatePart( KParts::Part * part );
72  bool closePart( KParts::Part * part );
73 
74  KURL::List openURLs();
75 
76  bool querySaveFiles();
77 
78  bool saveAllFiles();
79  bool saveFiles( const KURL::List & list);
80  bool saveFile( const KURL & url, bool force = false );
81 
82  void revertAllFiles();
83  void revertFiles( const KURL::List & list );
84 
85  bool closeAllFiles();
86  bool closeFiles( const KURL::List & list );
87 
88  DocumentState documentState( KURL const & );
89 
91 
92  bool readyToClose();
93 
94  bool closeFile( const KURL & );
95  bool closeAllOthers( const KURL & );
96  void reloadFile( const KURL & url );
97 
98  KTextEditor::Editor *openTextDocument( bool activate = true );
99  KParts::Factory *findPartFactory(const TQString &mimeType,
100  const TQString &partType,
101  const TQString &preferredName = TQString() );
102 
103 public slots:
104 
105  void slotActivePartChanged( KParts::Part* part );
106  void slotCloseWindow();
107  void slotCloseOtherWindows();
108  void slotCloseAllWindows();
109 
110  void slotSave();
111  void slotReload();
112 
113 protected:
114 
115  ~PartController();
116 
117 private slots:
118 
119  void slotWaitForFactoryHack();
120 
121  void slotDocumentUrlChanged();
122  void slotSaveAllFiles();
123  void slotRevertAllFiles();
124 
125  void slotOpenFile();
126  void slotOpenRecent(const KURL&);
127 
128  void slotBack();
129  void slotForward();
130  void slotBackAboutToShow();
131  void slotForwardAboutToShow();
132  void slotBackPopupActivated( int id );
133  void slotForwardPopupActivated( int id );
134 
135  void slotPartAdded( KParts::Part* );
136  void slotPartRemoved( KParts::Part* );
137 
138  void slotUploadFinished();
139 
140  void updateMenuItems();
141 
142  void slotDocumentDirty( Kate::Document * doc, bool isModified, unsigned char reason );
143  void slotDocumentDirtyStepTwo( void * );
144  void slotNewStatus();
145  void slotNewDesignerStatus(const TQString &formName, int status);
146  void textChanged();
147  void gotoLastEditPos();
148 
149 private:
150  KURL findURLInProject(const KURL& url);
151  KParts::Part* findOpenDocument(const KURL& url);
152 
153  void setupActions();
154 
155  bool closeFilesDialog( KURL::List const & ignoreList );
156  bool saveFilesDialog( KURL::List const & ignoreList );
157 
158  void doEmitState( KURL const & );
159 
160  KTextEditor::Editor * createEditorPart( bool activate,
161  bool addToCurrentBuffer = false,
162  const KURL &url = KURL() );
163 
164  void integratePart(KParts::Part *part, const KURL &url, TQWidget* widget = 0,
165  bool isTextEditor=false, bool activate=true,
166  bool addToCurrentBuffer = false );
167 
168  // returns a list of modified documents
169  KURL::List modifiedDocuments();
170  void clearModified( KURL::List const & filelist );
171 
172  bool isDirty( KURL const & url );
173  bool reactToDirty( KURL const & url, unsigned char reason );
174 
175  KURL storedURLForPart( KParts::ReadOnlyPart * );
176  void updatePartURL( KParts::ReadOnlyPart * );
177  bool partURLHasChanged( KParts::ReadOnlyPart * );
178 
179  static PartController *s_instance;
180 
181  TDEAction *m_closeWindowAction, *m_saveAllFilesAction, *m_revertAllFilesAction;
182  TDEAction *m_closeAllWindowsAction, *m_closeOtherWindowsAction;
183  TDERecentFilesAction *m_openRecentAction;
184  TQString m_presetEncoding;
185 
186  TDEToolBarPopupAction* m_backAction;
187  TDEToolBarPopupAction* m_forwardAction;
188  TDEAction * m_gotoLastEditPosAction;
189 
190  bool m_openNextAsText;
191 
192  TQValueList<KParts::ReadWritePart*> _dirtyDocuments;
193 
194  TQMap< KParts::ReadOnlyPart*, KURL > _partURLMap; // used to note when a URL changes (a file changes name)
195 
196  TQGuardedPtr<KParts::Factory> _editorFactory;
197 
198  struct HistoryEntry
199  {
200  HistoryEntry() {}
201  HistoryEntry( const KURL & url, int line, int col );
202 
203  KURL url;
204  int line;
205  int col;
206  int id;
207  };
208 
209  void addHistoryEntry( KParts::ReadOnlyPart * part = 0 );
210  HistoryEntry createHistoryEntry( KParts::ReadOnlyPart * part = 0 );
211  void jumpTo( const HistoryEntry & );
212 
213  TQValueList<HistoryEntry> m_backHistory;
214  TQValueList<HistoryEntry> m_forwardHistory;
215  bool m_isJumping;
216 
217  struct LastEditPos
218  {
219  KURL url;
220  TQPair<unsigned int,unsigned int> pos;
221 
222  LastEditPos() : pos( -1, -1) {}
223  };
224 
225  LastEditPos m_lastEditPos;
226 
227  KParts::Part * m_currentActivePart;
228  bool m_removingActivePart;
229 };
230 
231 
232 
233 #endif
PartController
Part controler implementation.
Definition: partcontroller.h:43
HTMLDocumentationPart
HTML documentation part.
Definition: documentationpart.h:11
KTextEditor
Definition: partcontroller.h:23
KParts
Definition: mainwindowshare.h:24
Kate
Definition: partcontroller.h:29

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Generic Shell by doxygen 1.8.13
This website is maintained by Timothy Pearson.