ktechlab.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003-2005 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef KTECHLAB_H
00012 #define KTECHLAB_H
00013 
00014 #include <katemdi.h>
00015 
00016 class CircuitDocument;
00017 class TextDocument;
00018 class ComponentSelector;
00019 class Document;
00020 class FlowCodeDocument;
00021 class ItemEditor;
00022 class LanguageManager;
00023 class LogView;
00024 class MechanicsDocument;
00025 class ProjectManager;
00026 class View;
00027 class ViewContainer;
00028 
00029 typedef QValueList< QGuardedPtr<ViewContainer> > ViewContainerList;
00030 
00031 class KAction;
00032 class RecentFilesAction;
00033 class KTabWidget;
00034 class KToolBar;
00035 class KToggleAction;
00036 class KURL;
00037 class QLabel;
00038 
00046 class KTechlab : public KateMDI::MainWindow
00047 {
00048         Q_OBJECT
00049         public:
00050                 KTechlab();
00051                 ~KTechlab();
00052         
00056                 KAction * action( const QString & name ) const;
00061                 static KURL::List getFileURLs();
00065                 QStringList recentFiles();
00070                 void requestUpdateCaptions();
00074                 KTabWidget * tabWidget() const { return m_pViewContainerTabWidget; }
00078                 void addWindow( ViewContainer * vc );
00082                 void removeGUIClients();
00087                 void addNoRemoveGUIClient( KXMLGUIClient * client );
00092                 void overlayToolBarScreenshot();
00093                 
00094                 virtual void show();
00095                 
00096         signals:
00100                 void configurationChanged();
00104                 void recentFileAdded( const KURL &url );
00108                 void needUpdateCaptions();
00109         
00110         public slots:
00114                 void slotTabContext( QWidget* widget,const QPoint & pos );
00115                 void slotDragContextActivated( int id );
00119                 void slotTabContextActivated( int id );
00120                 void slotChangeStatusbar(const QString& text);
00121                 void load(const KURL& url);
00122                 void slotUpdateConfiguration();
00126                 void addRecentFile( const KURL &url );
00131                 void slotDocModifiedChanged();
00136                 void slotDocUndoRedoChanged();
00137 
00138         protected:
00142                 virtual void dragEnterEvent(QDragEnterEvent *event);
00143                 virtual void dropEvent(QDropEvent *event);
00148                 void saveProperties(KConfig *);
00154                 void readProperties(KConfig *);
00160                 virtual bool queryClose();
00161         
00162         protected slots:
00163                 void slotViewContainerActivated( QWidget * viewContainer );
00164                 void slotTabDragEvent( const QDragMoveEvent *e, bool &accept );
00165                 void slotTabDragInitiate( QWidget *widget );
00166                 void slotTabReceivedDropEvent( QDropEvent *e );
00167                 void slotTabReceivedDropEvent( QWidget *widget, QDropEvent *e );
00168                 void slotUpdateTabWidget();
00173                 void slotUpdateCaptions();
00174 
00175         private slots:
00180                 void hideToolBarOverlay();
00181                 void slotViewContainerDestroyed( QObject * obj );
00182         
00183                 void slotFileNewAssembly();
00184                 void slotFileNewMicrobe();
00185                 void slotFileNewC();
00186                 void slotFileNewCircuit();
00187                 void slotFileNewFlowCode();
00188                 void slotFileNewMechanics();
00189                 void slotFileNew();
00190                 void slotFileOpen();
00191                 void slotFileSave();
00192                 void slotFileSaveAs();
00193                 void slotFilePrint();
00194                 void slotFileQuit();
00195         
00196                 // Editing operations
00197                 void slotEditUndo();
00198                 void slotEditRedo();
00199                 void slotEditCut();
00200                 void slotEditCopy();
00201                 void slotEditPaste();
00202         
00206                 void slotViewSplitLeftRight();
00210                 void slotViewSplitTopBottom();
00211                 void slotViewContainerClose();
00212                 void slotViewClose();
00213         
00214                 void slotOptionsShowStatusbar();
00215                 void slotOptionsConfigureKeys();
00216                 void slotOptionsConfigureToolbars();
00217                 void slotOptionsPreferences();
00218 
00219         private:
00220                 void setupActions();
00221                 void setupToolDocks();
00222                 void setupView();
00223                 void setupTabWidget();
00224         
00225                 RecentFilesAction * m_recentFiles;
00226                 RecentFilesAction * m_recentProjects;
00227                 KToggleAction * m_statusbarAction;
00228                 KTabWidget * m_pViewContainerTabWidget;
00229                 QString m_lastStatusBarMessage;
00230                 QValueList<KXMLGUIClient*> m_noRemoveGUIClients;
00231                 QLabel * m_pToolBarOverlayLabel;
00232                 bool m_bIsShown; // Set true when show() is called
00233                 ViewContainerList m_viewContainerList;
00234                 QTimer * m_pUpdateCaptionsTimer;
00235         
00236                 QGuardedPtr<ViewContainer> m_pContextMenuContainer;
00237                 QGuardedPtr<ViewContainer> m_pFocusedContainer;
00238                 QGuardedPtr<ViewContainer> m_pContainerDropSource;
00239                 QGuardedPtr<ViewContainer> m_pContainerDropReceived;
00240 };
00241 
00242 #endif // KTECHLAB_H
00243 

Generated on Tue May 8 17:05:30 2007 for KTechLab by  doxygen 1.5.1